diff --git a/system/vulkan_enc/VkEncoder.cpp b/system/vulkan_enc/VkEncoder.cpp
index 9f9805f..f7dbd4f 100644
--- a/system/vulkan_enc/VkEncoder.cpp
+++ b/system/vulkan_enc/VkEncoder.cpp
@@ -106,8 +106,9 @@
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkInstance*)pInstance, sizeof(VkInstance));
+        uint64_t cgen_var_1;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_1, 1);
+        countingStream->write((uint64_t*)&cgen_var_1, 8);
     }
     uint32_t packetSize_vkCreateInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
@@ -116,16 +117,18 @@
     stream->write(&packetSize_vkCreateInstance, sizeof(uint32_t));
     marshal_VkInstanceCreateInfo(stream, (VkInstanceCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1);
+    uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_2);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkInstance*)pInstance, sizeof(VkInstance));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkInstance*)pInstance, sizeof(VkInstance));
+    uint64_t cgen_var_3;
+    stream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_3, 1);
+    stream->write((uint64_t*)&cgen_var_3, 8);
+    uint64_t cgen_var_4;
+    stream->read((uint64_t*)&cgen_var_4, 8);
+    stream->handleMapping()->mapHandles_u64_VkInstance(&cgen_var_4, (VkInstance*)pInstance, 1);
     if (pInstance)
     {
         resources->createMapping()->mapHandles_VkInstance((VkInstance*)pInstance, 1);
@@ -133,6 +136,8 @@
     pool->freeAll();
     VkResult vkCreateInstance_VkResult_return = (VkResult)0;
     stream->read(&vkCreateInstance_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateInstance_VkResult_return;
 }
 
@@ -161,11 +166,12 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_2 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_2);
+        uint64_t cgen_var_5;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_5, 1);
+        countingStream->write((uint64_t*)&cgen_var_5, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_3 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_3);
+        uint64_t cgen_var_6 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_6);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -176,11 +182,12 @@
     uint32_t opcode_vkDestroyInstance = OP_vkDestroyInstance;
     stream->write(&opcode_vkDestroyInstance, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyInstance, sizeof(uint32_t));
-    uint64_t cgen_var_4 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_4);
+    uint64_t cgen_var_7;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_7, 1);
+    stream->write((uint64_t*)&cgen_var_7, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_5 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_5);
+    uint64_t cgen_var_8 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_8);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -203,22 +210,28 @@
     resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
     countingStream->rewind();
     {
-        uint64_t cgen_var_6 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_6);
+        uint64_t cgen_var_9;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_9, 1);
+        countingStream->write((uint64_t*)&cgen_var_9, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_7 = (uint64_t)(uintptr_t)pPhysicalDeviceCount;
-        countingStream->putBe64(cgen_var_7);
+        uint64_t cgen_var_10 = (uint64_t)(uintptr_t)pPhysicalDeviceCount;
+        countingStream->putBe64(cgen_var_10);
         if (pPhysicalDeviceCount)
         {
             countingStream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_8 = (uint64_t)(uintptr_t)pPhysicalDevices;
-        countingStream->putBe64(cgen_var_8);
+        uint64_t cgen_var_11 = (uint64_t)(uintptr_t)pPhysicalDevices;
+        countingStream->putBe64(cgen_var_11);
         if (pPhysicalDevices)
         {
-            // WARNING HANDLE TYPE POINTER
-            countingStream->write((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice));
+            if ((*(pPhysicalDeviceCount)))
+            {
+                uint64_t* cgen_var_12;
+                countingStream->alloc((void**)&cgen_var_12, (*(pPhysicalDeviceCount)) * 8);
+                countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_12, (*(pPhysicalDeviceCount)));
+                countingStream->write((uint64_t*)cgen_var_12, 8);
+            }
         }
     }
     uint32_t packetSize_vkEnumeratePhysicalDevices = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -226,22 +239,28 @@
     uint32_t opcode_vkEnumeratePhysicalDevices = OP_vkEnumeratePhysicalDevices;
     stream->write(&opcode_vkEnumeratePhysicalDevices, sizeof(uint32_t));
     stream->write(&packetSize_vkEnumeratePhysicalDevices, sizeof(uint32_t));
-    uint64_t cgen_var_9 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_9);
+    uint64_t cgen_var_13;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_13, 1);
+    stream->write((uint64_t*)&cgen_var_13, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_10 = (uint64_t)(uintptr_t)pPhysicalDeviceCount;
-    stream->putBe64(cgen_var_10);
+    uint64_t cgen_var_14 = (uint64_t)(uintptr_t)pPhysicalDeviceCount;
+    stream->putBe64(cgen_var_14);
     if (pPhysicalDeviceCount)
     {
         stream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_11 = (uint64_t)(uintptr_t)pPhysicalDevices;
-    stream->putBe64(cgen_var_11);
+    uint64_t cgen_var_15 = (uint64_t)(uintptr_t)pPhysicalDevices;
+    stream->putBe64(cgen_var_15);
     if (pPhysicalDevices)
     {
-        // WARNING HANDLE TYPE POINTER
-        stream->write((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice));
+        if ((*(pPhysicalDeviceCount)))
+        {
+            uint64_t* cgen_var_16;
+            stream->alloc((void**)&cgen_var_16, (*(pPhysicalDeviceCount)) * 8);
+            stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_16, (*(pPhysicalDeviceCount)));
+            stream->write((uint64_t*)cgen_var_16, 8);
+        }
     }
     // WARNING PTR CHECK
     uint32_t* check_pPhysicalDeviceCount;
@@ -263,8 +282,13 @@
         {
             fprintf(stderr, "fatal: pPhysicalDevices inconsistent between guest and host\n");
         }
-        // WARNING HANDLE TYPE POINTER
-        stream->read((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice));
+        if ((*(pPhysicalDeviceCount)))
+        {
+            uint64_t* cgen_var_19;
+            stream->alloc((void**)&cgen_var_19, (*(pPhysicalDeviceCount)) * 8);
+            stream->read((uint64_t*)cgen_var_19, 8);
+            stream->handleMapping()->mapHandles_u64_VkPhysicalDevice(cgen_var_19, (VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)));
+        }
     }
     if (pPhysicalDevices)
     {
@@ -273,6 +297,8 @@
     pool->freeAll();
     VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0;
     stream->read(&vkEnumeratePhysicalDevices_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkEnumeratePhysicalDevices_VkResult_return;
 }
 
@@ -289,8 +315,9 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_14 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_14);
+        uint64_t cgen_var_20;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_20, 1);
+        countingStream->write((uint64_t*)&cgen_var_20, 8);
         marshal_VkPhysicalDeviceFeatures(countingStream, (VkPhysicalDeviceFeatures*)(pFeatures));
     }
     uint32_t packetSize_vkGetPhysicalDeviceFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -298,8 +325,9 @@
     uint32_t opcode_vkGetPhysicalDeviceFeatures = OP_vkGetPhysicalDeviceFeatures;
     stream->write(&opcode_vkGetPhysicalDeviceFeatures, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceFeatures, sizeof(uint32_t));
-    uint64_t cgen_var_15 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_15);
+    uint64_t cgen_var_21;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_21, 1);
+    stream->write((uint64_t*)&cgen_var_21, 8);
     marshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures));
     unmarshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures));
     pool->freeAll();
@@ -321,8 +349,9 @@
     local_format = format;
     countingStream->rewind();
     {
-        uint64_t cgen_var_16 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_16);
+        uint64_t cgen_var_22;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_22, 1);
+        countingStream->write((uint64_t*)&cgen_var_22, 8);
         countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
         marshal_VkFormatProperties(countingStream, (VkFormatProperties*)(pFormatProperties));
     }
@@ -331,8 +360,9 @@
     uint32_t opcode_vkGetPhysicalDeviceFormatProperties = OP_vkGetPhysicalDeviceFormatProperties;
     stream->write(&opcode_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t));
-    uint64_t cgen_var_17 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_17);
+    uint64_t cgen_var_23;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_23, 1);
+    stream->write((uint64_t*)&cgen_var_23, 8);
     stream->write((VkFormat*)&local_format, sizeof(VkFormat));
     marshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties));
     unmarshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties));
@@ -367,8 +397,9 @@
     local_flags = flags;
     countingStream->rewind();
     {
-        uint64_t cgen_var_18 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_18);
+        uint64_t cgen_var_24;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_24, 1);
+        countingStream->write((uint64_t*)&cgen_var_24, 8);
         countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
         countingStream->write((VkImageType*)&local_type, sizeof(VkImageType));
         countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
@@ -381,8 +412,9 @@
     uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties = OP_vkGetPhysicalDeviceImageFormatProperties;
     stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t));
-    uint64_t cgen_var_19 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_19);
+    uint64_t cgen_var_25;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_25, 1);
+    stream->write((uint64_t*)&cgen_var_25, 8);
     stream->write((VkFormat*)&local_format, sizeof(VkFormat));
     stream->write((VkImageType*)&local_type, sizeof(VkImageType));
     stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
@@ -393,6 +425,8 @@
     pool->freeAll();
     VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceImageFormatProperties_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceImageFormatProperties_VkResult_return;
 }
 
@@ -409,8 +443,9 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_20 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_20);
+        uint64_t cgen_var_26;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_26, 1);
+        countingStream->write((uint64_t*)&cgen_var_26, 8);
         marshal_VkPhysicalDeviceProperties(countingStream, (VkPhysicalDeviceProperties*)(pProperties));
     }
     uint32_t packetSize_vkGetPhysicalDeviceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -418,8 +453,9 @@
     uint32_t opcode_vkGetPhysicalDeviceProperties = OP_vkGetPhysicalDeviceProperties;
     stream->write(&opcode_vkGetPhysicalDeviceProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceProperties, sizeof(uint32_t));
-    uint64_t cgen_var_21 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_21);
+    uint64_t cgen_var_27;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_27, 1);
+    stream->write((uint64_t*)&cgen_var_27, 8);
     marshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties));
     unmarshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties));
     pool->freeAll();
@@ -439,18 +475,19 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_22 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_22);
+        uint64_t cgen_var_28;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_28, 1);
+        countingStream->write((uint64_t*)&cgen_var_28, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_23 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
-        countingStream->putBe64(cgen_var_23);
+        uint64_t cgen_var_29 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
+        countingStream->putBe64(cgen_var_29);
         if (pQueueFamilyPropertyCount)
         {
             countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_24 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
-        countingStream->putBe64(cgen_var_24);
+        uint64_t cgen_var_30 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
+        countingStream->putBe64(cgen_var_30);
         if (pQueueFamilyProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
@@ -464,18 +501,19 @@
     uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties = OP_vkGetPhysicalDeviceQueueFamilyProperties;
     stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t));
-    uint64_t cgen_var_25 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_25);
+    uint64_t cgen_var_31;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_31, 1);
+    stream->write((uint64_t*)&cgen_var_31, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_26 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
-    stream->putBe64(cgen_var_26);
+    uint64_t cgen_var_32 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
+    stream->putBe64(cgen_var_32);
     if (pQueueFamilyPropertyCount)
     {
         stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_27 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
-    stream->putBe64(cgen_var_27);
+    uint64_t cgen_var_33 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
+    stream->putBe64(cgen_var_33);
     if (pQueueFamilyProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
@@ -524,8 +562,9 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_30 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_30);
+        uint64_t cgen_var_36;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_36, 1);
+        countingStream->write((uint64_t*)&cgen_var_36, 8);
         marshal_VkPhysicalDeviceMemoryProperties(countingStream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
     }
     uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -533,8 +572,9 @@
     uint32_t opcode_vkGetPhysicalDeviceMemoryProperties = OP_vkGetPhysicalDeviceMemoryProperties;
     stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t));
-    uint64_t cgen_var_31 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_31);
+    uint64_t cgen_var_37;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_37, 1);
+    stream->write((uint64_t*)&cgen_var_37, 8);
     marshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
     unmarshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
     pool->freeAll();
@@ -559,8 +599,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_32 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_32);
+        uint64_t cgen_var_38;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_38, 1);
+        countingStream->write((uint64_t*)&cgen_var_38, 8);
         countingStream->putString(local_pName);
     }
     uint32_t packetSize_vkGetInstanceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -568,12 +609,15 @@
     uint32_t opcode_vkGetInstanceProcAddr = OP_vkGetInstanceProcAddr;
     stream->write(&opcode_vkGetInstanceProcAddr, sizeof(uint32_t));
     stream->write(&packetSize_vkGetInstanceProcAddr, sizeof(uint32_t));
-    uint64_t cgen_var_33 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_33);
+    uint64_t cgen_var_39;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_39, 1);
+    stream->write((uint64_t*)&cgen_var_39, 8);
     stream->putString(local_pName);
     pool->freeAll();
     PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0;
     stream->read(&vkGetInstanceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetInstanceProcAddr_PFN_vkVoidFunction_return;
 }
 
@@ -596,8 +640,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_34 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_34);
+        uint64_t cgen_var_40;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_40, 1);
+        countingStream->write((uint64_t*)&cgen_var_40, 8);
         countingStream->putString(local_pName);
     }
     uint32_t packetSize_vkGetDeviceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -605,12 +650,15 @@
     uint32_t opcode_vkGetDeviceProcAddr = OP_vkGetDeviceProcAddr;
     stream->write(&opcode_vkGetDeviceProcAddr, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDeviceProcAddr, sizeof(uint32_t));
-    uint64_t cgen_var_35 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_35);
+    uint64_t cgen_var_41;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_41, 1);
+    stream->write((uint64_t*)&cgen_var_41, 8);
     stream->putString(local_pName);
     pool->freeAll();
     PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0;
     stream->read(&vkGetDeviceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetDeviceProcAddr_PFN_vkVoidFunction_return;
 }
 
@@ -652,38 +700,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_36 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_36);
+        uint64_t cgen_var_42;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_42, 1);
+        countingStream->write((uint64_t*)&cgen_var_42, 8);
         marshal_VkDeviceCreateInfo(countingStream, (VkDeviceCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_37 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_37);
+        uint64_t cgen_var_43 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_43);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDevice*)pDevice, sizeof(VkDevice));
+        uint64_t cgen_var_44;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_44, 1);
+        countingStream->write((uint64_t*)&cgen_var_44, 8);
     }
     uint32_t packetSize_vkCreateDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateDevice = OP_vkCreateDevice;
     stream->write(&opcode_vkCreateDevice, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateDevice, sizeof(uint32_t));
-    uint64_t cgen_var_38 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_38);
+    uint64_t cgen_var_45;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_45, 1);
+    stream->write((uint64_t*)&cgen_var_45, 8);
     marshal_VkDeviceCreateInfo(stream, (VkDeviceCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_39 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_39);
+    uint64_t cgen_var_46 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_46);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDevice*)pDevice, sizeof(VkDevice));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDevice*)pDevice, sizeof(VkDevice));
+    uint64_t cgen_var_47;
+    stream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_47, 1);
+    stream->write((uint64_t*)&cgen_var_47, 8);
+    uint64_t cgen_var_48;
+    stream->read((uint64_t*)&cgen_var_48, 8);
+    stream->handleMapping()->mapHandles_u64_VkDevice(&cgen_var_48, (VkDevice*)pDevice, 1);
     if (pDevice)
     {
         resources->createMapping()->mapHandles_VkDevice((VkDevice*)pDevice, 1);
@@ -691,6 +744,8 @@
     pool->freeAll();
     VkResult vkCreateDevice_VkResult_return = (VkResult)0;
     stream->read(&vkCreateDevice_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateDevice_VkResult_return;
 }
 
@@ -719,11 +774,12 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_40 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_40);
+        uint64_t cgen_var_49;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_49, 1);
+        countingStream->write((uint64_t*)&cgen_var_49, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_41 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_41);
+        uint64_t cgen_var_50 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_50);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -734,11 +790,12 @@
     uint32_t opcode_vkDestroyDevice = OP_vkDestroyDevice;
     stream->write(&opcode_vkDestroyDevice, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyDevice, sizeof(uint32_t));
-    uint64_t cgen_var_42 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_42);
+    uint64_t cgen_var_51;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_51, 1);
+    stream->write((uint64_t*)&cgen_var_51, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_43 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_43);
+    uint64_t cgen_var_52 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_52);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -766,15 +823,15 @@
     {
         countingStream->putString(local_pLayerName);
         // WARNING PTR CHECK
-        uint64_t cgen_var_44 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_44);
+        uint64_t cgen_var_53 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_53);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_45 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_45);
+        uint64_t cgen_var_54 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_54);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -790,15 +847,15 @@
     stream->write(&packetSize_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t));
     stream->putString(local_pLayerName);
     // WARNING PTR CHECK
-    uint64_t cgen_var_46 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_46);
+    uint64_t cgen_var_55 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_55);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_47 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_47);
+    uint64_t cgen_var_56 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_56);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -834,6 +891,8 @@
     pool->freeAll();
     VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0;
     stream->read(&vkEnumerateInstanceExtensionProperties_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkEnumerateInstanceExtensionProperties_VkResult_return;
 }
 
@@ -859,15 +918,15 @@
     countingStream->rewind();
     {
         // WARNING PTR CHECK
-        uint64_t cgen_var_50 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_50);
+        uint64_t cgen_var_59 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_59);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_51 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_51);
+        uint64_t cgen_var_60 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_60);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -882,15 +941,15 @@
     stream->write(&opcode_vkEnumerateInstanceLayerProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkEnumerateInstanceLayerProperties, sizeof(uint32_t));
     // WARNING PTR CHECK
-    uint64_t cgen_var_52 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_52);
+    uint64_t cgen_var_61 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_61);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_53 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_53);
+    uint64_t cgen_var_62 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_62);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -926,6 +985,8 @@
     pool->freeAll();
     VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0;
     stream->read(&vkEnumerateInstanceLayerProperties_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkEnumerateInstanceLayerProperties_VkResult_return;
 }
 
@@ -943,18 +1004,19 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_56 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_56);
+        uint64_t cgen_var_65;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_65, 1);
+        countingStream->write((uint64_t*)&cgen_var_65, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_57 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_57);
+        uint64_t cgen_var_66 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_66);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_58 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_58);
+        uint64_t cgen_var_67 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_67);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -968,18 +1030,19 @@
     uint32_t opcode_vkEnumerateDeviceLayerProperties = OP_vkEnumerateDeviceLayerProperties;
     stream->write(&opcode_vkEnumerateDeviceLayerProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkEnumerateDeviceLayerProperties, sizeof(uint32_t));
-    uint64_t cgen_var_59 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_59);
+    uint64_t cgen_var_68;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_68, 1);
+    stream->write((uint64_t*)&cgen_var_68, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_60 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_60);
+    uint64_t cgen_var_69 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_69);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_61 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_61);
+    uint64_t cgen_var_70 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_70);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -1015,6 +1078,8 @@
     pool->freeAll();
     VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0;
     stream->read(&vkEnumerateDeviceLayerProperties_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkEnumerateDeviceLayerProperties_VkResult_return;
 }
 
@@ -1037,26 +1102,31 @@
     local_queueIndex = queueIndex;
     countingStream->rewind();
     {
-        uint64_t cgen_var_64 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_64);
+        uint64_t cgen_var_73;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_73, 1);
+        countingStream->write((uint64_t*)&cgen_var_73, 8);
         countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkQueue*)pQueue, sizeof(VkQueue));
+        uint64_t cgen_var_74;
+        countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_74, 1);
+        countingStream->write((uint64_t*)&cgen_var_74, 8);
     }
     uint32_t packetSize_vkGetDeviceQueue = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkGetDeviceQueue = OP_vkGetDeviceQueue;
     stream->write(&opcode_vkGetDeviceQueue, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDeviceQueue, sizeof(uint32_t));
-    uint64_t cgen_var_65 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_65);
+    uint64_t cgen_var_75;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_75, 1);
+    stream->write((uint64_t*)&cgen_var_75, 8);
     stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
     stream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkQueue*)pQueue, sizeof(VkQueue));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkQueue*)pQueue, sizeof(VkQueue));
+    uint64_t cgen_var_76;
+    stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_76, 1);
+    stream->write((uint64_t*)&cgen_var_76, 8);
+    uint64_t cgen_var_77;
+    stream->read((uint64_t*)&cgen_var_77, 8);
+    stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_77, (VkQueue*)pQueue, 1);
     if (pQueue)
     {
         resources->createMapping()->mapHandles_VkQueue((VkQueue*)pQueue, 1);
@@ -1101,33 +1171,39 @@
     resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
     countingStream->rewind();
     {
-        uint64_t cgen_var_66 = (uint64_t)local_queue;
-        countingStream->putBe64(cgen_var_66);
+        uint64_t cgen_var_78;
+        countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_78, 1);
+        countingStream->write((uint64_t*)&cgen_var_78, 8);
         countingStream->write((uint32_t*)&local_submitCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i)
         {
             marshal_VkSubmitInfo(countingStream, (VkSubmitInfo*)(local_pSubmits + i));
         }
-        uint64_t cgen_var_67 = (uint64_t)local_fence;
-        countingStream->putBe64(cgen_var_67);
+        uint64_t cgen_var_79;
+        countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_79, 1);
+        countingStream->write((uint64_t*)&cgen_var_79, 8);
     }
     uint32_t packetSize_vkQueueSubmit = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkQueueSubmit = OP_vkQueueSubmit;
     stream->write(&opcode_vkQueueSubmit, sizeof(uint32_t));
     stream->write(&packetSize_vkQueueSubmit, sizeof(uint32_t));
-    uint64_t cgen_var_68 = (uint64_t)local_queue;
-    stream->putBe64(cgen_var_68);
+    uint64_t cgen_var_80;
+    stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_80, 1);
+    stream->write((uint64_t*)&cgen_var_80, 8);
     stream->write((uint32_t*)&local_submitCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i)
     {
         marshal_VkSubmitInfo(stream, (VkSubmitInfo*)(local_pSubmits + i));
     }
-    uint64_t cgen_var_69 = (uint64_t)local_fence;
-    stream->putBe64(cgen_var_69);
+    uint64_t cgen_var_81;
+    stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_81, 1);
+    stream->write((uint64_t*)&cgen_var_81, 8);
     pool->freeAll();
     VkResult vkQueueSubmit_VkResult_return = (VkResult)0;
     stream->read(&vkQueueSubmit_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkQueueSubmit_VkResult_return;
 }
 
@@ -1143,19 +1219,23 @@
     resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
     countingStream->rewind();
     {
-        uint64_t cgen_var_70 = (uint64_t)local_queue;
-        countingStream->putBe64(cgen_var_70);
+        uint64_t cgen_var_82;
+        countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_82, 1);
+        countingStream->write((uint64_t*)&cgen_var_82, 8);
     }
     uint32_t packetSize_vkQueueWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkQueueWaitIdle = OP_vkQueueWaitIdle;
     stream->write(&opcode_vkQueueWaitIdle, sizeof(uint32_t));
     stream->write(&packetSize_vkQueueWaitIdle, sizeof(uint32_t));
-    uint64_t cgen_var_71 = (uint64_t)local_queue;
-    stream->putBe64(cgen_var_71);
+    uint64_t cgen_var_83;
+    stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_83, 1);
+    stream->write((uint64_t*)&cgen_var_83, 8);
     pool->freeAll();
     VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0;
     stream->read(&vkQueueWaitIdle_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkQueueWaitIdle_VkResult_return;
 }
 
@@ -1171,19 +1251,23 @@
     resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
     countingStream->rewind();
     {
-        uint64_t cgen_var_72 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_72);
+        uint64_t cgen_var_84;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_84, 1);
+        countingStream->write((uint64_t*)&cgen_var_84, 8);
     }
     uint32_t packetSize_vkDeviceWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkDeviceWaitIdle = OP_vkDeviceWaitIdle;
     stream->write(&opcode_vkDeviceWaitIdle, sizeof(uint32_t));
     stream->write(&packetSize_vkDeviceWaitIdle, sizeof(uint32_t));
-    uint64_t cgen_var_73 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_73);
+    uint64_t cgen_var_85;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_85, 1);
+    stream->write((uint64_t*)&cgen_var_85, 8);
     pool->freeAll();
     VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0;
     stream->read(&vkDeviceWaitIdle_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkDeviceWaitIdle_VkResult_return;
 }
 
@@ -1225,38 +1309,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_74 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_74);
+        uint64_t cgen_var_86;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_86, 1);
+        countingStream->write((uint64_t*)&cgen_var_86, 8);
         marshal_VkMemoryAllocateInfo(countingStream, (VkMemoryAllocateInfo*)(local_pAllocateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_75 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_75);
+        uint64_t cgen_var_87 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_87);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory));
+        uint64_t cgen_var_88;
+        countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_88, 1);
+        countingStream->write((uint64_t*)&cgen_var_88, 8);
     }
     uint32_t packetSize_vkAllocateMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkAllocateMemory = OP_vkAllocateMemory;
     stream->write(&opcode_vkAllocateMemory, sizeof(uint32_t));
     stream->write(&packetSize_vkAllocateMemory, sizeof(uint32_t));
-    uint64_t cgen_var_76 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_76);
+    uint64_t cgen_var_89;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_89, 1);
+    stream->write((uint64_t*)&cgen_var_89, 8);
     marshal_VkMemoryAllocateInfo(stream, (VkMemoryAllocateInfo*)(local_pAllocateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_77 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_77);
+    uint64_t cgen_var_90 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_90);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory));
+    uint64_t cgen_var_91;
+    stream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_91, 1);
+    stream->write((uint64_t*)&cgen_var_91, 8);
+    uint64_t cgen_var_92;
+    stream->read((uint64_t*)&cgen_var_92, 8);
+    stream->handleMapping()->mapHandles_u64_VkDeviceMemory(&cgen_var_92, (VkDeviceMemory*)pMemory, 1);
     if (pMemory)
     {
         resources->createMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)pMemory, 1);
@@ -1265,6 +1354,8 @@
     pool->freeAll();
     VkResult vkAllocateMemory_VkResult_return = (VkResult)0;
     stream->read(&vkAllocateMemory_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkAllocateMemory_VkResult_return;
 }
 
@@ -1297,13 +1388,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_78 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_78);
-        uint64_t cgen_var_79 = (uint64_t)local_memory;
-        countingStream->putBe64(cgen_var_79);
+        uint64_t cgen_var_93;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_93, 1);
+        countingStream->write((uint64_t*)&cgen_var_93, 8);
+        uint64_t cgen_var_94;
+        countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_94, 1);
+        countingStream->write((uint64_t*)&cgen_var_94, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_80 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_80);
+        uint64_t cgen_var_95 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_95);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -1314,13 +1407,15 @@
     uint32_t opcode_vkFreeMemory = OP_vkFreeMemory;
     stream->write(&opcode_vkFreeMemory, sizeof(uint32_t));
     stream->write(&packetSize_vkFreeMemory, sizeof(uint32_t));
-    uint64_t cgen_var_81 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_81);
-    uint64_t cgen_var_82 = (uint64_t)local_memory;
-    stream->putBe64(cgen_var_82);
+    uint64_t cgen_var_96;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_96, 1);
+    stream->write((uint64_t*)&cgen_var_96, 8);
+    uint64_t cgen_var_97;
+    stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_97, 1);
+    stream->write((uint64_t*)&cgen_var_97, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_83 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_83);
+    uint64_t cgen_var_98 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_98);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -1382,8 +1477,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_84 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_84);
+        uint64_t cgen_var_99;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_99, 1);
+        countingStream->write((uint64_t*)&cgen_var_99, 8);
         countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
         {
@@ -1412,8 +1508,9 @@
     uint32_t opcode_vkFlushMappedMemoryRanges = OP_vkFlushMappedMemoryRanges;
     stream->write(&opcode_vkFlushMappedMemoryRanges, sizeof(uint32_t));
     stream->write(&packetSize_vkFlushMappedMemoryRanges, sizeof(uint32_t));
-    uint64_t cgen_var_85 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_85);
+    uint64_t cgen_var_100;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_100, 1);
+    stream->write((uint64_t*)&cgen_var_100, 8);
     stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
     {
@@ -1439,6 +1536,8 @@
     pool->freeAll();
     VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0;
     stream->read(&vkFlushMappedMemoryRanges_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkFlushMappedMemoryRanges_VkResult_return;
 }
 
@@ -1475,8 +1574,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_86 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_86);
+        uint64_t cgen_var_101;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_101, 1);
+        countingStream->write((uint64_t*)&cgen_var_101, 8);
         countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
         {
@@ -1488,8 +1588,9 @@
     uint32_t opcode_vkInvalidateMappedMemoryRanges = OP_vkInvalidateMappedMemoryRanges;
     stream->write(&opcode_vkInvalidateMappedMemoryRanges, sizeof(uint32_t));
     stream->write(&packetSize_vkInvalidateMappedMemoryRanges, sizeof(uint32_t));
-    uint64_t cgen_var_87 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_87);
+    uint64_t cgen_var_102;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_102, 1);
+    stream->write((uint64_t*)&cgen_var_102, 8);
     stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
     {
@@ -1498,6 +1599,8 @@
     pool->freeAll();
     VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0;
     stream->read(&vkInvalidateMappedMemoryRanges_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     for (uint32_t i = 0; i < memoryRangeCount; ++i)
     {
         auto range = pMemoryRanges[i];
@@ -1535,10 +1638,12 @@
     resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
     countingStream->rewind();
     {
-        uint64_t cgen_var_88 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_88);
-        uint64_t cgen_var_89 = (uint64_t)local_memory;
-        countingStream->putBe64(cgen_var_89);
+        uint64_t cgen_var_103;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_103, 1);
+        countingStream->write((uint64_t*)&cgen_var_103, 8);
+        uint64_t cgen_var_104;
+        countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_104, 1);
+        countingStream->write((uint64_t*)&cgen_var_104, 8);
         countingStream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
     }
     uint32_t packetSize_vkGetDeviceMemoryCommitment = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -1546,10 +1651,12 @@
     uint32_t opcode_vkGetDeviceMemoryCommitment = OP_vkGetDeviceMemoryCommitment;
     stream->write(&opcode_vkGetDeviceMemoryCommitment, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDeviceMemoryCommitment, sizeof(uint32_t));
-    uint64_t cgen_var_90 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_90);
-    uint64_t cgen_var_91 = (uint64_t)local_memory;
-    stream->putBe64(cgen_var_91);
+    uint64_t cgen_var_105;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_105, 1);
+    stream->write((uint64_t*)&cgen_var_105, 8);
+    uint64_t cgen_var_106;
+    stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_106, 1);
+    stream->write((uint64_t*)&cgen_var_106, 8);
     stream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
     stream->read((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
     pool->freeAll();
@@ -1578,12 +1685,15 @@
     local_memoryOffset = memoryOffset;
     countingStream->rewind();
     {
-        uint64_t cgen_var_92 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_92);
-        uint64_t cgen_var_93 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_93);
-        uint64_t cgen_var_94 = (uint64_t)local_memory;
-        countingStream->putBe64(cgen_var_94);
+        uint64_t cgen_var_107;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_107, 1);
+        countingStream->write((uint64_t*)&cgen_var_107, 8);
+        uint64_t cgen_var_108;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_108, 1);
+        countingStream->write((uint64_t*)&cgen_var_108, 8);
+        uint64_t cgen_var_109;
+        countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_109, 1);
+        countingStream->write((uint64_t*)&cgen_var_109, 8);
         countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
     }
     uint32_t packetSize_vkBindBufferMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -1591,16 +1701,21 @@
     uint32_t opcode_vkBindBufferMemory = OP_vkBindBufferMemory;
     stream->write(&opcode_vkBindBufferMemory, sizeof(uint32_t));
     stream->write(&packetSize_vkBindBufferMemory, sizeof(uint32_t));
-    uint64_t cgen_var_95 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_95);
-    uint64_t cgen_var_96 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_96);
-    uint64_t cgen_var_97 = (uint64_t)local_memory;
-    stream->putBe64(cgen_var_97);
+    uint64_t cgen_var_110;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_110, 1);
+    stream->write((uint64_t*)&cgen_var_110, 8);
+    uint64_t cgen_var_111;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_111, 1);
+    stream->write((uint64_t*)&cgen_var_111, 8);
+    uint64_t cgen_var_112;
+    stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_112, 1);
+    stream->write((uint64_t*)&cgen_var_112, 8);
     stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
     pool->freeAll();
     VkResult vkBindBufferMemory_VkResult_return = (VkResult)0;
     stream->read(&vkBindBufferMemory_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkBindBufferMemory_VkResult_return;
 }
 
@@ -1627,12 +1742,15 @@
     local_memoryOffset = memoryOffset;
     countingStream->rewind();
     {
-        uint64_t cgen_var_98 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_98);
-        uint64_t cgen_var_99 = (uint64_t)local_image;
-        countingStream->putBe64(cgen_var_99);
-        uint64_t cgen_var_100 = (uint64_t)local_memory;
-        countingStream->putBe64(cgen_var_100);
+        uint64_t cgen_var_113;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_113, 1);
+        countingStream->write((uint64_t*)&cgen_var_113, 8);
+        uint64_t cgen_var_114;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_114, 1);
+        countingStream->write((uint64_t*)&cgen_var_114, 8);
+        uint64_t cgen_var_115;
+        countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_115, 1);
+        countingStream->write((uint64_t*)&cgen_var_115, 8);
         countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
     }
     uint32_t packetSize_vkBindImageMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -1640,16 +1758,21 @@
     uint32_t opcode_vkBindImageMemory = OP_vkBindImageMemory;
     stream->write(&opcode_vkBindImageMemory, sizeof(uint32_t));
     stream->write(&packetSize_vkBindImageMemory, sizeof(uint32_t));
-    uint64_t cgen_var_101 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_101);
-    uint64_t cgen_var_102 = (uint64_t)local_image;
-    stream->putBe64(cgen_var_102);
-    uint64_t cgen_var_103 = (uint64_t)local_memory;
-    stream->putBe64(cgen_var_103);
+    uint64_t cgen_var_116;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_116, 1);
+    stream->write((uint64_t*)&cgen_var_116, 8);
+    uint64_t cgen_var_117;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_117, 1);
+    stream->write((uint64_t*)&cgen_var_117, 8);
+    uint64_t cgen_var_118;
+    stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_118, 1);
+    stream->write((uint64_t*)&cgen_var_118, 8);
     stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
     pool->freeAll();
     VkResult vkBindImageMemory_VkResult_return = (VkResult)0;
     stream->read(&vkBindImageMemory_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkBindImageMemory_VkResult_return;
 }
 
@@ -1670,10 +1793,12 @@
     resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
     countingStream->rewind();
     {
-        uint64_t cgen_var_104 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_104);
-        uint64_t cgen_var_105 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_105);
+        uint64_t cgen_var_119;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_119, 1);
+        countingStream->write((uint64_t*)&cgen_var_119, 8);
+        uint64_t cgen_var_120;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_120, 1);
+        countingStream->write((uint64_t*)&cgen_var_120, 8);
         marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements));
     }
     uint32_t packetSize_vkGetBufferMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -1681,10 +1806,12 @@
     uint32_t opcode_vkGetBufferMemoryRequirements = OP_vkGetBufferMemoryRequirements;
     stream->write(&opcode_vkGetBufferMemoryRequirements, sizeof(uint32_t));
     stream->write(&packetSize_vkGetBufferMemoryRequirements, sizeof(uint32_t));
-    uint64_t cgen_var_106 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_106);
-    uint64_t cgen_var_107 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_107);
+    uint64_t cgen_var_121;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_121, 1);
+    stream->write((uint64_t*)&cgen_var_121, 8);
+    uint64_t cgen_var_122;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_122, 1);
+    stream->write((uint64_t*)&cgen_var_122, 8);
     marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
     unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
     pool->freeAll();
@@ -1707,10 +1834,12 @@
     resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
     countingStream->rewind();
     {
-        uint64_t cgen_var_108 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_108);
-        uint64_t cgen_var_109 = (uint64_t)local_image;
-        countingStream->putBe64(cgen_var_109);
+        uint64_t cgen_var_123;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_123, 1);
+        countingStream->write((uint64_t*)&cgen_var_123, 8);
+        uint64_t cgen_var_124;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_124, 1);
+        countingStream->write((uint64_t*)&cgen_var_124, 8);
         marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements));
     }
     uint32_t packetSize_vkGetImageMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -1718,10 +1847,12 @@
     uint32_t opcode_vkGetImageMemoryRequirements = OP_vkGetImageMemoryRequirements;
     stream->write(&opcode_vkGetImageMemoryRequirements, sizeof(uint32_t));
     stream->write(&packetSize_vkGetImageMemoryRequirements, sizeof(uint32_t));
-    uint64_t cgen_var_110 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_110);
-    uint64_t cgen_var_111 = (uint64_t)local_image;
-    stream->putBe64(cgen_var_111);
+    uint64_t cgen_var_125;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_125, 1);
+    stream->write((uint64_t*)&cgen_var_125, 8);
+    uint64_t cgen_var_126;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_126, 1);
+    stream->write((uint64_t*)&cgen_var_126, 8);
     marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
     unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
     pool->freeAll();
@@ -1745,20 +1876,22 @@
     resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
     countingStream->rewind();
     {
-        uint64_t cgen_var_112 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_112);
-        uint64_t cgen_var_113 = (uint64_t)local_image;
-        countingStream->putBe64(cgen_var_113);
+        uint64_t cgen_var_127;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_127, 1);
+        countingStream->write((uint64_t*)&cgen_var_127, 8);
+        uint64_t cgen_var_128;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_128, 1);
+        countingStream->write((uint64_t*)&cgen_var_128, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_114 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
-        countingStream->putBe64(cgen_var_114);
+        uint64_t cgen_var_129 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
+        countingStream->putBe64(cgen_var_129);
         if (pSparseMemoryRequirementCount)
         {
             countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_115 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
-        countingStream->putBe64(cgen_var_115);
+        uint64_t cgen_var_130 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
+        countingStream->putBe64(cgen_var_130);
         if (pSparseMemoryRequirements)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
@@ -1772,20 +1905,22 @@
     uint32_t opcode_vkGetImageSparseMemoryRequirements = OP_vkGetImageSparseMemoryRequirements;
     stream->write(&opcode_vkGetImageSparseMemoryRequirements, sizeof(uint32_t));
     stream->write(&packetSize_vkGetImageSparseMemoryRequirements, sizeof(uint32_t));
-    uint64_t cgen_var_116 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_116);
-    uint64_t cgen_var_117 = (uint64_t)local_image;
-    stream->putBe64(cgen_var_117);
+    uint64_t cgen_var_131;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_131, 1);
+    stream->write((uint64_t*)&cgen_var_131, 8);
+    uint64_t cgen_var_132;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_132, 1);
+    stream->write((uint64_t*)&cgen_var_132, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_118 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
-    stream->putBe64(cgen_var_118);
+    uint64_t cgen_var_133 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
+    stream->putBe64(cgen_var_133);
     if (pSparseMemoryRequirementCount)
     {
         stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_119 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
-    stream->putBe64(cgen_var_119);
+    uint64_t cgen_var_134 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
+    stream->putBe64(cgen_var_134);
     if (pSparseMemoryRequirements)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
@@ -1850,23 +1985,24 @@
     local_tiling = tiling;
     countingStream->rewind();
     {
-        uint64_t cgen_var_122 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_122);
+        uint64_t cgen_var_137;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_137, 1);
+        countingStream->write((uint64_t*)&cgen_var_137, 8);
         countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
         countingStream->write((VkImageType*)&local_type, sizeof(VkImageType));
         countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
         countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
         countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
         // WARNING PTR CHECK
-        uint64_t cgen_var_123 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_123);
+        uint64_t cgen_var_138 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_138);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_124 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_124);
+        uint64_t cgen_var_139 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_139);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -1880,23 +2016,24 @@
     uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties = OP_vkGetPhysicalDeviceSparseImageFormatProperties;
     stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t));
-    uint64_t cgen_var_125 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_125);
+    uint64_t cgen_var_140;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_140, 1);
+    stream->write((uint64_t*)&cgen_var_140, 8);
     stream->write((VkFormat*)&local_format, sizeof(VkFormat));
     stream->write((VkImageType*)&local_type, sizeof(VkImageType));
     stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
     stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
     stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
     // WARNING PTR CHECK
-    uint64_t cgen_var_126 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_126);
+    uint64_t cgen_var_141 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_141);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_127 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_127);
+    uint64_t cgen_var_142 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_142);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -1969,33 +2106,39 @@
     resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
     countingStream->rewind();
     {
-        uint64_t cgen_var_130 = (uint64_t)local_queue;
-        countingStream->putBe64(cgen_var_130);
+        uint64_t cgen_var_145;
+        countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_145, 1);
+        countingStream->write((uint64_t*)&cgen_var_145, 8);
         countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
         {
             marshal_VkBindSparseInfo(countingStream, (VkBindSparseInfo*)(local_pBindInfo + i));
         }
-        uint64_t cgen_var_131 = (uint64_t)local_fence;
-        countingStream->putBe64(cgen_var_131);
+        uint64_t cgen_var_146;
+        countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_146, 1);
+        countingStream->write((uint64_t*)&cgen_var_146, 8);
     }
     uint32_t packetSize_vkQueueBindSparse = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkQueueBindSparse = OP_vkQueueBindSparse;
     stream->write(&opcode_vkQueueBindSparse, sizeof(uint32_t));
     stream->write(&packetSize_vkQueueBindSparse, sizeof(uint32_t));
-    uint64_t cgen_var_132 = (uint64_t)local_queue;
-    stream->putBe64(cgen_var_132);
+    uint64_t cgen_var_147;
+    stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_147, 1);
+    stream->write((uint64_t*)&cgen_var_147, 8);
     stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
     {
         marshal_VkBindSparseInfo(stream, (VkBindSparseInfo*)(local_pBindInfo + i));
     }
-    uint64_t cgen_var_133 = (uint64_t)local_fence;
-    stream->putBe64(cgen_var_133);
+    uint64_t cgen_var_148;
+    stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_148, 1);
+    stream->write((uint64_t*)&cgen_var_148, 8);
     pool->freeAll();
     VkResult vkQueueBindSparse_VkResult_return = (VkResult)0;
     stream->read(&vkQueueBindSparse_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkQueueBindSparse_VkResult_return;
 }
 
@@ -2037,38 +2180,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_134 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_134);
+        uint64_t cgen_var_149;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_149, 1);
+        countingStream->write((uint64_t*)&cgen_var_149, 8);
         marshal_VkFenceCreateInfo(countingStream, (VkFenceCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_135 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_135);
+        uint64_t cgen_var_150 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_150);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkFence*)pFence, sizeof(VkFence));
+        uint64_t cgen_var_151;
+        countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_151, 1);
+        countingStream->write((uint64_t*)&cgen_var_151, 8);
     }
     uint32_t packetSize_vkCreateFence = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateFence = OP_vkCreateFence;
     stream->write(&opcode_vkCreateFence, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateFence, sizeof(uint32_t));
-    uint64_t cgen_var_136 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_136);
+    uint64_t cgen_var_152;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_152, 1);
+    stream->write((uint64_t*)&cgen_var_152, 8);
     marshal_VkFenceCreateInfo(stream, (VkFenceCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_137 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_137);
+    uint64_t cgen_var_153 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_153);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkFence*)pFence, sizeof(VkFence));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkFence*)pFence, sizeof(VkFence));
+    uint64_t cgen_var_154;
+    stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_154, 1);
+    stream->write((uint64_t*)&cgen_var_154, 8);
+    uint64_t cgen_var_155;
+    stream->read((uint64_t*)&cgen_var_155, 8);
+    stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_155, (VkFence*)pFence, 1);
     if (pFence)
     {
         resources->createMapping()->mapHandles_VkFence((VkFence*)pFence, 1);
@@ -2076,6 +2224,8 @@
     pool->freeAll();
     VkResult vkCreateFence_VkResult_return = (VkResult)0;
     stream->read(&vkCreateFence_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateFence_VkResult_return;
 }
 
@@ -2108,13 +2258,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_138 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_138);
-        uint64_t cgen_var_139 = (uint64_t)local_fence;
-        countingStream->putBe64(cgen_var_139);
+        uint64_t cgen_var_156;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_156, 1);
+        countingStream->write((uint64_t*)&cgen_var_156, 8);
+        uint64_t cgen_var_157;
+        countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_157, 1);
+        countingStream->write((uint64_t*)&cgen_var_157, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_140 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_140);
+        uint64_t cgen_var_158 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_158);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -2125,13 +2277,15 @@
     uint32_t opcode_vkDestroyFence = OP_vkDestroyFence;
     stream->write(&opcode_vkDestroyFence, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyFence, sizeof(uint32_t));
-    uint64_t cgen_var_141 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_141);
-    uint64_t cgen_var_142 = (uint64_t)local_fence;
-    stream->putBe64(cgen_var_142);
+    uint64_t cgen_var_159;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_159, 1);
+    stream->write((uint64_t*)&cgen_var_159, 8);
+    uint64_t cgen_var_160;
+    stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_160, 1);
+    stream->write((uint64_t*)&cgen_var_160, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_143 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_143);
+    uint64_t cgen_var_161 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_161);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -2166,25 +2320,39 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_144 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_144);
+        uint64_t cgen_var_162;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_162, 1);
+        countingStream->write((uint64_t*)&cgen_var_162, 8);
         countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
+        if (((fenceCount)))
+        {
+            uint64_t* cgen_var_163;
+            countingStream->alloc((void**)&cgen_var_163, ((fenceCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_163, ((fenceCount)));
+            countingStream->write((uint64_t*)cgen_var_163, 8);
+        }
     }
     uint32_t packetSize_vkResetFences = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkResetFences = OP_vkResetFences;
     stream->write(&opcode_vkResetFences, sizeof(uint32_t));
     stream->write(&packetSize_vkResetFences, sizeof(uint32_t));
-    uint64_t cgen_var_145 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_145);
+    uint64_t cgen_var_164;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_164, 1);
+    stream->write((uint64_t*)&cgen_var_164, 8);
     stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
+    if (((fenceCount)))
+    {
+        uint64_t* cgen_var_165;
+        stream->alloc((void**)&cgen_var_165, ((fenceCount)) * 8);
+        stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_165, ((fenceCount)));
+        stream->write((uint64_t*)cgen_var_165, 8);
+    }
     pool->freeAll();
     VkResult vkResetFences_VkResult_return = (VkResult)0;
     stream->read(&vkResetFences_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkResetFences_VkResult_return;
 }
 
@@ -2204,23 +2372,29 @@
     resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
     countingStream->rewind();
     {
-        uint64_t cgen_var_146 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_146);
-        uint64_t cgen_var_147 = (uint64_t)local_fence;
-        countingStream->putBe64(cgen_var_147);
+        uint64_t cgen_var_166;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_166, 1);
+        countingStream->write((uint64_t*)&cgen_var_166, 8);
+        uint64_t cgen_var_167;
+        countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_167, 1);
+        countingStream->write((uint64_t*)&cgen_var_167, 8);
     }
     uint32_t packetSize_vkGetFenceStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkGetFenceStatus = OP_vkGetFenceStatus;
     stream->write(&opcode_vkGetFenceStatus, sizeof(uint32_t));
     stream->write(&packetSize_vkGetFenceStatus, sizeof(uint32_t));
-    uint64_t cgen_var_148 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_148);
-    uint64_t cgen_var_149 = (uint64_t)local_fence;
-    stream->putBe64(cgen_var_149);
+    uint64_t cgen_var_168;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_168, 1);
+    stream->write((uint64_t*)&cgen_var_168, 8);
+    uint64_t cgen_var_169;
+    stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_169, 1);
+    stream->write((uint64_t*)&cgen_var_169, 8);
     pool->freeAll();
     VkResult vkGetFenceStatus_VkResult_return = (VkResult)0;
     stream->read(&vkGetFenceStatus_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetFenceStatus_VkResult_return;
 }
 
@@ -2256,11 +2430,17 @@
     local_timeout = timeout;
     countingStream->rewind();
     {
-        uint64_t cgen_var_150 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_150);
+        uint64_t cgen_var_170;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_170, 1);
+        countingStream->write((uint64_t*)&cgen_var_170, 8);
         countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
+        if (((fenceCount)))
+        {
+            uint64_t* cgen_var_171;
+            countingStream->alloc((void**)&cgen_var_171, ((fenceCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_171, ((fenceCount)));
+            countingStream->write((uint64_t*)cgen_var_171, 8);
+        }
         countingStream->write((VkBool32*)&local_waitAll, sizeof(VkBool32));
         countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
     }
@@ -2269,16 +2449,24 @@
     uint32_t opcode_vkWaitForFences = OP_vkWaitForFences;
     stream->write(&opcode_vkWaitForFences, sizeof(uint32_t));
     stream->write(&packetSize_vkWaitForFences, sizeof(uint32_t));
-    uint64_t cgen_var_151 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_151);
+    uint64_t cgen_var_172;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_172, 1);
+    stream->write((uint64_t*)&cgen_var_172, 8);
     stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
+    if (((fenceCount)))
+    {
+        uint64_t* cgen_var_173;
+        stream->alloc((void**)&cgen_var_173, ((fenceCount)) * 8);
+        stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_173, ((fenceCount)));
+        stream->write((uint64_t*)cgen_var_173, 8);
+    }
     stream->write((VkBool32*)&local_waitAll, sizeof(VkBool32));
     stream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
     pool->freeAll();
     VkResult vkWaitForFences_VkResult_return = (VkResult)0;
     stream->read(&vkWaitForFences_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkWaitForFences_VkResult_return;
 }
 
@@ -2320,38 +2508,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_152 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_152);
+        uint64_t cgen_var_174;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_174, 1);
+        countingStream->write((uint64_t*)&cgen_var_174, 8);
         marshal_VkSemaphoreCreateInfo(countingStream, (VkSemaphoreCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_153 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_153);
+        uint64_t cgen_var_175 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_175);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSemaphore*)pSemaphore, sizeof(VkSemaphore));
+        uint64_t cgen_var_176;
+        countingStream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_176, 1);
+        countingStream->write((uint64_t*)&cgen_var_176, 8);
     }
     uint32_t packetSize_vkCreateSemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateSemaphore = OP_vkCreateSemaphore;
     stream->write(&opcode_vkCreateSemaphore, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateSemaphore, sizeof(uint32_t));
-    uint64_t cgen_var_154 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_154);
+    uint64_t cgen_var_177;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_177, 1);
+    stream->write((uint64_t*)&cgen_var_177, 8);
     marshal_VkSemaphoreCreateInfo(stream, (VkSemaphoreCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_155 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_155);
+    uint64_t cgen_var_178 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_178);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSemaphore*)pSemaphore, sizeof(VkSemaphore));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSemaphore*)pSemaphore, sizeof(VkSemaphore));
+    uint64_t cgen_var_179;
+    stream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_179, 1);
+    stream->write((uint64_t*)&cgen_var_179, 8);
+    uint64_t cgen_var_180;
+    stream->read((uint64_t*)&cgen_var_180, 8);
+    stream->handleMapping()->mapHandles_u64_VkSemaphore(&cgen_var_180, (VkSemaphore*)pSemaphore, 1);
     if (pSemaphore)
     {
         resources->createMapping()->mapHandles_VkSemaphore((VkSemaphore*)pSemaphore, 1);
@@ -2359,6 +2552,8 @@
     pool->freeAll();
     VkResult vkCreateSemaphore_VkResult_return = (VkResult)0;
     stream->read(&vkCreateSemaphore_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateSemaphore_VkResult_return;
 }
 
@@ -2391,13 +2586,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_156 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_156);
-        uint64_t cgen_var_157 = (uint64_t)local_semaphore;
-        countingStream->putBe64(cgen_var_157);
+        uint64_t cgen_var_181;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_181, 1);
+        countingStream->write((uint64_t*)&cgen_var_181, 8);
+        uint64_t cgen_var_182;
+        countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_182, 1);
+        countingStream->write((uint64_t*)&cgen_var_182, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_158 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_158);
+        uint64_t cgen_var_183 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_183);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -2408,13 +2605,15 @@
     uint32_t opcode_vkDestroySemaphore = OP_vkDestroySemaphore;
     stream->write(&opcode_vkDestroySemaphore, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroySemaphore, sizeof(uint32_t));
-    uint64_t cgen_var_159 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_159);
-    uint64_t cgen_var_160 = (uint64_t)local_semaphore;
-    stream->putBe64(cgen_var_160);
+    uint64_t cgen_var_184;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_184, 1);
+    stream->write((uint64_t*)&cgen_var_184, 8);
+    uint64_t cgen_var_185;
+    stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_185, 1);
+    stream->write((uint64_t*)&cgen_var_185, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_161 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_161);
+    uint64_t cgen_var_186 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_186);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -2461,38 +2660,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_162 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_162);
+        uint64_t cgen_var_187;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_187, 1);
+        countingStream->write((uint64_t*)&cgen_var_187, 8);
         marshal_VkEventCreateInfo(countingStream, (VkEventCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_163 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_163);
+        uint64_t cgen_var_188 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_188);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkEvent*)pEvent, sizeof(VkEvent));
+        uint64_t cgen_var_189;
+        countingStream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_189, 1);
+        countingStream->write((uint64_t*)&cgen_var_189, 8);
     }
     uint32_t packetSize_vkCreateEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateEvent = OP_vkCreateEvent;
     stream->write(&opcode_vkCreateEvent, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateEvent, sizeof(uint32_t));
-    uint64_t cgen_var_164 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_164);
+    uint64_t cgen_var_190;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_190, 1);
+    stream->write((uint64_t*)&cgen_var_190, 8);
     marshal_VkEventCreateInfo(stream, (VkEventCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_165 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_165);
+    uint64_t cgen_var_191 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_191);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkEvent*)pEvent, sizeof(VkEvent));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkEvent*)pEvent, sizeof(VkEvent));
+    uint64_t cgen_var_192;
+    stream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_192, 1);
+    stream->write((uint64_t*)&cgen_var_192, 8);
+    uint64_t cgen_var_193;
+    stream->read((uint64_t*)&cgen_var_193, 8);
+    stream->handleMapping()->mapHandles_u64_VkEvent(&cgen_var_193, (VkEvent*)pEvent, 1);
     if (pEvent)
     {
         resources->createMapping()->mapHandles_VkEvent((VkEvent*)pEvent, 1);
@@ -2500,6 +2704,8 @@
     pool->freeAll();
     VkResult vkCreateEvent_VkResult_return = (VkResult)0;
     stream->read(&vkCreateEvent_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateEvent_VkResult_return;
 }
 
@@ -2532,13 +2738,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_166 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_166);
-        uint64_t cgen_var_167 = (uint64_t)local_event;
-        countingStream->putBe64(cgen_var_167);
+        uint64_t cgen_var_194;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_194, 1);
+        countingStream->write((uint64_t*)&cgen_var_194, 8);
+        uint64_t cgen_var_195;
+        countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_195, 1);
+        countingStream->write((uint64_t*)&cgen_var_195, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_168 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_168);
+        uint64_t cgen_var_196 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_196);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -2549,13 +2757,15 @@
     uint32_t opcode_vkDestroyEvent = OP_vkDestroyEvent;
     stream->write(&opcode_vkDestroyEvent, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyEvent, sizeof(uint32_t));
-    uint64_t cgen_var_169 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_169);
-    uint64_t cgen_var_170 = (uint64_t)local_event;
-    stream->putBe64(cgen_var_170);
+    uint64_t cgen_var_197;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_197, 1);
+    stream->write((uint64_t*)&cgen_var_197, 8);
+    uint64_t cgen_var_198;
+    stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_198, 1);
+    stream->write((uint64_t*)&cgen_var_198, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_171 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_171);
+    uint64_t cgen_var_199 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_199);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -2580,23 +2790,29 @@
     resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
     countingStream->rewind();
     {
-        uint64_t cgen_var_172 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_172);
-        uint64_t cgen_var_173 = (uint64_t)local_event;
-        countingStream->putBe64(cgen_var_173);
+        uint64_t cgen_var_200;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_200, 1);
+        countingStream->write((uint64_t*)&cgen_var_200, 8);
+        uint64_t cgen_var_201;
+        countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_201, 1);
+        countingStream->write((uint64_t*)&cgen_var_201, 8);
     }
     uint32_t packetSize_vkGetEventStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkGetEventStatus = OP_vkGetEventStatus;
     stream->write(&opcode_vkGetEventStatus, sizeof(uint32_t));
     stream->write(&packetSize_vkGetEventStatus, sizeof(uint32_t));
-    uint64_t cgen_var_174 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_174);
-    uint64_t cgen_var_175 = (uint64_t)local_event;
-    stream->putBe64(cgen_var_175);
+    uint64_t cgen_var_202;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_202, 1);
+    stream->write((uint64_t*)&cgen_var_202, 8);
+    uint64_t cgen_var_203;
+    stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_203, 1);
+    stream->write((uint64_t*)&cgen_var_203, 8);
     pool->freeAll();
     VkResult vkGetEventStatus_VkResult_return = (VkResult)0;
     stream->read(&vkGetEventStatus_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetEventStatus_VkResult_return;
 }
 
@@ -2616,23 +2832,29 @@
     resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
     countingStream->rewind();
     {
-        uint64_t cgen_var_176 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_176);
-        uint64_t cgen_var_177 = (uint64_t)local_event;
-        countingStream->putBe64(cgen_var_177);
+        uint64_t cgen_var_204;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_204, 1);
+        countingStream->write((uint64_t*)&cgen_var_204, 8);
+        uint64_t cgen_var_205;
+        countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_205, 1);
+        countingStream->write((uint64_t*)&cgen_var_205, 8);
     }
     uint32_t packetSize_vkSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkSetEvent = OP_vkSetEvent;
     stream->write(&opcode_vkSetEvent, sizeof(uint32_t));
     stream->write(&packetSize_vkSetEvent, sizeof(uint32_t));
-    uint64_t cgen_var_178 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_178);
-    uint64_t cgen_var_179 = (uint64_t)local_event;
-    stream->putBe64(cgen_var_179);
+    uint64_t cgen_var_206;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_206, 1);
+    stream->write((uint64_t*)&cgen_var_206, 8);
+    uint64_t cgen_var_207;
+    stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_207, 1);
+    stream->write((uint64_t*)&cgen_var_207, 8);
     pool->freeAll();
     VkResult vkSetEvent_VkResult_return = (VkResult)0;
     stream->read(&vkSetEvent_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkSetEvent_VkResult_return;
 }
 
@@ -2652,23 +2874,29 @@
     resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
     countingStream->rewind();
     {
-        uint64_t cgen_var_180 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_180);
-        uint64_t cgen_var_181 = (uint64_t)local_event;
-        countingStream->putBe64(cgen_var_181);
+        uint64_t cgen_var_208;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_208, 1);
+        countingStream->write((uint64_t*)&cgen_var_208, 8);
+        uint64_t cgen_var_209;
+        countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_209, 1);
+        countingStream->write((uint64_t*)&cgen_var_209, 8);
     }
     uint32_t packetSize_vkResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkResetEvent = OP_vkResetEvent;
     stream->write(&opcode_vkResetEvent, sizeof(uint32_t));
     stream->write(&packetSize_vkResetEvent, sizeof(uint32_t));
-    uint64_t cgen_var_182 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_182);
-    uint64_t cgen_var_183 = (uint64_t)local_event;
-    stream->putBe64(cgen_var_183);
+    uint64_t cgen_var_210;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_210, 1);
+    stream->write((uint64_t*)&cgen_var_210, 8);
+    uint64_t cgen_var_211;
+    stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_211, 1);
+    stream->write((uint64_t*)&cgen_var_211, 8);
     pool->freeAll();
     VkResult vkResetEvent_VkResult_return = (VkResult)0;
     stream->read(&vkResetEvent_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkResetEvent_VkResult_return;
 }
 
@@ -2710,38 +2938,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_184 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_184);
+        uint64_t cgen_var_212;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_212, 1);
+        countingStream->write((uint64_t*)&cgen_var_212, 8);
         marshal_VkQueryPoolCreateInfo(countingStream, (VkQueryPoolCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_185 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_185);
+        uint64_t cgen_var_213 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_213);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkQueryPool*)pQueryPool, sizeof(VkQueryPool));
+        uint64_t cgen_var_214;
+        countingStream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_214, 1);
+        countingStream->write((uint64_t*)&cgen_var_214, 8);
     }
     uint32_t packetSize_vkCreateQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateQueryPool = OP_vkCreateQueryPool;
     stream->write(&opcode_vkCreateQueryPool, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateQueryPool, sizeof(uint32_t));
-    uint64_t cgen_var_186 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_186);
+    uint64_t cgen_var_215;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_215, 1);
+    stream->write((uint64_t*)&cgen_var_215, 8);
     marshal_VkQueryPoolCreateInfo(stream, (VkQueryPoolCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_187 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_187);
+    uint64_t cgen_var_216 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_216);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkQueryPool*)pQueryPool, sizeof(VkQueryPool));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkQueryPool*)pQueryPool, sizeof(VkQueryPool));
+    uint64_t cgen_var_217;
+    stream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_217, 1);
+    stream->write((uint64_t*)&cgen_var_217, 8);
+    uint64_t cgen_var_218;
+    stream->read((uint64_t*)&cgen_var_218, 8);
+    stream->handleMapping()->mapHandles_u64_VkQueryPool(&cgen_var_218, (VkQueryPool*)pQueryPool, 1);
     if (pQueryPool)
     {
         resources->createMapping()->mapHandles_VkQueryPool((VkQueryPool*)pQueryPool, 1);
@@ -2749,6 +2982,8 @@
     pool->freeAll();
     VkResult vkCreateQueryPool_VkResult_return = (VkResult)0;
     stream->read(&vkCreateQueryPool_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateQueryPool_VkResult_return;
 }
 
@@ -2781,13 +3016,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_188 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_188);
-        uint64_t cgen_var_189 = (uint64_t)local_queryPool;
-        countingStream->putBe64(cgen_var_189);
+        uint64_t cgen_var_219;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_219, 1);
+        countingStream->write((uint64_t*)&cgen_var_219, 8);
+        uint64_t cgen_var_220;
+        countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_220, 1);
+        countingStream->write((uint64_t*)&cgen_var_220, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_190 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_190);
+        uint64_t cgen_var_221 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_221);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -2798,13 +3035,15 @@
     uint32_t opcode_vkDestroyQueryPool = OP_vkDestroyQueryPool;
     stream->write(&opcode_vkDestroyQueryPool, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyQueryPool, sizeof(uint32_t));
-    uint64_t cgen_var_191 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_191);
-    uint64_t cgen_var_192 = (uint64_t)local_queryPool;
-    stream->putBe64(cgen_var_192);
+    uint64_t cgen_var_222;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_222, 1);
+    stream->write((uint64_t*)&cgen_var_222, 8);
+    uint64_t cgen_var_223;
+    stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_223, 1);
+    stream->write((uint64_t*)&cgen_var_223, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_193 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_193);
+    uint64_t cgen_var_224 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_224);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -2845,10 +3084,12 @@
     local_flags = flags;
     countingStream->rewind();
     {
-        uint64_t cgen_var_194 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_194);
-        uint64_t cgen_var_195 = (uint64_t)local_queryPool;
-        countingStream->putBe64(cgen_var_195);
+        uint64_t cgen_var_225;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_225, 1);
+        countingStream->write((uint64_t*)&cgen_var_225, 8);
+        uint64_t cgen_var_226;
+        countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_226, 1);
+        countingStream->write((uint64_t*)&cgen_var_226, 8);
         countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
         countingStream->write((size_t*)&local_dataSize, sizeof(size_t));
@@ -2861,10 +3102,12 @@
     uint32_t opcode_vkGetQueryPoolResults = OP_vkGetQueryPoolResults;
     stream->write(&opcode_vkGetQueryPoolResults, sizeof(uint32_t));
     stream->write(&packetSize_vkGetQueryPoolResults, sizeof(uint32_t));
-    uint64_t cgen_var_196 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_196);
-    uint64_t cgen_var_197 = (uint64_t)local_queryPool;
-    stream->putBe64(cgen_var_197);
+    uint64_t cgen_var_227;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_227, 1);
+    stream->write((uint64_t*)&cgen_var_227, 8);
+    uint64_t cgen_var_228;
+    stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_228, 1);
+    stream->write((uint64_t*)&cgen_var_228, 8);
     stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
     stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
     stream->write((size_t*)&local_dataSize, sizeof(size_t));
@@ -2875,6 +3118,8 @@
     pool->freeAll();
     VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0;
     stream->read(&vkGetQueryPoolResults_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetQueryPoolResults_VkResult_return;
 }
 
@@ -2916,38 +3161,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_198 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_198);
+        uint64_t cgen_var_229;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_229, 1);
+        countingStream->write((uint64_t*)&cgen_var_229, 8);
         marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_199 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_199);
+        uint64_t cgen_var_230 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_230);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkBuffer*)pBuffer, sizeof(VkBuffer));
+        uint64_t cgen_var_231;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_231, 1);
+        countingStream->write((uint64_t*)&cgen_var_231, 8);
     }
     uint32_t packetSize_vkCreateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateBuffer = OP_vkCreateBuffer;
     stream->write(&opcode_vkCreateBuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateBuffer, sizeof(uint32_t));
-    uint64_t cgen_var_200 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_200);
+    uint64_t cgen_var_232;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_232, 1);
+    stream->write((uint64_t*)&cgen_var_232, 8);
     marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_201 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_201);
+    uint64_t cgen_var_233 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_233);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkBuffer*)pBuffer, sizeof(VkBuffer));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkBuffer*)pBuffer, sizeof(VkBuffer));
+    uint64_t cgen_var_234;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_234, 1);
+    stream->write((uint64_t*)&cgen_var_234, 8);
+    uint64_t cgen_var_235;
+    stream->read((uint64_t*)&cgen_var_235, 8);
+    stream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_235, (VkBuffer*)pBuffer, 1);
     if (pBuffer)
     {
         resources->createMapping()->mapHandles_VkBuffer((VkBuffer*)pBuffer, 1);
@@ -2955,6 +3205,8 @@
     pool->freeAll();
     VkResult vkCreateBuffer_VkResult_return = (VkResult)0;
     stream->read(&vkCreateBuffer_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateBuffer_VkResult_return;
 }
 
@@ -2987,13 +3239,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_202 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_202);
-        uint64_t cgen_var_203 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_203);
+        uint64_t cgen_var_236;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_236, 1);
+        countingStream->write((uint64_t*)&cgen_var_236, 8);
+        uint64_t cgen_var_237;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_237, 1);
+        countingStream->write((uint64_t*)&cgen_var_237, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_204 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_204);
+        uint64_t cgen_var_238 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_238);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3004,13 +3258,15 @@
     uint32_t opcode_vkDestroyBuffer = OP_vkDestroyBuffer;
     stream->write(&opcode_vkDestroyBuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyBuffer, sizeof(uint32_t));
-    uint64_t cgen_var_205 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_205);
-    uint64_t cgen_var_206 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_206);
+    uint64_t cgen_var_239;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_239, 1);
+    stream->write((uint64_t*)&cgen_var_239, 8);
+    uint64_t cgen_var_240;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_240, 1);
+    stream->write((uint64_t*)&cgen_var_240, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_207 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_207);
+    uint64_t cgen_var_241 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_241);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3057,38 +3313,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_208 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_208);
+        uint64_t cgen_var_242;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_242, 1);
+        countingStream->write((uint64_t*)&cgen_var_242, 8);
         marshal_VkBufferViewCreateInfo(countingStream, (VkBufferViewCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_209 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_209);
+        uint64_t cgen_var_243 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_243);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkBufferView*)pView, sizeof(VkBufferView));
+        uint64_t cgen_var_244;
+        countingStream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_244, 1);
+        countingStream->write((uint64_t*)&cgen_var_244, 8);
     }
     uint32_t packetSize_vkCreateBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateBufferView = OP_vkCreateBufferView;
     stream->write(&opcode_vkCreateBufferView, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateBufferView, sizeof(uint32_t));
-    uint64_t cgen_var_210 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_210);
+    uint64_t cgen_var_245;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_245, 1);
+    stream->write((uint64_t*)&cgen_var_245, 8);
     marshal_VkBufferViewCreateInfo(stream, (VkBufferViewCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_211 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_211);
+    uint64_t cgen_var_246 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_246);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkBufferView*)pView, sizeof(VkBufferView));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkBufferView*)pView, sizeof(VkBufferView));
+    uint64_t cgen_var_247;
+    stream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_247, 1);
+    stream->write((uint64_t*)&cgen_var_247, 8);
+    uint64_t cgen_var_248;
+    stream->read((uint64_t*)&cgen_var_248, 8);
+    stream->handleMapping()->mapHandles_u64_VkBufferView(&cgen_var_248, (VkBufferView*)pView, 1);
     if (pView)
     {
         resources->createMapping()->mapHandles_VkBufferView((VkBufferView*)pView, 1);
@@ -3096,6 +3357,8 @@
     pool->freeAll();
     VkResult vkCreateBufferView_VkResult_return = (VkResult)0;
     stream->read(&vkCreateBufferView_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateBufferView_VkResult_return;
 }
 
@@ -3128,13 +3391,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_212 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_212);
-        uint64_t cgen_var_213 = (uint64_t)local_bufferView;
-        countingStream->putBe64(cgen_var_213);
+        uint64_t cgen_var_249;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_249, 1);
+        countingStream->write((uint64_t*)&cgen_var_249, 8);
+        uint64_t cgen_var_250;
+        countingStream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_250, 1);
+        countingStream->write((uint64_t*)&cgen_var_250, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_214 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_214);
+        uint64_t cgen_var_251 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_251);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3145,13 +3410,15 @@
     uint32_t opcode_vkDestroyBufferView = OP_vkDestroyBufferView;
     stream->write(&opcode_vkDestroyBufferView, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyBufferView, sizeof(uint32_t));
-    uint64_t cgen_var_215 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_215);
-    uint64_t cgen_var_216 = (uint64_t)local_bufferView;
-    stream->putBe64(cgen_var_216);
+    uint64_t cgen_var_252;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_252, 1);
+    stream->write((uint64_t*)&cgen_var_252, 8);
+    uint64_t cgen_var_253;
+    stream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_253, 1);
+    stream->write((uint64_t*)&cgen_var_253, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_217 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_217);
+    uint64_t cgen_var_254 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_254);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3198,38 +3465,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_218 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_218);
+        uint64_t cgen_var_255;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_255, 1);
+        countingStream->write((uint64_t*)&cgen_var_255, 8);
         marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_219 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_219);
+        uint64_t cgen_var_256 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_256);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkImage*)pImage, sizeof(VkImage));
+        uint64_t cgen_var_257;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_257, 1);
+        countingStream->write((uint64_t*)&cgen_var_257, 8);
     }
     uint32_t packetSize_vkCreateImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateImage = OP_vkCreateImage;
     stream->write(&opcode_vkCreateImage, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateImage, sizeof(uint32_t));
-    uint64_t cgen_var_220 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_220);
+    uint64_t cgen_var_258;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_258, 1);
+    stream->write((uint64_t*)&cgen_var_258, 8);
     marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_221 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_221);
+    uint64_t cgen_var_259 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_259);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkImage*)pImage, sizeof(VkImage));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkImage*)pImage, sizeof(VkImage));
+    uint64_t cgen_var_260;
+    stream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_260, 1);
+    stream->write((uint64_t*)&cgen_var_260, 8);
+    uint64_t cgen_var_261;
+    stream->read((uint64_t*)&cgen_var_261, 8);
+    stream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_261, (VkImage*)pImage, 1);
     if (pImage)
     {
         resources->createMapping()->mapHandles_VkImage((VkImage*)pImage, 1);
@@ -3237,6 +3509,8 @@
     pool->freeAll();
     VkResult vkCreateImage_VkResult_return = (VkResult)0;
     stream->read(&vkCreateImage_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateImage_VkResult_return;
 }
 
@@ -3269,13 +3543,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_222 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_222);
-        uint64_t cgen_var_223 = (uint64_t)local_image;
-        countingStream->putBe64(cgen_var_223);
+        uint64_t cgen_var_262;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_262, 1);
+        countingStream->write((uint64_t*)&cgen_var_262, 8);
+        uint64_t cgen_var_263;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_263, 1);
+        countingStream->write((uint64_t*)&cgen_var_263, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_224 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_224);
+        uint64_t cgen_var_264 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_264);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3286,13 +3562,15 @@
     uint32_t opcode_vkDestroyImage = OP_vkDestroyImage;
     stream->write(&opcode_vkDestroyImage, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyImage, sizeof(uint32_t));
-    uint64_t cgen_var_225 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_225);
-    uint64_t cgen_var_226 = (uint64_t)local_image;
-    stream->putBe64(cgen_var_226);
+    uint64_t cgen_var_265;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_265, 1);
+    stream->write((uint64_t*)&cgen_var_265, 8);
+    uint64_t cgen_var_266;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_266, 1);
+    stream->write((uint64_t*)&cgen_var_266, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_227 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_227);
+    uint64_t cgen_var_267 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_267);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3330,10 +3608,12 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_228 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_228);
-        uint64_t cgen_var_229 = (uint64_t)local_image;
-        countingStream->putBe64(cgen_var_229);
+        uint64_t cgen_var_268;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_268, 1);
+        countingStream->write((uint64_t*)&cgen_var_268, 8);
+        uint64_t cgen_var_269;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_269, 1);
+        countingStream->write((uint64_t*)&cgen_var_269, 8);
         marshal_VkImageSubresource(countingStream, (VkImageSubresource*)(local_pSubresource));
         marshal_VkSubresourceLayout(countingStream, (VkSubresourceLayout*)(pLayout));
     }
@@ -3342,10 +3622,12 @@
     uint32_t opcode_vkGetImageSubresourceLayout = OP_vkGetImageSubresourceLayout;
     stream->write(&opcode_vkGetImageSubresourceLayout, sizeof(uint32_t));
     stream->write(&packetSize_vkGetImageSubresourceLayout, sizeof(uint32_t));
-    uint64_t cgen_var_230 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_230);
-    uint64_t cgen_var_231 = (uint64_t)local_image;
-    stream->putBe64(cgen_var_231);
+    uint64_t cgen_var_270;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_270, 1);
+    stream->write((uint64_t*)&cgen_var_270, 8);
+    uint64_t cgen_var_271;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_271, 1);
+    stream->write((uint64_t*)&cgen_var_271, 8);
     marshal_VkImageSubresource(stream, (VkImageSubresource*)(local_pSubresource));
     marshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout));
     unmarshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout));
@@ -3390,38 +3672,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_232 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_232);
+        uint64_t cgen_var_272;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_272, 1);
+        countingStream->write((uint64_t*)&cgen_var_272, 8);
         marshal_VkImageViewCreateInfo(countingStream, (VkImageViewCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_233 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_233);
+        uint64_t cgen_var_273 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_273);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkImageView*)pView, sizeof(VkImageView));
+        uint64_t cgen_var_274;
+        countingStream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_274, 1);
+        countingStream->write((uint64_t*)&cgen_var_274, 8);
     }
     uint32_t packetSize_vkCreateImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateImageView = OP_vkCreateImageView;
     stream->write(&opcode_vkCreateImageView, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateImageView, sizeof(uint32_t));
-    uint64_t cgen_var_234 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_234);
+    uint64_t cgen_var_275;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_275, 1);
+    stream->write((uint64_t*)&cgen_var_275, 8);
     marshal_VkImageViewCreateInfo(stream, (VkImageViewCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_235 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_235);
+    uint64_t cgen_var_276 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_276);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkImageView*)pView, sizeof(VkImageView));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkImageView*)pView, sizeof(VkImageView));
+    uint64_t cgen_var_277;
+    stream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_277, 1);
+    stream->write((uint64_t*)&cgen_var_277, 8);
+    uint64_t cgen_var_278;
+    stream->read((uint64_t*)&cgen_var_278, 8);
+    stream->handleMapping()->mapHandles_u64_VkImageView(&cgen_var_278, (VkImageView*)pView, 1);
     if (pView)
     {
         resources->createMapping()->mapHandles_VkImageView((VkImageView*)pView, 1);
@@ -3429,6 +3716,8 @@
     pool->freeAll();
     VkResult vkCreateImageView_VkResult_return = (VkResult)0;
     stream->read(&vkCreateImageView_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateImageView_VkResult_return;
 }
 
@@ -3461,13 +3750,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_236 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_236);
-        uint64_t cgen_var_237 = (uint64_t)local_imageView;
-        countingStream->putBe64(cgen_var_237);
+        uint64_t cgen_var_279;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_279, 1);
+        countingStream->write((uint64_t*)&cgen_var_279, 8);
+        uint64_t cgen_var_280;
+        countingStream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_280, 1);
+        countingStream->write((uint64_t*)&cgen_var_280, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_238 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_238);
+        uint64_t cgen_var_281 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_281);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3478,13 +3769,15 @@
     uint32_t opcode_vkDestroyImageView = OP_vkDestroyImageView;
     stream->write(&opcode_vkDestroyImageView, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyImageView, sizeof(uint32_t));
-    uint64_t cgen_var_239 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_239);
-    uint64_t cgen_var_240 = (uint64_t)local_imageView;
-    stream->putBe64(cgen_var_240);
+    uint64_t cgen_var_282;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_282, 1);
+    stream->write((uint64_t*)&cgen_var_282, 8);
+    uint64_t cgen_var_283;
+    stream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_283, 1);
+    stream->write((uint64_t*)&cgen_var_283, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_241 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_241);
+    uint64_t cgen_var_284 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_284);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3531,38 +3824,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_242 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_242);
+        uint64_t cgen_var_285;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_285, 1);
+        countingStream->write((uint64_t*)&cgen_var_285, 8);
         marshal_VkShaderModuleCreateInfo(countingStream, (VkShaderModuleCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_243 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_243);
+        uint64_t cgen_var_286 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_286);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkShaderModule*)pShaderModule, sizeof(VkShaderModule));
+        uint64_t cgen_var_287;
+        countingStream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_287, 1);
+        countingStream->write((uint64_t*)&cgen_var_287, 8);
     }
     uint32_t packetSize_vkCreateShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateShaderModule = OP_vkCreateShaderModule;
     stream->write(&opcode_vkCreateShaderModule, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateShaderModule, sizeof(uint32_t));
-    uint64_t cgen_var_244 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_244);
+    uint64_t cgen_var_288;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_288, 1);
+    stream->write((uint64_t*)&cgen_var_288, 8);
     marshal_VkShaderModuleCreateInfo(stream, (VkShaderModuleCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_245 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_245);
+    uint64_t cgen_var_289 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_289);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkShaderModule*)pShaderModule, sizeof(VkShaderModule));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkShaderModule*)pShaderModule, sizeof(VkShaderModule));
+    uint64_t cgen_var_290;
+    stream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_290, 1);
+    stream->write((uint64_t*)&cgen_var_290, 8);
+    uint64_t cgen_var_291;
+    stream->read((uint64_t*)&cgen_var_291, 8);
+    stream->handleMapping()->mapHandles_u64_VkShaderModule(&cgen_var_291, (VkShaderModule*)pShaderModule, 1);
     if (pShaderModule)
     {
         resources->createMapping()->mapHandles_VkShaderModule((VkShaderModule*)pShaderModule, 1);
@@ -3570,6 +3868,8 @@
     pool->freeAll();
     VkResult vkCreateShaderModule_VkResult_return = (VkResult)0;
     stream->read(&vkCreateShaderModule_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateShaderModule_VkResult_return;
 }
 
@@ -3602,13 +3902,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_246 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_246);
-        uint64_t cgen_var_247 = (uint64_t)local_shaderModule;
-        countingStream->putBe64(cgen_var_247);
+        uint64_t cgen_var_292;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_292, 1);
+        countingStream->write((uint64_t*)&cgen_var_292, 8);
+        uint64_t cgen_var_293;
+        countingStream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_293, 1);
+        countingStream->write((uint64_t*)&cgen_var_293, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_248 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_248);
+        uint64_t cgen_var_294 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_294);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3619,13 +3921,15 @@
     uint32_t opcode_vkDestroyShaderModule = OP_vkDestroyShaderModule;
     stream->write(&opcode_vkDestroyShaderModule, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyShaderModule, sizeof(uint32_t));
-    uint64_t cgen_var_249 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_249);
-    uint64_t cgen_var_250 = (uint64_t)local_shaderModule;
-    stream->putBe64(cgen_var_250);
+    uint64_t cgen_var_295;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_295, 1);
+    stream->write((uint64_t*)&cgen_var_295, 8);
+    uint64_t cgen_var_296;
+    stream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_296, 1);
+    stream->write((uint64_t*)&cgen_var_296, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_251 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_251);
+    uint64_t cgen_var_297 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_297);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3672,38 +3976,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_252 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_252);
+        uint64_t cgen_var_298;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_298, 1);
+        countingStream->write((uint64_t*)&cgen_var_298, 8);
         marshal_VkPipelineCacheCreateInfo(countingStream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_253 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_253);
+        uint64_t cgen_var_299 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_299);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache));
+        uint64_t cgen_var_300;
+        countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_300, 1);
+        countingStream->write((uint64_t*)&cgen_var_300, 8);
     }
     uint32_t packetSize_vkCreatePipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreatePipelineCache = OP_vkCreatePipelineCache;
     stream->write(&opcode_vkCreatePipelineCache, sizeof(uint32_t));
     stream->write(&packetSize_vkCreatePipelineCache, sizeof(uint32_t));
-    uint64_t cgen_var_254 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_254);
+    uint64_t cgen_var_301;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_301, 1);
+    stream->write((uint64_t*)&cgen_var_301, 8);
     marshal_VkPipelineCacheCreateInfo(stream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_255 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_255);
+    uint64_t cgen_var_302 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_302);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache));
+    uint64_t cgen_var_303;
+    stream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_303, 1);
+    stream->write((uint64_t*)&cgen_var_303, 8);
+    uint64_t cgen_var_304;
+    stream->read((uint64_t*)&cgen_var_304, 8);
+    stream->handleMapping()->mapHandles_u64_VkPipelineCache(&cgen_var_304, (VkPipelineCache*)pPipelineCache, 1);
     if (pPipelineCache)
     {
         resources->createMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)pPipelineCache, 1);
@@ -3711,6 +4020,8 @@
     pool->freeAll();
     VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0;
     stream->read(&vkCreatePipelineCache_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreatePipelineCache_VkResult_return;
 }
 
@@ -3743,13 +4054,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_256 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_256);
-        uint64_t cgen_var_257 = (uint64_t)local_pipelineCache;
-        countingStream->putBe64(cgen_var_257);
+        uint64_t cgen_var_305;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_305, 1);
+        countingStream->write((uint64_t*)&cgen_var_305, 8);
+        uint64_t cgen_var_306;
+        countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_306, 1);
+        countingStream->write((uint64_t*)&cgen_var_306, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_258 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_258);
+        uint64_t cgen_var_307 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_307);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3760,13 +4073,15 @@
     uint32_t opcode_vkDestroyPipelineCache = OP_vkDestroyPipelineCache;
     stream->write(&opcode_vkDestroyPipelineCache, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyPipelineCache, sizeof(uint32_t));
-    uint64_t cgen_var_259 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_259);
-    uint64_t cgen_var_260 = (uint64_t)local_pipelineCache;
-    stream->putBe64(cgen_var_260);
+    uint64_t cgen_var_308;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_308, 1);
+    stream->write((uint64_t*)&cgen_var_308, 8);
+    uint64_t cgen_var_309;
+    stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_309, 1);
+    stream->write((uint64_t*)&cgen_var_309, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_261 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_261);
+    uint64_t cgen_var_310 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_310);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -3793,20 +4108,22 @@
     resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache);
     countingStream->rewind();
     {
-        uint64_t cgen_var_262 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_262);
-        uint64_t cgen_var_263 = (uint64_t)local_pipelineCache;
-        countingStream->putBe64(cgen_var_263);
+        uint64_t cgen_var_311;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_311, 1);
+        countingStream->write((uint64_t*)&cgen_var_311, 8);
+        uint64_t cgen_var_312;
+        countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_312, 1);
+        countingStream->write((uint64_t*)&cgen_var_312, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_264 = (uint64_t)(uintptr_t)pDataSize;
-        countingStream->putBe64(cgen_var_264);
+        uint64_t cgen_var_313 = (uint64_t)(uintptr_t)pDataSize;
+        countingStream->putBe64(cgen_var_313);
         if (pDataSize)
         {
             countingStream->write((size_t*)pDataSize, sizeof(size_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_265 = (uint64_t)(uintptr_t)pData;
-        countingStream->putBe64(cgen_var_265);
+        uint64_t cgen_var_314 = (uint64_t)(uintptr_t)pData;
+        countingStream->putBe64(cgen_var_314);
         if (pData)
         {
             countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
@@ -3817,20 +4134,22 @@
     uint32_t opcode_vkGetPipelineCacheData = OP_vkGetPipelineCacheData;
     stream->write(&opcode_vkGetPipelineCacheData, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPipelineCacheData, sizeof(uint32_t));
-    uint64_t cgen_var_266 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_266);
-    uint64_t cgen_var_267 = (uint64_t)local_pipelineCache;
-    stream->putBe64(cgen_var_267);
+    uint64_t cgen_var_315;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_315, 1);
+    stream->write((uint64_t*)&cgen_var_315, 8);
+    uint64_t cgen_var_316;
+    stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_316, 1);
+    stream->write((uint64_t*)&cgen_var_316, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_268 = (uint64_t)(uintptr_t)pDataSize;
-    stream->putBe64(cgen_var_268);
+    uint64_t cgen_var_317 = (uint64_t)(uintptr_t)pDataSize;
+    stream->putBe64(cgen_var_317);
     if (pDataSize)
     {
         stream->write((size_t*)pDataSize, sizeof(size_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_269 = (uint64_t)(uintptr_t)pData;
-    stream->putBe64(cgen_var_269);
+    uint64_t cgen_var_318 = (uint64_t)(uintptr_t)pData;
+    stream->putBe64(cgen_var_318);
     if (pData)
     {
         stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
@@ -3860,6 +4179,8 @@
     pool->freeAll();
     VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0;
     stream->read(&vkGetPipelineCacheData_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPipelineCacheData_VkResult_return;
 }
 
@@ -3893,29 +4214,45 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_272 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_272);
-        uint64_t cgen_var_273 = (uint64_t)local_dstCache;
-        countingStream->putBe64(cgen_var_273);
+        uint64_t cgen_var_321;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_321, 1);
+        countingStream->write((uint64_t*)&cgen_var_321, 8);
+        uint64_t cgen_var_322;
+        countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_322, 1);
+        countingStream->write((uint64_t*)&cgen_var_322, 8);
         countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkPipelineCache));
+        if (((srcCacheCount)))
+        {
+            uint64_t* cgen_var_323;
+            countingStream->alloc((void**)&cgen_var_323, ((srcCacheCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_323, ((srcCacheCount)));
+            countingStream->write((uint64_t*)cgen_var_323, 8);
+        }
     }
     uint32_t packetSize_vkMergePipelineCaches = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkMergePipelineCaches = OP_vkMergePipelineCaches;
     stream->write(&opcode_vkMergePipelineCaches, sizeof(uint32_t));
     stream->write(&packetSize_vkMergePipelineCaches, sizeof(uint32_t));
-    uint64_t cgen_var_274 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_274);
-    uint64_t cgen_var_275 = (uint64_t)local_dstCache;
-    stream->putBe64(cgen_var_275);
+    uint64_t cgen_var_324;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_324, 1);
+    stream->write((uint64_t*)&cgen_var_324, 8);
+    uint64_t cgen_var_325;
+    stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_325, 1);
+    stream->write((uint64_t*)&cgen_var_325, 8);
     stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkPipelineCache));
+    if (((srcCacheCount)))
+    {
+        uint64_t* cgen_var_326;
+        stream->alloc((void**)&cgen_var_326, ((srcCacheCount)) * 8);
+        stream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_326, ((srcCacheCount)));
+        stream->write((uint64_t*)cgen_var_326, 8);
+    }
     pool->freeAll();
     VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0;
     stream->read(&vkMergePipelineCaches_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkMergePipelineCaches_VkResult_return;
 }
 
@@ -3970,50 +4307,69 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_276 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_276);
-        uint64_t cgen_var_277 = (uint64_t)local_pipelineCache;
-        countingStream->putBe64(cgen_var_277);
+        uint64_t cgen_var_327;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_327, 1);
+        countingStream->write((uint64_t*)&cgen_var_327, 8);
+        uint64_t cgen_var_328;
+        countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_328, 1);
+        countingStream->write((uint64_t*)&cgen_var_328, 8);
         countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
         {
             marshal_VkGraphicsPipelineCreateInfo(countingStream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_278 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_278);
+        uint64_t cgen_var_329 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_329);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
+        if (((createInfoCount)))
+        {
+            uint64_t* cgen_var_330;
+            countingStream->alloc((void**)&cgen_var_330, ((createInfoCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_330, ((createInfoCount)));
+            countingStream->write((uint64_t*)cgen_var_330, 8);
+        }
     }
     uint32_t packetSize_vkCreateGraphicsPipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateGraphicsPipelines = OP_vkCreateGraphicsPipelines;
     stream->write(&opcode_vkCreateGraphicsPipelines, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateGraphicsPipelines, sizeof(uint32_t));
-    uint64_t cgen_var_279 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_279);
-    uint64_t cgen_var_280 = (uint64_t)local_pipelineCache;
-    stream->putBe64(cgen_var_280);
+    uint64_t cgen_var_331;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_331, 1);
+    stream->write((uint64_t*)&cgen_var_331, 8);
+    uint64_t cgen_var_332;
+    stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_332, 1);
+    stream->write((uint64_t*)&cgen_var_332, 8);
     stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
     {
         marshal_VkGraphicsPipelineCreateInfo(stream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_281 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_281);
+    uint64_t cgen_var_333 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_333);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
+    if (((createInfoCount)))
+    {
+        uint64_t* cgen_var_334;
+        stream->alloc((void**)&cgen_var_334, ((createInfoCount)) * 8);
+        stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_334, ((createInfoCount)));
+        stream->write((uint64_t*)cgen_var_334, 8);
+    }
+    if (((createInfoCount)))
+    {
+        uint64_t* cgen_var_335;
+        stream->alloc((void**)&cgen_var_335, ((createInfoCount)) * 8);
+        stream->read((uint64_t*)cgen_var_335, 8);
+        stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_335, (VkPipeline*)pPipelines, ((createInfoCount)));
+    }
     if (pPipelines)
     {
         resources->createMapping()->mapHandles_VkPipeline((VkPipeline*)pPipelines, ((createInfoCount)));
@@ -4021,6 +4377,8 @@
     pool->freeAll();
     VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0;
     stream->read(&vkCreateGraphicsPipelines_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateGraphicsPipelines_VkResult_return;
 }
 
@@ -4075,50 +4433,69 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_282 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_282);
-        uint64_t cgen_var_283 = (uint64_t)local_pipelineCache;
-        countingStream->putBe64(cgen_var_283);
+        uint64_t cgen_var_336;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_336, 1);
+        countingStream->write((uint64_t*)&cgen_var_336, 8);
+        uint64_t cgen_var_337;
+        countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_337, 1);
+        countingStream->write((uint64_t*)&cgen_var_337, 8);
         countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
         {
             marshal_VkComputePipelineCreateInfo(countingStream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_284 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_284);
+        uint64_t cgen_var_338 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_338);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
+        if (((createInfoCount)))
+        {
+            uint64_t* cgen_var_339;
+            countingStream->alloc((void**)&cgen_var_339, ((createInfoCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_339, ((createInfoCount)));
+            countingStream->write((uint64_t*)cgen_var_339, 8);
+        }
     }
     uint32_t packetSize_vkCreateComputePipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateComputePipelines = OP_vkCreateComputePipelines;
     stream->write(&opcode_vkCreateComputePipelines, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateComputePipelines, sizeof(uint32_t));
-    uint64_t cgen_var_285 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_285);
-    uint64_t cgen_var_286 = (uint64_t)local_pipelineCache;
-    stream->putBe64(cgen_var_286);
+    uint64_t cgen_var_340;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_340, 1);
+    stream->write((uint64_t*)&cgen_var_340, 8);
+    uint64_t cgen_var_341;
+    stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_341, 1);
+    stream->write((uint64_t*)&cgen_var_341, 8);
     stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
     {
         marshal_VkComputePipelineCreateInfo(stream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_287 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_287);
+    uint64_t cgen_var_342 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_342);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
+    if (((createInfoCount)))
+    {
+        uint64_t* cgen_var_343;
+        stream->alloc((void**)&cgen_var_343, ((createInfoCount)) * 8);
+        stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_343, ((createInfoCount)));
+        stream->write((uint64_t*)cgen_var_343, 8);
+    }
+    if (((createInfoCount)))
+    {
+        uint64_t* cgen_var_344;
+        stream->alloc((void**)&cgen_var_344, ((createInfoCount)) * 8);
+        stream->read((uint64_t*)cgen_var_344, 8);
+        stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_344, (VkPipeline*)pPipelines, ((createInfoCount)));
+    }
     if (pPipelines)
     {
         resources->createMapping()->mapHandles_VkPipeline((VkPipeline*)pPipelines, ((createInfoCount)));
@@ -4126,6 +4503,8 @@
     pool->freeAll();
     VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0;
     stream->read(&vkCreateComputePipelines_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateComputePipelines_VkResult_return;
 }
 
@@ -4158,13 +4537,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_288 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_288);
-        uint64_t cgen_var_289 = (uint64_t)local_pipeline;
-        countingStream->putBe64(cgen_var_289);
+        uint64_t cgen_var_345;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_345, 1);
+        countingStream->write((uint64_t*)&cgen_var_345, 8);
+        uint64_t cgen_var_346;
+        countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_346, 1);
+        countingStream->write((uint64_t*)&cgen_var_346, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_290 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_290);
+        uint64_t cgen_var_347 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_347);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -4175,13 +4556,15 @@
     uint32_t opcode_vkDestroyPipeline = OP_vkDestroyPipeline;
     stream->write(&opcode_vkDestroyPipeline, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyPipeline, sizeof(uint32_t));
-    uint64_t cgen_var_291 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_291);
-    uint64_t cgen_var_292 = (uint64_t)local_pipeline;
-    stream->putBe64(cgen_var_292);
+    uint64_t cgen_var_348;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_348, 1);
+    stream->write((uint64_t*)&cgen_var_348, 8);
+    uint64_t cgen_var_349;
+    stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_349, 1);
+    stream->write((uint64_t*)&cgen_var_349, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_293 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_293);
+    uint64_t cgen_var_350 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_350);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -4228,38 +4611,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_294 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_294);
+        uint64_t cgen_var_351;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_351, 1);
+        countingStream->write((uint64_t*)&cgen_var_351, 8);
         marshal_VkPipelineLayoutCreateInfo(countingStream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_295 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_295);
+        uint64_t cgen_var_352 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_352);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout));
+        uint64_t cgen_var_353;
+        countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_353, 1);
+        countingStream->write((uint64_t*)&cgen_var_353, 8);
     }
     uint32_t packetSize_vkCreatePipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreatePipelineLayout = OP_vkCreatePipelineLayout;
     stream->write(&opcode_vkCreatePipelineLayout, sizeof(uint32_t));
     stream->write(&packetSize_vkCreatePipelineLayout, sizeof(uint32_t));
-    uint64_t cgen_var_296 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_296);
+    uint64_t cgen_var_354;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_354, 1);
+    stream->write((uint64_t*)&cgen_var_354, 8);
     marshal_VkPipelineLayoutCreateInfo(stream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_297 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_297);
+    uint64_t cgen_var_355 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_355);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout));
+    uint64_t cgen_var_356;
+    stream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_356, 1);
+    stream->write((uint64_t*)&cgen_var_356, 8);
+    uint64_t cgen_var_357;
+    stream->read((uint64_t*)&cgen_var_357, 8);
+    stream->handleMapping()->mapHandles_u64_VkPipelineLayout(&cgen_var_357, (VkPipelineLayout*)pPipelineLayout, 1);
     if (pPipelineLayout)
     {
         resources->createMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)pPipelineLayout, 1);
@@ -4267,6 +4655,8 @@
     pool->freeAll();
     VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0;
     stream->read(&vkCreatePipelineLayout_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreatePipelineLayout_VkResult_return;
 }
 
@@ -4299,13 +4689,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_298 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_298);
-        uint64_t cgen_var_299 = (uint64_t)local_pipelineLayout;
-        countingStream->putBe64(cgen_var_299);
+        uint64_t cgen_var_358;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_358, 1);
+        countingStream->write((uint64_t*)&cgen_var_358, 8);
+        uint64_t cgen_var_359;
+        countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_359, 1);
+        countingStream->write((uint64_t*)&cgen_var_359, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_300 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_300);
+        uint64_t cgen_var_360 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_360);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -4316,13 +4708,15 @@
     uint32_t opcode_vkDestroyPipelineLayout = OP_vkDestroyPipelineLayout;
     stream->write(&opcode_vkDestroyPipelineLayout, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyPipelineLayout, sizeof(uint32_t));
-    uint64_t cgen_var_301 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_301);
-    uint64_t cgen_var_302 = (uint64_t)local_pipelineLayout;
-    stream->putBe64(cgen_var_302);
+    uint64_t cgen_var_361;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_361, 1);
+    stream->write((uint64_t*)&cgen_var_361, 8);
+    uint64_t cgen_var_362;
+    stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_362, 1);
+    stream->write((uint64_t*)&cgen_var_362, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_303 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_303);
+    uint64_t cgen_var_363 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_363);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -4369,38 +4763,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_304 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_304);
+        uint64_t cgen_var_364;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_364, 1);
+        countingStream->write((uint64_t*)&cgen_var_364, 8);
         marshal_VkSamplerCreateInfo(countingStream, (VkSamplerCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_305 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_305);
+        uint64_t cgen_var_365 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_365);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSampler*)pSampler, sizeof(VkSampler));
+        uint64_t cgen_var_366;
+        countingStream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_366, 1);
+        countingStream->write((uint64_t*)&cgen_var_366, 8);
     }
     uint32_t packetSize_vkCreateSampler = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateSampler = OP_vkCreateSampler;
     stream->write(&opcode_vkCreateSampler, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateSampler, sizeof(uint32_t));
-    uint64_t cgen_var_306 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_306);
+    uint64_t cgen_var_367;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_367, 1);
+    stream->write((uint64_t*)&cgen_var_367, 8);
     marshal_VkSamplerCreateInfo(stream, (VkSamplerCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_307 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_307);
+    uint64_t cgen_var_368 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_368);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSampler*)pSampler, sizeof(VkSampler));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSampler*)pSampler, sizeof(VkSampler));
+    uint64_t cgen_var_369;
+    stream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_369, 1);
+    stream->write((uint64_t*)&cgen_var_369, 8);
+    uint64_t cgen_var_370;
+    stream->read((uint64_t*)&cgen_var_370, 8);
+    stream->handleMapping()->mapHandles_u64_VkSampler(&cgen_var_370, (VkSampler*)pSampler, 1);
     if (pSampler)
     {
         resources->createMapping()->mapHandles_VkSampler((VkSampler*)pSampler, 1);
@@ -4408,6 +4807,8 @@
     pool->freeAll();
     VkResult vkCreateSampler_VkResult_return = (VkResult)0;
     stream->read(&vkCreateSampler_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateSampler_VkResult_return;
 }
 
@@ -4440,13 +4841,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_308 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_308);
-        uint64_t cgen_var_309 = (uint64_t)local_sampler;
-        countingStream->putBe64(cgen_var_309);
+        uint64_t cgen_var_371;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_371, 1);
+        countingStream->write((uint64_t*)&cgen_var_371, 8);
+        uint64_t cgen_var_372;
+        countingStream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_372, 1);
+        countingStream->write((uint64_t*)&cgen_var_372, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_310 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_310);
+        uint64_t cgen_var_373 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_373);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -4457,13 +4860,15 @@
     uint32_t opcode_vkDestroySampler = OP_vkDestroySampler;
     stream->write(&opcode_vkDestroySampler, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroySampler, sizeof(uint32_t));
-    uint64_t cgen_var_311 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_311);
-    uint64_t cgen_var_312 = (uint64_t)local_sampler;
-    stream->putBe64(cgen_var_312);
+    uint64_t cgen_var_374;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_374, 1);
+    stream->write((uint64_t*)&cgen_var_374, 8);
+    uint64_t cgen_var_375;
+    stream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_375, 1);
+    stream->write((uint64_t*)&cgen_var_375, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_313 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_313);
+    uint64_t cgen_var_376 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_376);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -4510,38 +4915,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_314 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_314);
+        uint64_t cgen_var_377;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_377, 1);
+        countingStream->write((uint64_t*)&cgen_var_377, 8);
         marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_315 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_315);
+        uint64_t cgen_var_378 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_378);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout));
+        uint64_t cgen_var_379;
+        countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_379, 1);
+        countingStream->write((uint64_t*)&cgen_var_379, 8);
     }
     uint32_t packetSize_vkCreateDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateDescriptorSetLayout = OP_vkCreateDescriptorSetLayout;
     stream->write(&opcode_vkCreateDescriptorSetLayout, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateDescriptorSetLayout, sizeof(uint32_t));
-    uint64_t cgen_var_316 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_316);
+    uint64_t cgen_var_380;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_380, 1);
+    stream->write((uint64_t*)&cgen_var_380, 8);
     marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_317 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_317);
+    uint64_t cgen_var_381 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_381);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout));
+    uint64_t cgen_var_382;
+    stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_382, 1);
+    stream->write((uint64_t*)&cgen_var_382, 8);
+    uint64_t cgen_var_383;
+    stream->read((uint64_t*)&cgen_var_383, 8);
+    stream->handleMapping()->mapHandles_u64_VkDescriptorSetLayout(&cgen_var_383, (VkDescriptorSetLayout*)pSetLayout, 1);
     if (pSetLayout)
     {
         resources->createMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)pSetLayout, 1);
@@ -4549,6 +4959,8 @@
     pool->freeAll();
     VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0;
     stream->read(&vkCreateDescriptorSetLayout_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateDescriptorSetLayout_VkResult_return;
 }
 
@@ -4581,13 +4993,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_318 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_318);
-        uint64_t cgen_var_319 = (uint64_t)local_descriptorSetLayout;
-        countingStream->putBe64(cgen_var_319);
+        uint64_t cgen_var_384;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_384, 1);
+        countingStream->write((uint64_t*)&cgen_var_384, 8);
+        uint64_t cgen_var_385;
+        countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_385, 1);
+        countingStream->write((uint64_t*)&cgen_var_385, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_320 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_320);
+        uint64_t cgen_var_386 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_386);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -4598,13 +5012,15 @@
     uint32_t opcode_vkDestroyDescriptorSetLayout = OP_vkDestroyDescriptorSetLayout;
     stream->write(&opcode_vkDestroyDescriptorSetLayout, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyDescriptorSetLayout, sizeof(uint32_t));
-    uint64_t cgen_var_321 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_321);
-    uint64_t cgen_var_322 = (uint64_t)local_descriptorSetLayout;
-    stream->putBe64(cgen_var_322);
+    uint64_t cgen_var_387;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_387, 1);
+    stream->write((uint64_t*)&cgen_var_387, 8);
+    uint64_t cgen_var_388;
+    stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_388, 1);
+    stream->write((uint64_t*)&cgen_var_388, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_323 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_323);
+    uint64_t cgen_var_389 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_389);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -4651,38 +5067,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_324 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_324);
+        uint64_t cgen_var_390;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_390, 1);
+        countingStream->write((uint64_t*)&cgen_var_390, 8);
         marshal_VkDescriptorPoolCreateInfo(countingStream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_325 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_325);
+        uint64_t cgen_var_391 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_391);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool));
+        uint64_t cgen_var_392;
+        countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_392, 1);
+        countingStream->write((uint64_t*)&cgen_var_392, 8);
     }
     uint32_t packetSize_vkCreateDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateDescriptorPool = OP_vkCreateDescriptorPool;
     stream->write(&opcode_vkCreateDescriptorPool, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateDescriptorPool, sizeof(uint32_t));
-    uint64_t cgen_var_326 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_326);
+    uint64_t cgen_var_393;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_393, 1);
+    stream->write((uint64_t*)&cgen_var_393, 8);
     marshal_VkDescriptorPoolCreateInfo(stream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_327 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_327);
+    uint64_t cgen_var_394 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_394);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool));
+    uint64_t cgen_var_395;
+    stream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_395, 1);
+    stream->write((uint64_t*)&cgen_var_395, 8);
+    uint64_t cgen_var_396;
+    stream->read((uint64_t*)&cgen_var_396, 8);
+    stream->handleMapping()->mapHandles_u64_VkDescriptorPool(&cgen_var_396, (VkDescriptorPool*)pDescriptorPool, 1);
     if (pDescriptorPool)
     {
         resources->createMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)pDescriptorPool, 1);
@@ -4690,6 +5111,8 @@
     pool->freeAll();
     VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0;
     stream->read(&vkCreateDescriptorPool_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateDescriptorPool_VkResult_return;
 }
 
@@ -4722,13 +5145,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_328 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_328);
-        uint64_t cgen_var_329 = (uint64_t)local_descriptorPool;
-        countingStream->putBe64(cgen_var_329);
+        uint64_t cgen_var_397;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_397, 1);
+        countingStream->write((uint64_t*)&cgen_var_397, 8);
+        uint64_t cgen_var_398;
+        countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_398, 1);
+        countingStream->write((uint64_t*)&cgen_var_398, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_330 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_330);
+        uint64_t cgen_var_399 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_399);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -4739,13 +5164,15 @@
     uint32_t opcode_vkDestroyDescriptorPool = OP_vkDestroyDescriptorPool;
     stream->write(&opcode_vkDestroyDescriptorPool, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyDescriptorPool, sizeof(uint32_t));
-    uint64_t cgen_var_331 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_331);
-    uint64_t cgen_var_332 = (uint64_t)local_descriptorPool;
-    stream->putBe64(cgen_var_332);
+    uint64_t cgen_var_400;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_400, 1);
+    stream->write((uint64_t*)&cgen_var_400, 8);
+    uint64_t cgen_var_401;
+    stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_401, 1);
+    stream->write((uint64_t*)&cgen_var_401, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_333 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_333);
+    uint64_t cgen_var_402 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_402);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -4773,10 +5200,12 @@
     local_flags = flags;
     countingStream->rewind();
     {
-        uint64_t cgen_var_334 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_334);
-        uint64_t cgen_var_335 = (uint64_t)local_descriptorPool;
-        countingStream->putBe64(cgen_var_335);
+        uint64_t cgen_var_403;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_403, 1);
+        countingStream->write((uint64_t*)&cgen_var_403, 8);
+        uint64_t cgen_var_404;
+        countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_404, 1);
+        countingStream->write((uint64_t*)&cgen_var_404, 8);
         countingStream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags));
     }
     uint32_t packetSize_vkResetDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -4784,14 +5213,18 @@
     uint32_t opcode_vkResetDescriptorPool = OP_vkResetDescriptorPool;
     stream->write(&opcode_vkResetDescriptorPool, sizeof(uint32_t));
     stream->write(&packetSize_vkResetDescriptorPool, sizeof(uint32_t));
-    uint64_t cgen_var_336 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_336);
-    uint64_t cgen_var_337 = (uint64_t)local_descriptorPool;
-    stream->putBe64(cgen_var_337);
+    uint64_t cgen_var_405;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_405, 1);
+    stream->write((uint64_t*)&cgen_var_405, 8);
+    uint64_t cgen_var_406;
+    stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_406, 1);
+    stream->write((uint64_t*)&cgen_var_406, 8);
     stream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags));
     pool->freeAll();
     VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0;
     stream->read(&vkResetDescriptorPool_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkResetDescriptorPool_VkResult_return;
 }
 
@@ -4820,24 +5253,41 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_338 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_338);
+        uint64_t cgen_var_407;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_407, 1);
+        countingStream->write((uint64_t*)&cgen_var_407, 8);
         marshal_VkDescriptorSetAllocateInfo(countingStream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet));
+        if (pAllocateInfo->descriptorSetCount)
+        {
+            uint64_t* cgen_var_408;
+            countingStream->alloc((void**)&cgen_var_408, pAllocateInfo->descriptorSetCount * 8);
+            countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_408, pAllocateInfo->descriptorSetCount);
+            countingStream->write((uint64_t*)cgen_var_408, 8);
+        }
     }
     uint32_t packetSize_vkAllocateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkAllocateDescriptorSets = OP_vkAllocateDescriptorSets;
     stream->write(&opcode_vkAllocateDescriptorSets, sizeof(uint32_t));
     stream->write(&packetSize_vkAllocateDescriptorSets, sizeof(uint32_t));
-    uint64_t cgen_var_339 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_339);
+    uint64_t cgen_var_409;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_409, 1);
+    stream->write((uint64_t*)&cgen_var_409, 8);
     marshal_VkDescriptorSetAllocateInfo(stream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet));
+    if (pAllocateInfo->descriptorSetCount)
+    {
+        uint64_t* cgen_var_410;
+        stream->alloc((void**)&cgen_var_410, pAllocateInfo->descriptorSetCount * 8);
+        stream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_410, pAllocateInfo->descriptorSetCount);
+        stream->write((uint64_t*)cgen_var_410, 8);
+    }
+    if (pAllocateInfo->descriptorSetCount)
+    {
+        uint64_t* cgen_var_411;
+        stream->alloc((void**)&cgen_var_411, pAllocateInfo->descriptorSetCount * 8);
+        stream->read((uint64_t*)cgen_var_411, 8);
+        stream->handleMapping()->mapHandles_u64_VkDescriptorSet(cgen_var_411, (VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount);
+    }
     if (pDescriptorSets)
     {
         resources->createMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount);
@@ -4845,6 +5295,8 @@
     pool->freeAll();
     VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0;
     stream->read(&vkAllocateDescriptorSets_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkAllocateDescriptorSets_VkResult_return;
 }
 
@@ -4878,18 +5330,25 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_340 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_340);
-        uint64_t cgen_var_341 = (uint64_t)local_descriptorPool;
-        countingStream->putBe64(cgen_var_341);
+        uint64_t cgen_var_412;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_412, 1);
+        countingStream->write((uint64_t*)&cgen_var_412, 8);
+        uint64_t cgen_var_413;
+        countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_413, 1);
+        countingStream->write((uint64_t*)&cgen_var_413, 8);
         countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
         // WARNING PTR CHECK
-        uint64_t cgen_var_342 = (uint64_t)(uintptr_t)local_pDescriptorSets;
-        countingStream->putBe64(cgen_var_342);
+        uint64_t cgen_var_414 = (uint64_t)(uintptr_t)local_pDescriptorSets;
+        countingStream->putBe64(cgen_var_414);
         if (local_pDescriptorSets)
         {
-            // WARNING HANDLE TYPE POINTER
-            countingStream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet));
+            if (((descriptorSetCount)))
+            {
+                uint64_t* cgen_var_415;
+                countingStream->alloc((void**)&cgen_var_415, ((descriptorSetCount)) * 8);
+                countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_415, ((descriptorSetCount)));
+                countingStream->write((uint64_t*)cgen_var_415, 8);
+            }
         }
     }
     uint32_t packetSize_vkFreeDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -4897,18 +5356,25 @@
     uint32_t opcode_vkFreeDescriptorSets = OP_vkFreeDescriptorSets;
     stream->write(&opcode_vkFreeDescriptorSets, sizeof(uint32_t));
     stream->write(&packetSize_vkFreeDescriptorSets, sizeof(uint32_t));
-    uint64_t cgen_var_343 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_343);
-    uint64_t cgen_var_344 = (uint64_t)local_descriptorPool;
-    stream->putBe64(cgen_var_344);
+    uint64_t cgen_var_416;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_416, 1);
+    stream->write((uint64_t*)&cgen_var_416, 8);
+    uint64_t cgen_var_417;
+    stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_417, 1);
+    stream->write((uint64_t*)&cgen_var_417, 8);
     stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
     // WARNING PTR CHECK
-    uint64_t cgen_var_345 = (uint64_t)(uintptr_t)local_pDescriptorSets;
-    stream->putBe64(cgen_var_345);
+    uint64_t cgen_var_418 = (uint64_t)(uintptr_t)local_pDescriptorSets;
+    stream->putBe64(cgen_var_418);
     if (local_pDescriptorSets)
     {
-        // WARNING HANDLE TYPE POINTER
-        stream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet));
+        if (((descriptorSetCount)))
+        {
+            uint64_t* cgen_var_419;
+            stream->alloc((void**)&cgen_var_419, ((descriptorSetCount)) * 8);
+            stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_419, ((descriptorSetCount)));
+            stream->write((uint64_t*)cgen_var_419, 8);
+        }
     }
     if (pDescriptorSets)
     {
@@ -4917,6 +5383,8 @@
     pool->freeAll();
     VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0;
     stream->read(&vkFreeDescriptorSets_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkFreeDescriptorSets_VkResult_return;
 }
 
@@ -4974,8 +5442,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_346 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_346);
+        uint64_t cgen_var_420;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_420, 1);
+        countingStream->write((uint64_t*)&cgen_var_420, 8);
         countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
         {
@@ -4992,8 +5461,9 @@
     uint32_t opcode_vkUpdateDescriptorSets = OP_vkUpdateDescriptorSets;
     stream->write(&opcode_vkUpdateDescriptorSets, sizeof(uint32_t));
     stream->write(&packetSize_vkUpdateDescriptorSets, sizeof(uint32_t));
-    uint64_t cgen_var_347 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_347);
+    uint64_t cgen_var_421;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_421, 1);
+    stream->write((uint64_t*)&cgen_var_421, 8);
     stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
     {
@@ -5045,38 +5515,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_348 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_348);
+        uint64_t cgen_var_422;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_422, 1);
+        countingStream->write((uint64_t*)&cgen_var_422, 8);
         marshal_VkFramebufferCreateInfo(countingStream, (VkFramebufferCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_349 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_349);
+        uint64_t cgen_var_423 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_423);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer));
+        uint64_t cgen_var_424;
+        countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_424, 1);
+        countingStream->write((uint64_t*)&cgen_var_424, 8);
     }
     uint32_t packetSize_vkCreateFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateFramebuffer = OP_vkCreateFramebuffer;
     stream->write(&opcode_vkCreateFramebuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateFramebuffer, sizeof(uint32_t));
-    uint64_t cgen_var_350 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_350);
+    uint64_t cgen_var_425;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_425, 1);
+    stream->write((uint64_t*)&cgen_var_425, 8);
     marshal_VkFramebufferCreateInfo(stream, (VkFramebufferCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_351 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_351);
+    uint64_t cgen_var_426 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_426);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer));
+    uint64_t cgen_var_427;
+    stream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_427, 1);
+    stream->write((uint64_t*)&cgen_var_427, 8);
+    uint64_t cgen_var_428;
+    stream->read((uint64_t*)&cgen_var_428, 8);
+    stream->handleMapping()->mapHandles_u64_VkFramebuffer(&cgen_var_428, (VkFramebuffer*)pFramebuffer, 1);
     if (pFramebuffer)
     {
         resources->createMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)pFramebuffer, 1);
@@ -5084,6 +5559,8 @@
     pool->freeAll();
     VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0;
     stream->read(&vkCreateFramebuffer_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateFramebuffer_VkResult_return;
 }
 
@@ -5116,13 +5593,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_352 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_352);
-        uint64_t cgen_var_353 = (uint64_t)local_framebuffer;
-        countingStream->putBe64(cgen_var_353);
+        uint64_t cgen_var_429;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_429, 1);
+        countingStream->write((uint64_t*)&cgen_var_429, 8);
+        uint64_t cgen_var_430;
+        countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_430, 1);
+        countingStream->write((uint64_t*)&cgen_var_430, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_354 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_354);
+        uint64_t cgen_var_431 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_431);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -5133,13 +5612,15 @@
     uint32_t opcode_vkDestroyFramebuffer = OP_vkDestroyFramebuffer;
     stream->write(&opcode_vkDestroyFramebuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyFramebuffer, sizeof(uint32_t));
-    uint64_t cgen_var_355 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_355);
-    uint64_t cgen_var_356 = (uint64_t)local_framebuffer;
-    stream->putBe64(cgen_var_356);
+    uint64_t cgen_var_432;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_432, 1);
+    stream->write((uint64_t*)&cgen_var_432, 8);
+    uint64_t cgen_var_433;
+    stream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_433, 1);
+    stream->write((uint64_t*)&cgen_var_433, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_357 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_357);
+    uint64_t cgen_var_434 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_434);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -5186,38 +5667,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_358 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_358);
+        uint64_t cgen_var_435;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_435, 1);
+        countingStream->write((uint64_t*)&cgen_var_435, 8);
         marshal_VkRenderPassCreateInfo(countingStream, (VkRenderPassCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_359 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_359);
+        uint64_t cgen_var_436 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_436);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
+        uint64_t cgen_var_437;
+        countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_437, 1);
+        countingStream->write((uint64_t*)&cgen_var_437, 8);
     }
     uint32_t packetSize_vkCreateRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateRenderPass = OP_vkCreateRenderPass;
     stream->write(&opcode_vkCreateRenderPass, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateRenderPass, sizeof(uint32_t));
-    uint64_t cgen_var_360 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_360);
+    uint64_t cgen_var_438;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_438, 1);
+    stream->write((uint64_t*)&cgen_var_438, 8);
     marshal_VkRenderPassCreateInfo(stream, (VkRenderPassCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_361 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_361);
+    uint64_t cgen_var_439 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_439);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
+    uint64_t cgen_var_440;
+    stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_440, 1);
+    stream->write((uint64_t*)&cgen_var_440, 8);
+    uint64_t cgen_var_441;
+    stream->read((uint64_t*)&cgen_var_441, 8);
+    stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_441, (VkRenderPass*)pRenderPass, 1);
     if (pRenderPass)
     {
         resources->createMapping()->mapHandles_VkRenderPass((VkRenderPass*)pRenderPass, 1);
@@ -5225,6 +5711,8 @@
     pool->freeAll();
     VkResult vkCreateRenderPass_VkResult_return = (VkResult)0;
     stream->read(&vkCreateRenderPass_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateRenderPass_VkResult_return;
 }
 
@@ -5257,13 +5745,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_362 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_362);
-        uint64_t cgen_var_363 = (uint64_t)local_renderPass;
-        countingStream->putBe64(cgen_var_363);
+        uint64_t cgen_var_442;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_442, 1);
+        countingStream->write((uint64_t*)&cgen_var_442, 8);
+        uint64_t cgen_var_443;
+        countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_443, 1);
+        countingStream->write((uint64_t*)&cgen_var_443, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_364 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_364);
+        uint64_t cgen_var_444 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_444);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -5274,13 +5764,15 @@
     uint32_t opcode_vkDestroyRenderPass = OP_vkDestroyRenderPass;
     stream->write(&opcode_vkDestroyRenderPass, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyRenderPass, sizeof(uint32_t));
-    uint64_t cgen_var_365 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_365);
-    uint64_t cgen_var_366 = (uint64_t)local_renderPass;
-    stream->putBe64(cgen_var_366);
+    uint64_t cgen_var_445;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_445, 1);
+    stream->write((uint64_t*)&cgen_var_445, 8);
+    uint64_t cgen_var_446;
+    stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_446, 1);
+    stream->write((uint64_t*)&cgen_var_446, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_367 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_367);
+    uint64_t cgen_var_447 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_447);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -5306,10 +5798,12 @@
     resources->unwrapMapping()->mapHandles_VkRenderPass((VkRenderPass*)&local_renderPass);
     countingStream->rewind();
     {
-        uint64_t cgen_var_368 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_368);
-        uint64_t cgen_var_369 = (uint64_t)local_renderPass;
-        countingStream->putBe64(cgen_var_369);
+        uint64_t cgen_var_448;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_448, 1);
+        countingStream->write((uint64_t*)&cgen_var_448, 8);
+        uint64_t cgen_var_449;
+        countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_449, 1);
+        countingStream->write((uint64_t*)&cgen_var_449, 8);
         marshal_VkExtent2D(countingStream, (VkExtent2D*)(pGranularity));
     }
     uint32_t packetSize_vkGetRenderAreaGranularity = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -5317,10 +5811,12 @@
     uint32_t opcode_vkGetRenderAreaGranularity = OP_vkGetRenderAreaGranularity;
     stream->write(&opcode_vkGetRenderAreaGranularity, sizeof(uint32_t));
     stream->write(&packetSize_vkGetRenderAreaGranularity, sizeof(uint32_t));
-    uint64_t cgen_var_370 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_370);
-    uint64_t cgen_var_371 = (uint64_t)local_renderPass;
-    stream->putBe64(cgen_var_371);
+    uint64_t cgen_var_450;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_450, 1);
+    stream->write((uint64_t*)&cgen_var_450, 8);
+    uint64_t cgen_var_451;
+    stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_451, 1);
+    stream->write((uint64_t*)&cgen_var_451, 8);
     marshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity));
     unmarshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity));
     pool->freeAll();
@@ -5364,38 +5860,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_372 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_372);
+        uint64_t cgen_var_452;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_452, 1);
+        countingStream->write((uint64_t*)&cgen_var_452, 8);
         marshal_VkCommandPoolCreateInfo(countingStream, (VkCommandPoolCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_373 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_373);
+        uint64_t cgen_var_453 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_453);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkCommandPool*)pCommandPool, sizeof(VkCommandPool));
+        uint64_t cgen_var_454;
+        countingStream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_454, 1);
+        countingStream->write((uint64_t*)&cgen_var_454, 8);
     }
     uint32_t packetSize_vkCreateCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateCommandPool = OP_vkCreateCommandPool;
     stream->write(&opcode_vkCreateCommandPool, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateCommandPool, sizeof(uint32_t));
-    uint64_t cgen_var_374 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_374);
+    uint64_t cgen_var_455;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_455, 1);
+    stream->write((uint64_t*)&cgen_var_455, 8);
     marshal_VkCommandPoolCreateInfo(stream, (VkCommandPoolCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_375 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_375);
+    uint64_t cgen_var_456 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_456);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkCommandPool*)pCommandPool, sizeof(VkCommandPool));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkCommandPool*)pCommandPool, sizeof(VkCommandPool));
+    uint64_t cgen_var_457;
+    stream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_457, 1);
+    stream->write((uint64_t*)&cgen_var_457, 8);
+    uint64_t cgen_var_458;
+    stream->read((uint64_t*)&cgen_var_458, 8);
+    stream->handleMapping()->mapHandles_u64_VkCommandPool(&cgen_var_458, (VkCommandPool*)pCommandPool, 1);
     if (pCommandPool)
     {
         resources->createMapping()->mapHandles_VkCommandPool((VkCommandPool*)pCommandPool, 1);
@@ -5403,6 +5904,8 @@
     pool->freeAll();
     VkResult vkCreateCommandPool_VkResult_return = (VkResult)0;
     stream->read(&vkCreateCommandPool_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateCommandPool_VkResult_return;
 }
 
@@ -5435,13 +5938,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_376 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_376);
-        uint64_t cgen_var_377 = (uint64_t)local_commandPool;
-        countingStream->putBe64(cgen_var_377);
+        uint64_t cgen_var_459;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_459, 1);
+        countingStream->write((uint64_t*)&cgen_var_459, 8);
+        uint64_t cgen_var_460;
+        countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_460, 1);
+        countingStream->write((uint64_t*)&cgen_var_460, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_378 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_378);
+        uint64_t cgen_var_461 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_461);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -5452,13 +5957,15 @@
     uint32_t opcode_vkDestroyCommandPool = OP_vkDestroyCommandPool;
     stream->write(&opcode_vkDestroyCommandPool, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyCommandPool, sizeof(uint32_t));
-    uint64_t cgen_var_379 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_379);
-    uint64_t cgen_var_380 = (uint64_t)local_commandPool;
-    stream->putBe64(cgen_var_380);
+    uint64_t cgen_var_462;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_462, 1);
+    stream->write((uint64_t*)&cgen_var_462, 8);
+    uint64_t cgen_var_463;
+    stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_463, 1);
+    stream->write((uint64_t*)&cgen_var_463, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_381 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_381);
+    uint64_t cgen_var_464 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_464);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -5486,10 +5993,12 @@
     local_flags = flags;
     countingStream->rewind();
     {
-        uint64_t cgen_var_382 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_382);
-        uint64_t cgen_var_383 = (uint64_t)local_commandPool;
-        countingStream->putBe64(cgen_var_383);
+        uint64_t cgen_var_465;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_465, 1);
+        countingStream->write((uint64_t*)&cgen_var_465, 8);
+        uint64_t cgen_var_466;
+        countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_466, 1);
+        countingStream->write((uint64_t*)&cgen_var_466, 8);
         countingStream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags));
     }
     uint32_t packetSize_vkResetCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -5497,14 +6006,18 @@
     uint32_t opcode_vkResetCommandPool = OP_vkResetCommandPool;
     stream->write(&opcode_vkResetCommandPool, sizeof(uint32_t));
     stream->write(&packetSize_vkResetCommandPool, sizeof(uint32_t));
-    uint64_t cgen_var_384 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_384);
-    uint64_t cgen_var_385 = (uint64_t)local_commandPool;
-    stream->putBe64(cgen_var_385);
+    uint64_t cgen_var_467;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_467, 1);
+    stream->write((uint64_t*)&cgen_var_467, 8);
+    uint64_t cgen_var_468;
+    stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_468, 1);
+    stream->write((uint64_t*)&cgen_var_468, 8);
     stream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags));
     pool->freeAll();
     VkResult vkResetCommandPool_VkResult_return = (VkResult)0;
     stream->read(&vkResetCommandPool_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkResetCommandPool_VkResult_return;
 }
 
@@ -5533,24 +6046,41 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_386 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_386);
+        uint64_t cgen_var_469;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_469, 1);
+        countingStream->write((uint64_t*)&cgen_var_469, 8);
         marshal_VkCommandBufferAllocateInfo(countingStream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer));
+        if (pAllocateInfo->commandBufferCount)
+        {
+            uint64_t* cgen_var_470;
+            countingStream->alloc((void**)&cgen_var_470, pAllocateInfo->commandBufferCount * 8);
+            countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_470, pAllocateInfo->commandBufferCount);
+            countingStream->write((uint64_t*)cgen_var_470, 8);
+        }
     }
     uint32_t packetSize_vkAllocateCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkAllocateCommandBuffers = OP_vkAllocateCommandBuffers;
     stream->write(&opcode_vkAllocateCommandBuffers, sizeof(uint32_t));
     stream->write(&packetSize_vkAllocateCommandBuffers, sizeof(uint32_t));
-    uint64_t cgen_var_387 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_387);
+    uint64_t cgen_var_471;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_471, 1);
+    stream->write((uint64_t*)&cgen_var_471, 8);
     marshal_VkCommandBufferAllocateInfo(stream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer));
+    if (pAllocateInfo->commandBufferCount)
+    {
+        uint64_t* cgen_var_472;
+        stream->alloc((void**)&cgen_var_472, pAllocateInfo->commandBufferCount * 8);
+        stream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_472, pAllocateInfo->commandBufferCount);
+        stream->write((uint64_t*)cgen_var_472, 8);
+    }
+    if (pAllocateInfo->commandBufferCount)
+    {
+        uint64_t* cgen_var_473;
+        stream->alloc((void**)&cgen_var_473, pAllocateInfo->commandBufferCount * 8);
+        stream->read((uint64_t*)cgen_var_473, 8);
+        stream->handleMapping()->mapHandles_u64_VkCommandBuffer(cgen_var_473, (VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount);
+    }
     if (pCommandBuffers)
     {
         resources->createMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount);
@@ -5558,6 +6088,8 @@
     pool->freeAll();
     VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0;
     stream->read(&vkAllocateCommandBuffers_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkAllocateCommandBuffers_VkResult_return;
 }
 
@@ -5591,18 +6123,25 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_388 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_388);
-        uint64_t cgen_var_389 = (uint64_t)local_commandPool;
-        countingStream->putBe64(cgen_var_389);
+        uint64_t cgen_var_474;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_474, 1);
+        countingStream->write((uint64_t*)&cgen_var_474, 8);
+        uint64_t cgen_var_475;
+        countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_475, 1);
+        countingStream->write((uint64_t*)&cgen_var_475, 8);
         countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
         // WARNING PTR CHECK
-        uint64_t cgen_var_390 = (uint64_t)(uintptr_t)local_pCommandBuffers;
-        countingStream->putBe64(cgen_var_390);
+        uint64_t cgen_var_476 = (uint64_t)(uintptr_t)local_pCommandBuffers;
+        countingStream->putBe64(cgen_var_476);
         if (local_pCommandBuffers)
         {
-            // WARNING HANDLE TYPE POINTER
-            countingStream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer));
+            if (((commandBufferCount)))
+            {
+                uint64_t* cgen_var_477;
+                countingStream->alloc((void**)&cgen_var_477, ((commandBufferCount)) * 8);
+                countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_477, ((commandBufferCount)));
+                countingStream->write((uint64_t*)cgen_var_477, 8);
+            }
         }
     }
     uint32_t packetSize_vkFreeCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -5610,18 +6149,25 @@
     uint32_t opcode_vkFreeCommandBuffers = OP_vkFreeCommandBuffers;
     stream->write(&opcode_vkFreeCommandBuffers, sizeof(uint32_t));
     stream->write(&packetSize_vkFreeCommandBuffers, sizeof(uint32_t));
-    uint64_t cgen_var_391 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_391);
-    uint64_t cgen_var_392 = (uint64_t)local_commandPool;
-    stream->putBe64(cgen_var_392);
+    uint64_t cgen_var_478;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_478, 1);
+    stream->write((uint64_t*)&cgen_var_478, 8);
+    uint64_t cgen_var_479;
+    stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_479, 1);
+    stream->write((uint64_t*)&cgen_var_479, 8);
     stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
     // WARNING PTR CHECK
-    uint64_t cgen_var_393 = (uint64_t)(uintptr_t)local_pCommandBuffers;
-    stream->putBe64(cgen_var_393);
+    uint64_t cgen_var_480 = (uint64_t)(uintptr_t)local_pCommandBuffers;
+    stream->putBe64(cgen_var_480);
     if (local_pCommandBuffers)
     {
-        // WARNING HANDLE TYPE POINTER
-        stream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer));
+        if (((commandBufferCount)))
+        {
+            uint64_t* cgen_var_481;
+            stream->alloc((void**)&cgen_var_481, ((commandBufferCount)) * 8);
+            stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_481, ((commandBufferCount)));
+            stream->write((uint64_t*)cgen_var_481, 8);
+        }
     }
     if (pCommandBuffers)
     {
@@ -5654,8 +6200,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_394 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_394);
+        uint64_t cgen_var_482;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_482, 1);
+        countingStream->write((uint64_t*)&cgen_var_482, 8);
         marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo));
     }
     uint32_t packetSize_vkBeginCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -5663,12 +6210,15 @@
     uint32_t opcode_vkBeginCommandBuffer = OP_vkBeginCommandBuffer;
     stream->write(&opcode_vkBeginCommandBuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkBeginCommandBuffer, sizeof(uint32_t));
-    uint64_t cgen_var_395 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_395);
+    uint64_t cgen_var_483;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_483, 1);
+    stream->write((uint64_t*)&cgen_var_483, 8);
     marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo));
     pool->freeAll();
     VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0;
     stream->read(&vkBeginCommandBuffer_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkBeginCommandBuffer_VkResult_return;
 }
 
@@ -5684,19 +6234,23 @@
     resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
     countingStream->rewind();
     {
-        uint64_t cgen_var_396 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_396);
+        uint64_t cgen_var_484;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_484, 1);
+        countingStream->write((uint64_t*)&cgen_var_484, 8);
     }
     uint32_t packetSize_vkEndCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkEndCommandBuffer = OP_vkEndCommandBuffer;
     stream->write(&opcode_vkEndCommandBuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkEndCommandBuffer, sizeof(uint32_t));
-    uint64_t cgen_var_397 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_397);
+    uint64_t cgen_var_485;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_485, 1);
+    stream->write((uint64_t*)&cgen_var_485, 8);
     pool->freeAll();
     VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0;
     stream->read(&vkEndCommandBuffer_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkEndCommandBuffer_VkResult_return;
 }
 
@@ -5715,8 +6269,9 @@
     local_flags = flags;
     countingStream->rewind();
     {
-        uint64_t cgen_var_398 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_398);
+        uint64_t cgen_var_486;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_486, 1);
+        countingStream->write((uint64_t*)&cgen_var_486, 8);
         countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags));
     }
     uint32_t packetSize_vkResetCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -5724,12 +6279,15 @@
     uint32_t opcode_vkResetCommandBuffer = OP_vkResetCommandBuffer;
     stream->write(&opcode_vkResetCommandBuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkResetCommandBuffer, sizeof(uint32_t));
-    uint64_t cgen_var_399 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_399);
+    uint64_t cgen_var_487;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_487, 1);
+    stream->write((uint64_t*)&cgen_var_487, 8);
     stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags));
     pool->freeAll();
     VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0;
     stream->read(&vkResetCommandBuffer_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkResetCommandBuffer_VkResult_return;
 }
 
@@ -5752,22 +6310,26 @@
     resources->unwrapMapping()->mapHandles_VkPipeline((VkPipeline*)&local_pipeline);
     countingStream->rewind();
     {
-        uint64_t cgen_var_400 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_400);
+        uint64_t cgen_var_488;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_488, 1);
+        countingStream->write((uint64_t*)&cgen_var_488, 8);
         countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
-        uint64_t cgen_var_401 = (uint64_t)local_pipeline;
-        countingStream->putBe64(cgen_var_401);
+        uint64_t cgen_var_489;
+        countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_489, 1);
+        countingStream->write((uint64_t*)&cgen_var_489, 8);
     }
     uint32_t packetSize_vkCmdBindPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCmdBindPipeline = OP_vkCmdBindPipeline;
     stream->write(&opcode_vkCmdBindPipeline, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdBindPipeline, sizeof(uint32_t));
-    uint64_t cgen_var_402 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_402);
+    uint64_t cgen_var_490;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_490, 1);
+    stream->write((uint64_t*)&cgen_var_490, 8);
     stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
-    uint64_t cgen_var_403 = (uint64_t)local_pipeline;
-    stream->putBe64(cgen_var_403);
+    uint64_t cgen_var_491;
+    stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_491, 1);
+    stream->write((uint64_t*)&cgen_var_491, 8);
     pool->freeAll();
 }
 
@@ -5807,8 +6369,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_404 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_404);
+        uint64_t cgen_var_492;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_492, 1);
+        countingStream->write((uint64_t*)&cgen_var_492, 8);
         countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
@@ -5821,8 +6384,9 @@
     uint32_t opcode_vkCmdSetViewport = OP_vkCmdSetViewport;
     stream->write(&opcode_vkCmdSetViewport, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetViewport, sizeof(uint32_t));
-    uint64_t cgen_var_405 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_405);
+    uint64_t cgen_var_493;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_493, 1);
+    stream->write((uint64_t*)&cgen_var_493, 8);
     stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
     stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
@@ -5868,8 +6432,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_406 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_406);
+        uint64_t cgen_var_494;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_494, 1);
+        countingStream->write((uint64_t*)&cgen_var_494, 8);
         countingStream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i)
@@ -5882,8 +6447,9 @@
     uint32_t opcode_vkCmdSetScissor = OP_vkCmdSetScissor;
     stream->write(&opcode_vkCmdSetScissor, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetScissor, sizeof(uint32_t));
-    uint64_t cgen_var_407 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_407);
+    uint64_t cgen_var_495;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_495, 1);
+    stream->write((uint64_t*)&cgen_var_495, 8);
     stream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t));
     stream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i)
@@ -5908,8 +6474,9 @@
     local_lineWidth = lineWidth;
     countingStream->rewind();
     {
-        uint64_t cgen_var_408 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_408);
+        uint64_t cgen_var_496;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_496, 1);
+        countingStream->write((uint64_t*)&cgen_var_496, 8);
         countingStream->write((float*)&local_lineWidth, sizeof(float));
     }
     uint32_t packetSize_vkCmdSetLineWidth = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -5917,8 +6484,9 @@
     uint32_t opcode_vkCmdSetLineWidth = OP_vkCmdSetLineWidth;
     stream->write(&opcode_vkCmdSetLineWidth, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetLineWidth, sizeof(uint32_t));
-    uint64_t cgen_var_409 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_409);
+    uint64_t cgen_var_497;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_497, 1);
+    stream->write((uint64_t*)&cgen_var_497, 8);
     stream->write((float*)&local_lineWidth, sizeof(float));
     pool->freeAll();
 }
@@ -5944,8 +6512,9 @@
     local_depthBiasSlopeFactor = depthBiasSlopeFactor;
     countingStream->rewind();
     {
-        uint64_t cgen_var_410 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_410);
+        uint64_t cgen_var_498;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_498, 1);
+        countingStream->write((uint64_t*)&cgen_var_498, 8);
         countingStream->write((float*)&local_depthBiasConstantFactor, sizeof(float));
         countingStream->write((float*)&local_depthBiasClamp, sizeof(float));
         countingStream->write((float*)&local_depthBiasSlopeFactor, sizeof(float));
@@ -5955,8 +6524,9 @@
     uint32_t opcode_vkCmdSetDepthBias = OP_vkCmdSetDepthBias;
     stream->write(&opcode_vkCmdSetDepthBias, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetDepthBias, sizeof(uint32_t));
-    uint64_t cgen_var_411 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_411);
+    uint64_t cgen_var_499;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_499, 1);
+    stream->write((uint64_t*)&cgen_var_499, 8);
     stream->write((float*)&local_depthBiasConstantFactor, sizeof(float));
     stream->write((float*)&local_depthBiasClamp, sizeof(float));
     stream->write((float*)&local_depthBiasSlopeFactor, sizeof(float));
@@ -5978,8 +6548,9 @@
     memcpy(&local_blendConstants, &blendConstants, 4 * sizeof(const float));
     countingStream->rewind();
     {
-        uint64_t cgen_var_412 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_412);
+        uint64_t cgen_var_500;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_500, 1);
+        countingStream->write((uint64_t*)&cgen_var_500, 8);
         countingStream->write((float*)&local_blendConstants, 4 * sizeof(float));
     }
     uint32_t packetSize_vkCmdSetBlendConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -5987,8 +6558,9 @@
     uint32_t opcode_vkCmdSetBlendConstants = OP_vkCmdSetBlendConstants;
     stream->write(&opcode_vkCmdSetBlendConstants, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetBlendConstants, sizeof(uint32_t));
-    uint64_t cgen_var_413 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_413);
+    uint64_t cgen_var_501;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_501, 1);
+    stream->write((uint64_t*)&cgen_var_501, 8);
     stream->write((float*)&local_blendConstants, 4 * sizeof(float));
     pool->freeAll();
 }
@@ -6011,8 +6583,9 @@
     local_maxDepthBounds = maxDepthBounds;
     countingStream->rewind();
     {
-        uint64_t cgen_var_414 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_414);
+        uint64_t cgen_var_502;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_502, 1);
+        countingStream->write((uint64_t*)&cgen_var_502, 8);
         countingStream->write((float*)&local_minDepthBounds, sizeof(float));
         countingStream->write((float*)&local_maxDepthBounds, sizeof(float));
     }
@@ -6021,8 +6594,9 @@
     uint32_t opcode_vkCmdSetDepthBounds = OP_vkCmdSetDepthBounds;
     stream->write(&opcode_vkCmdSetDepthBounds, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetDepthBounds, sizeof(uint32_t));
-    uint64_t cgen_var_415 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_415);
+    uint64_t cgen_var_503;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_503, 1);
+    stream->write((uint64_t*)&cgen_var_503, 8);
     stream->write((float*)&local_minDepthBounds, sizeof(float));
     stream->write((float*)&local_maxDepthBounds, sizeof(float));
     pool->freeAll();
@@ -6046,8 +6620,9 @@
     local_compareMask = compareMask;
     countingStream->rewind();
     {
-        uint64_t cgen_var_416 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_416);
+        uint64_t cgen_var_504;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_504, 1);
+        countingStream->write((uint64_t*)&cgen_var_504, 8);
         countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
         countingStream->write((uint32_t*)&local_compareMask, sizeof(uint32_t));
     }
@@ -6056,8 +6631,9 @@
     uint32_t opcode_vkCmdSetStencilCompareMask = OP_vkCmdSetStencilCompareMask;
     stream->write(&opcode_vkCmdSetStencilCompareMask, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetStencilCompareMask, sizeof(uint32_t));
-    uint64_t cgen_var_417 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_417);
+    uint64_t cgen_var_505;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_505, 1);
+    stream->write((uint64_t*)&cgen_var_505, 8);
     stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
     stream->write((uint32_t*)&local_compareMask, sizeof(uint32_t));
     pool->freeAll();
@@ -6081,8 +6657,9 @@
     local_writeMask = writeMask;
     countingStream->rewind();
     {
-        uint64_t cgen_var_418 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_418);
+        uint64_t cgen_var_506;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_506, 1);
+        countingStream->write((uint64_t*)&cgen_var_506, 8);
         countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
         countingStream->write((uint32_t*)&local_writeMask, sizeof(uint32_t));
     }
@@ -6091,8 +6668,9 @@
     uint32_t opcode_vkCmdSetStencilWriteMask = OP_vkCmdSetStencilWriteMask;
     stream->write(&opcode_vkCmdSetStencilWriteMask, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetStencilWriteMask, sizeof(uint32_t));
-    uint64_t cgen_var_419 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_419);
+    uint64_t cgen_var_507;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_507, 1);
+    stream->write((uint64_t*)&cgen_var_507, 8);
     stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
     stream->write((uint32_t*)&local_writeMask, sizeof(uint32_t));
     pool->freeAll();
@@ -6116,8 +6694,9 @@
     local_reference = reference;
     countingStream->rewind();
     {
-        uint64_t cgen_var_420 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_420);
+        uint64_t cgen_var_508;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_508, 1);
+        countingStream->write((uint64_t*)&cgen_var_508, 8);
         countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
         countingStream->write((uint32_t*)&local_reference, sizeof(uint32_t));
     }
@@ -6126,8 +6705,9 @@
     uint32_t opcode_vkCmdSetStencilReference = OP_vkCmdSetStencilReference;
     stream->write(&opcode_vkCmdSetStencilReference, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetStencilReference, sizeof(uint32_t));
-    uint64_t cgen_var_421 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_421);
+    uint64_t cgen_var_509;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_509, 1);
+    stream->write((uint64_t*)&cgen_var_509, 8);
     stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
     stream->write((uint32_t*)&local_reference, sizeof(uint32_t));
     pool->freeAll();
@@ -6179,15 +6759,22 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_422 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_422);
+        uint64_t cgen_var_510;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_510, 1);
+        countingStream->write((uint64_t*)&cgen_var_510, 8);
         countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
-        uint64_t cgen_var_423 = (uint64_t)local_layout;
-        countingStream->putBe64(cgen_var_423);
+        uint64_t cgen_var_511;
+        countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_511, 1);
+        countingStream->write((uint64_t*)&cgen_var_511, 8);
         countingStream->write((uint32_t*)&local_firstSet, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet));
+        if (((descriptorSetCount)))
+        {
+            uint64_t* cgen_var_512;
+            countingStream->alloc((void**)&cgen_var_512, ((descriptorSetCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_512, ((descriptorSetCount)));
+            countingStream->write((uint64_t*)cgen_var_512, 8);
+        }
         countingStream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t));
     }
@@ -6196,15 +6783,22 @@
     uint32_t opcode_vkCmdBindDescriptorSets = OP_vkCmdBindDescriptorSets;
     stream->write(&opcode_vkCmdBindDescriptorSets, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdBindDescriptorSets, sizeof(uint32_t));
-    uint64_t cgen_var_424 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_424);
+    uint64_t cgen_var_513;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_513, 1);
+    stream->write((uint64_t*)&cgen_var_513, 8);
     stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
-    uint64_t cgen_var_425 = (uint64_t)local_layout;
-    stream->putBe64(cgen_var_425);
+    uint64_t cgen_var_514;
+    stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_514, 1);
+    stream->write((uint64_t*)&cgen_var_514, 8);
     stream->write((uint32_t*)&local_firstSet, sizeof(uint32_t));
     stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet));
+    if (((descriptorSetCount)))
+    {
+        uint64_t* cgen_var_515;
+        stream->alloc((void**)&cgen_var_515, ((descriptorSetCount)) * 8);
+        stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_515, ((descriptorSetCount)));
+        stream->write((uint64_t*)cgen_var_515, 8);
+    }
     stream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t));
     stream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t));
     pool->freeAll();
@@ -6232,10 +6826,12 @@
     local_indexType = indexType;
     countingStream->rewind();
     {
-        uint64_t cgen_var_426 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_426);
-        uint64_t cgen_var_427 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_427);
+        uint64_t cgen_var_516;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_516, 1);
+        countingStream->write((uint64_t*)&cgen_var_516, 8);
+        uint64_t cgen_var_517;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_517, 1);
+        countingStream->write((uint64_t*)&cgen_var_517, 8);
         countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
         countingStream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType));
     }
@@ -6244,10 +6840,12 @@
     uint32_t opcode_vkCmdBindIndexBuffer = OP_vkCmdBindIndexBuffer;
     stream->write(&opcode_vkCmdBindIndexBuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdBindIndexBuffer, sizeof(uint32_t));
-    uint64_t cgen_var_428 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_428);
-    uint64_t cgen_var_429 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_429);
+    uint64_t cgen_var_518;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_518, 1);
+    stream->write((uint64_t*)&cgen_var_518, 8);
+    uint64_t cgen_var_519;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_519, 1);
+    stream->write((uint64_t*)&cgen_var_519, 8);
     stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
     stream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType));
     pool->freeAll();
@@ -6289,12 +6887,18 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_430 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_430);
+        uint64_t cgen_var_520;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_520, 1);
+        countingStream->write((uint64_t*)&cgen_var_520, 8);
         countingStream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkBuffer*)local_pBuffers, ((bindingCount)) * sizeof(VkBuffer));
+        if (((bindingCount)))
+        {
+            uint64_t* cgen_var_521;
+            countingStream->alloc((void**)&cgen_var_521, ((bindingCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_521, ((bindingCount)));
+            countingStream->write((uint64_t*)cgen_var_521, 8);
+        }
         countingStream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize));
     }
     uint32_t packetSize_vkCmdBindVertexBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -6302,12 +6906,18 @@
     uint32_t opcode_vkCmdBindVertexBuffers = OP_vkCmdBindVertexBuffers;
     stream->write(&opcode_vkCmdBindVertexBuffers, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdBindVertexBuffers, sizeof(uint32_t));
-    uint64_t cgen_var_431 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_431);
+    uint64_t cgen_var_522;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_522, 1);
+    stream->write((uint64_t*)&cgen_var_522, 8);
     stream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t));
     stream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkBuffer*)local_pBuffers, ((bindingCount)) * sizeof(VkBuffer));
+    if (((bindingCount)))
+    {
+        uint64_t* cgen_var_523;
+        stream->alloc((void**)&cgen_var_523, ((bindingCount)) * 8);
+        stream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_523, ((bindingCount)));
+        stream->write((uint64_t*)cgen_var_523, 8);
+    }
     stream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize));
     pool->freeAll();
 }
@@ -6336,8 +6946,9 @@
     local_firstInstance = firstInstance;
     countingStream->rewind();
     {
-        uint64_t cgen_var_432 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_432);
+        uint64_t cgen_var_524;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_524, 1);
+        countingStream->write((uint64_t*)&cgen_var_524, 8);
         countingStream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t));
@@ -6348,8 +6959,9 @@
     uint32_t opcode_vkCmdDraw = OP_vkCmdDraw;
     stream->write(&opcode_vkCmdDraw, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDraw, sizeof(uint32_t));
-    uint64_t cgen_var_433 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_433);
+    uint64_t cgen_var_525;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_525, 1);
+    stream->write((uint64_t*)&cgen_var_525, 8);
     stream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t));
     stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
     stream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t));
@@ -6384,8 +6996,9 @@
     local_firstInstance = firstInstance;
     countingStream->rewind();
     {
-        uint64_t cgen_var_434 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_434);
+        uint64_t cgen_var_526;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_526, 1);
+        countingStream->write((uint64_t*)&cgen_var_526, 8);
         countingStream->write((uint32_t*)&local_indexCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t));
@@ -6397,8 +7010,9 @@
     uint32_t opcode_vkCmdDrawIndexed = OP_vkCmdDrawIndexed;
     stream->write(&opcode_vkCmdDrawIndexed, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDrawIndexed, sizeof(uint32_t));
-    uint64_t cgen_var_435 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_435);
+    uint64_t cgen_var_527;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_527, 1);
+    stream->write((uint64_t*)&cgen_var_527, 8);
     stream->write((uint32_t*)&local_indexCount, sizeof(uint32_t));
     stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
     stream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t));
@@ -6432,10 +7046,12 @@
     local_stride = stride;
     countingStream->rewind();
     {
-        uint64_t cgen_var_436 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_436);
-        uint64_t cgen_var_437 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_437);
+        uint64_t cgen_var_528;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_528, 1);
+        countingStream->write((uint64_t*)&cgen_var_528, 8);
+        uint64_t cgen_var_529;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_529, 1);
+        countingStream->write((uint64_t*)&cgen_var_529, 8);
         countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
         countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -6445,10 +7061,12 @@
     uint32_t opcode_vkCmdDrawIndirect = OP_vkCmdDrawIndirect;
     stream->write(&opcode_vkCmdDrawIndirect, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDrawIndirect, sizeof(uint32_t));
-    uint64_t cgen_var_438 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_438);
-    uint64_t cgen_var_439 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_439);
+    uint64_t cgen_var_530;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_530, 1);
+    stream->write((uint64_t*)&cgen_var_530, 8);
+    uint64_t cgen_var_531;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_531, 1);
+    stream->write((uint64_t*)&cgen_var_531, 8);
     stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
     stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
     stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -6480,10 +7098,12 @@
     local_stride = stride;
     countingStream->rewind();
     {
-        uint64_t cgen_var_440 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_440);
-        uint64_t cgen_var_441 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_441);
+        uint64_t cgen_var_532;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_532, 1);
+        countingStream->write((uint64_t*)&cgen_var_532, 8);
+        uint64_t cgen_var_533;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_533, 1);
+        countingStream->write((uint64_t*)&cgen_var_533, 8);
         countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
         countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -6493,10 +7113,12 @@
     uint32_t opcode_vkCmdDrawIndexedIndirect = OP_vkCmdDrawIndexedIndirect;
     stream->write(&opcode_vkCmdDrawIndexedIndirect, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDrawIndexedIndirect, sizeof(uint32_t));
-    uint64_t cgen_var_442 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_442);
-    uint64_t cgen_var_443 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_443);
+    uint64_t cgen_var_534;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_534, 1);
+    stream->write((uint64_t*)&cgen_var_534, 8);
+    uint64_t cgen_var_535;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_535, 1);
+    stream->write((uint64_t*)&cgen_var_535, 8);
     stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
     stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
     stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -6524,8 +7146,9 @@
     local_groupCountZ = groupCountZ;
     countingStream->rewind();
     {
-        uint64_t cgen_var_444 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_444);
+        uint64_t cgen_var_536;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_536, 1);
+        countingStream->write((uint64_t*)&cgen_var_536, 8);
         countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
@@ -6535,8 +7158,9 @@
     uint32_t opcode_vkCmdDispatch = OP_vkCmdDispatch;
     stream->write(&opcode_vkCmdDispatch, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDispatch, sizeof(uint32_t));
-    uint64_t cgen_var_445 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_445);
+    uint64_t cgen_var_537;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_537, 1);
+    stream->write((uint64_t*)&cgen_var_537, 8);
     stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
     stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
     stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
@@ -6562,10 +7186,12 @@
     local_offset = offset;
     countingStream->rewind();
     {
-        uint64_t cgen_var_446 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_446);
-        uint64_t cgen_var_447 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_447);
+        uint64_t cgen_var_538;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_538, 1);
+        countingStream->write((uint64_t*)&cgen_var_538, 8);
+        uint64_t cgen_var_539;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_539, 1);
+        countingStream->write((uint64_t*)&cgen_var_539, 8);
         countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
     }
     uint32_t packetSize_vkCmdDispatchIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -6573,10 +7199,12 @@
     uint32_t opcode_vkCmdDispatchIndirect = OP_vkCmdDispatchIndirect;
     stream->write(&opcode_vkCmdDispatchIndirect, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDispatchIndirect, sizeof(uint32_t));
-    uint64_t cgen_var_448 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_448);
-    uint64_t cgen_var_449 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_449);
+    uint64_t cgen_var_540;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_540, 1);
+    stream->write((uint64_t*)&cgen_var_540, 8);
+    uint64_t cgen_var_541;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_541, 1);
+    stream->write((uint64_t*)&cgen_var_541, 8);
     stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
     pool->freeAll();
 }
@@ -6622,12 +7250,15 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_450 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_450);
-        uint64_t cgen_var_451 = (uint64_t)local_srcBuffer;
-        countingStream->putBe64(cgen_var_451);
-        uint64_t cgen_var_452 = (uint64_t)local_dstBuffer;
-        countingStream->putBe64(cgen_var_452);
+        uint64_t cgen_var_542;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_542, 1);
+        countingStream->write((uint64_t*)&cgen_var_542, 8);
+        uint64_t cgen_var_543;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_543, 1);
+        countingStream->write((uint64_t*)&cgen_var_543, 8);
+        uint64_t cgen_var_544;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_544, 1);
+        countingStream->write((uint64_t*)&cgen_var_544, 8);
         countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
         {
@@ -6639,12 +7270,15 @@
     uint32_t opcode_vkCmdCopyBuffer = OP_vkCmdCopyBuffer;
     stream->write(&opcode_vkCmdCopyBuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdCopyBuffer, sizeof(uint32_t));
-    uint64_t cgen_var_453 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_453);
-    uint64_t cgen_var_454 = (uint64_t)local_srcBuffer;
-    stream->putBe64(cgen_var_454);
-    uint64_t cgen_var_455 = (uint64_t)local_dstBuffer;
-    stream->putBe64(cgen_var_455);
+    uint64_t cgen_var_545;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_545, 1);
+    stream->write((uint64_t*)&cgen_var_545, 8);
+    uint64_t cgen_var_546;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_546, 1);
+    stream->write((uint64_t*)&cgen_var_546, 8);
+    uint64_t cgen_var_547;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_547, 1);
+    stream->write((uint64_t*)&cgen_var_547, 8);
     stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
     {
@@ -6700,13 +7334,16 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_456 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_456);
-        uint64_t cgen_var_457 = (uint64_t)local_srcImage;
-        countingStream->putBe64(cgen_var_457);
+        uint64_t cgen_var_548;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_548, 1);
+        countingStream->write((uint64_t*)&cgen_var_548, 8);
+        uint64_t cgen_var_549;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_549, 1);
+        countingStream->write((uint64_t*)&cgen_var_549, 8);
         countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
-        uint64_t cgen_var_458 = (uint64_t)local_dstImage;
-        countingStream->putBe64(cgen_var_458);
+        uint64_t cgen_var_550;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_550, 1);
+        countingStream->write((uint64_t*)&cgen_var_550, 8);
         countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
         countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
@@ -6719,13 +7356,16 @@
     uint32_t opcode_vkCmdCopyImage = OP_vkCmdCopyImage;
     stream->write(&opcode_vkCmdCopyImage, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdCopyImage, sizeof(uint32_t));
-    uint64_t cgen_var_459 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_459);
-    uint64_t cgen_var_460 = (uint64_t)local_srcImage;
-    stream->putBe64(cgen_var_460);
+    uint64_t cgen_var_551;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_551, 1);
+    stream->write((uint64_t*)&cgen_var_551, 8);
+    uint64_t cgen_var_552;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_552, 1);
+    stream->write((uint64_t*)&cgen_var_552, 8);
     stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
-    uint64_t cgen_var_461 = (uint64_t)local_dstImage;
-    stream->putBe64(cgen_var_461);
+    uint64_t cgen_var_553;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_553, 1);
+    stream->write((uint64_t*)&cgen_var_553, 8);
     stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
     stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
@@ -6785,13 +7425,16 @@
     local_filter = filter;
     countingStream->rewind();
     {
-        uint64_t cgen_var_462 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_462);
-        uint64_t cgen_var_463 = (uint64_t)local_srcImage;
-        countingStream->putBe64(cgen_var_463);
+        uint64_t cgen_var_554;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_554, 1);
+        countingStream->write((uint64_t*)&cgen_var_554, 8);
+        uint64_t cgen_var_555;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_555, 1);
+        countingStream->write((uint64_t*)&cgen_var_555, 8);
         countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
-        uint64_t cgen_var_464 = (uint64_t)local_dstImage;
-        countingStream->putBe64(cgen_var_464);
+        uint64_t cgen_var_556;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_556, 1);
+        countingStream->write((uint64_t*)&cgen_var_556, 8);
         countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
         countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
@@ -6805,13 +7448,16 @@
     uint32_t opcode_vkCmdBlitImage = OP_vkCmdBlitImage;
     stream->write(&opcode_vkCmdBlitImage, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdBlitImage, sizeof(uint32_t));
-    uint64_t cgen_var_465 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_465);
-    uint64_t cgen_var_466 = (uint64_t)local_srcImage;
-    stream->putBe64(cgen_var_466);
+    uint64_t cgen_var_557;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_557, 1);
+    stream->write((uint64_t*)&cgen_var_557, 8);
+    uint64_t cgen_var_558;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_558, 1);
+    stream->write((uint64_t*)&cgen_var_558, 8);
     stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
-    uint64_t cgen_var_467 = (uint64_t)local_dstImage;
-    stream->putBe64(cgen_var_467);
+    uint64_t cgen_var_559;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_559, 1);
+    stream->write((uint64_t*)&cgen_var_559, 8);
     stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
     stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
@@ -6866,12 +7512,15 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_468 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_468);
-        uint64_t cgen_var_469 = (uint64_t)local_srcBuffer;
-        countingStream->putBe64(cgen_var_469);
-        uint64_t cgen_var_470 = (uint64_t)local_dstImage;
-        countingStream->putBe64(cgen_var_470);
+        uint64_t cgen_var_560;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_560, 1);
+        countingStream->write((uint64_t*)&cgen_var_560, 8);
+        uint64_t cgen_var_561;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_561, 1);
+        countingStream->write((uint64_t*)&cgen_var_561, 8);
+        uint64_t cgen_var_562;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_562, 1);
+        countingStream->write((uint64_t*)&cgen_var_562, 8);
         countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
         countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
@@ -6884,12 +7533,15 @@
     uint32_t opcode_vkCmdCopyBufferToImage = OP_vkCmdCopyBufferToImage;
     stream->write(&opcode_vkCmdCopyBufferToImage, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdCopyBufferToImage, sizeof(uint32_t));
-    uint64_t cgen_var_471 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_471);
-    uint64_t cgen_var_472 = (uint64_t)local_srcBuffer;
-    stream->putBe64(cgen_var_472);
-    uint64_t cgen_var_473 = (uint64_t)local_dstImage;
-    stream->putBe64(cgen_var_473);
+    uint64_t cgen_var_563;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_563, 1);
+    stream->write((uint64_t*)&cgen_var_563, 8);
+    uint64_t cgen_var_564;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_564, 1);
+    stream->write((uint64_t*)&cgen_var_564, 8);
+    uint64_t cgen_var_565;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_565, 1);
+    stream->write((uint64_t*)&cgen_var_565, 8);
     stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
     stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
@@ -6943,13 +7595,16 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_474 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_474);
-        uint64_t cgen_var_475 = (uint64_t)local_srcImage;
-        countingStream->putBe64(cgen_var_475);
+        uint64_t cgen_var_566;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_566, 1);
+        countingStream->write((uint64_t*)&cgen_var_566, 8);
+        uint64_t cgen_var_567;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_567, 1);
+        countingStream->write((uint64_t*)&cgen_var_567, 8);
         countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
-        uint64_t cgen_var_476 = (uint64_t)local_dstBuffer;
-        countingStream->putBe64(cgen_var_476);
+        uint64_t cgen_var_568;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_568, 1);
+        countingStream->write((uint64_t*)&cgen_var_568, 8);
         countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
         {
@@ -6961,13 +7616,16 @@
     uint32_t opcode_vkCmdCopyImageToBuffer = OP_vkCmdCopyImageToBuffer;
     stream->write(&opcode_vkCmdCopyImageToBuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdCopyImageToBuffer, sizeof(uint32_t));
-    uint64_t cgen_var_477 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_477);
-    uint64_t cgen_var_478 = (uint64_t)local_srcImage;
-    stream->putBe64(cgen_var_478);
+    uint64_t cgen_var_569;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_569, 1);
+    stream->write((uint64_t*)&cgen_var_569, 8);
+    uint64_t cgen_var_570;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_570, 1);
+    stream->write((uint64_t*)&cgen_var_570, 8);
     stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
-    uint64_t cgen_var_479 = (uint64_t)local_dstBuffer;
-    stream->putBe64(cgen_var_479);
+    uint64_t cgen_var_571;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_571, 1);
+    stream->write((uint64_t*)&cgen_var_571, 8);
     stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
     {
@@ -7005,10 +7663,12 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_480 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_480);
-        uint64_t cgen_var_481 = (uint64_t)local_dstBuffer;
-        countingStream->putBe64(cgen_var_481);
+        uint64_t cgen_var_572;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_572, 1);
+        countingStream->write((uint64_t*)&cgen_var_572, 8);
+        uint64_t cgen_var_573;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_573, 1);
+        countingStream->write((uint64_t*)&cgen_var_573, 8);
         countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
         countingStream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize));
         countingStream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t));
@@ -7018,10 +7678,12 @@
     uint32_t opcode_vkCmdUpdateBuffer = OP_vkCmdUpdateBuffer;
     stream->write(&opcode_vkCmdUpdateBuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdUpdateBuffer, sizeof(uint32_t));
-    uint64_t cgen_var_482 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_482);
-    uint64_t cgen_var_483 = (uint64_t)local_dstBuffer;
-    stream->putBe64(cgen_var_483);
+    uint64_t cgen_var_574;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_574, 1);
+    stream->write((uint64_t*)&cgen_var_574, 8);
+    uint64_t cgen_var_575;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_575, 1);
+    stream->write((uint64_t*)&cgen_var_575, 8);
     stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
     stream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize));
     stream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t));
@@ -7053,10 +7715,12 @@
     local_data = data;
     countingStream->rewind();
     {
-        uint64_t cgen_var_484 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_484);
-        uint64_t cgen_var_485 = (uint64_t)local_dstBuffer;
-        countingStream->putBe64(cgen_var_485);
+        uint64_t cgen_var_576;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_576, 1);
+        countingStream->write((uint64_t*)&cgen_var_576, 8);
+        uint64_t cgen_var_577;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_577, 1);
+        countingStream->write((uint64_t*)&cgen_var_577, 8);
         countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
         countingStream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize));
         countingStream->write((uint32_t*)&local_data, sizeof(uint32_t));
@@ -7066,10 +7730,12 @@
     uint32_t opcode_vkCmdFillBuffer = OP_vkCmdFillBuffer;
     stream->write(&opcode_vkCmdFillBuffer, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdFillBuffer, sizeof(uint32_t));
-    uint64_t cgen_var_486 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_486);
-    uint64_t cgen_var_487 = (uint64_t)local_dstBuffer;
-    stream->putBe64(cgen_var_487);
+    uint64_t cgen_var_578;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_578, 1);
+    stream->write((uint64_t*)&cgen_var_578, 8);
+    uint64_t cgen_var_579;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_579, 1);
+    stream->write((uint64_t*)&cgen_var_579, 8);
     stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
     stream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize));
     stream->write((uint32_t*)&local_data, sizeof(uint32_t));
@@ -7128,10 +7794,12 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_488 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_488);
-        uint64_t cgen_var_489 = (uint64_t)local_image;
-        countingStream->putBe64(cgen_var_489);
+        uint64_t cgen_var_580;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_580, 1);
+        countingStream->write((uint64_t*)&cgen_var_580, 8);
+        uint64_t cgen_var_581;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_581, 1);
+        countingStream->write((uint64_t*)&cgen_var_581, 8);
         countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
         marshal_VkClearColorValue(countingStream, (VkClearColorValue*)(local_pColor));
         countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
@@ -7145,10 +7813,12 @@
     uint32_t opcode_vkCmdClearColorImage = OP_vkCmdClearColorImage;
     stream->write(&opcode_vkCmdClearColorImage, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdClearColorImage, sizeof(uint32_t));
-    uint64_t cgen_var_490 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_490);
-    uint64_t cgen_var_491 = (uint64_t)local_image;
-    stream->putBe64(cgen_var_491);
+    uint64_t cgen_var_582;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_582, 1);
+    stream->write((uint64_t*)&cgen_var_582, 8);
+    uint64_t cgen_var_583;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_583, 1);
+    stream->write((uint64_t*)&cgen_var_583, 8);
     stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
     marshal_VkClearColorValue(stream, (VkClearColorValue*)(local_pColor));
     stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
@@ -7211,10 +7881,12 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_492 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_492);
-        uint64_t cgen_var_493 = (uint64_t)local_image;
-        countingStream->putBe64(cgen_var_493);
+        uint64_t cgen_var_584;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_584, 1);
+        countingStream->write((uint64_t*)&cgen_var_584, 8);
+        uint64_t cgen_var_585;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_585, 1);
+        countingStream->write((uint64_t*)&cgen_var_585, 8);
         countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
         marshal_VkClearDepthStencilValue(countingStream, (VkClearDepthStencilValue*)(local_pDepthStencil));
         countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
@@ -7228,10 +7900,12 @@
     uint32_t opcode_vkCmdClearDepthStencilImage = OP_vkCmdClearDepthStencilImage;
     stream->write(&opcode_vkCmdClearDepthStencilImage, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdClearDepthStencilImage, sizeof(uint32_t));
-    uint64_t cgen_var_494 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_494);
-    uint64_t cgen_var_495 = (uint64_t)local_image;
-    stream->putBe64(cgen_var_495);
+    uint64_t cgen_var_586;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_586, 1);
+    stream->write((uint64_t*)&cgen_var_586, 8);
+    uint64_t cgen_var_587;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_587, 1);
+    stream->write((uint64_t*)&cgen_var_587, 8);
     stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
     marshal_VkClearDepthStencilValue(stream, (VkClearDepthStencilValue*)(local_pDepthStencil));
     stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
@@ -7296,8 +7970,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_496 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_496);
+        uint64_t cgen_var_588;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_588, 1);
+        countingStream->write((uint64_t*)&cgen_var_588, 8);
         countingStream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i)
         {
@@ -7314,8 +7989,9 @@
     uint32_t opcode_vkCmdClearAttachments = OP_vkCmdClearAttachments;
     stream->write(&opcode_vkCmdClearAttachments, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdClearAttachments, sizeof(uint32_t));
-    uint64_t cgen_var_497 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_497);
+    uint64_t cgen_var_589;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_589, 1);
+    stream->write((uint64_t*)&cgen_var_589, 8);
     stream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i)
     {
@@ -7376,13 +8052,16 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_498 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_498);
-        uint64_t cgen_var_499 = (uint64_t)local_srcImage;
-        countingStream->putBe64(cgen_var_499);
+        uint64_t cgen_var_590;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_590, 1);
+        countingStream->write((uint64_t*)&cgen_var_590, 8);
+        uint64_t cgen_var_591;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_591, 1);
+        countingStream->write((uint64_t*)&cgen_var_591, 8);
         countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
-        uint64_t cgen_var_500 = (uint64_t)local_dstImage;
-        countingStream->putBe64(cgen_var_500);
+        uint64_t cgen_var_592;
+        countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_592, 1);
+        countingStream->write((uint64_t*)&cgen_var_592, 8);
         countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
         countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
@@ -7395,13 +8074,16 @@
     uint32_t opcode_vkCmdResolveImage = OP_vkCmdResolveImage;
     stream->write(&opcode_vkCmdResolveImage, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdResolveImage, sizeof(uint32_t));
-    uint64_t cgen_var_501 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_501);
-    uint64_t cgen_var_502 = (uint64_t)local_srcImage;
-    stream->putBe64(cgen_var_502);
+    uint64_t cgen_var_593;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_593, 1);
+    stream->write((uint64_t*)&cgen_var_593, 8);
+    uint64_t cgen_var_594;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_594, 1);
+    stream->write((uint64_t*)&cgen_var_594, 8);
     stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
-    uint64_t cgen_var_503 = (uint64_t)local_dstImage;
-    stream->putBe64(cgen_var_503);
+    uint64_t cgen_var_595;
+    stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_595, 1);
+    stream->write((uint64_t*)&cgen_var_595, 8);
     stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
     stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
@@ -7430,10 +8112,12 @@
     local_stageMask = stageMask;
     countingStream->rewind();
     {
-        uint64_t cgen_var_504 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_504);
-        uint64_t cgen_var_505 = (uint64_t)local_event;
-        countingStream->putBe64(cgen_var_505);
+        uint64_t cgen_var_596;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_596, 1);
+        countingStream->write((uint64_t*)&cgen_var_596, 8);
+        uint64_t cgen_var_597;
+        countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_597, 1);
+        countingStream->write((uint64_t*)&cgen_var_597, 8);
         countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
     }
     uint32_t packetSize_vkCmdSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -7441,10 +8125,12 @@
     uint32_t opcode_vkCmdSetEvent = OP_vkCmdSetEvent;
     stream->write(&opcode_vkCmdSetEvent, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetEvent, sizeof(uint32_t));
-    uint64_t cgen_var_506 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_506);
-    uint64_t cgen_var_507 = (uint64_t)local_event;
-    stream->putBe64(cgen_var_507);
+    uint64_t cgen_var_598;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_598, 1);
+    stream->write((uint64_t*)&cgen_var_598, 8);
+    uint64_t cgen_var_599;
+    stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_599, 1);
+    stream->write((uint64_t*)&cgen_var_599, 8);
     stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
     pool->freeAll();
 }
@@ -7468,10 +8154,12 @@
     local_stageMask = stageMask;
     countingStream->rewind();
     {
-        uint64_t cgen_var_508 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_508);
-        uint64_t cgen_var_509 = (uint64_t)local_event;
-        countingStream->putBe64(cgen_var_509);
+        uint64_t cgen_var_600;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_600, 1);
+        countingStream->write((uint64_t*)&cgen_var_600, 8);
+        uint64_t cgen_var_601;
+        countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_601, 1);
+        countingStream->write((uint64_t*)&cgen_var_601, 8);
         countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
     }
     uint32_t packetSize_vkCmdResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -7479,10 +8167,12 @@
     uint32_t opcode_vkCmdResetEvent = OP_vkCmdResetEvent;
     stream->write(&opcode_vkCmdResetEvent, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdResetEvent, sizeof(uint32_t));
-    uint64_t cgen_var_510 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_510);
-    uint64_t cgen_var_511 = (uint64_t)local_event;
-    stream->putBe64(cgen_var_511);
+    uint64_t cgen_var_602;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_602, 1);
+    stream->write((uint64_t*)&cgen_var_602, 8);
+    uint64_t cgen_var_603;
+    stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_603, 1);
+    stream->write((uint64_t*)&cgen_var_603, 8);
     stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
     pool->freeAll();
 }
@@ -7582,11 +8272,17 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_512 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_512);
+        uint64_t cgen_var_604;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_604, 1);
+        countingStream->write((uint64_t*)&cgen_var_604, 8);
         countingStream->write((uint32_t*)&local_eventCount, sizeof(uint32_t));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkEvent*)local_pEvents, ((eventCount)) * sizeof(VkEvent));
+        if (((eventCount)))
+        {
+            uint64_t* cgen_var_605;
+            countingStream->alloc((void**)&cgen_var_605, ((eventCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_605, ((eventCount)));
+            countingStream->write((uint64_t*)cgen_var_605, 8);
+        }
         countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
         countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
         countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
@@ -7610,11 +8306,17 @@
     uint32_t opcode_vkCmdWaitEvents = OP_vkCmdWaitEvents;
     stream->write(&opcode_vkCmdWaitEvents, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdWaitEvents, sizeof(uint32_t));
-    uint64_t cgen_var_513 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_513);
+    uint64_t cgen_var_606;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_606, 1);
+    stream->write((uint64_t*)&cgen_var_606, 8);
     stream->write((uint32_t*)&local_eventCount, sizeof(uint32_t));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkEvent*)local_pEvents, ((eventCount)) * sizeof(VkEvent));
+    if (((eventCount)))
+    {
+        uint64_t* cgen_var_607;
+        stream->alloc((void**)&cgen_var_607, ((eventCount)) * 8);
+        stream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_607, ((eventCount)));
+        stream->write((uint64_t*)cgen_var_607, 8);
+    }
     stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
     stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
     stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
@@ -7719,8 +8421,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_514 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_514);
+        uint64_t cgen_var_608;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_608, 1);
+        countingStream->write((uint64_t*)&cgen_var_608, 8);
         countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
         countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
         countingStream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags));
@@ -7745,8 +8448,9 @@
     uint32_t opcode_vkCmdPipelineBarrier = OP_vkCmdPipelineBarrier;
     stream->write(&opcode_vkCmdPipelineBarrier, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdPipelineBarrier, sizeof(uint32_t));
-    uint64_t cgen_var_515 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_515);
+    uint64_t cgen_var_609;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_609, 1);
+    stream->write((uint64_t*)&cgen_var_609, 8);
     stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
     stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
     stream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags));
@@ -7790,10 +8494,12 @@
     local_flags = flags;
     countingStream->rewind();
     {
-        uint64_t cgen_var_516 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_516);
-        uint64_t cgen_var_517 = (uint64_t)local_queryPool;
-        countingStream->putBe64(cgen_var_517);
+        uint64_t cgen_var_610;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_610, 1);
+        countingStream->write((uint64_t*)&cgen_var_610, 8);
+        uint64_t cgen_var_611;
+        countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_611, 1);
+        countingStream->write((uint64_t*)&cgen_var_611, 8);
         countingStream->write((uint32_t*)&local_query, sizeof(uint32_t));
         countingStream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags));
     }
@@ -7802,10 +8508,12 @@
     uint32_t opcode_vkCmdBeginQuery = OP_vkCmdBeginQuery;
     stream->write(&opcode_vkCmdBeginQuery, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdBeginQuery, sizeof(uint32_t));
-    uint64_t cgen_var_518 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_518);
-    uint64_t cgen_var_519 = (uint64_t)local_queryPool;
-    stream->putBe64(cgen_var_519);
+    uint64_t cgen_var_612;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_612, 1);
+    stream->write((uint64_t*)&cgen_var_612, 8);
+    uint64_t cgen_var_613;
+    stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_613, 1);
+    stream->write((uint64_t*)&cgen_var_613, 8);
     stream->write((uint32_t*)&local_query, sizeof(uint32_t));
     stream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags));
     pool->freeAll();
@@ -7830,10 +8538,12 @@
     local_query = query;
     countingStream->rewind();
     {
-        uint64_t cgen_var_520 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_520);
-        uint64_t cgen_var_521 = (uint64_t)local_queryPool;
-        countingStream->putBe64(cgen_var_521);
+        uint64_t cgen_var_614;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_614, 1);
+        countingStream->write((uint64_t*)&cgen_var_614, 8);
+        uint64_t cgen_var_615;
+        countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_615, 1);
+        countingStream->write((uint64_t*)&cgen_var_615, 8);
         countingStream->write((uint32_t*)&local_query, sizeof(uint32_t));
     }
     uint32_t packetSize_vkCmdEndQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -7841,10 +8551,12 @@
     uint32_t opcode_vkCmdEndQuery = OP_vkCmdEndQuery;
     stream->write(&opcode_vkCmdEndQuery, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdEndQuery, sizeof(uint32_t));
-    uint64_t cgen_var_522 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_522);
-    uint64_t cgen_var_523 = (uint64_t)local_queryPool;
-    stream->putBe64(cgen_var_523);
+    uint64_t cgen_var_616;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_616, 1);
+    stream->write((uint64_t*)&cgen_var_616, 8);
+    uint64_t cgen_var_617;
+    stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_617, 1);
+    stream->write((uint64_t*)&cgen_var_617, 8);
     stream->write((uint32_t*)&local_query, sizeof(uint32_t));
     pool->freeAll();
 }
@@ -7871,10 +8583,12 @@
     local_queryCount = queryCount;
     countingStream->rewind();
     {
-        uint64_t cgen_var_524 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_524);
-        uint64_t cgen_var_525 = (uint64_t)local_queryPool;
-        countingStream->putBe64(cgen_var_525);
+        uint64_t cgen_var_618;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_618, 1);
+        countingStream->write((uint64_t*)&cgen_var_618, 8);
+        uint64_t cgen_var_619;
+        countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_619, 1);
+        countingStream->write((uint64_t*)&cgen_var_619, 8);
         countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
     }
@@ -7883,10 +8597,12 @@
     uint32_t opcode_vkCmdResetQueryPool = OP_vkCmdResetQueryPool;
     stream->write(&opcode_vkCmdResetQueryPool, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdResetQueryPool, sizeof(uint32_t));
-    uint64_t cgen_var_526 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_526);
-    uint64_t cgen_var_527 = (uint64_t)local_queryPool;
-    stream->putBe64(cgen_var_527);
+    uint64_t cgen_var_620;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_620, 1);
+    stream->write((uint64_t*)&cgen_var_620, 8);
+    uint64_t cgen_var_621;
+    stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_621, 1);
+    stream->write((uint64_t*)&cgen_var_621, 8);
     stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
     stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
     pool->freeAll();
@@ -7914,11 +8630,13 @@
     local_query = query;
     countingStream->rewind();
     {
-        uint64_t cgen_var_528 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_528);
+        uint64_t cgen_var_622;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_622, 1);
+        countingStream->write((uint64_t*)&cgen_var_622, 8);
         countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
-        uint64_t cgen_var_529 = (uint64_t)local_queryPool;
-        countingStream->putBe64(cgen_var_529);
+        uint64_t cgen_var_623;
+        countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_623, 1);
+        countingStream->write((uint64_t*)&cgen_var_623, 8);
         countingStream->write((uint32_t*)&local_query, sizeof(uint32_t));
     }
     uint32_t packetSize_vkCmdWriteTimestamp = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -7926,11 +8644,13 @@
     uint32_t opcode_vkCmdWriteTimestamp = OP_vkCmdWriteTimestamp;
     stream->write(&opcode_vkCmdWriteTimestamp, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdWriteTimestamp, sizeof(uint32_t));
-    uint64_t cgen_var_530 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_530);
+    uint64_t cgen_var_624;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_624, 1);
+    stream->write((uint64_t*)&cgen_var_624, 8);
     stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
-    uint64_t cgen_var_531 = (uint64_t)local_queryPool;
-    stream->putBe64(cgen_var_531);
+    uint64_t cgen_var_625;
+    stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_625, 1);
+    stream->write((uint64_t*)&cgen_var_625, 8);
     stream->write((uint32_t*)&local_query, sizeof(uint32_t));
     pool->freeAll();
 }
@@ -7970,14 +8690,17 @@
     local_flags = flags;
     countingStream->rewind();
     {
-        uint64_t cgen_var_532 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_532);
-        uint64_t cgen_var_533 = (uint64_t)local_queryPool;
-        countingStream->putBe64(cgen_var_533);
+        uint64_t cgen_var_626;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_626, 1);
+        countingStream->write((uint64_t*)&cgen_var_626, 8);
+        uint64_t cgen_var_627;
+        countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_627, 1);
+        countingStream->write((uint64_t*)&cgen_var_627, 8);
         countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
-        uint64_t cgen_var_534 = (uint64_t)local_dstBuffer;
-        countingStream->putBe64(cgen_var_534);
+        uint64_t cgen_var_628;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_628, 1);
+        countingStream->write((uint64_t*)&cgen_var_628, 8);
         countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
         countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
         countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
@@ -7987,14 +8710,17 @@
     uint32_t opcode_vkCmdCopyQueryPoolResults = OP_vkCmdCopyQueryPoolResults;
     stream->write(&opcode_vkCmdCopyQueryPoolResults, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdCopyQueryPoolResults, sizeof(uint32_t));
-    uint64_t cgen_var_535 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_535);
-    uint64_t cgen_var_536 = (uint64_t)local_queryPool;
-    stream->putBe64(cgen_var_536);
+    uint64_t cgen_var_629;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_629, 1);
+    stream->write((uint64_t*)&cgen_var_629, 8);
+    uint64_t cgen_var_630;
+    stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_630, 1);
+    stream->write((uint64_t*)&cgen_var_630, 8);
     stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
     stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
-    uint64_t cgen_var_537 = (uint64_t)local_dstBuffer;
-    stream->putBe64(cgen_var_537);
+    uint64_t cgen_var_631;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_631, 1);
+    stream->write((uint64_t*)&cgen_var_631, 8);
     stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
     stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
     stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
@@ -8033,10 +8759,12 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_538 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_538);
-        uint64_t cgen_var_539 = (uint64_t)local_layout;
-        countingStream->putBe64(cgen_var_539);
+        uint64_t cgen_var_632;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_632, 1);
+        countingStream->write((uint64_t*)&cgen_var_632, 8);
+        uint64_t cgen_var_633;
+        countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_633, 1);
+        countingStream->write((uint64_t*)&cgen_var_633, 8);
         countingStream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags));
         countingStream->write((uint32_t*)&local_offset, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_size, sizeof(uint32_t));
@@ -8047,10 +8775,12 @@
     uint32_t opcode_vkCmdPushConstants = OP_vkCmdPushConstants;
     stream->write(&opcode_vkCmdPushConstants, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdPushConstants, sizeof(uint32_t));
-    uint64_t cgen_var_540 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_540);
-    uint64_t cgen_var_541 = (uint64_t)local_layout;
-    stream->putBe64(cgen_var_541);
+    uint64_t cgen_var_634;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_634, 1);
+    stream->write((uint64_t*)&cgen_var_634, 8);
+    uint64_t cgen_var_635;
+    stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_635, 1);
+    stream->write((uint64_t*)&cgen_var_635, 8);
     stream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags));
     stream->write((uint32_t*)&local_offset, sizeof(uint32_t));
     stream->write((uint32_t*)&local_size, sizeof(uint32_t));
@@ -8085,8 +8815,9 @@
     local_contents = contents;
     countingStream->rewind();
     {
-        uint64_t cgen_var_542 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_542);
+        uint64_t cgen_var_636;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_636, 1);
+        countingStream->write((uint64_t*)&cgen_var_636, 8);
         marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
         countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
     }
@@ -8095,8 +8826,9 @@
     uint32_t opcode_vkCmdBeginRenderPass = OP_vkCmdBeginRenderPass;
     stream->write(&opcode_vkCmdBeginRenderPass, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdBeginRenderPass, sizeof(uint32_t));
-    uint64_t cgen_var_543 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_543);
+    uint64_t cgen_var_637;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_637, 1);
+    stream->write((uint64_t*)&cgen_var_637, 8);
     marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
     stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
     pool->freeAll();
@@ -8117,8 +8849,9 @@
     local_contents = contents;
     countingStream->rewind();
     {
-        uint64_t cgen_var_544 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_544);
+        uint64_t cgen_var_638;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_638, 1);
+        countingStream->write((uint64_t*)&cgen_var_638, 8);
         countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
     }
     uint32_t packetSize_vkCmdNextSubpass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -8126,8 +8859,9 @@
     uint32_t opcode_vkCmdNextSubpass = OP_vkCmdNextSubpass;
     stream->write(&opcode_vkCmdNextSubpass, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdNextSubpass, sizeof(uint32_t));
-    uint64_t cgen_var_545 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_545);
+    uint64_t cgen_var_639;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_639, 1);
+    stream->write((uint64_t*)&cgen_var_639, 8);
     stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
     pool->freeAll();
 }
@@ -8144,16 +8878,18 @@
     resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
     countingStream->rewind();
     {
-        uint64_t cgen_var_546 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_546);
+        uint64_t cgen_var_640;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_640, 1);
+        countingStream->write((uint64_t*)&cgen_var_640, 8);
     }
     uint32_t packetSize_vkCmdEndRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCmdEndRenderPass = OP_vkCmdEndRenderPass;
     stream->write(&opcode_vkCmdEndRenderPass, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdEndRenderPass, sizeof(uint32_t));
-    uint64_t cgen_var_547 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_547);
+    uint64_t cgen_var_641;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_641, 1);
+    stream->write((uint64_t*)&cgen_var_641, 8);
     pool->freeAll();
 }
 
@@ -8183,22 +8919,34 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_548 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_548);
+        uint64_t cgen_var_642;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_642, 1);
+        countingStream->write((uint64_t*)&cgen_var_642, 8);
         countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer));
+        if (((commandBufferCount)))
+        {
+            uint64_t* cgen_var_643;
+            countingStream->alloc((void**)&cgen_var_643, ((commandBufferCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_643, ((commandBufferCount)));
+            countingStream->write((uint64_t*)cgen_var_643, 8);
+        }
     }
     uint32_t packetSize_vkCmdExecuteCommands = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCmdExecuteCommands = OP_vkCmdExecuteCommands;
     stream->write(&opcode_vkCmdExecuteCommands, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdExecuteCommands, sizeof(uint32_t));
-    uint64_t cgen_var_549 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_549);
+    uint64_t cgen_var_644;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_644, 1);
+    stream->write((uint64_t*)&cgen_var_644, 8);
     stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer));
+    if (((commandBufferCount)))
+    {
+        uint64_t* cgen_var_645;
+        stream->alloc((void**)&cgen_var_645, ((commandBufferCount)) * 8);
+        stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_645, ((commandBufferCount)));
+        stream->write((uint64_t*)cgen_var_645, 8);
+    }
     pool->freeAll();
 }
 
@@ -8245,8 +8993,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_550 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_550);
+        uint64_t cgen_var_646;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_646, 1);
+        countingStream->write((uint64_t*)&cgen_var_646, 8);
         countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
         {
@@ -8258,8 +9007,9 @@
     uint32_t opcode_vkBindBufferMemory2 = OP_vkBindBufferMemory2;
     stream->write(&opcode_vkBindBufferMemory2, sizeof(uint32_t));
     stream->write(&packetSize_vkBindBufferMemory2, sizeof(uint32_t));
-    uint64_t cgen_var_551 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_551);
+    uint64_t cgen_var_647;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_647, 1);
+    stream->write((uint64_t*)&cgen_var_647, 8);
     stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
     {
@@ -8268,6 +9018,8 @@
     pool->freeAll();
     VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0;
     stream->read(&vkBindBufferMemory2_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkBindBufferMemory2_VkResult_return;
 }
 
@@ -8304,8 +9056,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_552 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_552);
+        uint64_t cgen_var_648;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_648, 1);
+        countingStream->write((uint64_t*)&cgen_var_648, 8);
         countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
         {
@@ -8317,8 +9070,9 @@
     uint32_t opcode_vkBindImageMemory2 = OP_vkBindImageMemory2;
     stream->write(&opcode_vkBindImageMemory2, sizeof(uint32_t));
     stream->write(&packetSize_vkBindImageMemory2, sizeof(uint32_t));
-    uint64_t cgen_var_553 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_553);
+    uint64_t cgen_var_649;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_649, 1);
+    stream->write((uint64_t*)&cgen_var_649, 8);
     stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
     {
@@ -8327,6 +9081,8 @@
     pool->freeAll();
     VkResult vkBindImageMemory2_VkResult_return = (VkResult)0;
     stream->read(&vkBindImageMemory2_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkBindImageMemory2_VkResult_return;
 }
 
@@ -8352,8 +9108,9 @@
     local_remoteDeviceIndex = remoteDeviceIndex;
     countingStream->rewind();
     {
-        uint64_t cgen_var_554 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_554);
+        uint64_t cgen_var_650;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_650, 1);
+        countingStream->write((uint64_t*)&cgen_var_650, 8);
         countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
@@ -8364,8 +9121,9 @@
     uint32_t opcode_vkGetDeviceGroupPeerMemoryFeatures = OP_vkGetDeviceGroupPeerMemoryFeatures;
     stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t));
-    uint64_t cgen_var_555 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_555);
+    uint64_t cgen_var_651;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_651, 1);
+    stream->write((uint64_t*)&cgen_var_651, 8);
     stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
     stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
     stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
@@ -8389,8 +9147,9 @@
     local_deviceMask = deviceMask;
     countingStream->rewind();
     {
-        uint64_t cgen_var_556 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_556);
+        uint64_t cgen_var_652;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_652, 1);
+        countingStream->write((uint64_t*)&cgen_var_652, 8);
         countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
     }
     uint32_t packetSize_vkCmdSetDeviceMask = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -8398,8 +9157,9 @@
     uint32_t opcode_vkCmdSetDeviceMask = OP_vkCmdSetDeviceMask;
     stream->write(&opcode_vkCmdSetDeviceMask, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetDeviceMask, sizeof(uint32_t));
-    uint64_t cgen_var_557 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_557);
+    uint64_t cgen_var_653;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_653, 1);
+    stream->write((uint64_t*)&cgen_var_653, 8);
     stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
     pool->freeAll();
 }
@@ -8434,8 +9194,9 @@
     local_groupCountZ = groupCountZ;
     countingStream->rewind();
     {
-        uint64_t cgen_var_558 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_558);
+        uint64_t cgen_var_654;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_654, 1);
+        countingStream->write((uint64_t*)&cgen_var_654, 8);
         countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
@@ -8448,8 +9209,9 @@
     uint32_t opcode_vkCmdDispatchBase = OP_vkCmdDispatchBase;
     stream->write(&opcode_vkCmdDispatchBase, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDispatchBase, sizeof(uint32_t));
-    uint64_t cgen_var_559 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_559);
+    uint64_t cgen_var_655;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_655, 1);
+    stream->write((uint64_t*)&cgen_var_655, 8);
     stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
     stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
     stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
@@ -8473,18 +9235,19 @@
     resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
     countingStream->rewind();
     {
-        uint64_t cgen_var_560 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_560);
+        uint64_t cgen_var_656;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_656, 1);
+        countingStream->write((uint64_t*)&cgen_var_656, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_561 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
-        countingStream->putBe64(cgen_var_561);
+        uint64_t cgen_var_657 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
+        countingStream->putBe64(cgen_var_657);
         if (pPhysicalDeviceGroupCount)
         {
             countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_562 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
-        countingStream->putBe64(cgen_var_562);
+        uint64_t cgen_var_658 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
+        countingStream->putBe64(cgen_var_658);
         if (pPhysicalDeviceGroupProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
@@ -8498,18 +9261,19 @@
     uint32_t opcode_vkEnumeratePhysicalDeviceGroups = OP_vkEnumeratePhysicalDeviceGroups;
     stream->write(&opcode_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t));
     stream->write(&packetSize_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t));
-    uint64_t cgen_var_563 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_563);
+    uint64_t cgen_var_659;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_659, 1);
+    stream->write((uint64_t*)&cgen_var_659, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_564 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
-    stream->putBe64(cgen_var_564);
+    uint64_t cgen_var_660 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
+    stream->putBe64(cgen_var_660);
     if (pPhysicalDeviceGroupCount)
     {
         stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_565 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
-    stream->putBe64(cgen_var_565);
+    uint64_t cgen_var_661 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
+    stream->putBe64(cgen_var_661);
     if (pPhysicalDeviceGroupProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
@@ -8545,6 +9309,8 @@
     pool->freeAll();
     VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0;
     stream->read(&vkEnumeratePhysicalDeviceGroups_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkEnumeratePhysicalDeviceGroups_VkResult_return;
 }
 
@@ -8573,8 +9339,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_568 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_568);
+        uint64_t cgen_var_664;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_664, 1);
+        countingStream->write((uint64_t*)&cgen_var_664, 8);
         marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
         marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
     }
@@ -8583,8 +9350,9 @@
     uint32_t opcode_vkGetImageMemoryRequirements2 = OP_vkGetImageMemoryRequirements2;
     stream->write(&opcode_vkGetImageMemoryRequirements2, sizeof(uint32_t));
     stream->write(&packetSize_vkGetImageMemoryRequirements2, sizeof(uint32_t));
-    uint64_t cgen_var_569 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_569);
+    uint64_t cgen_var_665;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_665, 1);
+    stream->write((uint64_t*)&cgen_var_665, 8);
     marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
     marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
     unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
@@ -8616,8 +9384,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_570 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_570);
+        uint64_t cgen_var_666;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_666, 1);
+        countingStream->write((uint64_t*)&cgen_var_666, 8);
         marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
         marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
     }
@@ -8626,8 +9395,9 @@
     uint32_t opcode_vkGetBufferMemoryRequirements2 = OP_vkGetBufferMemoryRequirements2;
     stream->write(&opcode_vkGetBufferMemoryRequirements2, sizeof(uint32_t));
     stream->write(&packetSize_vkGetBufferMemoryRequirements2, sizeof(uint32_t));
-    uint64_t cgen_var_571 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_571);
+    uint64_t cgen_var_667;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_667, 1);
+    stream->write((uint64_t*)&cgen_var_667, 8);
     marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
     marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
     unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
@@ -8660,19 +9430,20 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_572 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_572);
+        uint64_t cgen_var_668;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_668, 1);
+        countingStream->write((uint64_t*)&cgen_var_668, 8);
         marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_573 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
-        countingStream->putBe64(cgen_var_573);
+        uint64_t cgen_var_669 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
+        countingStream->putBe64(cgen_var_669);
         if (pSparseMemoryRequirementCount)
         {
             countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_574 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
-        countingStream->putBe64(cgen_var_574);
+        uint64_t cgen_var_670 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
+        countingStream->putBe64(cgen_var_670);
         if (pSparseMemoryRequirements)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
@@ -8686,19 +9457,20 @@
     uint32_t opcode_vkGetImageSparseMemoryRequirements2 = OP_vkGetImageSparseMemoryRequirements2;
     stream->write(&opcode_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t));
     stream->write(&packetSize_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t));
-    uint64_t cgen_var_575 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_575);
+    uint64_t cgen_var_671;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_671, 1);
+    stream->write((uint64_t*)&cgen_var_671, 8);
     marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_576 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
-    stream->putBe64(cgen_var_576);
+    uint64_t cgen_var_672 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
+    stream->putBe64(cgen_var_672);
     if (pSparseMemoryRequirementCount)
     {
         stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_577 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
-    stream->putBe64(cgen_var_577);
+    uint64_t cgen_var_673 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
+    stream->putBe64(cgen_var_673);
     if (pSparseMemoryRequirements)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
@@ -8747,8 +9519,9 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_580 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_580);
+        uint64_t cgen_var_676;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_676, 1);
+        countingStream->write((uint64_t*)&cgen_var_676, 8);
         marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures));
     }
     uint32_t packetSize_vkGetPhysicalDeviceFeatures2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -8756,8 +9529,9 @@
     uint32_t opcode_vkGetPhysicalDeviceFeatures2 = OP_vkGetPhysicalDeviceFeatures2;
     stream->write(&opcode_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t));
-    uint64_t cgen_var_581 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_581);
+    uint64_t cgen_var_677;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_677, 1);
+    stream->write((uint64_t*)&cgen_var_677, 8);
     marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
     unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
     pool->freeAll();
@@ -8786,8 +9560,9 @@
     local_format = format;
     countingStream->rewind();
     {
-        uint64_t cgen_var_582 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_582);
+        uint64_t cgen_var_678;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_678, 1);
+        countingStream->write((uint64_t*)&cgen_var_678, 8);
         countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
         marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties));
     }
@@ -8796,8 +9571,9 @@
     uint32_t opcode_vkGetPhysicalDeviceFormatProperties2 = OP_vkGetPhysicalDeviceFormatProperties2;
     stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t));
-    uint64_t cgen_var_583 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_583);
+    uint64_t cgen_var_679;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_679, 1);
+    stream->write((uint64_t*)&cgen_var_679, 8);
     stream->write((VkFormat*)&local_format, sizeof(VkFormat));
     marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
     unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
@@ -8829,8 +9605,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_584 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_584);
+        uint64_t cgen_var_680;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_680, 1);
+        countingStream->write((uint64_t*)&cgen_var_680, 8);
         marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
         marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties));
     }
@@ -8839,14 +9616,17 @@
     uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2 = OP_vkGetPhysicalDeviceImageFormatProperties2;
     stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t));
-    uint64_t cgen_var_585 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_585);
+    uint64_t cgen_var_681;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_681, 1);
+    stream->write((uint64_t*)&cgen_var_681, 8);
     marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
     marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
     unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
     pool->freeAll();
     VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceImageFormatProperties2_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return;
 }
 
@@ -8864,18 +9644,19 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_586 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_586);
+        uint64_t cgen_var_682;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_682, 1);
+        countingStream->write((uint64_t*)&cgen_var_682, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_587 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
-        countingStream->putBe64(cgen_var_587);
+        uint64_t cgen_var_683 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
+        countingStream->putBe64(cgen_var_683);
         if (pQueueFamilyPropertyCount)
         {
             countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_588 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
-        countingStream->putBe64(cgen_var_588);
+        uint64_t cgen_var_684 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
+        countingStream->putBe64(cgen_var_684);
         if (pQueueFamilyProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
@@ -8889,18 +9670,19 @@
     uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2 = OP_vkGetPhysicalDeviceQueueFamilyProperties2;
     stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t));
-    uint64_t cgen_var_589 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_589);
+    uint64_t cgen_var_685;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_685, 1);
+    stream->write((uint64_t*)&cgen_var_685, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_590 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
-    stream->putBe64(cgen_var_590);
+    uint64_t cgen_var_686 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
+    stream->putBe64(cgen_var_686);
     if (pQueueFamilyPropertyCount)
     {
         stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_591 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
-    stream->putBe64(cgen_var_591);
+    uint64_t cgen_var_687 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
+    stream->putBe64(cgen_var_687);
     if (pQueueFamilyProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
@@ -8949,8 +9731,9 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_594 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_594);
+        uint64_t cgen_var_690;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_690, 1);
+        countingStream->write((uint64_t*)&cgen_var_690, 8);
         marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
     }
     uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -8958,8 +9741,9 @@
     uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2 = OP_vkGetPhysicalDeviceMemoryProperties2;
     stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t));
-    uint64_t cgen_var_595 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_595);
+    uint64_t cgen_var_691;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_691, 1);
+    stream->write((uint64_t*)&cgen_var_691, 8);
     marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
     unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
     pool->freeAll();
@@ -8991,19 +9775,20 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_596 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_596);
+        uint64_t cgen_var_692;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_692, 1);
+        countingStream->write((uint64_t*)&cgen_var_692, 8);
         marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_597 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_597);
+        uint64_t cgen_var_693 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_693);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_598 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_598);
+        uint64_t cgen_var_694 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_694);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -9017,19 +9802,20 @@
     uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2 = OP_vkGetPhysicalDeviceSparseImageFormatProperties2;
     stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t));
-    uint64_t cgen_var_599 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_599);
+    uint64_t cgen_var_695;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_695, 1);
+    stream->write((uint64_t*)&cgen_var_695, 8);
     marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_600 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_600);
+    uint64_t cgen_var_696 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_696);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_601 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_601);
+    uint64_t cgen_var_697 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_697);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -9084,10 +9870,12 @@
     local_flags = flags;
     countingStream->rewind();
     {
-        uint64_t cgen_var_604 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_604);
-        uint64_t cgen_var_605 = (uint64_t)local_commandPool;
-        countingStream->putBe64(cgen_var_605);
+        uint64_t cgen_var_700;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_700, 1);
+        countingStream->write((uint64_t*)&cgen_var_700, 8);
+        uint64_t cgen_var_701;
+        countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_701, 1);
+        countingStream->write((uint64_t*)&cgen_var_701, 8);
         countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
     }
     uint32_t packetSize_vkTrimCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -9095,10 +9883,12 @@
     uint32_t opcode_vkTrimCommandPool = OP_vkTrimCommandPool;
     stream->write(&opcode_vkTrimCommandPool, sizeof(uint32_t));
     stream->write(&packetSize_vkTrimCommandPool, sizeof(uint32_t));
-    uint64_t cgen_var_606 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_606);
-    uint64_t cgen_var_607 = (uint64_t)local_commandPool;
-    stream->putBe64(cgen_var_607);
+    uint64_t cgen_var_702;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_702, 1);
+    stream->write((uint64_t*)&cgen_var_702, 8);
+    uint64_t cgen_var_703;
+    stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_703, 1);
+    stream->write((uint64_t*)&cgen_var_703, 8);
     stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
     pool->freeAll();
 }
@@ -9128,24 +9918,29 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_608 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_608);
+        uint64_t cgen_var_704;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_704, 1);
+        countingStream->write((uint64_t*)&cgen_var_704, 8);
         marshal_VkDeviceQueueInfo2(countingStream, (VkDeviceQueueInfo2*)(local_pQueueInfo));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkQueue*)pQueue, sizeof(VkQueue));
+        uint64_t cgen_var_705;
+        countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_705, 1);
+        countingStream->write((uint64_t*)&cgen_var_705, 8);
     }
     uint32_t packetSize_vkGetDeviceQueue2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkGetDeviceQueue2 = OP_vkGetDeviceQueue2;
     stream->write(&opcode_vkGetDeviceQueue2, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDeviceQueue2, sizeof(uint32_t));
-    uint64_t cgen_var_609 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_609);
+    uint64_t cgen_var_706;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_706, 1);
+    stream->write((uint64_t*)&cgen_var_706, 8);
     marshal_VkDeviceQueueInfo2(stream, (VkDeviceQueueInfo2*)(local_pQueueInfo));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkQueue*)pQueue, sizeof(VkQueue));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkQueue*)pQueue, sizeof(VkQueue));
+    uint64_t cgen_var_707;
+    stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_707, 1);
+    stream->write((uint64_t*)&cgen_var_707, 8);
+    uint64_t cgen_var_708;
+    stream->read((uint64_t*)&cgen_var_708, 8);
+    stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_708, (VkQueue*)pQueue, 1);
     pool->freeAll();
 }
 
@@ -9187,38 +9982,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_610 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_610);
+        uint64_t cgen_var_709;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_709, 1);
+        countingStream->write((uint64_t*)&cgen_var_709, 8);
         marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_611 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_611);
+        uint64_t cgen_var_710 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_710);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
+        uint64_t cgen_var_711;
+        countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_711, 1);
+        countingStream->write((uint64_t*)&cgen_var_711, 8);
     }
     uint32_t packetSize_vkCreateSamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateSamplerYcbcrConversion = OP_vkCreateSamplerYcbcrConversion;
     stream->write(&opcode_vkCreateSamplerYcbcrConversion, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateSamplerYcbcrConversion, sizeof(uint32_t));
-    uint64_t cgen_var_612 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_612);
+    uint64_t cgen_var_712;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_712, 1);
+    stream->write((uint64_t*)&cgen_var_712, 8);
     marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_613 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_613);
+    uint64_t cgen_var_713 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_713);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
+    uint64_t cgen_var_714;
+    stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_714, 1);
+    stream->write((uint64_t*)&cgen_var_714, 8);
+    uint64_t cgen_var_715;
+    stream->read((uint64_t*)&cgen_var_715, 8);
+    stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_715, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1);
     if (pYcbcrConversion)
     {
         resources->createMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)pYcbcrConversion, 1);
@@ -9226,6 +10026,8 @@
     pool->freeAll();
     VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0;
     stream->read(&vkCreateSamplerYcbcrConversion_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateSamplerYcbcrConversion_VkResult_return;
 }
 
@@ -9258,13 +10060,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_614 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_614);
-        uint64_t cgen_var_615 = (uint64_t)local_ycbcrConversion;
-        countingStream->putBe64(cgen_var_615);
+        uint64_t cgen_var_716;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_716, 1);
+        countingStream->write((uint64_t*)&cgen_var_716, 8);
+        uint64_t cgen_var_717;
+        countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_717, 1);
+        countingStream->write((uint64_t*)&cgen_var_717, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_616 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_616);
+        uint64_t cgen_var_718 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_718);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -9275,13 +10079,15 @@
     uint32_t opcode_vkDestroySamplerYcbcrConversion = OP_vkDestroySamplerYcbcrConversion;
     stream->write(&opcode_vkDestroySamplerYcbcrConversion, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroySamplerYcbcrConversion, sizeof(uint32_t));
-    uint64_t cgen_var_617 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_617);
-    uint64_t cgen_var_618 = (uint64_t)local_ycbcrConversion;
-    stream->putBe64(cgen_var_618);
+    uint64_t cgen_var_719;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_719, 1);
+    stream->write((uint64_t*)&cgen_var_719, 8);
+    uint64_t cgen_var_720;
+    stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_720, 1);
+    stream->write((uint64_t*)&cgen_var_720, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_619 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_619);
+    uint64_t cgen_var_721 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_721);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -9328,38 +10134,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_620 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_620);
+        uint64_t cgen_var_722;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_722, 1);
+        countingStream->write((uint64_t*)&cgen_var_722, 8);
         marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_621 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_621);
+        uint64_t cgen_var_723 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_723);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
+        uint64_t cgen_var_724;
+        countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_724, 1);
+        countingStream->write((uint64_t*)&cgen_var_724, 8);
     }
     uint32_t packetSize_vkCreateDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateDescriptorUpdateTemplate = OP_vkCreateDescriptorUpdateTemplate;
     stream->write(&opcode_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t));
-    uint64_t cgen_var_622 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_622);
+    uint64_t cgen_var_725;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_725, 1);
+    stream->write((uint64_t*)&cgen_var_725, 8);
     marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_623 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_623);
+    uint64_t cgen_var_726 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_726);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
+    uint64_t cgen_var_727;
+    stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_727, 1);
+    stream->write((uint64_t*)&cgen_var_727, 8);
+    uint64_t cgen_var_728;
+    stream->read((uint64_t*)&cgen_var_728, 8);
+    stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_728, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1);
     if (pDescriptorUpdateTemplate)
     {
         resources->createMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1);
@@ -9367,6 +10178,8 @@
     pool->freeAll();
     VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0;
     stream->read(&vkCreateDescriptorUpdateTemplate_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateDescriptorUpdateTemplate_VkResult_return;
 }
 
@@ -9399,13 +10212,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_624 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_624);
-        uint64_t cgen_var_625 = (uint64_t)local_descriptorUpdateTemplate;
-        countingStream->putBe64(cgen_var_625);
+        uint64_t cgen_var_729;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_729, 1);
+        countingStream->write((uint64_t*)&cgen_var_729, 8);
+        uint64_t cgen_var_730;
+        countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_730, 1);
+        countingStream->write((uint64_t*)&cgen_var_730, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_626 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_626);
+        uint64_t cgen_var_731 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_731);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -9416,13 +10231,15 @@
     uint32_t opcode_vkDestroyDescriptorUpdateTemplate = OP_vkDestroyDescriptorUpdateTemplate;
     stream->write(&opcode_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t));
-    uint64_t cgen_var_627 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_627);
-    uint64_t cgen_var_628 = (uint64_t)local_descriptorUpdateTemplate;
-    stream->putBe64(cgen_var_628);
+    uint64_t cgen_var_732;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_732, 1);
+    stream->write((uint64_t*)&cgen_var_732, 8);
+    uint64_t cgen_var_733;
+    stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_733, 1);
+    stream->write((uint64_t*)&cgen_var_733, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_629 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_629);
+    uint64_t cgen_var_734 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_734);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -9458,15 +10275,18 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_630 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_630);
-        uint64_t cgen_var_631 = (uint64_t)local_descriptorSet;
-        countingStream->putBe64(cgen_var_631);
-        uint64_t cgen_var_632 = (uint64_t)local_descriptorUpdateTemplate;
-        countingStream->putBe64(cgen_var_632);
+        uint64_t cgen_var_735;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_735, 1);
+        countingStream->write((uint64_t*)&cgen_var_735, 8);
+        uint64_t cgen_var_736;
+        countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_736, 1);
+        countingStream->write((uint64_t*)&cgen_var_736, 8);
+        uint64_t cgen_var_737;
+        countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_737, 1);
+        countingStream->write((uint64_t*)&cgen_var_737, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_633 = (uint64_t)(uintptr_t)local_pData;
-        countingStream->putBe64(cgen_var_633);
+        uint64_t cgen_var_738 = (uint64_t)(uintptr_t)local_pData;
+        countingStream->putBe64(cgen_var_738);
         if (local_pData)
         {
             countingStream->write((void*)local_pData, sizeof(uint8_t));
@@ -9477,15 +10297,18 @@
     uint32_t opcode_vkUpdateDescriptorSetWithTemplate = OP_vkUpdateDescriptorSetWithTemplate;
     stream->write(&opcode_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t));
     stream->write(&packetSize_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t));
-    uint64_t cgen_var_634 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_634);
-    uint64_t cgen_var_635 = (uint64_t)local_descriptorSet;
-    stream->putBe64(cgen_var_635);
-    uint64_t cgen_var_636 = (uint64_t)local_descriptorUpdateTemplate;
-    stream->putBe64(cgen_var_636);
+    uint64_t cgen_var_739;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_739, 1);
+    stream->write((uint64_t*)&cgen_var_739, 8);
+    uint64_t cgen_var_740;
+    stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_740, 1);
+    stream->write((uint64_t*)&cgen_var_740, 8);
+    uint64_t cgen_var_741;
+    stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_741, 1);
+    stream->write((uint64_t*)&cgen_var_741, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_637 = (uint64_t)(uintptr_t)local_pData;
-    stream->putBe64(cgen_var_637);
+    uint64_t cgen_var_742 = (uint64_t)(uintptr_t)local_pData;
+    stream->putBe64(cgen_var_742);
     if (local_pData)
     {
         stream->write((void*)local_pData, sizeof(uint8_t));
@@ -9518,8 +10341,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_638 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_638);
+        uint64_t cgen_var_743;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_743, 1);
+        countingStream->write((uint64_t*)&cgen_var_743, 8);
         marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
         marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties));
     }
@@ -9528,8 +10352,9 @@
     uint32_t opcode_vkGetPhysicalDeviceExternalBufferProperties = OP_vkGetPhysicalDeviceExternalBufferProperties;
     stream->write(&opcode_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t));
-    uint64_t cgen_var_639 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_639);
+    uint64_t cgen_var_744;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_744, 1);
+    stream->write((uint64_t*)&cgen_var_744, 8);
     marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
     marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
     unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
@@ -9561,8 +10386,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_640 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_640);
+        uint64_t cgen_var_745;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_745, 1);
+        countingStream->write((uint64_t*)&cgen_var_745, 8);
         marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
         marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties));
     }
@@ -9571,8 +10397,9 @@
     uint32_t opcode_vkGetPhysicalDeviceExternalFenceProperties = OP_vkGetPhysicalDeviceExternalFenceProperties;
     stream->write(&opcode_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t));
-    uint64_t cgen_var_641 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_641);
+    uint64_t cgen_var_746;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_746, 1);
+    stream->write((uint64_t*)&cgen_var_746, 8);
     marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
     marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
     unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
@@ -9604,8 +10431,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_642 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_642);
+        uint64_t cgen_var_747;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_747, 1);
+        countingStream->write((uint64_t*)&cgen_var_747, 8);
         marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
         marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
     }
@@ -9614,8 +10442,9 @@
     uint32_t opcode_vkGetPhysicalDeviceExternalSemaphoreProperties = OP_vkGetPhysicalDeviceExternalSemaphoreProperties;
     stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t));
-    uint64_t cgen_var_643 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_643);
+    uint64_t cgen_var_748;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_748, 1);
+    stream->write((uint64_t*)&cgen_var_748, 8);
     marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
     marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
     unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
@@ -9647,8 +10476,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_644 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_644);
+        uint64_t cgen_var_749;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_749, 1);
+        countingStream->write((uint64_t*)&cgen_var_749, 8);
         marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
         marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport));
     }
@@ -9657,8 +10487,9 @@
     uint32_t opcode_vkGetDescriptorSetLayoutSupport = OP_vkGetDescriptorSetLayoutSupport;
     stream->write(&opcode_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t));
-    uint64_t cgen_var_645 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_645);
+    uint64_t cgen_var_750;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_750, 1);
+    stream->write((uint64_t*)&cgen_var_750, 8);
     marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
     marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
     unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
@@ -9696,13 +10527,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_646 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_646);
-        uint64_t cgen_var_647 = (uint64_t)local_surface;
-        countingStream->putBe64(cgen_var_647);
+        uint64_t cgen_var_751;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_751, 1);
+        countingStream->write((uint64_t*)&cgen_var_751, 8);
+        uint64_t cgen_var_752;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_752, 1);
+        countingStream->write((uint64_t*)&cgen_var_752, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_648 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_648);
+        uint64_t cgen_var_753 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_753);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -9713,13 +10546,15 @@
     uint32_t opcode_vkDestroySurfaceKHR = OP_vkDestroySurfaceKHR;
     stream->write(&opcode_vkDestroySurfaceKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroySurfaceKHR, sizeof(uint32_t));
-    uint64_t cgen_var_649 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_649);
-    uint64_t cgen_var_650 = (uint64_t)local_surface;
-    stream->putBe64(cgen_var_650);
+    uint64_t cgen_var_754;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_754, 1);
+    stream->write((uint64_t*)&cgen_var_754, 8);
+    uint64_t cgen_var_755;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_755, 1);
+    stream->write((uint64_t*)&cgen_var_755, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_651 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_651);
+    uint64_t cgen_var_756 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_756);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -9748,11 +10583,13 @@
     resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
     countingStream->rewind();
     {
-        uint64_t cgen_var_652 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_652);
+        uint64_t cgen_var_757;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_757, 1);
+        countingStream->write((uint64_t*)&cgen_var_757, 8);
         countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
-        uint64_t cgen_var_653 = (uint64_t)local_surface;
-        countingStream->putBe64(cgen_var_653);
+        uint64_t cgen_var_758;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_758, 1);
+        countingStream->write((uint64_t*)&cgen_var_758, 8);
         countingStream->write((VkBool32*)pSupported, sizeof(VkBool32));
     }
     uint32_t packetSize_vkGetPhysicalDeviceSurfaceSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -9760,16 +10597,20 @@
     uint32_t opcode_vkGetPhysicalDeviceSurfaceSupportKHR = OP_vkGetPhysicalDeviceSurfaceSupportKHR;
     stream->write(&opcode_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t));
-    uint64_t cgen_var_654 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_654);
+    uint64_t cgen_var_759;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_759, 1);
+    stream->write((uint64_t*)&cgen_var_759, 8);
     stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
-    uint64_t cgen_var_655 = (uint64_t)local_surface;
-    stream->putBe64(cgen_var_655);
+    uint64_t cgen_var_760;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_760, 1);
+    stream->write((uint64_t*)&cgen_var_760, 8);
     stream->write((VkBool32*)pSupported, sizeof(VkBool32));
     stream->read((VkBool32*)pSupported, sizeof(VkBool32));
     pool->freeAll();
     VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return;
 }
 
@@ -9790,10 +10631,12 @@
     resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
     countingStream->rewind();
     {
-        uint64_t cgen_var_656 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_656);
-        uint64_t cgen_var_657 = (uint64_t)local_surface;
-        countingStream->putBe64(cgen_var_657);
+        uint64_t cgen_var_761;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_761, 1);
+        countingStream->write((uint64_t*)&cgen_var_761, 8);
+        uint64_t cgen_var_762;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_762, 1);
+        countingStream->write((uint64_t*)&cgen_var_762, 8);
         marshal_VkSurfaceCapabilitiesKHR(countingStream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
     }
     uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -9801,15 +10644,19 @@
     uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
     stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_658 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_658);
-    uint64_t cgen_var_659 = (uint64_t)local_surface;
-    stream->putBe64(cgen_var_659);
+    uint64_t cgen_var_763;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_763, 1);
+    stream->write((uint64_t*)&cgen_var_763, 8);
+    uint64_t cgen_var_764;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_764, 1);
+    stream->write((uint64_t*)&cgen_var_764, 8);
     marshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
     unmarshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
     pool->freeAll();
     VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return;
 }
 
@@ -9831,20 +10678,22 @@
     resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
     countingStream->rewind();
     {
-        uint64_t cgen_var_660 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_660);
-        uint64_t cgen_var_661 = (uint64_t)local_surface;
-        countingStream->putBe64(cgen_var_661);
+        uint64_t cgen_var_765;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_765, 1);
+        countingStream->write((uint64_t*)&cgen_var_765, 8);
+        uint64_t cgen_var_766;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_766, 1);
+        countingStream->write((uint64_t*)&cgen_var_766, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_662 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
-        countingStream->putBe64(cgen_var_662);
+        uint64_t cgen_var_767 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
+        countingStream->putBe64(cgen_var_767);
         if (pSurfaceFormatCount)
         {
             countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_663 = (uint64_t)(uintptr_t)pSurfaceFormats;
-        countingStream->putBe64(cgen_var_663);
+        uint64_t cgen_var_768 = (uint64_t)(uintptr_t)pSurfaceFormats;
+        countingStream->putBe64(cgen_var_768);
         if (pSurfaceFormats)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
@@ -9858,20 +10707,22 @@
     uint32_t opcode_vkGetPhysicalDeviceSurfaceFormatsKHR = OP_vkGetPhysicalDeviceSurfaceFormatsKHR;
     stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t));
-    uint64_t cgen_var_664 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_664);
-    uint64_t cgen_var_665 = (uint64_t)local_surface;
-    stream->putBe64(cgen_var_665);
+    uint64_t cgen_var_769;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_769, 1);
+    stream->write((uint64_t*)&cgen_var_769, 8);
+    uint64_t cgen_var_770;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_770, 1);
+    stream->write((uint64_t*)&cgen_var_770, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_666 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
-    stream->putBe64(cgen_var_666);
+    uint64_t cgen_var_771 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
+    stream->putBe64(cgen_var_771);
     if (pSurfaceFormatCount)
     {
         stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_667 = (uint64_t)(uintptr_t)pSurfaceFormats;
-    stream->putBe64(cgen_var_667);
+    uint64_t cgen_var_772 = (uint64_t)(uintptr_t)pSurfaceFormats;
+    stream->putBe64(cgen_var_772);
     if (pSurfaceFormats)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
@@ -9907,6 +10758,8 @@
     pool->freeAll();
     VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return;
 }
 
@@ -9928,20 +10781,22 @@
     resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
     countingStream->rewind();
     {
-        uint64_t cgen_var_670 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_670);
-        uint64_t cgen_var_671 = (uint64_t)local_surface;
-        countingStream->putBe64(cgen_var_671);
+        uint64_t cgen_var_775;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_775, 1);
+        countingStream->write((uint64_t*)&cgen_var_775, 8);
+        uint64_t cgen_var_776;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_776, 1);
+        countingStream->write((uint64_t*)&cgen_var_776, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_672 = (uint64_t)(uintptr_t)pPresentModeCount;
-        countingStream->putBe64(cgen_var_672);
+        uint64_t cgen_var_777 = (uint64_t)(uintptr_t)pPresentModeCount;
+        countingStream->putBe64(cgen_var_777);
         if (pPresentModeCount)
         {
             countingStream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_673 = (uint64_t)(uintptr_t)pPresentModes;
-        countingStream->putBe64(cgen_var_673);
+        uint64_t cgen_var_778 = (uint64_t)(uintptr_t)pPresentModes;
+        countingStream->putBe64(cgen_var_778);
         if (pPresentModes)
         {
             countingStream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
@@ -9952,20 +10807,22 @@
     uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModesKHR = OP_vkGetPhysicalDeviceSurfacePresentModesKHR;
     stream->write(&opcode_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_674 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_674);
-    uint64_t cgen_var_675 = (uint64_t)local_surface;
-    stream->putBe64(cgen_var_675);
+    uint64_t cgen_var_779;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_779, 1);
+    stream->write((uint64_t*)&cgen_var_779, 8);
+    uint64_t cgen_var_780;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_780, 1);
+    stream->write((uint64_t*)&cgen_var_780, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_676 = (uint64_t)(uintptr_t)pPresentModeCount;
-    stream->putBe64(cgen_var_676);
+    uint64_t cgen_var_781 = (uint64_t)(uintptr_t)pPresentModeCount;
+    stream->putBe64(cgen_var_781);
     if (pPresentModeCount)
     {
         stream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_677 = (uint64_t)(uintptr_t)pPresentModes;
-    stream->putBe64(cgen_var_677);
+    uint64_t cgen_var_782 = (uint64_t)(uintptr_t)pPresentModes;
+    stream->putBe64(cgen_var_782);
     if (pPresentModes)
     {
         stream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
@@ -9995,6 +10852,8 @@
     pool->freeAll();
     VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return;
 }
 
@@ -10038,38 +10897,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_680 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_680);
+        uint64_t cgen_var_785;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_785, 1);
+        countingStream->write((uint64_t*)&cgen_var_785, 8);
         marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_681 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_681);
+        uint64_t cgen_var_786 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_786);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR));
+        uint64_t cgen_var_787;
+        countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_787, 1);
+        countingStream->write((uint64_t*)&cgen_var_787, 8);
     }
     uint32_t packetSize_vkCreateSwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateSwapchainKHR = OP_vkCreateSwapchainKHR;
     stream->write(&opcode_vkCreateSwapchainKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateSwapchainKHR, sizeof(uint32_t));
-    uint64_t cgen_var_682 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_682);
+    uint64_t cgen_var_788;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_788, 1);
+    stream->write((uint64_t*)&cgen_var_788, 8);
     marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_683 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_683);
+    uint64_t cgen_var_789 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_789);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR));
+    uint64_t cgen_var_790;
+    stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_790, 1);
+    stream->write((uint64_t*)&cgen_var_790, 8);
+    uint64_t cgen_var_791;
+    stream->read((uint64_t*)&cgen_var_791, 8);
+    stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(&cgen_var_791, (VkSwapchainKHR*)pSwapchain, 1);
     if (pSwapchain)
     {
         resources->createMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)pSwapchain, 1);
@@ -10077,6 +10941,8 @@
     pool->freeAll();
     VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateSwapchainKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateSwapchainKHR_VkResult_return;
 }
 
@@ -10109,13 +10975,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_684 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_684);
-        uint64_t cgen_var_685 = (uint64_t)local_swapchain;
-        countingStream->putBe64(cgen_var_685);
+        uint64_t cgen_var_792;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_792, 1);
+        countingStream->write((uint64_t*)&cgen_var_792, 8);
+        uint64_t cgen_var_793;
+        countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_793, 1);
+        countingStream->write((uint64_t*)&cgen_var_793, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_686 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_686);
+        uint64_t cgen_var_794 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_794);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -10126,13 +10994,15 @@
     uint32_t opcode_vkDestroySwapchainKHR = OP_vkDestroySwapchainKHR;
     stream->write(&opcode_vkDestroySwapchainKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroySwapchainKHR, sizeof(uint32_t));
-    uint64_t cgen_var_687 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_687);
-    uint64_t cgen_var_688 = (uint64_t)local_swapchain;
-    stream->putBe64(cgen_var_688);
+    uint64_t cgen_var_795;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_795, 1);
+    stream->write((uint64_t*)&cgen_var_795, 8);
+    uint64_t cgen_var_796;
+    stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_796, 1);
+    stream->write((uint64_t*)&cgen_var_796, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_689 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_689);
+    uint64_t cgen_var_797 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_797);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -10159,24 +11029,31 @@
     resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
     countingStream->rewind();
     {
-        uint64_t cgen_var_690 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_690);
-        uint64_t cgen_var_691 = (uint64_t)local_swapchain;
-        countingStream->putBe64(cgen_var_691);
+        uint64_t cgen_var_798;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_798, 1);
+        countingStream->write((uint64_t*)&cgen_var_798, 8);
+        uint64_t cgen_var_799;
+        countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_799, 1);
+        countingStream->write((uint64_t*)&cgen_var_799, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_692 = (uint64_t)(uintptr_t)pSwapchainImageCount;
-        countingStream->putBe64(cgen_var_692);
+        uint64_t cgen_var_800 = (uint64_t)(uintptr_t)pSwapchainImageCount;
+        countingStream->putBe64(cgen_var_800);
         if (pSwapchainImageCount)
         {
             countingStream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_693 = (uint64_t)(uintptr_t)pSwapchainImages;
-        countingStream->putBe64(cgen_var_693);
+        uint64_t cgen_var_801 = (uint64_t)(uintptr_t)pSwapchainImages;
+        countingStream->putBe64(cgen_var_801);
         if (pSwapchainImages)
         {
-            // WARNING HANDLE TYPE POINTER
-            countingStream->write((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage));
+            if ((*(pSwapchainImageCount)))
+            {
+                uint64_t* cgen_var_802;
+                countingStream->alloc((void**)&cgen_var_802, (*(pSwapchainImageCount)) * 8);
+                countingStream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_802, (*(pSwapchainImageCount)));
+                countingStream->write((uint64_t*)cgen_var_802, 8);
+            }
         }
     }
     uint32_t packetSize_vkGetSwapchainImagesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -10184,24 +11061,31 @@
     uint32_t opcode_vkGetSwapchainImagesKHR = OP_vkGetSwapchainImagesKHR;
     stream->write(&opcode_vkGetSwapchainImagesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetSwapchainImagesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_694 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_694);
-    uint64_t cgen_var_695 = (uint64_t)local_swapchain;
-    stream->putBe64(cgen_var_695);
+    uint64_t cgen_var_803;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_803, 1);
+    stream->write((uint64_t*)&cgen_var_803, 8);
+    uint64_t cgen_var_804;
+    stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_804, 1);
+    stream->write((uint64_t*)&cgen_var_804, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_696 = (uint64_t)(uintptr_t)pSwapchainImageCount;
-    stream->putBe64(cgen_var_696);
+    uint64_t cgen_var_805 = (uint64_t)(uintptr_t)pSwapchainImageCount;
+    stream->putBe64(cgen_var_805);
     if (pSwapchainImageCount)
     {
         stream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_697 = (uint64_t)(uintptr_t)pSwapchainImages;
-    stream->putBe64(cgen_var_697);
+    uint64_t cgen_var_806 = (uint64_t)(uintptr_t)pSwapchainImages;
+    stream->putBe64(cgen_var_806);
     if (pSwapchainImages)
     {
-        // WARNING HANDLE TYPE POINTER
-        stream->write((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage));
+        if ((*(pSwapchainImageCount)))
+        {
+            uint64_t* cgen_var_807;
+            stream->alloc((void**)&cgen_var_807, (*(pSwapchainImageCount)) * 8);
+            stream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_807, (*(pSwapchainImageCount)));
+            stream->write((uint64_t*)cgen_var_807, 8);
+        }
     }
     // WARNING PTR CHECK
     uint32_t* check_pSwapchainImageCount;
@@ -10223,12 +11107,19 @@
         {
             fprintf(stderr, "fatal: pSwapchainImages inconsistent between guest and host\n");
         }
-        // WARNING HANDLE TYPE POINTER
-        stream->read((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage));
+        if ((*(pSwapchainImageCount)))
+        {
+            uint64_t* cgen_var_810;
+            stream->alloc((void**)&cgen_var_810, (*(pSwapchainImageCount)) * 8);
+            stream->read((uint64_t*)cgen_var_810, 8);
+            stream->handleMapping()->mapHandles_u64_VkImage(cgen_var_810, (VkImage*)pSwapchainImages, (*(pSwapchainImageCount)));
+        }
     }
     pool->freeAll();
     VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetSwapchainImagesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetSwapchainImagesKHR_VkResult_return;
 }
 
@@ -10260,15 +11151,19 @@
     resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
     countingStream->rewind();
     {
-        uint64_t cgen_var_700 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_700);
-        uint64_t cgen_var_701 = (uint64_t)local_swapchain;
-        countingStream->putBe64(cgen_var_701);
+        uint64_t cgen_var_811;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_811, 1);
+        countingStream->write((uint64_t*)&cgen_var_811, 8);
+        uint64_t cgen_var_812;
+        countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_812, 1);
+        countingStream->write((uint64_t*)&cgen_var_812, 8);
         countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
-        uint64_t cgen_var_702 = (uint64_t)local_semaphore;
-        countingStream->putBe64(cgen_var_702);
-        uint64_t cgen_var_703 = (uint64_t)local_fence;
-        countingStream->putBe64(cgen_var_703);
+        uint64_t cgen_var_813;
+        countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_813, 1);
+        countingStream->write((uint64_t*)&cgen_var_813, 8);
+        uint64_t cgen_var_814;
+        countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_814, 1);
+        countingStream->write((uint64_t*)&cgen_var_814, 8);
         countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
     }
     uint32_t packetSize_vkAcquireNextImageKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -10276,20 +11171,26 @@
     uint32_t opcode_vkAcquireNextImageKHR = OP_vkAcquireNextImageKHR;
     stream->write(&opcode_vkAcquireNextImageKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkAcquireNextImageKHR, sizeof(uint32_t));
-    uint64_t cgen_var_704 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_704);
-    uint64_t cgen_var_705 = (uint64_t)local_swapchain;
-    stream->putBe64(cgen_var_705);
+    uint64_t cgen_var_815;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_815, 1);
+    stream->write((uint64_t*)&cgen_var_815, 8);
+    uint64_t cgen_var_816;
+    stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_816, 1);
+    stream->write((uint64_t*)&cgen_var_816, 8);
     stream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
-    uint64_t cgen_var_706 = (uint64_t)local_semaphore;
-    stream->putBe64(cgen_var_706);
-    uint64_t cgen_var_707 = (uint64_t)local_fence;
-    stream->putBe64(cgen_var_707);
+    uint64_t cgen_var_817;
+    stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_817, 1);
+    stream->write((uint64_t*)&cgen_var_817, 8);
+    uint64_t cgen_var_818;
+    stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_818, 1);
+    stream->write((uint64_t*)&cgen_var_818, 8);
     stream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
     stream->read((uint32_t*)pImageIndex, sizeof(uint32_t));
     pool->freeAll();
     VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0;
     stream->read(&vkAcquireNextImageKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkAcquireNextImageKHR_VkResult_return;
 }
 
@@ -10317,8 +11218,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_708 = (uint64_t)local_queue;
-        countingStream->putBe64(cgen_var_708);
+        uint64_t cgen_var_819;
+        countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_819, 1);
+        countingStream->write((uint64_t*)&cgen_var_819, 8);
         marshal_VkPresentInfoKHR(countingStream, (VkPresentInfoKHR*)(local_pPresentInfo));
     }
     uint32_t packetSize_vkQueuePresentKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -10326,12 +11228,15 @@
     uint32_t opcode_vkQueuePresentKHR = OP_vkQueuePresentKHR;
     stream->write(&opcode_vkQueuePresentKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkQueuePresentKHR, sizeof(uint32_t));
-    uint64_t cgen_var_709 = (uint64_t)local_queue;
-    stream->putBe64(cgen_var_709);
+    uint64_t cgen_var_820;
+    stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_820, 1);
+    stream->write((uint64_t*)&cgen_var_820, 8);
     marshal_VkPresentInfoKHR(stream, (VkPresentInfoKHR*)(local_pPresentInfo));
     pool->freeAll();
     VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0;
     stream->read(&vkQueuePresentKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkQueuePresentKHR_VkResult_return;
 }
 
@@ -10348,8 +11253,9 @@
     resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
     countingStream->rewind();
     {
-        uint64_t cgen_var_710 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_710);
+        uint64_t cgen_var_821;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_821, 1);
+        countingStream->write((uint64_t*)&cgen_var_821, 8);
         marshal_VkDeviceGroupPresentCapabilitiesKHR(countingStream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
     }
     uint32_t packetSize_vkGetDeviceGroupPresentCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -10357,13 +11263,16 @@
     uint32_t opcode_vkGetDeviceGroupPresentCapabilitiesKHR = OP_vkGetDeviceGroupPresentCapabilitiesKHR;
     stream->write(&opcode_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_711 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_711);
+    uint64_t cgen_var_822;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_822, 1);
+    stream->write((uint64_t*)&cgen_var_822, 8);
     marshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
     unmarshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
     pool->freeAll();
     VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return;
 }
 
@@ -10384,13 +11293,15 @@
     resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
     countingStream->rewind();
     {
-        uint64_t cgen_var_712 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_712);
-        uint64_t cgen_var_713 = (uint64_t)local_surface;
-        countingStream->putBe64(cgen_var_713);
+        uint64_t cgen_var_823;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_823, 1);
+        countingStream->write((uint64_t*)&cgen_var_823, 8);
+        uint64_t cgen_var_824;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_824, 1);
+        countingStream->write((uint64_t*)&cgen_var_824, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_714 = (uint64_t)(uintptr_t)pModes;
-        countingStream->putBe64(cgen_var_714);
+        uint64_t cgen_var_825 = (uint64_t)(uintptr_t)pModes;
+        countingStream->putBe64(cgen_var_825);
         if (pModes)
         {
             countingStream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR));
@@ -10401,13 +11312,15 @@
     uint32_t opcode_vkGetDeviceGroupSurfacePresentModesKHR = OP_vkGetDeviceGroupSurfacePresentModesKHR;
     stream->write(&opcode_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_715 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_715);
-    uint64_t cgen_var_716 = (uint64_t)local_surface;
-    stream->putBe64(cgen_var_716);
+    uint64_t cgen_var_826;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_826, 1);
+    stream->write((uint64_t*)&cgen_var_826, 8);
+    uint64_t cgen_var_827;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_827, 1);
+    stream->write((uint64_t*)&cgen_var_827, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_717 = (uint64_t)(uintptr_t)pModes;
-    stream->putBe64(cgen_var_717);
+    uint64_t cgen_var_828 = (uint64_t)(uintptr_t)pModes;
+    stream->putBe64(cgen_var_828);
     if (pModes)
     {
         stream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR));
@@ -10426,6 +11339,8 @@
     pool->freeAll();
     VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return;
 }
 
@@ -10447,20 +11362,22 @@
     resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
     countingStream->rewind();
     {
-        uint64_t cgen_var_719 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_719);
-        uint64_t cgen_var_720 = (uint64_t)local_surface;
-        countingStream->putBe64(cgen_var_720);
+        uint64_t cgen_var_830;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_830, 1);
+        countingStream->write((uint64_t*)&cgen_var_830, 8);
+        uint64_t cgen_var_831;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_831, 1);
+        countingStream->write((uint64_t*)&cgen_var_831, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_721 = (uint64_t)(uintptr_t)pRectCount;
-        countingStream->putBe64(cgen_var_721);
+        uint64_t cgen_var_832 = (uint64_t)(uintptr_t)pRectCount;
+        countingStream->putBe64(cgen_var_832);
         if (pRectCount)
         {
             countingStream->write((uint32_t*)pRectCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_722 = (uint64_t)(uintptr_t)pRects;
-        countingStream->putBe64(cgen_var_722);
+        uint64_t cgen_var_833 = (uint64_t)(uintptr_t)pRects;
+        countingStream->putBe64(cgen_var_833);
         if (pRects)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i)
@@ -10474,20 +11391,22 @@
     uint32_t opcode_vkGetPhysicalDevicePresentRectanglesKHR = OP_vkGetPhysicalDevicePresentRectanglesKHR;
     stream->write(&opcode_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_723 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_723);
-    uint64_t cgen_var_724 = (uint64_t)local_surface;
-    stream->putBe64(cgen_var_724);
+    uint64_t cgen_var_834;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_834, 1);
+    stream->write((uint64_t*)&cgen_var_834, 8);
+    uint64_t cgen_var_835;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_835, 1);
+    stream->write((uint64_t*)&cgen_var_835, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_725 = (uint64_t)(uintptr_t)pRectCount;
-    stream->putBe64(cgen_var_725);
+    uint64_t cgen_var_836 = (uint64_t)(uintptr_t)pRectCount;
+    stream->putBe64(cgen_var_836);
     if (pRectCount)
     {
         stream->write((uint32_t*)pRectCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_726 = (uint64_t)(uintptr_t)pRects;
-    stream->putBe64(cgen_var_726);
+    uint64_t cgen_var_837 = (uint64_t)(uintptr_t)pRects;
+    stream->putBe64(cgen_var_837);
     if (pRects)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i)
@@ -10523,6 +11442,8 @@
     pool->freeAll();
     VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return;
 }
 
@@ -10551,8 +11472,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_729 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_729);
+        uint64_t cgen_var_840;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_840, 1);
+        countingStream->write((uint64_t*)&cgen_var_840, 8);
         marshal_VkAcquireNextImageInfoKHR(countingStream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
         countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
     }
@@ -10561,14 +11483,17 @@
     uint32_t opcode_vkAcquireNextImage2KHR = OP_vkAcquireNextImage2KHR;
     stream->write(&opcode_vkAcquireNextImage2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkAcquireNextImage2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_730 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_730);
+    uint64_t cgen_var_841;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_841, 1);
+    stream->write((uint64_t*)&cgen_var_841, 8);
     marshal_VkAcquireNextImageInfoKHR(stream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
     stream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
     stream->read((uint32_t*)pImageIndex, sizeof(uint32_t));
     pool->freeAll();
     VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkAcquireNextImage2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkAcquireNextImage2KHR_VkResult_return;
 }
 
@@ -10588,18 +11513,19 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_731 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_731);
+        uint64_t cgen_var_842;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_842, 1);
+        countingStream->write((uint64_t*)&cgen_var_842, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_732 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_732);
+        uint64_t cgen_var_843 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_843);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_733 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_733);
+        uint64_t cgen_var_844 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_844);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -10613,18 +11539,19 @@
     uint32_t opcode_vkGetPhysicalDeviceDisplayPropertiesKHR = OP_vkGetPhysicalDeviceDisplayPropertiesKHR;
     stream->write(&opcode_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_734 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_734);
+    uint64_t cgen_var_845;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_845, 1);
+    stream->write((uint64_t*)&cgen_var_845, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_735 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_735);
+    uint64_t cgen_var_846 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_846);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_736 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_736);
+    uint64_t cgen_var_847 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_847);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -10660,6 +11587,8 @@
     pool->freeAll();
     VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return;
 }
 
@@ -10677,18 +11606,19 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_739 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_739);
+        uint64_t cgen_var_850;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_850, 1);
+        countingStream->write((uint64_t*)&cgen_var_850, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_740 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_740);
+        uint64_t cgen_var_851 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_851);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_741 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_741);
+        uint64_t cgen_var_852 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_852);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -10702,18 +11632,19 @@
     uint32_t opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR;
     stream->write(&opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_742 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_742);
+    uint64_t cgen_var_853;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_853, 1);
+    stream->write((uint64_t*)&cgen_var_853, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_743 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_743);
+    uint64_t cgen_var_854 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_854);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_744 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_744);
+    uint64_t cgen_var_855 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_855);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -10749,6 +11680,8 @@
     pool->freeAll();
     VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return;
 }
 
@@ -10769,23 +11702,29 @@
     local_planeIndex = planeIndex;
     countingStream->rewind();
     {
-        uint64_t cgen_var_747 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_747);
+        uint64_t cgen_var_858;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_858, 1);
+        countingStream->write((uint64_t*)&cgen_var_858, 8);
         countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
         // WARNING PTR CHECK
-        uint64_t cgen_var_748 = (uint64_t)(uintptr_t)pDisplayCount;
-        countingStream->putBe64(cgen_var_748);
+        uint64_t cgen_var_859 = (uint64_t)(uintptr_t)pDisplayCount;
+        countingStream->putBe64(cgen_var_859);
         if (pDisplayCount)
         {
             countingStream->write((uint32_t*)pDisplayCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_749 = (uint64_t)(uintptr_t)pDisplays;
-        countingStream->putBe64(cgen_var_749);
+        uint64_t cgen_var_860 = (uint64_t)(uintptr_t)pDisplays;
+        countingStream->putBe64(cgen_var_860);
         if (pDisplays)
         {
-            // WARNING HANDLE TYPE POINTER
-            countingStream->write((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR));
+            if ((*(pDisplayCount)))
+            {
+                uint64_t* cgen_var_861;
+                countingStream->alloc((void**)&cgen_var_861, (*(pDisplayCount)) * 8);
+                countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_861, (*(pDisplayCount)));
+                countingStream->write((uint64_t*)cgen_var_861, 8);
+            }
         }
     }
     uint32_t packetSize_vkGetDisplayPlaneSupportedDisplaysKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -10793,23 +11732,29 @@
     uint32_t opcode_vkGetDisplayPlaneSupportedDisplaysKHR = OP_vkGetDisplayPlaneSupportedDisplaysKHR;
     stream->write(&opcode_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t));
-    uint64_t cgen_var_750 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_750);
+    uint64_t cgen_var_862;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_862, 1);
+    stream->write((uint64_t*)&cgen_var_862, 8);
     stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
     // WARNING PTR CHECK
-    uint64_t cgen_var_751 = (uint64_t)(uintptr_t)pDisplayCount;
-    stream->putBe64(cgen_var_751);
+    uint64_t cgen_var_863 = (uint64_t)(uintptr_t)pDisplayCount;
+    stream->putBe64(cgen_var_863);
     if (pDisplayCount)
     {
         stream->write((uint32_t*)pDisplayCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_752 = (uint64_t)(uintptr_t)pDisplays;
-    stream->putBe64(cgen_var_752);
+    uint64_t cgen_var_864 = (uint64_t)(uintptr_t)pDisplays;
+    stream->putBe64(cgen_var_864);
     if (pDisplays)
     {
-        // WARNING HANDLE TYPE POINTER
-        stream->write((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR));
+        if ((*(pDisplayCount)))
+        {
+            uint64_t* cgen_var_865;
+            stream->alloc((void**)&cgen_var_865, (*(pDisplayCount)) * 8);
+            stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_865, (*(pDisplayCount)));
+            stream->write((uint64_t*)cgen_var_865, 8);
+        }
     }
     // WARNING PTR CHECK
     uint32_t* check_pDisplayCount;
@@ -10831,12 +11776,19 @@
         {
             fprintf(stderr, "fatal: pDisplays inconsistent between guest and host\n");
         }
-        // WARNING HANDLE TYPE POINTER
-        stream->read((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR));
+        if ((*(pDisplayCount)))
+        {
+            uint64_t* cgen_var_868;
+            stream->alloc((void**)&cgen_var_868, (*(pDisplayCount)) * 8);
+            stream->read((uint64_t*)cgen_var_868, 8);
+            stream->handleMapping()->mapHandles_u64_VkDisplayKHR(cgen_var_868, (VkDisplayKHR*)pDisplays, (*(pDisplayCount)));
+        }
     }
     pool->freeAll();
     VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return;
 }
 
@@ -10858,20 +11810,22 @@
     resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
     countingStream->rewind();
     {
-        uint64_t cgen_var_755 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_755);
-        uint64_t cgen_var_756 = (uint64_t)local_display;
-        countingStream->putBe64(cgen_var_756);
+        uint64_t cgen_var_869;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_869, 1);
+        countingStream->write((uint64_t*)&cgen_var_869, 8);
+        uint64_t cgen_var_870;
+        countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_870, 1);
+        countingStream->write((uint64_t*)&cgen_var_870, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_757 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_757);
+        uint64_t cgen_var_871 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_871);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_758 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_758);
+        uint64_t cgen_var_872 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_872);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -10885,20 +11839,22 @@
     uint32_t opcode_vkGetDisplayModePropertiesKHR = OP_vkGetDisplayModePropertiesKHR;
     stream->write(&opcode_vkGetDisplayModePropertiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDisplayModePropertiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_759 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_759);
-    uint64_t cgen_var_760 = (uint64_t)local_display;
-    stream->putBe64(cgen_var_760);
+    uint64_t cgen_var_873;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_873, 1);
+    stream->write((uint64_t*)&cgen_var_873, 8);
+    uint64_t cgen_var_874;
+    stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_874, 1);
+    stream->write((uint64_t*)&cgen_var_874, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_761 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_761);
+    uint64_t cgen_var_875 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_875);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_762 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_762);
+    uint64_t cgen_var_876 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_876);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -10934,6 +11890,8 @@
     pool->freeAll();
     VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetDisplayModePropertiesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetDisplayModePropertiesKHR_VkResult_return;
 }
 
@@ -10979,42 +11937,49 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_765 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_765);
-        uint64_t cgen_var_766 = (uint64_t)local_display;
-        countingStream->putBe64(cgen_var_766);
+        uint64_t cgen_var_879;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_879, 1);
+        countingStream->write((uint64_t*)&cgen_var_879, 8);
+        uint64_t cgen_var_880;
+        countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_880, 1);
+        countingStream->write((uint64_t*)&cgen_var_880, 8);
         marshal_VkDisplayModeCreateInfoKHR(countingStream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_767 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_767);
+        uint64_t cgen_var_881 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_881);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR));
+        uint64_t cgen_var_882;
+        countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_882, 1);
+        countingStream->write((uint64_t*)&cgen_var_882, 8);
     }
     uint32_t packetSize_vkCreateDisplayModeKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateDisplayModeKHR = OP_vkCreateDisplayModeKHR;
     stream->write(&opcode_vkCreateDisplayModeKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateDisplayModeKHR, sizeof(uint32_t));
-    uint64_t cgen_var_768 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_768);
-    uint64_t cgen_var_769 = (uint64_t)local_display;
-    stream->putBe64(cgen_var_769);
+    uint64_t cgen_var_883;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_883, 1);
+    stream->write((uint64_t*)&cgen_var_883, 8);
+    uint64_t cgen_var_884;
+    stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_884, 1);
+    stream->write((uint64_t*)&cgen_var_884, 8);
     marshal_VkDisplayModeCreateInfoKHR(stream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_770 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_770);
+    uint64_t cgen_var_885 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_885);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR));
+    uint64_t cgen_var_886;
+    stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_886, 1);
+    stream->write((uint64_t*)&cgen_var_886, 8);
+    uint64_t cgen_var_887;
+    stream->read((uint64_t*)&cgen_var_887, 8);
+    stream->handleMapping()->mapHandles_u64_VkDisplayModeKHR(&cgen_var_887, (VkDisplayModeKHR*)pMode, 1);
     if (pMode)
     {
         resources->createMapping()->mapHandles_VkDisplayModeKHR((VkDisplayModeKHR*)pMode, 1);
@@ -11022,6 +11987,8 @@
     pool->freeAll();
     VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateDisplayModeKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateDisplayModeKHR_VkResult_return;
 }
 
@@ -11045,10 +12012,12 @@
     local_planeIndex = planeIndex;
     countingStream->rewind();
     {
-        uint64_t cgen_var_771 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_771);
-        uint64_t cgen_var_772 = (uint64_t)local_mode;
-        countingStream->putBe64(cgen_var_772);
+        uint64_t cgen_var_888;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_888, 1);
+        countingStream->write((uint64_t*)&cgen_var_888, 8);
+        uint64_t cgen_var_889;
+        countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_889, 1);
+        countingStream->write((uint64_t*)&cgen_var_889, 8);
         countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
         marshal_VkDisplayPlaneCapabilitiesKHR(countingStream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
     }
@@ -11057,16 +12026,20 @@
     uint32_t opcode_vkGetDisplayPlaneCapabilitiesKHR = OP_vkGetDisplayPlaneCapabilitiesKHR;
     stream->write(&opcode_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_773 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_773);
-    uint64_t cgen_var_774 = (uint64_t)local_mode;
-    stream->putBe64(cgen_var_774);
+    uint64_t cgen_var_890;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_890, 1);
+    stream->write((uint64_t*)&cgen_var_890, 8);
+    uint64_t cgen_var_891;
+    stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_891, 1);
+    stream->write((uint64_t*)&cgen_var_891, 8);
     stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
     marshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
     unmarshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
     pool->freeAll();
     VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetDisplayPlaneCapabilitiesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return;
 }
 
@@ -11108,41 +12081,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_775 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_775);
+        uint64_t cgen_var_892;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_892, 1);
+        countingStream->write((uint64_t*)&cgen_var_892, 8);
         marshal_VkDisplaySurfaceCreateInfoKHR(countingStream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_776 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_776);
+        uint64_t cgen_var_893 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_893);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+        uint64_t cgen_var_894;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_894, 1);
+        countingStream->write((uint64_t*)&cgen_var_894, 8);
     }
     uint32_t packetSize_vkCreateDisplayPlaneSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateDisplayPlaneSurfaceKHR = OP_vkCreateDisplayPlaneSurfaceKHR;
     stream->write(&opcode_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t));
-    uint64_t cgen_var_777 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_777);
+    uint64_t cgen_var_895;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_895, 1);
+    stream->write((uint64_t*)&cgen_var_895, 8);
     marshal_VkDisplaySurfaceCreateInfoKHR(stream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_778 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_778);
+    uint64_t cgen_var_896 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_896);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+    uint64_t cgen_var_897;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_897, 1);
+    stream->write((uint64_t*)&cgen_var_897, 8);
+    uint64_t cgen_var_898;
+    stream->read((uint64_t*)&cgen_var_898, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_898, (VkSurfaceKHR*)pSurface, 1);
     pool->freeAll();
     VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateDisplayPlaneSurfaceKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateDisplayPlaneSurfaceKHR_VkResult_return;
 }
 
@@ -11195,49 +12175,68 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_779 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_779);
+        uint64_t cgen_var_899;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_899, 1);
+        countingStream->write((uint64_t*)&cgen_var_899, 8);
         countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
         {
             marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_780 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_780);
+        uint64_t cgen_var_900 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_900);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
+        if (((swapchainCount)))
+        {
+            uint64_t* cgen_var_901;
+            countingStream->alloc((void**)&cgen_var_901, ((swapchainCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_901, ((swapchainCount)));
+            countingStream->write((uint64_t*)cgen_var_901, 8);
+        }
     }
     uint32_t packetSize_vkCreateSharedSwapchainsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateSharedSwapchainsKHR = OP_vkCreateSharedSwapchainsKHR;
     stream->write(&opcode_vkCreateSharedSwapchainsKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateSharedSwapchainsKHR, sizeof(uint32_t));
-    uint64_t cgen_var_781 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_781);
+    uint64_t cgen_var_902;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_902, 1);
+    stream->write((uint64_t*)&cgen_var_902, 8);
     stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
     {
         marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_782 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_782);
+    uint64_t cgen_var_903 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_903);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
+    if (((swapchainCount)))
+    {
+        uint64_t* cgen_var_904;
+        stream->alloc((void**)&cgen_var_904, ((swapchainCount)) * 8);
+        stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_904, ((swapchainCount)));
+        stream->write((uint64_t*)cgen_var_904, 8);
+    }
+    if (((swapchainCount)))
+    {
+        uint64_t* cgen_var_905;
+        stream->alloc((void**)&cgen_var_905, ((swapchainCount)) * 8);
+        stream->read((uint64_t*)cgen_var_905, 8);
+        stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(cgen_var_905, (VkSwapchainKHR*)pSwapchains, ((swapchainCount)));
+    }
     pool->freeAll();
     VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateSharedSwapchainsKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateSharedSwapchainsKHR_VkResult_return;
 }
 
@@ -11281,41 +12280,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_783 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_783);
+        uint64_t cgen_var_906;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_906, 1);
+        countingStream->write((uint64_t*)&cgen_var_906, 8);
         marshal_VkXlibSurfaceCreateInfoKHR(countingStream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_784 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_784);
+        uint64_t cgen_var_907 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_907);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+        uint64_t cgen_var_908;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_908, 1);
+        countingStream->write((uint64_t*)&cgen_var_908, 8);
     }
     uint32_t packetSize_vkCreateXlibSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateXlibSurfaceKHR = OP_vkCreateXlibSurfaceKHR;
     stream->write(&opcode_vkCreateXlibSurfaceKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateXlibSurfaceKHR, sizeof(uint32_t));
-    uint64_t cgen_var_785 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_785);
+    uint64_t cgen_var_909;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_909, 1);
+    stream->write((uint64_t*)&cgen_var_909, 8);
     marshal_VkXlibSurfaceCreateInfoKHR(stream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_786 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_786);
+    uint64_t cgen_var_910 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_910);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+    uint64_t cgen_var_911;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_911, 1);
+    stream->write((uint64_t*)&cgen_var_911, 8);
+    uint64_t cgen_var_912;
+    stream->read((uint64_t*)&cgen_var_912, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_912, (VkSurfaceKHR*)pSurface, 1);
     pool->freeAll();
     VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateXlibSurfaceKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateXlibSurfaceKHR_VkResult_return;
 }
 
@@ -11338,8 +12344,9 @@
     local_visualID = visualID;
     countingStream->rewind();
     {
-        uint64_t cgen_var_787 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_787);
+        uint64_t cgen_var_913;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_913, 1);
+        countingStream->write((uint64_t*)&cgen_var_913, 8);
         countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
         countingStream->write((Display*)dpy, sizeof(Display));
         countingStream->write((VisualID*)&local_visualID, sizeof(VisualID));
@@ -11349,8 +12356,9 @@
     uint32_t opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR = OP_vkGetPhysicalDeviceXlibPresentationSupportKHR;
     stream->write(&opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t));
-    uint64_t cgen_var_788 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_788);
+    uint64_t cgen_var_914;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_914, 1);
+    stream->write((uint64_t*)&cgen_var_914, 8);
     stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
     stream->write((Display*)dpy, sizeof(Display));
     stream->write((VisualID*)&local_visualID, sizeof(VisualID));
@@ -11358,6 +12366,8 @@
     pool->freeAll();
     VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0;
     stream->read(&vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return;
 }
 
@@ -11401,41 +12411,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_789 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_789);
+        uint64_t cgen_var_915;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_915, 1);
+        countingStream->write((uint64_t*)&cgen_var_915, 8);
         marshal_VkXcbSurfaceCreateInfoKHR(countingStream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_790 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_790);
+        uint64_t cgen_var_916 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_916);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+        uint64_t cgen_var_917;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_917, 1);
+        countingStream->write((uint64_t*)&cgen_var_917, 8);
     }
     uint32_t packetSize_vkCreateXcbSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateXcbSurfaceKHR = OP_vkCreateXcbSurfaceKHR;
     stream->write(&opcode_vkCreateXcbSurfaceKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateXcbSurfaceKHR, sizeof(uint32_t));
-    uint64_t cgen_var_791 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_791);
+    uint64_t cgen_var_918;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_918, 1);
+    stream->write((uint64_t*)&cgen_var_918, 8);
     marshal_VkXcbSurfaceCreateInfoKHR(stream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_792 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_792);
+    uint64_t cgen_var_919 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_919);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+    uint64_t cgen_var_920;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_920, 1);
+    stream->write((uint64_t*)&cgen_var_920, 8);
+    uint64_t cgen_var_921;
+    stream->read((uint64_t*)&cgen_var_921, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_921, (VkSurfaceKHR*)pSurface, 1);
     pool->freeAll();
     VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateXcbSurfaceKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateXcbSurfaceKHR_VkResult_return;
 }
 
@@ -11458,8 +12475,9 @@
     local_visual_id = visual_id;
     countingStream->rewind();
     {
-        uint64_t cgen_var_793 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_793);
+        uint64_t cgen_var_922;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_922, 1);
+        countingStream->write((uint64_t*)&cgen_var_922, 8);
         countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
         countingStream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t));
         countingStream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t));
@@ -11469,8 +12487,9 @@
     uint32_t opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR = OP_vkGetPhysicalDeviceXcbPresentationSupportKHR;
     stream->write(&opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t));
-    uint64_t cgen_var_794 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_794);
+    uint64_t cgen_var_923;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_923, 1);
+    stream->write((uint64_t*)&cgen_var_923, 8);
     stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
     stream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t));
     stream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t));
@@ -11478,6 +12497,8 @@
     pool->freeAll();
     VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0;
     stream->read(&vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return;
 }
 
@@ -11521,41 +12542,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_795 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_795);
+        uint64_t cgen_var_924;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_924, 1);
+        countingStream->write((uint64_t*)&cgen_var_924, 8);
         marshal_VkWaylandSurfaceCreateInfoKHR(countingStream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_796 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_796);
+        uint64_t cgen_var_925 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_925);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+        uint64_t cgen_var_926;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_926, 1);
+        countingStream->write((uint64_t*)&cgen_var_926, 8);
     }
     uint32_t packetSize_vkCreateWaylandSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateWaylandSurfaceKHR = OP_vkCreateWaylandSurfaceKHR;
     stream->write(&opcode_vkCreateWaylandSurfaceKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateWaylandSurfaceKHR, sizeof(uint32_t));
-    uint64_t cgen_var_797 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_797);
+    uint64_t cgen_var_927;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_927, 1);
+    stream->write((uint64_t*)&cgen_var_927, 8);
     marshal_VkWaylandSurfaceCreateInfoKHR(stream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_798 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_798);
+    uint64_t cgen_var_928 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_928);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+    uint64_t cgen_var_929;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_929, 1);
+    stream->write((uint64_t*)&cgen_var_929, 8);
+    uint64_t cgen_var_930;
+    stream->read((uint64_t*)&cgen_var_930, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_930, (VkSurfaceKHR*)pSurface, 1);
     pool->freeAll();
     VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateWaylandSurfaceKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateWaylandSurfaceKHR_VkResult_return;
 }
 
@@ -11575,8 +12603,9 @@
     local_queueFamilyIndex = queueFamilyIndex;
     countingStream->rewind();
     {
-        uint64_t cgen_var_799 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_799);
+        uint64_t cgen_var_931;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_931, 1);
+        countingStream->write((uint64_t*)&cgen_var_931, 8);
         countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
         countingStream->write((wl_display*)display, sizeof(wl_display));
     }
@@ -11585,14 +12614,17 @@
     uint32_t opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR = OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR;
     stream->write(&opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t));
-    uint64_t cgen_var_800 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_800);
+    uint64_t cgen_var_932;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_932, 1);
+    stream->write((uint64_t*)&cgen_var_932, 8);
     stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
     stream->write((wl_display*)display, sizeof(wl_display));
     stream->read((wl_display*)display, sizeof(wl_display));
     pool->freeAll();
     VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0;
     stream->read(&vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return;
 }
 
@@ -11636,41 +12668,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_801 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_801);
+        uint64_t cgen_var_933;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_933, 1);
+        countingStream->write((uint64_t*)&cgen_var_933, 8);
         marshal_VkMirSurfaceCreateInfoKHR(countingStream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_802 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_802);
+        uint64_t cgen_var_934 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_934);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+        uint64_t cgen_var_935;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_935, 1);
+        countingStream->write((uint64_t*)&cgen_var_935, 8);
     }
     uint32_t packetSize_vkCreateMirSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateMirSurfaceKHR = OP_vkCreateMirSurfaceKHR;
     stream->write(&opcode_vkCreateMirSurfaceKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateMirSurfaceKHR, sizeof(uint32_t));
-    uint64_t cgen_var_803 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_803);
+    uint64_t cgen_var_936;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_936, 1);
+    stream->write((uint64_t*)&cgen_var_936, 8);
     marshal_VkMirSurfaceCreateInfoKHR(stream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_804 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_804);
+    uint64_t cgen_var_937 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_937);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+    uint64_t cgen_var_938;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_938, 1);
+    stream->write((uint64_t*)&cgen_var_938, 8);
+    uint64_t cgen_var_939;
+    stream->read((uint64_t*)&cgen_var_939, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_939, (VkSurfaceKHR*)pSurface, 1);
     pool->freeAll();
     VkResult vkCreateMirSurfaceKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateMirSurfaceKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateMirSurfaceKHR_VkResult_return;
 }
 
@@ -11690,8 +12729,9 @@
     local_queueFamilyIndex = queueFamilyIndex;
     countingStream->rewind();
     {
-        uint64_t cgen_var_805 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_805);
+        uint64_t cgen_var_940;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_940, 1);
+        countingStream->write((uint64_t*)&cgen_var_940, 8);
         countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
         countingStream->write((MirConnection*)connection, sizeof(MirConnection));
     }
@@ -11700,14 +12740,17 @@
     uint32_t opcode_vkGetPhysicalDeviceMirPresentationSupportKHR = OP_vkGetPhysicalDeviceMirPresentationSupportKHR;
     stream->write(&opcode_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t));
-    uint64_t cgen_var_806 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_806);
+    uint64_t cgen_var_941;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_941, 1);
+    stream->write((uint64_t*)&cgen_var_941, 8);
     stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
     stream->write((MirConnection*)connection, sizeof(MirConnection));
     stream->read((MirConnection*)connection, sizeof(MirConnection));
     pool->freeAll();
     VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return = (VkBool32)0;
     stream->read(&vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return;
 }
 
@@ -11751,41 +12794,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_807 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_807);
+        uint64_t cgen_var_942;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_942, 1);
+        countingStream->write((uint64_t*)&cgen_var_942, 8);
         marshal_VkAndroidSurfaceCreateInfoKHR(countingStream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_808 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_808);
+        uint64_t cgen_var_943 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_943);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+        uint64_t cgen_var_944;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_944, 1);
+        countingStream->write((uint64_t*)&cgen_var_944, 8);
     }
     uint32_t packetSize_vkCreateAndroidSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateAndroidSurfaceKHR = OP_vkCreateAndroidSurfaceKHR;
     stream->write(&opcode_vkCreateAndroidSurfaceKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateAndroidSurfaceKHR, sizeof(uint32_t));
-    uint64_t cgen_var_809 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_809);
+    uint64_t cgen_var_945;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_945, 1);
+    stream->write((uint64_t*)&cgen_var_945, 8);
     marshal_VkAndroidSurfaceCreateInfoKHR(stream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_810 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_810);
+    uint64_t cgen_var_946 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_946);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+    uint64_t cgen_var_947;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_947, 1);
+    stream->write((uint64_t*)&cgen_var_947, 8);
+    uint64_t cgen_var_948;
+    stream->read((uint64_t*)&cgen_var_948, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_948, (VkSurfaceKHR*)pSurface, 1);
     pool->freeAll();
     VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateAndroidSurfaceKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateAndroidSurfaceKHR_VkResult_return;
 }
 
@@ -11829,41 +12879,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_811 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_811);
+        uint64_t cgen_var_949;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_949, 1);
+        countingStream->write((uint64_t*)&cgen_var_949, 8);
         marshal_VkWin32SurfaceCreateInfoKHR(countingStream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_812 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_812);
+        uint64_t cgen_var_950 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_950);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+        uint64_t cgen_var_951;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_951, 1);
+        countingStream->write((uint64_t*)&cgen_var_951, 8);
     }
     uint32_t packetSize_vkCreateWin32SurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateWin32SurfaceKHR = OP_vkCreateWin32SurfaceKHR;
     stream->write(&opcode_vkCreateWin32SurfaceKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateWin32SurfaceKHR, sizeof(uint32_t));
-    uint64_t cgen_var_813 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_813);
+    uint64_t cgen_var_952;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_952, 1);
+    stream->write((uint64_t*)&cgen_var_952, 8);
     marshal_VkWin32SurfaceCreateInfoKHR(stream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_814 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_814);
+    uint64_t cgen_var_953 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_953);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+    uint64_t cgen_var_954;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_954, 1);
+    stream->write((uint64_t*)&cgen_var_954, 8);
+    uint64_t cgen_var_955;
+    stream->read((uint64_t*)&cgen_var_955, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_955, (VkSurfaceKHR*)pSurface, 1);
     pool->freeAll();
     VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateWin32SurfaceKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateWin32SurfaceKHR_VkResult_return;
 }
 
@@ -11882,8 +12939,9 @@
     local_queueFamilyIndex = queueFamilyIndex;
     countingStream->rewind();
     {
-        uint64_t cgen_var_815 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_815);
+        uint64_t cgen_var_956;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_956, 1);
+        countingStream->write((uint64_t*)&cgen_var_956, 8);
         countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
     }
     uint32_t packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -11891,12 +12949,15 @@
     uint32_t opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR = OP_vkGetPhysicalDeviceWin32PresentationSupportKHR;
     stream->write(&opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t));
-    uint64_t cgen_var_816 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_816);
+    uint64_t cgen_var_957;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_957, 1);
+    stream->write((uint64_t*)&cgen_var_957, 8);
     stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
     pool->freeAll();
     VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0;
     stream->read(&vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return;
 }
 
@@ -11919,8 +12980,9 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_817 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_817);
+        uint64_t cgen_var_958;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_958, 1);
+        countingStream->write((uint64_t*)&cgen_var_958, 8);
         marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures));
     }
     uint32_t packetSize_vkGetPhysicalDeviceFeatures2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -11928,8 +12990,9 @@
     uint32_t opcode_vkGetPhysicalDeviceFeatures2KHR = OP_vkGetPhysicalDeviceFeatures2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_818 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_818);
+    uint64_t cgen_var_959;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_959, 1);
+    stream->write((uint64_t*)&cgen_var_959, 8);
     marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
     unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
     pool->freeAll();
@@ -11948,8 +13011,9 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_819 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_819);
+        uint64_t cgen_var_960;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_960, 1);
+        countingStream->write((uint64_t*)&cgen_var_960, 8);
         marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties));
     }
     uint32_t packetSize_vkGetPhysicalDeviceProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -11957,8 +13021,9 @@
     uint32_t opcode_vkGetPhysicalDeviceProperties2KHR = OP_vkGetPhysicalDeviceProperties2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_820 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_820);
+    uint64_t cgen_var_961;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_961, 1);
+    stream->write((uint64_t*)&cgen_var_961, 8);
     marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties));
     unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties));
     pool->freeAll();
@@ -11980,8 +13045,9 @@
     local_format = format;
     countingStream->rewind();
     {
-        uint64_t cgen_var_821 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_821);
+        uint64_t cgen_var_962;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_962, 1);
+        countingStream->write((uint64_t*)&cgen_var_962, 8);
         countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
         marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties));
     }
@@ -11990,8 +13056,9 @@
     uint32_t opcode_vkGetPhysicalDeviceFormatProperties2KHR = OP_vkGetPhysicalDeviceFormatProperties2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_822 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_822);
+    uint64_t cgen_var_963;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_963, 1);
+    stream->write((uint64_t*)&cgen_var_963, 8);
     stream->write((VkFormat*)&local_format, sizeof(VkFormat));
     marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
     unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
@@ -12023,8 +13090,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_823 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_823);
+        uint64_t cgen_var_964;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_964, 1);
+        countingStream->write((uint64_t*)&cgen_var_964, 8);
         marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
         marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties));
     }
@@ -12033,14 +13101,17 @@
     uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2KHR = OP_vkGetPhysicalDeviceImageFormatProperties2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_824 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_824);
+    uint64_t cgen_var_965;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_965, 1);
+    stream->write((uint64_t*)&cgen_var_965, 8);
     marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
     marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
     unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
     pool->freeAll();
     VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return;
 }
 
@@ -12058,18 +13129,19 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_825 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_825);
+        uint64_t cgen_var_966;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_966, 1);
+        countingStream->write((uint64_t*)&cgen_var_966, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_826 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
-        countingStream->putBe64(cgen_var_826);
+        uint64_t cgen_var_967 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
+        countingStream->putBe64(cgen_var_967);
         if (pQueueFamilyPropertyCount)
         {
             countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_827 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
-        countingStream->putBe64(cgen_var_827);
+        uint64_t cgen_var_968 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
+        countingStream->putBe64(cgen_var_968);
         if (pQueueFamilyProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
@@ -12083,18 +13155,19 @@
     uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR = OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_828 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_828);
+    uint64_t cgen_var_969;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_969, 1);
+    stream->write((uint64_t*)&cgen_var_969, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_829 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
-    stream->putBe64(cgen_var_829);
+    uint64_t cgen_var_970 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
+    stream->putBe64(cgen_var_970);
     if (pQueueFamilyPropertyCount)
     {
         stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_830 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
-    stream->putBe64(cgen_var_830);
+    uint64_t cgen_var_971 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
+    stream->putBe64(cgen_var_971);
     if (pQueueFamilyProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
@@ -12143,8 +13216,9 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_833 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_833);
+        uint64_t cgen_var_974;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_974, 1);
+        countingStream->write((uint64_t*)&cgen_var_974, 8);
         marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
     }
     uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -12152,8 +13226,9 @@
     uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2KHR = OP_vkGetPhysicalDeviceMemoryProperties2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_834 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_834);
+    uint64_t cgen_var_975;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_975, 1);
+    stream->write((uint64_t*)&cgen_var_975, 8);
     marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
     unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
     pool->freeAll();
@@ -12185,19 +13260,20 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_835 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_835);
+        uint64_t cgen_var_976;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_976, 1);
+        countingStream->write((uint64_t*)&cgen_var_976, 8);
         marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_836 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_836);
+        uint64_t cgen_var_977 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_977);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_837 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_837);
+        uint64_t cgen_var_978 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_978);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -12211,19 +13287,20 @@
     uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_838 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_838);
+    uint64_t cgen_var_979;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_979, 1);
+    stream->write((uint64_t*)&cgen_var_979, 8);
     marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_839 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_839);
+    uint64_t cgen_var_980 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_980);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_840 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_840);
+    uint64_t cgen_var_981 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_981);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -12283,8 +13360,9 @@
     local_remoteDeviceIndex = remoteDeviceIndex;
     countingStream->rewind();
     {
-        uint64_t cgen_var_843 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_843);
+        uint64_t cgen_var_984;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_984, 1);
+        countingStream->write((uint64_t*)&cgen_var_984, 8);
         countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
@@ -12295,8 +13373,9 @@
     uint32_t opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR = OP_vkGetDeviceGroupPeerMemoryFeaturesKHR;
     stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_844 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_844);
+    uint64_t cgen_var_985;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_985, 1);
+    stream->write((uint64_t*)&cgen_var_985, 8);
     stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
     stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
     stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
@@ -12320,8 +13399,9 @@
     local_deviceMask = deviceMask;
     countingStream->rewind();
     {
-        uint64_t cgen_var_845 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_845);
+        uint64_t cgen_var_986;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_986, 1);
+        countingStream->write((uint64_t*)&cgen_var_986, 8);
         countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
     }
     uint32_t packetSize_vkCmdSetDeviceMaskKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -12329,8 +13409,9 @@
     uint32_t opcode_vkCmdSetDeviceMaskKHR = OP_vkCmdSetDeviceMaskKHR;
     stream->write(&opcode_vkCmdSetDeviceMaskKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetDeviceMaskKHR, sizeof(uint32_t));
-    uint64_t cgen_var_846 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_846);
+    uint64_t cgen_var_987;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_987, 1);
+    stream->write((uint64_t*)&cgen_var_987, 8);
     stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
     pool->freeAll();
 }
@@ -12365,8 +13446,9 @@
     local_groupCountZ = groupCountZ;
     countingStream->rewind();
     {
-        uint64_t cgen_var_847 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_847);
+        uint64_t cgen_var_988;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_988, 1);
+        countingStream->write((uint64_t*)&cgen_var_988, 8);
         countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
@@ -12379,8 +13461,9 @@
     uint32_t opcode_vkCmdDispatchBaseKHR = OP_vkCmdDispatchBaseKHR;
     stream->write(&opcode_vkCmdDispatchBaseKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDispatchBaseKHR, sizeof(uint32_t));
-    uint64_t cgen_var_848 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_848);
+    uint64_t cgen_var_989;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_989, 1);
+    stream->write((uint64_t*)&cgen_var_989, 8);
     stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
     stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
     stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
@@ -12413,10 +13496,12 @@
     local_flags = flags;
     countingStream->rewind();
     {
-        uint64_t cgen_var_849 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_849);
-        uint64_t cgen_var_850 = (uint64_t)local_commandPool;
-        countingStream->putBe64(cgen_var_850);
+        uint64_t cgen_var_990;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_990, 1);
+        countingStream->write((uint64_t*)&cgen_var_990, 8);
+        uint64_t cgen_var_991;
+        countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_991, 1);
+        countingStream->write((uint64_t*)&cgen_var_991, 8);
         countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
     }
     uint32_t packetSize_vkTrimCommandPoolKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -12424,10 +13509,12 @@
     uint32_t opcode_vkTrimCommandPoolKHR = OP_vkTrimCommandPoolKHR;
     stream->write(&opcode_vkTrimCommandPoolKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkTrimCommandPoolKHR, sizeof(uint32_t));
-    uint64_t cgen_var_851 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_851);
-    uint64_t cgen_var_852 = (uint64_t)local_commandPool;
-    stream->putBe64(cgen_var_852);
+    uint64_t cgen_var_992;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_992, 1);
+    stream->write((uint64_t*)&cgen_var_992, 8);
+    uint64_t cgen_var_993;
+    stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_993, 1);
+    stream->write((uint64_t*)&cgen_var_993, 8);
     stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
     pool->freeAll();
 }
@@ -12448,18 +13535,19 @@
     resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
     countingStream->rewind();
     {
-        uint64_t cgen_var_853 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_853);
+        uint64_t cgen_var_994;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_994, 1);
+        countingStream->write((uint64_t*)&cgen_var_994, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_854 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
-        countingStream->putBe64(cgen_var_854);
+        uint64_t cgen_var_995 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
+        countingStream->putBe64(cgen_var_995);
         if (pPhysicalDeviceGroupCount)
         {
             countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_855 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
-        countingStream->putBe64(cgen_var_855);
+        uint64_t cgen_var_996 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
+        countingStream->putBe64(cgen_var_996);
         if (pPhysicalDeviceGroupProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
@@ -12473,18 +13561,19 @@
     uint32_t opcode_vkEnumeratePhysicalDeviceGroupsKHR = OP_vkEnumeratePhysicalDeviceGroupsKHR;
     stream->write(&opcode_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t));
-    uint64_t cgen_var_856 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_856);
+    uint64_t cgen_var_997;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_997, 1);
+    stream->write((uint64_t*)&cgen_var_997, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_857 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
-    stream->putBe64(cgen_var_857);
+    uint64_t cgen_var_998 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
+    stream->putBe64(cgen_var_998);
     if (pPhysicalDeviceGroupCount)
     {
         stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_858 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
-    stream->putBe64(cgen_var_858);
+    uint64_t cgen_var_999 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
+    stream->putBe64(cgen_var_999);
     if (pPhysicalDeviceGroupProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
@@ -12520,6 +13609,8 @@
     pool->freeAll();
     VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0;
     stream->read(&vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return;
 }
 
@@ -12550,8 +13641,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_861 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_861);
+        uint64_t cgen_var_1002;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1002, 1);
+        countingStream->write((uint64_t*)&cgen_var_1002, 8);
         marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
         marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties));
     }
@@ -12560,8 +13652,9 @@
     uint32_t opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR = OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR;
     stream->write(&opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_862 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_862);
+    uint64_t cgen_var_1003;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1003, 1);
+    stream->write((uint64_t*)&cgen_var_1003, 8);
     marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
     marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
     unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
@@ -12597,8 +13690,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_863 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_863);
+        uint64_t cgen_var_1004;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1004, 1);
+        countingStream->write((uint64_t*)&cgen_var_1004, 8);
         marshal_VkMemoryGetWin32HandleInfoKHR(countingStream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
         countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
     }
@@ -12607,14 +13701,17 @@
     uint32_t opcode_vkGetMemoryWin32HandleKHR = OP_vkGetMemoryWin32HandleKHR;
     stream->write(&opcode_vkGetMemoryWin32HandleKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetMemoryWin32HandleKHR, sizeof(uint32_t));
-    uint64_t cgen_var_864 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_864);
+    uint64_t cgen_var_1005;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1005, 1);
+    stream->write((uint64_t*)&cgen_var_1005, 8);
     marshal_VkMemoryGetWin32HandleInfoKHR(stream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
     stream->write((HANDLE*)pHandle, sizeof(HANDLE));
     stream->read((HANDLE*)pHandle, sizeof(HANDLE));
     pool->freeAll();
     VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetMemoryWin32HandleKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetMemoryWin32HandleKHR_VkResult_return;
 }
 
@@ -12637,8 +13734,9 @@
     local_handle = handle;
     countingStream->rewind();
     {
-        uint64_t cgen_var_865 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_865);
+        uint64_t cgen_var_1006;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1006, 1);
+        countingStream->write((uint64_t*)&cgen_var_1006, 8);
         countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
         countingStream->write((HANDLE*)&local_handle, sizeof(HANDLE));
         marshal_VkMemoryWin32HandlePropertiesKHR(countingStream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties));
@@ -12648,8 +13746,9 @@
     uint32_t opcode_vkGetMemoryWin32HandlePropertiesKHR = OP_vkGetMemoryWin32HandlePropertiesKHR;
     stream->write(&opcode_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_866 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_866);
+    uint64_t cgen_var_1007;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1007, 1);
+    stream->write((uint64_t*)&cgen_var_1007, 8);
     stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
     stream->write((HANDLE*)&local_handle, sizeof(HANDLE));
     marshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties));
@@ -12657,6 +13756,8 @@
     pool->freeAll();
     VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetMemoryWin32HandlePropertiesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return;
 }
 
@@ -12687,8 +13788,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_867 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_867);
+        uint64_t cgen_var_1008;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1008, 1);
+        countingStream->write((uint64_t*)&cgen_var_1008, 8);
         marshal_VkMemoryGetFdInfoKHR(countingStream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
         countingStream->write((int*)pFd, sizeof(int));
     }
@@ -12697,14 +13799,17 @@
     uint32_t opcode_vkGetMemoryFdKHR = OP_vkGetMemoryFdKHR;
     stream->write(&opcode_vkGetMemoryFdKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetMemoryFdKHR, sizeof(uint32_t));
-    uint64_t cgen_var_868 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_868);
+    uint64_t cgen_var_1009;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1009, 1);
+    stream->write((uint64_t*)&cgen_var_1009, 8);
     marshal_VkMemoryGetFdInfoKHR(stream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
     stream->write((int*)pFd, sizeof(int));
     stream->read((int*)pFd, sizeof(int));
     pool->freeAll();
     VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetMemoryFdKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetMemoryFdKHR_VkResult_return;
 }
 
@@ -12727,8 +13832,9 @@
     local_fd = fd;
     countingStream->rewind();
     {
-        uint64_t cgen_var_869 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_869);
+        uint64_t cgen_var_1010;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1010, 1);
+        countingStream->write((uint64_t*)&cgen_var_1010, 8);
         countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
         countingStream->write((int*)&local_fd, sizeof(int));
         marshal_VkMemoryFdPropertiesKHR(countingStream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties));
@@ -12738,8 +13844,9 @@
     uint32_t opcode_vkGetMemoryFdPropertiesKHR = OP_vkGetMemoryFdPropertiesKHR;
     stream->write(&opcode_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_870 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_870);
+    uint64_t cgen_var_1011;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1011, 1);
+    stream->write((uint64_t*)&cgen_var_1011, 8);
     stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
     stream->write((int*)&local_fd, sizeof(int));
     marshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties));
@@ -12747,6 +13854,8 @@
     pool->freeAll();
     VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetMemoryFdPropertiesKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetMemoryFdPropertiesKHR_VkResult_return;
 }
 
@@ -12779,8 +13888,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_871 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_871);
+        uint64_t cgen_var_1012;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1012, 1);
+        countingStream->write((uint64_t*)&cgen_var_1012, 8);
         marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
         marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
     }
@@ -12789,8 +13899,9 @@
     uint32_t opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR;
     stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_872 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_872);
+    uint64_t cgen_var_1013;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1013, 1);
+    stream->write((uint64_t*)&cgen_var_1013, 8);
     marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
     marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
     unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
@@ -12825,8 +13936,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_873 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_873);
+        uint64_t cgen_var_1014;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1014, 1);
+        countingStream->write((uint64_t*)&cgen_var_1014, 8);
         marshal_VkImportSemaphoreWin32HandleInfoKHR(countingStream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
     }
     uint32_t packetSize_vkImportSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -12834,12 +13946,15 @@
     uint32_t opcode_vkImportSemaphoreWin32HandleKHR = OP_vkImportSemaphoreWin32HandleKHR;
     stream->write(&opcode_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t));
-    uint64_t cgen_var_874 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_874);
+    uint64_t cgen_var_1015;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1015, 1);
+    stream->write((uint64_t*)&cgen_var_1015, 8);
     marshal_VkImportSemaphoreWin32HandleInfoKHR(stream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
     pool->freeAll();
     VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
     stream->read(&vkImportSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkImportSemaphoreWin32HandleKHR_VkResult_return;
 }
 
@@ -12868,8 +13983,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_875 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_875);
+        uint64_t cgen_var_1016;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1016, 1);
+        countingStream->write((uint64_t*)&cgen_var_1016, 8);
         marshal_VkSemaphoreGetWin32HandleInfoKHR(countingStream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
         countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
     }
@@ -12878,14 +13994,17 @@
     uint32_t opcode_vkGetSemaphoreWin32HandleKHR = OP_vkGetSemaphoreWin32HandleKHR;
     stream->write(&opcode_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t));
-    uint64_t cgen_var_876 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_876);
+    uint64_t cgen_var_1017;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1017, 1);
+    stream->write((uint64_t*)&cgen_var_1017, 8);
     marshal_VkSemaphoreGetWin32HandleInfoKHR(stream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
     stream->write((HANDLE*)pHandle, sizeof(HANDLE));
     stream->read((HANDLE*)pHandle, sizeof(HANDLE));
     pool->freeAll();
     VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetSemaphoreWin32HandleKHR_VkResult_return;
 }
 
@@ -12915,8 +14034,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_877 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_877);
+        uint64_t cgen_var_1018;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1018, 1);
+        countingStream->write((uint64_t*)&cgen_var_1018, 8);
         marshal_VkImportSemaphoreFdInfoKHR(countingStream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
     }
     uint32_t packetSize_vkImportSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -12924,12 +14044,15 @@
     uint32_t opcode_vkImportSemaphoreFdKHR = OP_vkImportSemaphoreFdKHR;
     stream->write(&opcode_vkImportSemaphoreFdKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkImportSemaphoreFdKHR, sizeof(uint32_t));
-    uint64_t cgen_var_878 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_878);
+    uint64_t cgen_var_1019;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1019, 1);
+    stream->write((uint64_t*)&cgen_var_1019, 8);
     marshal_VkImportSemaphoreFdInfoKHR(stream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
     pool->freeAll();
     VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0;
     stream->read(&vkImportSemaphoreFdKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkImportSemaphoreFdKHR_VkResult_return;
 }
 
@@ -12958,8 +14081,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_879 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_879);
+        uint64_t cgen_var_1020;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1020, 1);
+        countingStream->write((uint64_t*)&cgen_var_1020, 8);
         marshal_VkSemaphoreGetFdInfoKHR(countingStream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
         countingStream->write((int*)pFd, sizeof(int));
     }
@@ -12968,14 +14092,17 @@
     uint32_t opcode_vkGetSemaphoreFdKHR = OP_vkGetSemaphoreFdKHR;
     stream->write(&opcode_vkGetSemaphoreFdKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetSemaphoreFdKHR, sizeof(uint32_t));
-    uint64_t cgen_var_880 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_880);
+    uint64_t cgen_var_1021;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1021, 1);
+    stream->write((uint64_t*)&cgen_var_1021, 8);
     marshal_VkSemaphoreGetFdInfoKHR(stream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
     stream->write((int*)pFd, sizeof(int));
     stream->read((int*)pFd, sizeof(int));
     pool->freeAll();
     VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetSemaphoreFdKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetSemaphoreFdKHR_VkResult_return;
 }
 
@@ -13024,11 +14151,13 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_881 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_881);
+        uint64_t cgen_var_1022;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1022, 1);
+        countingStream->write((uint64_t*)&cgen_var_1022, 8);
         countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
-        uint64_t cgen_var_882 = (uint64_t)local_layout;
-        countingStream->putBe64(cgen_var_882);
+        uint64_t cgen_var_1023;
+        countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1023, 1);
+        countingStream->write((uint64_t*)&cgen_var_1023, 8);
         countingStream->write((uint32_t*)&local_set, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
@@ -13041,11 +14170,13 @@
     uint32_t opcode_vkCmdPushDescriptorSetKHR = OP_vkCmdPushDescriptorSetKHR;
     stream->write(&opcode_vkCmdPushDescriptorSetKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdPushDescriptorSetKHR, sizeof(uint32_t));
-    uint64_t cgen_var_883 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_883);
+    uint64_t cgen_var_1024;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1024, 1);
+    stream->write((uint64_t*)&cgen_var_1024, 8);
     stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
-    uint64_t cgen_var_884 = (uint64_t)local_layout;
-    stream->putBe64(cgen_var_884);
+    uint64_t cgen_var_1025;
+    stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1025, 1);
+    stream->write((uint64_t*)&cgen_var_1025, 8);
     stream->write((uint32_t*)&local_set, sizeof(uint32_t));
     stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
@@ -13085,16 +14216,19 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_885 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_885);
-        uint64_t cgen_var_886 = (uint64_t)local_descriptorUpdateTemplate;
-        countingStream->putBe64(cgen_var_886);
-        uint64_t cgen_var_887 = (uint64_t)local_layout;
-        countingStream->putBe64(cgen_var_887);
+        uint64_t cgen_var_1026;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1026, 1);
+        countingStream->write((uint64_t*)&cgen_var_1026, 8);
+        uint64_t cgen_var_1027;
+        countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1027, 1);
+        countingStream->write((uint64_t*)&cgen_var_1027, 8);
+        uint64_t cgen_var_1028;
+        countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1028, 1);
+        countingStream->write((uint64_t*)&cgen_var_1028, 8);
         countingStream->write((uint32_t*)&local_set, sizeof(uint32_t));
         // WARNING PTR CHECK
-        uint64_t cgen_var_888 = (uint64_t)(uintptr_t)local_pData;
-        countingStream->putBe64(cgen_var_888);
+        uint64_t cgen_var_1029 = (uint64_t)(uintptr_t)local_pData;
+        countingStream->putBe64(cgen_var_1029);
         if (local_pData)
         {
             countingStream->write((void*)local_pData, sizeof(uint8_t));
@@ -13105,16 +14239,19 @@
     uint32_t opcode_vkCmdPushDescriptorSetWithTemplateKHR = OP_vkCmdPushDescriptorSetWithTemplateKHR;
     stream->write(&opcode_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t));
-    uint64_t cgen_var_889 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_889);
-    uint64_t cgen_var_890 = (uint64_t)local_descriptorUpdateTemplate;
-    stream->putBe64(cgen_var_890);
-    uint64_t cgen_var_891 = (uint64_t)local_layout;
-    stream->putBe64(cgen_var_891);
+    uint64_t cgen_var_1030;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1030, 1);
+    stream->write((uint64_t*)&cgen_var_1030, 8);
+    uint64_t cgen_var_1031;
+    stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1031, 1);
+    stream->write((uint64_t*)&cgen_var_1031, 8);
+    uint64_t cgen_var_1032;
+    stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1032, 1);
+    stream->write((uint64_t*)&cgen_var_1032, 8);
     stream->write((uint32_t*)&local_set, sizeof(uint32_t));
     // WARNING PTR CHECK
-    uint64_t cgen_var_892 = (uint64_t)(uintptr_t)local_pData;
-    stream->putBe64(cgen_var_892);
+    uint64_t cgen_var_1033 = (uint64_t)(uintptr_t)local_pData;
+    stream->putBe64(cgen_var_1033);
     if (local_pData)
     {
         stream->write((void*)local_pData, sizeof(uint8_t));
@@ -13166,41 +14303,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_893 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_893);
+        uint64_t cgen_var_1034;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1034, 1);
+        countingStream->write((uint64_t*)&cgen_var_1034, 8);
         marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_894 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_894);
+        uint64_t cgen_var_1035 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1035);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
+        uint64_t cgen_var_1036;
+        countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1036, 1);
+        countingStream->write((uint64_t*)&cgen_var_1036, 8);
     }
     uint32_t packetSize_vkCreateDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateDescriptorUpdateTemplateKHR = OP_vkCreateDescriptorUpdateTemplateKHR;
     stream->write(&opcode_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t));
-    uint64_t cgen_var_895 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_895);
+    uint64_t cgen_var_1037;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1037, 1);
+    stream->write((uint64_t*)&cgen_var_1037, 8);
     marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_896 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_896);
+    uint64_t cgen_var_1038 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1038);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
+    uint64_t cgen_var_1039;
+    stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1039, 1);
+    stream->write((uint64_t*)&cgen_var_1039, 8);
+    uint64_t cgen_var_1040;
+    stream->read((uint64_t*)&cgen_var_1040, 8);
+    stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_1040, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1);
     pool->freeAll();
     VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateDescriptorUpdateTemplateKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateDescriptorUpdateTemplateKHR_VkResult_return;
 }
 
@@ -13233,13 +14377,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_897 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_897);
-        uint64_t cgen_var_898 = (uint64_t)local_descriptorUpdateTemplate;
-        countingStream->putBe64(cgen_var_898);
+        uint64_t cgen_var_1041;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1041, 1);
+        countingStream->write((uint64_t*)&cgen_var_1041, 8);
+        uint64_t cgen_var_1042;
+        countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1042, 1);
+        countingStream->write((uint64_t*)&cgen_var_1042, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_899 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_899);
+        uint64_t cgen_var_1043 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1043);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -13250,13 +14396,15 @@
     uint32_t opcode_vkDestroyDescriptorUpdateTemplateKHR = OP_vkDestroyDescriptorUpdateTemplateKHR;
     stream->write(&opcode_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t));
-    uint64_t cgen_var_900 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_900);
-    uint64_t cgen_var_901 = (uint64_t)local_descriptorUpdateTemplate;
-    stream->putBe64(cgen_var_901);
+    uint64_t cgen_var_1044;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1044, 1);
+    stream->write((uint64_t*)&cgen_var_1044, 8);
+    uint64_t cgen_var_1045;
+    stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1045, 1);
+    stream->write((uint64_t*)&cgen_var_1045, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_902 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_902);
+    uint64_t cgen_var_1046 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1046);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -13291,15 +14439,18 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_903 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_903);
-        uint64_t cgen_var_904 = (uint64_t)local_descriptorSet;
-        countingStream->putBe64(cgen_var_904);
-        uint64_t cgen_var_905 = (uint64_t)local_descriptorUpdateTemplate;
-        countingStream->putBe64(cgen_var_905);
+        uint64_t cgen_var_1047;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1047, 1);
+        countingStream->write((uint64_t*)&cgen_var_1047, 8);
+        uint64_t cgen_var_1048;
+        countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1048, 1);
+        countingStream->write((uint64_t*)&cgen_var_1048, 8);
+        uint64_t cgen_var_1049;
+        countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1049, 1);
+        countingStream->write((uint64_t*)&cgen_var_1049, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_906 = (uint64_t)(uintptr_t)local_pData;
-        countingStream->putBe64(cgen_var_906);
+        uint64_t cgen_var_1050 = (uint64_t)(uintptr_t)local_pData;
+        countingStream->putBe64(cgen_var_1050);
         if (local_pData)
         {
             countingStream->write((void*)local_pData, sizeof(uint8_t));
@@ -13310,15 +14461,18 @@
     uint32_t opcode_vkUpdateDescriptorSetWithTemplateKHR = OP_vkUpdateDescriptorSetWithTemplateKHR;
     stream->write(&opcode_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t));
-    uint64_t cgen_var_907 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_907);
-    uint64_t cgen_var_908 = (uint64_t)local_descriptorSet;
-    stream->putBe64(cgen_var_908);
-    uint64_t cgen_var_909 = (uint64_t)local_descriptorUpdateTemplate;
-    stream->putBe64(cgen_var_909);
+    uint64_t cgen_var_1051;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1051, 1);
+    stream->write((uint64_t*)&cgen_var_1051, 8);
+    uint64_t cgen_var_1052;
+    stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1052, 1);
+    stream->write((uint64_t*)&cgen_var_1052, 8);
+    uint64_t cgen_var_1053;
+    stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1053, 1);
+    stream->write((uint64_t*)&cgen_var_1053, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_910 = (uint64_t)(uintptr_t)local_pData;
-    stream->putBe64(cgen_var_910);
+    uint64_t cgen_var_1054 = (uint64_t)(uintptr_t)local_pData;
+    stream->putBe64(cgen_var_1054);
     if (local_pData)
     {
         stream->write((void*)local_pData, sizeof(uint8_t));
@@ -13366,41 +14520,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_911 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_911);
+        uint64_t cgen_var_1055;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1055, 1);
+        countingStream->write((uint64_t*)&cgen_var_1055, 8);
         marshal_VkRenderPassCreateInfo2KHR(countingStream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_912 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_912);
+        uint64_t cgen_var_1056 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1056);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
+        uint64_t cgen_var_1057;
+        countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1057, 1);
+        countingStream->write((uint64_t*)&cgen_var_1057, 8);
     }
     uint32_t packetSize_vkCreateRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateRenderPass2KHR = OP_vkCreateRenderPass2KHR;
     stream->write(&opcode_vkCreateRenderPass2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateRenderPass2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_913 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_913);
+    uint64_t cgen_var_1058;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1058, 1);
+    stream->write((uint64_t*)&cgen_var_1058, 8);
     marshal_VkRenderPassCreateInfo2KHR(stream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_914 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_914);
+    uint64_t cgen_var_1059 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1059);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
+    uint64_t cgen_var_1060;
+    stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1060, 1);
+    stream->write((uint64_t*)&cgen_var_1060, 8);
+    uint64_t cgen_var_1061;
+    stream->read((uint64_t*)&cgen_var_1061, 8);
+    stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_1061, (VkRenderPass*)pRenderPass, 1);
     pool->freeAll();
     VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateRenderPass2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateRenderPass2KHR_VkResult_return;
 }
 
@@ -13440,8 +14601,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_915 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_915);
+        uint64_t cgen_var_1062;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1062, 1);
+        countingStream->write((uint64_t*)&cgen_var_1062, 8);
         marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
         marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
     }
@@ -13450,8 +14612,9 @@
     uint32_t opcode_vkCmdBeginRenderPass2KHR = OP_vkCmdBeginRenderPass2KHR;
     stream->write(&opcode_vkCmdBeginRenderPass2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdBeginRenderPass2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_916 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_916);
+    uint64_t cgen_var_1063;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1063, 1);
+    stream->write((uint64_t*)&cgen_var_1063, 8);
     marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
     marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
     pool->freeAll();
@@ -13493,8 +14656,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_917 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_917);
+        uint64_t cgen_var_1064;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1064, 1);
+        countingStream->write((uint64_t*)&cgen_var_1064, 8);
         marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
         marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
     }
@@ -13503,8 +14667,9 @@
     uint32_t opcode_vkCmdNextSubpass2KHR = OP_vkCmdNextSubpass2KHR;
     stream->write(&opcode_vkCmdNextSubpass2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdNextSubpass2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_918 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_918);
+    uint64_t cgen_var_1065;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1065, 1);
+    stream->write((uint64_t*)&cgen_var_1065, 8);
     marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
     marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
     pool->freeAll();
@@ -13534,8 +14699,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_919 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_919);
+        uint64_t cgen_var_1066;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1066, 1);
+        countingStream->write((uint64_t*)&cgen_var_1066, 8);
         marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
     }
     uint32_t packetSize_vkCmdEndRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -13543,8 +14709,9 @@
     uint32_t opcode_vkCmdEndRenderPass2KHR = OP_vkCmdEndRenderPass2KHR;
     stream->write(&opcode_vkCmdEndRenderPass2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdEndRenderPass2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_920 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_920);
+    uint64_t cgen_var_1067;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1067, 1);
+    stream->write((uint64_t*)&cgen_var_1067, 8);
     marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
     pool->freeAll();
 }
@@ -13567,23 +14734,29 @@
     resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
     countingStream->rewind();
     {
-        uint64_t cgen_var_921 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_921);
-        uint64_t cgen_var_922 = (uint64_t)local_swapchain;
-        countingStream->putBe64(cgen_var_922);
+        uint64_t cgen_var_1068;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1068, 1);
+        countingStream->write((uint64_t*)&cgen_var_1068, 8);
+        uint64_t cgen_var_1069;
+        countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1069, 1);
+        countingStream->write((uint64_t*)&cgen_var_1069, 8);
     }
     uint32_t packetSize_vkGetSwapchainStatusKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkGetSwapchainStatusKHR = OP_vkGetSwapchainStatusKHR;
     stream->write(&opcode_vkGetSwapchainStatusKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetSwapchainStatusKHR, sizeof(uint32_t));
-    uint64_t cgen_var_923 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_923);
-    uint64_t cgen_var_924 = (uint64_t)local_swapchain;
-    stream->putBe64(cgen_var_924);
+    uint64_t cgen_var_1070;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1070, 1);
+    stream->write((uint64_t*)&cgen_var_1070, 8);
+    uint64_t cgen_var_1071;
+    stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1071, 1);
+    stream->write((uint64_t*)&cgen_var_1071, 8);
     pool->freeAll();
     VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetSwapchainStatusKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetSwapchainStatusKHR_VkResult_return;
 }
 
@@ -13614,8 +14787,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_925 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_925);
+        uint64_t cgen_var_1072;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1072, 1);
+        countingStream->write((uint64_t*)&cgen_var_1072, 8);
         marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
         marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties));
     }
@@ -13624,8 +14798,9 @@
     uint32_t opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR = OP_vkGetPhysicalDeviceExternalFencePropertiesKHR;
     stream->write(&opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t));
-    uint64_t cgen_var_926 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_926);
+    uint64_t cgen_var_1073;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1073, 1);
+    stream->write((uint64_t*)&cgen_var_1073, 8);
     marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
     marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
     unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
@@ -13660,8 +14835,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_927 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_927);
+        uint64_t cgen_var_1074;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1074, 1);
+        countingStream->write((uint64_t*)&cgen_var_1074, 8);
         marshal_VkImportFenceWin32HandleInfoKHR(countingStream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
     }
     uint32_t packetSize_vkImportFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -13669,12 +14845,15 @@
     uint32_t opcode_vkImportFenceWin32HandleKHR = OP_vkImportFenceWin32HandleKHR;
     stream->write(&opcode_vkImportFenceWin32HandleKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkImportFenceWin32HandleKHR, sizeof(uint32_t));
-    uint64_t cgen_var_928 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_928);
+    uint64_t cgen_var_1075;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1075, 1);
+    stream->write((uint64_t*)&cgen_var_1075, 8);
     marshal_VkImportFenceWin32HandleInfoKHR(stream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
     pool->freeAll();
     VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0;
     stream->read(&vkImportFenceWin32HandleKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkImportFenceWin32HandleKHR_VkResult_return;
 }
 
@@ -13703,8 +14882,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_929 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_929);
+        uint64_t cgen_var_1076;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1076, 1);
+        countingStream->write((uint64_t*)&cgen_var_1076, 8);
         marshal_VkFenceGetWin32HandleInfoKHR(countingStream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
         countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
     }
@@ -13713,14 +14893,17 @@
     uint32_t opcode_vkGetFenceWin32HandleKHR = OP_vkGetFenceWin32HandleKHR;
     stream->write(&opcode_vkGetFenceWin32HandleKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetFenceWin32HandleKHR, sizeof(uint32_t));
-    uint64_t cgen_var_930 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_930);
+    uint64_t cgen_var_1077;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1077, 1);
+    stream->write((uint64_t*)&cgen_var_1077, 8);
     marshal_VkFenceGetWin32HandleInfoKHR(stream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
     stream->write((HANDLE*)pHandle, sizeof(HANDLE));
     stream->read((HANDLE*)pHandle, sizeof(HANDLE));
     pool->freeAll();
     VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetFenceWin32HandleKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetFenceWin32HandleKHR_VkResult_return;
 }
 
@@ -13750,8 +14933,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_931 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_931);
+        uint64_t cgen_var_1078;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1078, 1);
+        countingStream->write((uint64_t*)&cgen_var_1078, 8);
         marshal_VkImportFenceFdInfoKHR(countingStream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
     }
     uint32_t packetSize_vkImportFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -13759,12 +14943,15 @@
     uint32_t opcode_vkImportFenceFdKHR = OP_vkImportFenceFdKHR;
     stream->write(&opcode_vkImportFenceFdKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkImportFenceFdKHR, sizeof(uint32_t));
-    uint64_t cgen_var_932 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_932);
+    uint64_t cgen_var_1079;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1079, 1);
+    stream->write((uint64_t*)&cgen_var_1079, 8);
     marshal_VkImportFenceFdInfoKHR(stream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
     pool->freeAll();
     VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0;
     stream->read(&vkImportFenceFdKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkImportFenceFdKHR_VkResult_return;
 }
 
@@ -13793,8 +14980,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_933 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_933);
+        uint64_t cgen_var_1080;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1080, 1);
+        countingStream->write((uint64_t*)&cgen_var_1080, 8);
         marshal_VkFenceGetFdInfoKHR(countingStream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
         countingStream->write((int*)pFd, sizeof(int));
     }
@@ -13803,14 +14991,17 @@
     uint32_t opcode_vkGetFenceFdKHR = OP_vkGetFenceFdKHR;
     stream->write(&opcode_vkGetFenceFdKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetFenceFdKHR, sizeof(uint32_t));
-    uint64_t cgen_var_934 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_934);
+    uint64_t cgen_var_1081;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1081, 1);
+    stream->write((uint64_t*)&cgen_var_1081, 8);
     marshal_VkFenceGetFdInfoKHR(stream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
     stream->write((int*)pFd, sizeof(int));
     stream->read((int*)pFd, sizeof(int));
     pool->freeAll();
     VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetFenceFdKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetFenceFdKHR_VkResult_return;
 }
 
@@ -13843,8 +15034,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_935 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_935);
+        uint64_t cgen_var_1082;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1082, 1);
+        countingStream->write((uint64_t*)&cgen_var_1082, 8);
         marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
         marshal_VkSurfaceCapabilities2KHR(countingStream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
     }
@@ -13853,14 +15045,17 @@
     uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR = OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_936 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_936);
+    uint64_t cgen_var_1083;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1083, 1);
+    stream->write((uint64_t*)&cgen_var_1083, 8);
     marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
     marshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
     unmarshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
     pool->freeAll();
     VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return;
 }
 
@@ -13890,19 +15085,20 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_937 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_937);
+        uint64_t cgen_var_1084;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1084, 1);
+        countingStream->write((uint64_t*)&cgen_var_1084, 8);
         marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_938 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
-        countingStream->putBe64(cgen_var_938);
+        uint64_t cgen_var_1085 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
+        countingStream->putBe64(cgen_var_1085);
         if (pSurfaceFormatCount)
         {
             countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_939 = (uint64_t)(uintptr_t)pSurfaceFormats;
-        countingStream->putBe64(cgen_var_939);
+        uint64_t cgen_var_1086 = (uint64_t)(uintptr_t)pSurfaceFormats;
+        countingStream->putBe64(cgen_var_1086);
         if (pSurfaceFormats)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
@@ -13916,19 +15112,20 @@
     uint32_t opcode_vkGetPhysicalDeviceSurfaceFormats2KHR = OP_vkGetPhysicalDeviceSurfaceFormats2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_940 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_940);
+    uint64_t cgen_var_1087;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1087, 1);
+    stream->write((uint64_t*)&cgen_var_1087, 8);
     marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_941 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
-    stream->putBe64(cgen_var_941);
+    uint64_t cgen_var_1088 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
+    stream->putBe64(cgen_var_1088);
     if (pSurfaceFormatCount)
     {
         stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_942 = (uint64_t)(uintptr_t)pSurfaceFormats;
-    stream->putBe64(cgen_var_942);
+    uint64_t cgen_var_1089 = (uint64_t)(uintptr_t)pSurfaceFormats;
+    stream->putBe64(cgen_var_1089);
     if (pSurfaceFormats)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
@@ -13964,6 +15161,8 @@
     pool->freeAll();
     VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return;
 }
 
@@ -13985,18 +15184,19 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_945 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_945);
+        uint64_t cgen_var_1092;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1092, 1);
+        countingStream->write((uint64_t*)&cgen_var_1092, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_946 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_946);
+        uint64_t cgen_var_1093 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_1093);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_947 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_947);
+        uint64_t cgen_var_1094 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_1094);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -14010,18 +15210,19 @@
     uint32_t opcode_vkGetPhysicalDeviceDisplayProperties2KHR = OP_vkGetPhysicalDeviceDisplayProperties2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_948 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_948);
+    uint64_t cgen_var_1095;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1095, 1);
+    stream->write((uint64_t*)&cgen_var_1095, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_949 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_949);
+    uint64_t cgen_var_1096 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_1096);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_950 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_950);
+    uint64_t cgen_var_1097 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_1097);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -14057,6 +15258,8 @@
     pool->freeAll();
     VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return;
 }
 
@@ -14074,18 +15277,19 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_953 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_953);
+        uint64_t cgen_var_1100;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1100, 1);
+        countingStream->write((uint64_t*)&cgen_var_1100, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_954 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_954);
+        uint64_t cgen_var_1101 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_1101);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_955 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_955);
+        uint64_t cgen_var_1102 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_1102);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -14099,18 +15303,19 @@
     uint32_t opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR;
     stream->write(&opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_956 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_956);
+    uint64_t cgen_var_1103;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1103, 1);
+    stream->write((uint64_t*)&cgen_var_1103, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_957 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_957);
+    uint64_t cgen_var_1104 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_1104);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_958 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_958);
+    uint64_t cgen_var_1105 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_1105);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -14146,6 +15351,8 @@
     pool->freeAll();
     VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return;
 }
 
@@ -14167,20 +15374,22 @@
     resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
     countingStream->rewind();
     {
-        uint64_t cgen_var_961 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_961);
-        uint64_t cgen_var_962 = (uint64_t)local_display;
-        countingStream->putBe64(cgen_var_962);
+        uint64_t cgen_var_1108;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1108, 1);
+        countingStream->write((uint64_t*)&cgen_var_1108, 8);
+        uint64_t cgen_var_1109;
+        countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1109, 1);
+        countingStream->write((uint64_t*)&cgen_var_1109, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_963 = (uint64_t)(uintptr_t)pPropertyCount;
-        countingStream->putBe64(cgen_var_963);
+        uint64_t cgen_var_1110 = (uint64_t)(uintptr_t)pPropertyCount;
+        countingStream->putBe64(cgen_var_1110);
         if (pPropertyCount)
         {
             countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_964 = (uint64_t)(uintptr_t)pProperties;
-        countingStream->putBe64(cgen_var_964);
+        uint64_t cgen_var_1111 = (uint64_t)(uintptr_t)pProperties;
+        countingStream->putBe64(cgen_var_1111);
         if (pProperties)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -14194,20 +15403,22 @@
     uint32_t opcode_vkGetDisplayModeProperties2KHR = OP_vkGetDisplayModeProperties2KHR;
     stream->write(&opcode_vkGetDisplayModeProperties2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDisplayModeProperties2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_965 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_965);
-    uint64_t cgen_var_966 = (uint64_t)local_display;
-    stream->putBe64(cgen_var_966);
+    uint64_t cgen_var_1112;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1112, 1);
+    stream->write((uint64_t*)&cgen_var_1112, 8);
+    uint64_t cgen_var_1113;
+    stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1113, 1);
+    stream->write((uint64_t*)&cgen_var_1113, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_967 = (uint64_t)(uintptr_t)pPropertyCount;
-    stream->putBe64(cgen_var_967);
+    uint64_t cgen_var_1114 = (uint64_t)(uintptr_t)pPropertyCount;
+    stream->putBe64(cgen_var_1114);
     if (pPropertyCount)
     {
         stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_968 = (uint64_t)(uintptr_t)pProperties;
-    stream->putBe64(cgen_var_968);
+    uint64_t cgen_var_1115 = (uint64_t)(uintptr_t)pProperties;
+    stream->putBe64(cgen_var_1115);
     if (pProperties)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
@@ -14243,6 +15454,8 @@
     pool->freeAll();
     VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetDisplayModeProperties2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetDisplayModeProperties2KHR_VkResult_return;
 }
 
@@ -14271,8 +15484,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_971 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_971);
+        uint64_t cgen_var_1118;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1118, 1);
+        countingStream->write((uint64_t*)&cgen_var_1118, 8);
         marshal_VkDisplayPlaneInfo2KHR(countingStream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
         marshal_VkDisplayPlaneCapabilities2KHR(countingStream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
     }
@@ -14281,14 +15495,17 @@
     uint32_t opcode_vkGetDisplayPlaneCapabilities2KHR = OP_vkGetDisplayPlaneCapabilities2KHR;
     stream->write(&opcode_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_972 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_972);
+    uint64_t cgen_var_1119;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1119, 1);
+    stream->write((uint64_t*)&cgen_var_1119, 8);
     marshal_VkDisplayPlaneInfo2KHR(stream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
     marshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
     unmarshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
     pool->freeAll();
     VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkGetDisplayPlaneCapabilities2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetDisplayPlaneCapabilities2KHR_VkResult_return;
 }
 
@@ -14325,8 +15542,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_973 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_973);
+        uint64_t cgen_var_1120;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1120, 1);
+        countingStream->write((uint64_t*)&cgen_var_1120, 8);
         marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
         marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
     }
@@ -14335,8 +15553,9 @@
     uint32_t opcode_vkGetImageMemoryRequirements2KHR = OP_vkGetImageMemoryRequirements2KHR;
     stream->write(&opcode_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_974 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_974);
+    uint64_t cgen_var_1121;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1121, 1);
+    stream->write((uint64_t*)&cgen_var_1121, 8);
     marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
     marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
     unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
@@ -14368,8 +15587,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_975 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_975);
+        uint64_t cgen_var_1122;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1122, 1);
+        countingStream->write((uint64_t*)&cgen_var_1122, 8);
         marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
         marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
     }
@@ -14378,8 +15598,9 @@
     uint32_t opcode_vkGetBufferMemoryRequirements2KHR = OP_vkGetBufferMemoryRequirements2KHR;
     stream->write(&opcode_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_976 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_976);
+    uint64_t cgen_var_1123;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1123, 1);
+    stream->write((uint64_t*)&cgen_var_1123, 8);
     marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
     marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
     unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
@@ -14412,19 +15633,20 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_977 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_977);
+        uint64_t cgen_var_1124;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1124, 1);
+        countingStream->write((uint64_t*)&cgen_var_1124, 8);
         marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_978 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
-        countingStream->putBe64(cgen_var_978);
+        uint64_t cgen_var_1125 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
+        countingStream->putBe64(cgen_var_1125);
         if (pSparseMemoryRequirementCount)
         {
             countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_979 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
-        countingStream->putBe64(cgen_var_979);
+        uint64_t cgen_var_1126 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
+        countingStream->putBe64(cgen_var_1126);
         if (pSparseMemoryRequirements)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
@@ -14438,19 +15660,20 @@
     uint32_t opcode_vkGetImageSparseMemoryRequirements2KHR = OP_vkGetImageSparseMemoryRequirements2KHR;
     stream->write(&opcode_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_980 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_980);
+    uint64_t cgen_var_1127;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1127, 1);
+    stream->write((uint64_t*)&cgen_var_1127, 8);
     marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_981 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
-    stream->putBe64(cgen_var_981);
+    uint64_t cgen_var_1128 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
+    stream->putBe64(cgen_var_1128);
     if (pSparseMemoryRequirementCount)
     {
         stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_982 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
-    stream->putBe64(cgen_var_982);
+    uint64_t cgen_var_1129 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
+    stream->putBe64(cgen_var_1129);
     if (pSparseMemoryRequirements)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
@@ -14528,41 +15751,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_985 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_985);
+        uint64_t cgen_var_1132;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1132, 1);
+        countingStream->write((uint64_t*)&cgen_var_1132, 8);
         marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_986 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_986);
+        uint64_t cgen_var_1133 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1133);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
+        uint64_t cgen_var_1134;
+        countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1134, 1);
+        countingStream->write((uint64_t*)&cgen_var_1134, 8);
     }
     uint32_t packetSize_vkCreateSamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateSamplerYcbcrConversionKHR = OP_vkCreateSamplerYcbcrConversionKHR;
     stream->write(&opcode_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t));
-    uint64_t cgen_var_987 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_987);
+    uint64_t cgen_var_1135;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1135, 1);
+    stream->write((uint64_t*)&cgen_var_1135, 8);
     marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_988 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_988);
+    uint64_t cgen_var_1136 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1136);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
+    uint64_t cgen_var_1137;
+    stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1137, 1);
+    stream->write((uint64_t*)&cgen_var_1137, 8);
+    uint64_t cgen_var_1138;
+    stream->read((uint64_t*)&cgen_var_1138, 8);
+    stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_1138, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1);
     pool->freeAll();
     VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0;
     stream->read(&vkCreateSamplerYcbcrConversionKHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateSamplerYcbcrConversionKHR_VkResult_return;
 }
 
@@ -14595,13 +15825,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_989 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_989);
-        uint64_t cgen_var_990 = (uint64_t)local_ycbcrConversion;
-        countingStream->putBe64(cgen_var_990);
+        uint64_t cgen_var_1139;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1139, 1);
+        countingStream->write((uint64_t*)&cgen_var_1139, 8);
+        uint64_t cgen_var_1140;
+        countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1140, 1);
+        countingStream->write((uint64_t*)&cgen_var_1140, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_991 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_991);
+        uint64_t cgen_var_1141 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1141);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -14612,13 +15844,15 @@
     uint32_t opcode_vkDestroySamplerYcbcrConversionKHR = OP_vkDestroySamplerYcbcrConversionKHR;
     stream->write(&opcode_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t));
-    uint64_t cgen_var_992 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_992);
-    uint64_t cgen_var_993 = (uint64_t)local_ycbcrConversion;
-    stream->putBe64(cgen_var_993);
+    uint64_t cgen_var_1142;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1142, 1);
+    stream->write((uint64_t*)&cgen_var_1142, 8);
+    uint64_t cgen_var_1143;
+    stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1143, 1);
+    stream->write((uint64_t*)&cgen_var_1143, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_994 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_994);
+    uint64_t cgen_var_1144 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1144);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -14661,8 +15895,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_995 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_995);
+        uint64_t cgen_var_1145;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1145, 1);
+        countingStream->write((uint64_t*)&cgen_var_1145, 8);
         countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
         {
@@ -14674,8 +15909,9 @@
     uint32_t opcode_vkBindBufferMemory2KHR = OP_vkBindBufferMemory2KHR;
     stream->write(&opcode_vkBindBufferMemory2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkBindBufferMemory2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_996 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_996);
+    uint64_t cgen_var_1146;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1146, 1);
+    stream->write((uint64_t*)&cgen_var_1146, 8);
     stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
     {
@@ -14684,6 +15920,8 @@
     pool->freeAll();
     VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkBindBufferMemory2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkBindBufferMemory2KHR_VkResult_return;
 }
 
@@ -14720,8 +15958,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_997 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_997);
+        uint64_t cgen_var_1147;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1147, 1);
+        countingStream->write((uint64_t*)&cgen_var_1147, 8);
         countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
         {
@@ -14733,8 +15972,9 @@
     uint32_t opcode_vkBindImageMemory2KHR = OP_vkBindImageMemory2KHR;
     stream->write(&opcode_vkBindImageMemory2KHR, sizeof(uint32_t));
     stream->write(&packetSize_vkBindImageMemory2KHR, sizeof(uint32_t));
-    uint64_t cgen_var_998 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_998);
+    uint64_t cgen_var_1148;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1148, 1);
+    stream->write((uint64_t*)&cgen_var_1148, 8);
     stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
     {
@@ -14743,6 +15983,8 @@
     pool->freeAll();
     VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0;
     stream->read(&vkBindImageMemory2KHR_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkBindImageMemory2KHR_VkResult_return;
 }
 
@@ -14773,8 +16015,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_999 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_999);
+        uint64_t cgen_var_1149;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1149, 1);
+        countingStream->write((uint64_t*)&cgen_var_1149, 8);
         marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
         marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport));
     }
@@ -14783,8 +16026,9 @@
     uint32_t opcode_vkGetDescriptorSetLayoutSupportKHR = OP_vkGetDescriptorSetLayoutSupportKHR;
     stream->write(&opcode_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t));
-    uint64_t cgen_var_1000 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1000);
+    uint64_t cgen_var_1150;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1150, 1);
+    stream->write((uint64_t*)&cgen_var_1150, 8);
     marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
     marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
     unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
@@ -14825,13 +16069,16 @@
     local_stride = stride;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1001 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1001);
-        uint64_t cgen_var_1002 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_1002);
+        uint64_t cgen_var_1151;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1151, 1);
+        countingStream->write((uint64_t*)&cgen_var_1151, 8);
+        uint64_t cgen_var_1152;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1152, 1);
+        countingStream->write((uint64_t*)&cgen_var_1152, 8);
         countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
-        uint64_t cgen_var_1003 = (uint64_t)local_countBuffer;
-        countingStream->putBe64(cgen_var_1003);
+        uint64_t cgen_var_1153;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1153, 1);
+        countingStream->write((uint64_t*)&cgen_var_1153, 8);
         countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
         countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -14841,13 +16088,16 @@
     uint32_t opcode_vkCmdDrawIndirectCountKHR = OP_vkCmdDrawIndirectCountKHR;
     stream->write(&opcode_vkCmdDrawIndirectCountKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDrawIndirectCountKHR, sizeof(uint32_t));
-    uint64_t cgen_var_1004 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1004);
-    uint64_t cgen_var_1005 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_1005);
+    uint64_t cgen_var_1154;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1154, 1);
+    stream->write((uint64_t*)&cgen_var_1154, 8);
+    uint64_t cgen_var_1155;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1155, 1);
+    stream->write((uint64_t*)&cgen_var_1155, 8);
     stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
-    uint64_t cgen_var_1006 = (uint64_t)local_countBuffer;
-    stream->putBe64(cgen_var_1006);
+    uint64_t cgen_var_1156;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1156, 1);
+    stream->write((uint64_t*)&cgen_var_1156, 8);
     stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
     stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
     stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -14886,13 +16136,16 @@
     local_stride = stride;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1007 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1007);
-        uint64_t cgen_var_1008 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_1008);
+        uint64_t cgen_var_1157;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1157, 1);
+        countingStream->write((uint64_t*)&cgen_var_1157, 8);
+        uint64_t cgen_var_1158;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1158, 1);
+        countingStream->write((uint64_t*)&cgen_var_1158, 8);
         countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
-        uint64_t cgen_var_1009 = (uint64_t)local_countBuffer;
-        countingStream->putBe64(cgen_var_1009);
+        uint64_t cgen_var_1159;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1159, 1);
+        countingStream->write((uint64_t*)&cgen_var_1159, 8);
         countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
         countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -14902,13 +16155,16 @@
     uint32_t opcode_vkCmdDrawIndexedIndirectCountKHR = OP_vkCmdDrawIndexedIndirectCountKHR;
     stream->write(&opcode_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t));
-    uint64_t cgen_var_1010 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1010);
-    uint64_t cgen_var_1011 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_1011);
+    uint64_t cgen_var_1160;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1160, 1);
+    stream->write((uint64_t*)&cgen_var_1160, 8);
+    uint64_t cgen_var_1161;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1161, 1);
+    stream->write((uint64_t*)&cgen_var_1161, 8);
     stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
-    uint64_t cgen_var_1012 = (uint64_t)local_countBuffer;
-    stream->putBe64(cgen_var_1012);
+    uint64_t cgen_var_1162;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1162, 1);
+    stream->write((uint64_t*)&cgen_var_1162, 8);
     stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
     stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
     stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -14957,38 +16213,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1013 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_1013);
+        uint64_t cgen_var_1163;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1163, 1);
+        countingStream->write((uint64_t*)&cgen_var_1163, 8);
         marshal_VkDebugReportCallbackCreateInfoEXT(countingStream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1014 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1014);
+        uint64_t cgen_var_1164 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1164);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT));
+        uint64_t cgen_var_1165;
+        countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1165, 1);
+        countingStream->write((uint64_t*)&cgen_var_1165, 8);
     }
     uint32_t packetSize_vkCreateDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateDebugReportCallbackEXT = OP_vkCreateDebugReportCallbackEXT;
     stream->write(&opcode_vkCreateDebugReportCallbackEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateDebugReportCallbackEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1015 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_1015);
+    uint64_t cgen_var_1166;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1166, 1);
+    stream->write((uint64_t*)&cgen_var_1166, 8);
     marshal_VkDebugReportCallbackCreateInfoEXT(stream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1016 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1016);
+    uint64_t cgen_var_1167 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1167);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT));
+    uint64_t cgen_var_1168;
+    stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1168, 1);
+    stream->write((uint64_t*)&cgen_var_1168, 8);
+    uint64_t cgen_var_1169;
+    stream->read((uint64_t*)&cgen_var_1169, 8);
+    stream->handleMapping()->mapHandles_u64_VkDebugReportCallbackEXT(&cgen_var_1169, (VkDebugReportCallbackEXT*)pCallback, 1);
     if (pCallback)
     {
         resources->createMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)pCallback, 1);
@@ -14996,6 +16257,8 @@
     pool->freeAll();
     VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0;
     stream->read(&vkCreateDebugReportCallbackEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateDebugReportCallbackEXT_VkResult_return;
 }
 
@@ -15028,13 +16291,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1017 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_1017);
-        uint64_t cgen_var_1018 = (uint64_t)local_callback;
-        countingStream->putBe64(cgen_var_1018);
+        uint64_t cgen_var_1170;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1170, 1);
+        countingStream->write((uint64_t*)&cgen_var_1170, 8);
+        uint64_t cgen_var_1171;
+        countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1171, 1);
+        countingStream->write((uint64_t*)&cgen_var_1171, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_1019 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1019);
+        uint64_t cgen_var_1172 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1172);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -15045,13 +16310,15 @@
     uint32_t opcode_vkDestroyDebugReportCallbackEXT = OP_vkDestroyDebugReportCallbackEXT;
     stream->write(&opcode_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1020 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_1020);
-    uint64_t cgen_var_1021 = (uint64_t)local_callback;
-    stream->putBe64(cgen_var_1021);
+    uint64_t cgen_var_1173;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1173, 1);
+    stream->write((uint64_t*)&cgen_var_1173, 8);
+    uint64_t cgen_var_1174;
+    stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1174, 1);
+    stream->write((uint64_t*)&cgen_var_1174, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_1022 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1022);
+    uint64_t cgen_var_1175 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1175);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -15101,8 +16368,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1023 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_1023);
+        uint64_t cgen_var_1176;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1176, 1);
+        countingStream->write((uint64_t*)&cgen_var_1176, 8);
         countingStream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT));
         countingStream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT));
         countingStream->write((uint64_t*)&local_object, sizeof(uint64_t));
@@ -15116,8 +16384,9 @@
     uint32_t opcode_vkDebugReportMessageEXT = OP_vkDebugReportMessageEXT;
     stream->write(&opcode_vkDebugReportMessageEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkDebugReportMessageEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1024 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_1024);
+    uint64_t cgen_var_1177;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1177, 1);
+    stream->write((uint64_t*)&cgen_var_1177, 8);
     stream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT));
     stream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT));
     stream->write((uint64_t*)&local_object, sizeof(uint64_t));
@@ -15166,8 +16435,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1025 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1025);
+        uint64_t cgen_var_1178;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1178, 1);
+        countingStream->write((uint64_t*)&cgen_var_1178, 8);
         marshal_VkDebugMarkerObjectTagInfoEXT(countingStream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
     }
     uint32_t packetSize_vkDebugMarkerSetObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -15175,12 +16445,15 @@
     uint32_t opcode_vkDebugMarkerSetObjectTagEXT = OP_vkDebugMarkerSetObjectTagEXT;
     stream->write(&opcode_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1026 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1026);
+    uint64_t cgen_var_1179;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1179, 1);
+    stream->write((uint64_t*)&cgen_var_1179, 8);
     marshal_VkDebugMarkerObjectTagInfoEXT(stream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
     pool->freeAll();
     VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0;
     stream->read(&vkDebugMarkerSetObjectTagEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkDebugMarkerSetObjectTagEXT_VkResult_return;
 }
 
@@ -15208,8 +16481,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1027 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1027);
+        uint64_t cgen_var_1180;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1180, 1);
+        countingStream->write((uint64_t*)&cgen_var_1180, 8);
         marshal_VkDebugMarkerObjectNameInfoEXT(countingStream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
     }
     uint32_t packetSize_vkDebugMarkerSetObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -15217,12 +16491,15 @@
     uint32_t opcode_vkDebugMarkerSetObjectNameEXT = OP_vkDebugMarkerSetObjectNameEXT;
     stream->write(&opcode_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1028 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1028);
+    uint64_t cgen_var_1181;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1181, 1);
+    stream->write((uint64_t*)&cgen_var_1181, 8);
     marshal_VkDebugMarkerObjectNameInfoEXT(stream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
     pool->freeAll();
     VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0;
     stream->read(&vkDebugMarkerSetObjectNameEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkDebugMarkerSetObjectNameEXT_VkResult_return;
 }
 
@@ -15250,8 +16527,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1029 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1029);
+        uint64_t cgen_var_1182;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1182, 1);
+        countingStream->write((uint64_t*)&cgen_var_1182, 8);
         marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
     }
     uint32_t packetSize_vkCmdDebugMarkerBeginEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -15259,8 +16537,9 @@
     uint32_t opcode_vkCmdDebugMarkerBeginEXT = OP_vkCmdDebugMarkerBeginEXT;
     stream->write(&opcode_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1030 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1030);
+    uint64_t cgen_var_1183;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1183, 1);
+    stream->write((uint64_t*)&cgen_var_1183, 8);
     marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
     pool->freeAll();
 }
@@ -15277,16 +16556,18 @@
     resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1031 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1031);
+        uint64_t cgen_var_1184;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1184, 1);
+        countingStream->write((uint64_t*)&cgen_var_1184, 8);
     }
     uint32_t packetSize_vkCmdDebugMarkerEndEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCmdDebugMarkerEndEXT = OP_vkCmdDebugMarkerEndEXT;
     stream->write(&opcode_vkCmdDebugMarkerEndEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDebugMarkerEndEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1032 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1032);
+    uint64_t cgen_var_1185;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1185, 1);
+    stream->write((uint64_t*)&cgen_var_1185, 8);
     pool->freeAll();
 }
 
@@ -15314,8 +16595,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1033 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1033);
+        uint64_t cgen_var_1186;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1186, 1);
+        countingStream->write((uint64_t*)&cgen_var_1186, 8);
         marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
     }
     uint32_t packetSize_vkCmdDebugMarkerInsertEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -15323,8 +16605,9 @@
     uint32_t opcode_vkCmdDebugMarkerInsertEXT = OP_vkCmdDebugMarkerInsertEXT;
     stream->write(&opcode_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1034 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1034);
+    uint64_t cgen_var_1187;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1187, 1);
+    stream->write((uint64_t*)&cgen_var_1187, 8);
     marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
     pool->freeAll();
 }
@@ -15367,13 +16650,16 @@
     local_stride = stride;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1035 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1035);
-        uint64_t cgen_var_1036 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_1036);
+        uint64_t cgen_var_1188;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1188, 1);
+        countingStream->write((uint64_t*)&cgen_var_1188, 8);
+        uint64_t cgen_var_1189;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1189, 1);
+        countingStream->write((uint64_t*)&cgen_var_1189, 8);
         countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
-        uint64_t cgen_var_1037 = (uint64_t)local_countBuffer;
-        countingStream->putBe64(cgen_var_1037);
+        uint64_t cgen_var_1190;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1190, 1);
+        countingStream->write((uint64_t*)&cgen_var_1190, 8);
         countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
         countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -15383,13 +16669,16 @@
     uint32_t opcode_vkCmdDrawIndirectCountAMD = OP_vkCmdDrawIndirectCountAMD;
     stream->write(&opcode_vkCmdDrawIndirectCountAMD, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDrawIndirectCountAMD, sizeof(uint32_t));
-    uint64_t cgen_var_1038 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1038);
-    uint64_t cgen_var_1039 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_1039);
+    uint64_t cgen_var_1191;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1191, 1);
+    stream->write((uint64_t*)&cgen_var_1191, 8);
+    uint64_t cgen_var_1192;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1192, 1);
+    stream->write((uint64_t*)&cgen_var_1192, 8);
     stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
-    uint64_t cgen_var_1040 = (uint64_t)local_countBuffer;
-    stream->putBe64(cgen_var_1040);
+    uint64_t cgen_var_1193;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1193, 1);
+    stream->write((uint64_t*)&cgen_var_1193, 8);
     stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
     stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
     stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -15428,13 +16717,16 @@
     local_stride = stride;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1041 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1041);
-        uint64_t cgen_var_1042 = (uint64_t)local_buffer;
-        countingStream->putBe64(cgen_var_1042);
+        uint64_t cgen_var_1194;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1194, 1);
+        countingStream->write((uint64_t*)&cgen_var_1194, 8);
+        uint64_t cgen_var_1195;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1195, 1);
+        countingStream->write((uint64_t*)&cgen_var_1195, 8);
         countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
-        uint64_t cgen_var_1043 = (uint64_t)local_countBuffer;
-        countingStream->putBe64(cgen_var_1043);
+        uint64_t cgen_var_1196;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1196, 1);
+        countingStream->write((uint64_t*)&cgen_var_1196, 8);
         countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
         countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -15444,13 +16736,16 @@
     uint32_t opcode_vkCmdDrawIndexedIndirectCountAMD = OP_vkCmdDrawIndexedIndirectCountAMD;
     stream->write(&opcode_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t));
-    uint64_t cgen_var_1044 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1044);
-    uint64_t cgen_var_1045 = (uint64_t)local_buffer;
-    stream->putBe64(cgen_var_1045);
+    uint64_t cgen_var_1197;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1197, 1);
+    stream->write((uint64_t*)&cgen_var_1197, 8);
+    uint64_t cgen_var_1198;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1198, 1);
+    stream->write((uint64_t*)&cgen_var_1198, 8);
     stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
-    uint64_t cgen_var_1046 = (uint64_t)local_countBuffer;
-    stream->putBe64(cgen_var_1046);
+    uint64_t cgen_var_1199;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1199, 1);
+    stream->write((uint64_t*)&cgen_var_1199, 8);
     stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
     stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
     stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
@@ -15491,22 +16786,24 @@
     local_infoType = infoType;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1047 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1047);
-        uint64_t cgen_var_1048 = (uint64_t)local_pipeline;
-        countingStream->putBe64(cgen_var_1048);
+        uint64_t cgen_var_1200;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1200, 1);
+        countingStream->write((uint64_t*)&cgen_var_1200, 8);
+        uint64_t cgen_var_1201;
+        countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1201, 1);
+        countingStream->write((uint64_t*)&cgen_var_1201, 8);
         countingStream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits));
         countingStream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1049 = (uint64_t)(uintptr_t)pInfoSize;
-        countingStream->putBe64(cgen_var_1049);
+        uint64_t cgen_var_1202 = (uint64_t)(uintptr_t)pInfoSize;
+        countingStream->putBe64(cgen_var_1202);
         if (pInfoSize)
         {
             countingStream->write((size_t*)pInfoSize, sizeof(size_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_1050 = (uint64_t)(uintptr_t)pInfo;
-        countingStream->putBe64(cgen_var_1050);
+        uint64_t cgen_var_1203 = (uint64_t)(uintptr_t)pInfo;
+        countingStream->putBe64(cgen_var_1203);
         if (pInfo)
         {
             countingStream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t));
@@ -15517,22 +16814,24 @@
     uint32_t opcode_vkGetShaderInfoAMD = OP_vkGetShaderInfoAMD;
     stream->write(&opcode_vkGetShaderInfoAMD, sizeof(uint32_t));
     stream->write(&packetSize_vkGetShaderInfoAMD, sizeof(uint32_t));
-    uint64_t cgen_var_1051 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1051);
-    uint64_t cgen_var_1052 = (uint64_t)local_pipeline;
-    stream->putBe64(cgen_var_1052);
+    uint64_t cgen_var_1204;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1204, 1);
+    stream->write((uint64_t*)&cgen_var_1204, 8);
+    uint64_t cgen_var_1205;
+    stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1205, 1);
+    stream->write((uint64_t*)&cgen_var_1205, 8);
     stream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits));
     stream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1053 = (uint64_t)(uintptr_t)pInfoSize;
-    stream->putBe64(cgen_var_1053);
+    uint64_t cgen_var_1206 = (uint64_t)(uintptr_t)pInfoSize;
+    stream->putBe64(cgen_var_1206);
     if (pInfoSize)
     {
         stream->write((size_t*)pInfoSize, sizeof(size_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_1054 = (uint64_t)(uintptr_t)pInfo;
-    stream->putBe64(cgen_var_1054);
+    uint64_t cgen_var_1207 = (uint64_t)(uintptr_t)pInfo;
+    stream->putBe64(cgen_var_1207);
     if (pInfo)
     {
         stream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t));
@@ -15562,6 +16861,8 @@
     pool->freeAll();
     VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0;
     stream->read(&vkGetShaderInfoAMD_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetShaderInfoAMD_VkResult_return;
 }
 
@@ -15602,8 +16903,9 @@
     local_externalHandleType = externalHandleType;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1057 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_1057);
+        uint64_t cgen_var_1210;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1210, 1);
+        countingStream->write((uint64_t*)&cgen_var_1210, 8);
         countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
         countingStream->write((VkImageType*)&local_type, sizeof(VkImageType));
         countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
@@ -15617,8 +16919,9 @@
     uint32_t opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV;
     stream->write(&opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t));
-    uint64_t cgen_var_1058 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_1058);
+    uint64_t cgen_var_1211;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1211, 1);
+    stream->write((uint64_t*)&cgen_var_1211, 8);
     stream->write((VkFormat*)&local_format, sizeof(VkFormat));
     stream->write((VkImageType*)&local_type, sizeof(VkImageType));
     stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
@@ -15630,6 +16933,8 @@
     pool->freeAll();
     VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return;
 }
 
@@ -15657,10 +16962,12 @@
     local_handleType = handleType;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1059 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1059);
-        uint64_t cgen_var_1060 = (uint64_t)local_memory;
-        countingStream->putBe64(cgen_var_1060);
+        uint64_t cgen_var_1212;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1212, 1);
+        countingStream->write((uint64_t*)&cgen_var_1212, 8);
+        uint64_t cgen_var_1213;
+        countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1213, 1);
+        countingStream->write((uint64_t*)&cgen_var_1213, 8);
         countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV));
         countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
     }
@@ -15669,16 +16976,20 @@
     uint32_t opcode_vkGetMemoryWin32HandleNV = OP_vkGetMemoryWin32HandleNV;
     stream->write(&opcode_vkGetMemoryWin32HandleNV, sizeof(uint32_t));
     stream->write(&packetSize_vkGetMemoryWin32HandleNV, sizeof(uint32_t));
-    uint64_t cgen_var_1061 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1061);
-    uint64_t cgen_var_1062 = (uint64_t)local_memory;
-    stream->putBe64(cgen_var_1062);
+    uint64_t cgen_var_1214;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1214, 1);
+    stream->write((uint64_t*)&cgen_var_1214, 8);
+    uint64_t cgen_var_1215;
+    stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1215, 1);
+    stream->write((uint64_t*)&cgen_var_1215, 8);
     stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV));
     stream->write((HANDLE*)pHandle, sizeof(HANDLE));
     stream->read((HANDLE*)pHandle, sizeof(HANDLE));
     pool->freeAll();
     VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0;
     stream->read(&vkGetMemoryWin32HandleNV_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetMemoryWin32HandleNV_VkResult_return;
 }
 
@@ -15726,41 +17037,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1063 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_1063);
+        uint64_t cgen_var_1216;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1216, 1);
+        countingStream->write((uint64_t*)&cgen_var_1216, 8);
         marshal_VkViSurfaceCreateInfoNN(countingStream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1064 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1064);
+        uint64_t cgen_var_1217 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1217);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+        uint64_t cgen_var_1218;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1218, 1);
+        countingStream->write((uint64_t*)&cgen_var_1218, 8);
     }
     uint32_t packetSize_vkCreateViSurfaceNN = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateViSurfaceNN = OP_vkCreateViSurfaceNN;
     stream->write(&opcode_vkCreateViSurfaceNN, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateViSurfaceNN, sizeof(uint32_t));
-    uint64_t cgen_var_1065 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_1065);
+    uint64_t cgen_var_1219;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1219, 1);
+    stream->write((uint64_t*)&cgen_var_1219, 8);
     marshal_VkViSurfaceCreateInfoNN(stream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1066 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1066);
+    uint64_t cgen_var_1220 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1220);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+    uint64_t cgen_var_1221;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1221, 1);
+    stream->write((uint64_t*)&cgen_var_1221, 8);
+    uint64_t cgen_var_1222;
+    stream->read((uint64_t*)&cgen_var_1222, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1222, (VkSurfaceKHR*)pSurface, 1);
     pool->freeAll();
     VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0;
     stream->read(&vkCreateViSurfaceNN_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateViSurfaceNN_VkResult_return;
 }
 
@@ -15794,8 +17112,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1067 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1067);
+        uint64_t cgen_var_1223;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1223, 1);
+        countingStream->write((uint64_t*)&cgen_var_1223, 8);
         marshal_VkConditionalRenderingBeginInfoEXT(countingStream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
     }
     uint32_t packetSize_vkCmdBeginConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -15803,8 +17122,9 @@
     uint32_t opcode_vkCmdBeginConditionalRenderingEXT = OP_vkCmdBeginConditionalRenderingEXT;
     stream->write(&opcode_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1068 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1068);
+    uint64_t cgen_var_1224;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1224, 1);
+    stream->write((uint64_t*)&cgen_var_1224, 8);
     marshal_VkConditionalRenderingBeginInfoEXT(stream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
     pool->freeAll();
 }
@@ -15821,16 +17141,18 @@
     resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1069 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1069);
+        uint64_t cgen_var_1225;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1225, 1);
+        countingStream->write((uint64_t*)&cgen_var_1225, 8);
     }
     uint32_t packetSize_vkCmdEndConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCmdEndConditionalRenderingEXT = OP_vkCmdEndConditionalRenderingEXT;
     stream->write(&opcode_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1070 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1070);
+    uint64_t cgen_var_1226;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1226, 1);
+    stream->write((uint64_t*)&cgen_var_1226, 8);
     pool->freeAll();
 }
 
@@ -15860,8 +17182,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1071 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1071);
+        uint64_t cgen_var_1227;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1227, 1);
+        countingStream->write((uint64_t*)&cgen_var_1227, 8);
         marshal_VkCmdProcessCommandsInfoNVX(countingStream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo));
     }
     uint32_t packetSize_vkCmdProcessCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -15869,8 +17192,9 @@
     uint32_t opcode_vkCmdProcessCommandsNVX = OP_vkCmdProcessCommandsNVX;
     stream->write(&opcode_vkCmdProcessCommandsNVX, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdProcessCommandsNVX, sizeof(uint32_t));
-    uint64_t cgen_var_1072 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1072);
+    uint64_t cgen_var_1228;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1228, 1);
+    stream->write((uint64_t*)&cgen_var_1228, 8);
     marshal_VkCmdProcessCommandsInfoNVX(stream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo));
     pool->freeAll();
 }
@@ -15899,8 +17223,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1073 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1073);
+        uint64_t cgen_var_1229;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1229, 1);
+        countingStream->write((uint64_t*)&cgen_var_1229, 8);
         marshal_VkCmdReserveSpaceForCommandsInfoNVX(countingStream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo));
     }
     uint32_t packetSize_vkCmdReserveSpaceForCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -15908,8 +17233,9 @@
     uint32_t opcode_vkCmdReserveSpaceForCommandsNVX = OP_vkCmdReserveSpaceForCommandsNVX;
     stream->write(&opcode_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t));
-    uint64_t cgen_var_1074 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1074);
+    uint64_t cgen_var_1230;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1230, 1);
+    stream->write((uint64_t*)&cgen_var_1230, 8);
     marshal_VkCmdReserveSpaceForCommandsInfoNVX(stream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo));
     pool->freeAll();
 }
@@ -15952,38 +17278,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1075 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1075);
+        uint64_t cgen_var_1231;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1231, 1);
+        countingStream->write((uint64_t*)&cgen_var_1231, 8);
         marshal_VkIndirectCommandsLayoutCreateInfoNVX(countingStream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1076 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1076);
+        uint64_t cgen_var_1232 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1232);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
+        uint64_t cgen_var_1233;
+        countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1233, 1);
+        countingStream->write((uint64_t*)&cgen_var_1233, 8);
     }
     uint32_t packetSize_vkCreateIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateIndirectCommandsLayoutNVX = OP_vkCreateIndirectCommandsLayoutNVX;
     stream->write(&opcode_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t));
-    uint64_t cgen_var_1077 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1077);
+    uint64_t cgen_var_1234;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1234, 1);
+    stream->write((uint64_t*)&cgen_var_1234, 8);
     marshal_VkIndirectCommandsLayoutCreateInfoNVX(stream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1078 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1078);
+    uint64_t cgen_var_1235 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1235);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
+    uint64_t cgen_var_1236;
+    stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1236, 1);
+    stream->write((uint64_t*)&cgen_var_1236, 8);
+    uint64_t cgen_var_1237;
+    stream->read((uint64_t*)&cgen_var_1237, 8);
+    stream->handleMapping()->mapHandles_u64_VkIndirectCommandsLayoutNVX(&cgen_var_1237, (VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, 1);
     if (pIndirectCommandsLayout)
     {
         resources->createMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, 1);
@@ -15991,6 +17322,8 @@
     pool->freeAll();
     VkResult vkCreateIndirectCommandsLayoutNVX_VkResult_return = (VkResult)0;
     stream->read(&vkCreateIndirectCommandsLayoutNVX_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateIndirectCommandsLayoutNVX_VkResult_return;
 }
 
@@ -16023,13 +17356,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1079 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1079);
-        uint64_t cgen_var_1080 = (uint64_t)local_indirectCommandsLayout;
-        countingStream->putBe64(cgen_var_1080);
+        uint64_t cgen_var_1238;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1238, 1);
+        countingStream->write((uint64_t*)&cgen_var_1238, 8);
+        uint64_t cgen_var_1239;
+        countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1239, 1);
+        countingStream->write((uint64_t*)&cgen_var_1239, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_1081 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1081);
+        uint64_t cgen_var_1240 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1240);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -16040,13 +17375,15 @@
     uint32_t opcode_vkDestroyIndirectCommandsLayoutNVX = OP_vkDestroyIndirectCommandsLayoutNVX;
     stream->write(&opcode_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t));
-    uint64_t cgen_var_1082 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1082);
-    uint64_t cgen_var_1083 = (uint64_t)local_indirectCommandsLayout;
-    stream->putBe64(cgen_var_1083);
+    uint64_t cgen_var_1241;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1241, 1);
+    stream->write((uint64_t*)&cgen_var_1241, 8);
+    uint64_t cgen_var_1242;
+    stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1242, 1);
+    stream->write((uint64_t*)&cgen_var_1242, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_1084 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1084);
+    uint64_t cgen_var_1243 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1243);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -16093,38 +17430,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1085 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1085);
+        uint64_t cgen_var_1244;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1244, 1);
+        countingStream->write((uint64_t*)&cgen_var_1244, 8);
         marshal_VkObjectTableCreateInfoNVX(countingStream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1086 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1086);
+        uint64_t cgen_var_1245 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1245);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX));
+        uint64_t cgen_var_1246;
+        countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1246, 1);
+        countingStream->write((uint64_t*)&cgen_var_1246, 8);
     }
     uint32_t packetSize_vkCreateObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateObjectTableNVX = OP_vkCreateObjectTableNVX;
     stream->write(&opcode_vkCreateObjectTableNVX, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateObjectTableNVX, sizeof(uint32_t));
-    uint64_t cgen_var_1087 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1087);
+    uint64_t cgen_var_1247;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1247, 1);
+    stream->write((uint64_t*)&cgen_var_1247, 8);
     marshal_VkObjectTableCreateInfoNVX(stream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1088 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1088);
+    uint64_t cgen_var_1248 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1248);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX));
+    uint64_t cgen_var_1249;
+    stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1249, 1);
+    stream->write((uint64_t*)&cgen_var_1249, 8);
+    uint64_t cgen_var_1250;
+    stream->read((uint64_t*)&cgen_var_1250, 8);
+    stream->handleMapping()->mapHandles_u64_VkObjectTableNVX(&cgen_var_1250, (VkObjectTableNVX*)pObjectTable, 1);
     if (pObjectTable)
     {
         resources->createMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)pObjectTable, 1);
@@ -16132,6 +17474,8 @@
     pool->freeAll();
     VkResult vkCreateObjectTableNVX_VkResult_return = (VkResult)0;
     stream->read(&vkCreateObjectTableNVX_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateObjectTableNVX_VkResult_return;
 }
 
@@ -16164,13 +17508,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1089 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1089);
-        uint64_t cgen_var_1090 = (uint64_t)local_objectTable;
-        countingStream->putBe64(cgen_var_1090);
+        uint64_t cgen_var_1251;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1251, 1);
+        countingStream->write((uint64_t*)&cgen_var_1251, 8);
+        uint64_t cgen_var_1252;
+        countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1252, 1);
+        countingStream->write((uint64_t*)&cgen_var_1252, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_1091 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1091);
+        uint64_t cgen_var_1253 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1253);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -16181,13 +17527,15 @@
     uint32_t opcode_vkDestroyObjectTableNVX = OP_vkDestroyObjectTableNVX;
     stream->write(&opcode_vkDestroyObjectTableNVX, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyObjectTableNVX, sizeof(uint32_t));
-    uint64_t cgen_var_1092 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1092);
-    uint64_t cgen_var_1093 = (uint64_t)local_objectTable;
-    stream->putBe64(cgen_var_1093);
+    uint64_t cgen_var_1254;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1254, 1);
+    stream->write((uint64_t*)&cgen_var_1254, 8);
+    uint64_t cgen_var_1255;
+    stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1255, 1);
+    stream->write((uint64_t*)&cgen_var_1255, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_1094 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1094);
+    uint64_t cgen_var_1256 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1256);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -16225,10 +17573,12 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1095 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1095);
-        uint64_t cgen_var_1096 = (uint64_t)local_objectTable;
-        countingStream->putBe64(cgen_var_1096);
+        uint64_t cgen_var_1257;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1257, 1);
+        countingStream->write((uint64_t*)&cgen_var_1257, 8);
+        uint64_t cgen_var_1258;
+        countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1258, 1);
+        countingStream->write((uint64_t*)&cgen_var_1258, 8);
         countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
         (void)local_ppObjectTableEntries;
         countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
@@ -16238,16 +17588,20 @@
     uint32_t opcode_vkRegisterObjectsNVX = OP_vkRegisterObjectsNVX;
     stream->write(&opcode_vkRegisterObjectsNVX, sizeof(uint32_t));
     stream->write(&packetSize_vkRegisterObjectsNVX, sizeof(uint32_t));
-    uint64_t cgen_var_1097 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1097);
-    uint64_t cgen_var_1098 = (uint64_t)local_objectTable;
-    stream->putBe64(cgen_var_1098);
+    uint64_t cgen_var_1259;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1259, 1);
+    stream->write((uint64_t*)&cgen_var_1259, 8);
+    uint64_t cgen_var_1260;
+    stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1260, 1);
+    stream->write((uint64_t*)&cgen_var_1260, 8);
     stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
     (void)local_ppObjectTableEntries;
     stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
     pool->freeAll();
     VkResult vkRegisterObjectsNVX_VkResult_return = (VkResult)0;
     stream->read(&vkRegisterObjectsNVX_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkRegisterObjectsNVX_VkResult_return;
 }
 
@@ -16284,10 +17638,12 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1099 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1099);
-        uint64_t cgen_var_1100 = (uint64_t)local_objectTable;
-        countingStream->putBe64(cgen_var_1100);
+        uint64_t cgen_var_1261;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1261, 1);
+        countingStream->write((uint64_t*)&cgen_var_1261, 8);
+        uint64_t cgen_var_1262;
+        countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1262, 1);
+        countingStream->write((uint64_t*)&cgen_var_1262, 8);
         countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
         countingStream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX));
         countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
@@ -16297,16 +17653,20 @@
     uint32_t opcode_vkUnregisterObjectsNVX = OP_vkUnregisterObjectsNVX;
     stream->write(&opcode_vkUnregisterObjectsNVX, sizeof(uint32_t));
     stream->write(&packetSize_vkUnregisterObjectsNVX, sizeof(uint32_t));
-    uint64_t cgen_var_1101 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1101);
-    uint64_t cgen_var_1102 = (uint64_t)local_objectTable;
-    stream->putBe64(cgen_var_1102);
+    uint64_t cgen_var_1263;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1263, 1);
+    stream->write((uint64_t*)&cgen_var_1263, 8);
+    uint64_t cgen_var_1264;
+    stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1264, 1);
+    stream->write((uint64_t*)&cgen_var_1264, 8);
     stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
     stream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX));
     stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
     pool->freeAll();
     VkResult vkUnregisterObjectsNVX_VkResult_return = (VkResult)0;
     stream->read(&vkUnregisterObjectsNVX_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkUnregisterObjectsNVX_VkResult_return;
 }
 
@@ -16324,8 +17684,9 @@
     resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1103 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_1103);
+        uint64_t cgen_var_1265;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1265, 1);
+        countingStream->write((uint64_t*)&cgen_var_1265, 8);
         marshal_VkDeviceGeneratedCommandsFeaturesNVX(countingStream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures));
         marshal_VkDeviceGeneratedCommandsLimitsNVX(countingStream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits));
     }
@@ -16334,8 +17695,9 @@
     uint32_t opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = OP_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX;
     stream->write(&opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t));
-    uint64_t cgen_var_1104 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_1104);
+    uint64_t cgen_var_1266;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1266, 1);
+    stream->write((uint64_t*)&cgen_var_1266, 8);
     marshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures));
     marshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits));
     unmarshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures));
@@ -16381,8 +17743,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1105 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1105);
+        uint64_t cgen_var_1267;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1267, 1);
+        countingStream->write((uint64_t*)&cgen_var_1267, 8);
         countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
@@ -16395,8 +17758,9 @@
     uint32_t opcode_vkCmdSetViewportWScalingNV = OP_vkCmdSetViewportWScalingNV;
     stream->write(&opcode_vkCmdSetViewportWScalingNV, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetViewportWScalingNV, sizeof(uint32_t));
-    uint64_t cgen_var_1106 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1106);
+    uint64_t cgen_var_1268;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1268, 1);
+    stream->write((uint64_t*)&cgen_var_1268, 8);
     stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
     stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
@@ -16424,23 +17788,29 @@
     resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1107 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_1107);
-        uint64_t cgen_var_1108 = (uint64_t)local_display;
-        countingStream->putBe64(cgen_var_1108);
+        uint64_t cgen_var_1269;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1269, 1);
+        countingStream->write((uint64_t*)&cgen_var_1269, 8);
+        uint64_t cgen_var_1270;
+        countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1270, 1);
+        countingStream->write((uint64_t*)&cgen_var_1270, 8);
     }
     uint32_t packetSize_vkReleaseDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkReleaseDisplayEXT = OP_vkReleaseDisplayEXT;
     stream->write(&opcode_vkReleaseDisplayEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkReleaseDisplayEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1109 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_1109);
-    uint64_t cgen_var_1110 = (uint64_t)local_display;
-    stream->putBe64(cgen_var_1110);
+    uint64_t cgen_var_1271;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1271, 1);
+    stream->write((uint64_t*)&cgen_var_1271, 8);
+    uint64_t cgen_var_1272;
+    stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1272, 1);
+    stream->write((uint64_t*)&cgen_var_1272, 8);
     pool->freeAll();
     VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0;
     stream->read(&vkReleaseDisplayEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkReleaseDisplayEXT_VkResult_return;
 }
 
@@ -16463,26 +17833,32 @@
     resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1111 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_1111);
+        uint64_t cgen_var_1273;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1273, 1);
+        countingStream->write((uint64_t*)&cgen_var_1273, 8);
         countingStream->write((Display*)dpy, sizeof(Display));
-        uint64_t cgen_var_1112 = (uint64_t)local_display;
-        countingStream->putBe64(cgen_var_1112);
+        uint64_t cgen_var_1274;
+        countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1274, 1);
+        countingStream->write((uint64_t*)&cgen_var_1274, 8);
     }
     uint32_t packetSize_vkAcquireXlibDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkAcquireXlibDisplayEXT = OP_vkAcquireXlibDisplayEXT;
     stream->write(&opcode_vkAcquireXlibDisplayEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkAcquireXlibDisplayEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1113 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_1113);
+    uint64_t cgen_var_1275;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1275, 1);
+    stream->write((uint64_t*)&cgen_var_1275, 8);
     stream->write((Display*)dpy, sizeof(Display));
-    uint64_t cgen_var_1114 = (uint64_t)local_display;
-    stream->putBe64(cgen_var_1114);
+    uint64_t cgen_var_1276;
+    stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1276, 1);
+    stream->write((uint64_t*)&cgen_var_1276, 8);
     stream->read((Display*)dpy, sizeof(Display));
     pool->freeAll();
     VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0;
     stream->read(&vkAcquireXlibDisplayEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkAcquireXlibDisplayEXT_VkResult_return;
 }
 
@@ -16503,30 +17879,37 @@
     local_rrOutput = rrOutput;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1115 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_1115);
+        uint64_t cgen_var_1277;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1277, 1);
+        countingStream->write((uint64_t*)&cgen_var_1277, 8);
         countingStream->write((Display*)dpy, sizeof(Display));
         countingStream->write((RROutput*)&local_rrOutput, sizeof(RROutput));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR));
+        uint64_t cgen_var_1278;
+        countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1278, 1);
+        countingStream->write((uint64_t*)&cgen_var_1278, 8);
     }
     uint32_t packetSize_vkGetRandROutputDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkGetRandROutputDisplayEXT = OP_vkGetRandROutputDisplayEXT;
     stream->write(&opcode_vkGetRandROutputDisplayEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkGetRandROutputDisplayEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1116 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_1116);
+    uint64_t cgen_var_1279;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1279, 1);
+    stream->write((uint64_t*)&cgen_var_1279, 8);
     stream->write((Display*)dpy, sizeof(Display));
     stream->write((RROutput*)&local_rrOutput, sizeof(RROutput));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR));
+    uint64_t cgen_var_1280;
+    stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1280, 1);
+    stream->write((uint64_t*)&cgen_var_1280, 8);
     stream->read((Display*)dpy, sizeof(Display));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR));
+    uint64_t cgen_var_1281;
+    stream->read((uint64_t*)&cgen_var_1281, 8);
+    stream->handleMapping()->mapHandles_u64_VkDisplayKHR(&cgen_var_1281, (VkDisplayKHR*)pDisplay, 1);
     pool->freeAll();
     VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0;
     stream->read(&vkGetRandROutputDisplayEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetRandROutputDisplayEXT_VkResult_return;
 }
 
@@ -16549,10 +17932,12 @@
     resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1117 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_1117);
-        uint64_t cgen_var_1118 = (uint64_t)local_surface;
-        countingStream->putBe64(cgen_var_1118);
+        uint64_t cgen_var_1282;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1282, 1);
+        countingStream->write((uint64_t*)&cgen_var_1282, 8);
+        uint64_t cgen_var_1283;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1283, 1);
+        countingStream->write((uint64_t*)&cgen_var_1283, 8);
         marshal_VkSurfaceCapabilities2EXT(countingStream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
     }
     uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -16560,15 +17945,19 @@
     uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT = OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT;
     stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t));
-    uint64_t cgen_var_1119 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_1119);
-    uint64_t cgen_var_1120 = (uint64_t)local_surface;
-    stream->putBe64(cgen_var_1120);
+    uint64_t cgen_var_1284;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1284, 1);
+    stream->write((uint64_t*)&cgen_var_1284, 8);
+    uint64_t cgen_var_1285;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1285, 1);
+    stream->write((uint64_t*)&cgen_var_1285, 8);
     marshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
     unmarshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
     pool->freeAll();
     VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0;
     stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return;
 }
 
@@ -16602,10 +17991,12 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1121 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1121);
-        uint64_t cgen_var_1122 = (uint64_t)local_display;
-        countingStream->putBe64(cgen_var_1122);
+        uint64_t cgen_var_1286;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1286, 1);
+        countingStream->write((uint64_t*)&cgen_var_1286, 8);
+        uint64_t cgen_var_1287;
+        countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1287, 1);
+        countingStream->write((uint64_t*)&cgen_var_1287, 8);
         marshal_VkDisplayPowerInfoEXT(countingStream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
     }
     uint32_t packetSize_vkDisplayPowerControlEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -16613,14 +18004,18 @@
     uint32_t opcode_vkDisplayPowerControlEXT = OP_vkDisplayPowerControlEXT;
     stream->write(&opcode_vkDisplayPowerControlEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkDisplayPowerControlEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1123 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1123);
-    uint64_t cgen_var_1124 = (uint64_t)local_display;
-    stream->putBe64(cgen_var_1124);
+    uint64_t cgen_var_1288;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1288, 1);
+    stream->write((uint64_t*)&cgen_var_1288, 8);
+    uint64_t cgen_var_1289;
+    stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1289, 1);
+    stream->write((uint64_t*)&cgen_var_1289, 8);
     marshal_VkDisplayPowerInfoEXT(stream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
     pool->freeAll();
     VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0;
     stream->read(&vkDisplayPowerControlEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkDisplayPowerControlEXT_VkResult_return;
 }
 
@@ -16662,41 +18057,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1125 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1125);
+        uint64_t cgen_var_1290;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1290, 1);
+        countingStream->write((uint64_t*)&cgen_var_1290, 8);
         marshal_VkDeviceEventInfoEXT(countingStream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1126 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1126);
+        uint64_t cgen_var_1291 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1291);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkFence*)pFence, sizeof(VkFence));
+        uint64_t cgen_var_1292;
+        countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1292, 1);
+        countingStream->write((uint64_t*)&cgen_var_1292, 8);
     }
     uint32_t packetSize_vkRegisterDeviceEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkRegisterDeviceEventEXT = OP_vkRegisterDeviceEventEXT;
     stream->write(&opcode_vkRegisterDeviceEventEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkRegisterDeviceEventEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1127 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1127);
+    uint64_t cgen_var_1293;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1293, 1);
+    stream->write((uint64_t*)&cgen_var_1293, 8);
     marshal_VkDeviceEventInfoEXT(stream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1128 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1128);
+    uint64_t cgen_var_1294 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1294);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkFence*)pFence, sizeof(VkFence));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkFence*)pFence, sizeof(VkFence));
+    uint64_t cgen_var_1295;
+    stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1295, 1);
+    stream->write((uint64_t*)&cgen_var_1295, 8);
+    uint64_t cgen_var_1296;
+    stream->read((uint64_t*)&cgen_var_1296, 8);
+    stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1296, (VkFence*)pFence, 1);
     pool->freeAll();
     VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0;
     stream->read(&vkRegisterDeviceEventEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkRegisterDeviceEventEXT_VkResult_return;
 }
 
@@ -16742,45 +18144,54 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1129 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1129);
-        uint64_t cgen_var_1130 = (uint64_t)local_display;
-        countingStream->putBe64(cgen_var_1130);
+        uint64_t cgen_var_1297;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1297, 1);
+        countingStream->write((uint64_t*)&cgen_var_1297, 8);
+        uint64_t cgen_var_1298;
+        countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1298, 1);
+        countingStream->write((uint64_t*)&cgen_var_1298, 8);
         marshal_VkDisplayEventInfoEXT(countingStream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1131 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1131);
+        uint64_t cgen_var_1299 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1299);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkFence*)pFence, sizeof(VkFence));
+        uint64_t cgen_var_1300;
+        countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1300, 1);
+        countingStream->write((uint64_t*)&cgen_var_1300, 8);
     }
     uint32_t packetSize_vkRegisterDisplayEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkRegisterDisplayEventEXT = OP_vkRegisterDisplayEventEXT;
     stream->write(&opcode_vkRegisterDisplayEventEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkRegisterDisplayEventEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1132 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1132);
-    uint64_t cgen_var_1133 = (uint64_t)local_display;
-    stream->putBe64(cgen_var_1133);
+    uint64_t cgen_var_1301;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1301, 1);
+    stream->write((uint64_t*)&cgen_var_1301, 8);
+    uint64_t cgen_var_1302;
+    stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1302, 1);
+    stream->write((uint64_t*)&cgen_var_1302, 8);
     marshal_VkDisplayEventInfoEXT(stream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1134 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1134);
+    uint64_t cgen_var_1303 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1303);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkFence*)pFence, sizeof(VkFence));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkFence*)pFence, sizeof(VkFence));
+    uint64_t cgen_var_1304;
+    stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1304, 1);
+    stream->write((uint64_t*)&cgen_var_1304, 8);
+    uint64_t cgen_var_1305;
+    stream->read((uint64_t*)&cgen_var_1305, 8);
+    stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1305, (VkFence*)pFence, 1);
     pool->freeAll();
     VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0;
     stream->read(&vkRegisterDisplayEventEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkRegisterDisplayEventEXT_VkResult_return;
 }
 
@@ -16804,10 +18215,12 @@
     local_counter = counter;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1135 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1135);
-        uint64_t cgen_var_1136 = (uint64_t)local_swapchain;
-        countingStream->putBe64(cgen_var_1136);
+        uint64_t cgen_var_1306;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1306, 1);
+        countingStream->write((uint64_t*)&cgen_var_1306, 8);
+        uint64_t cgen_var_1307;
+        countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1307, 1);
+        countingStream->write((uint64_t*)&cgen_var_1307, 8);
         countingStream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT));
         countingStream->write((uint64_t*)pCounterValue, sizeof(uint64_t));
     }
@@ -16816,16 +18229,20 @@
     uint32_t opcode_vkGetSwapchainCounterEXT = OP_vkGetSwapchainCounterEXT;
     stream->write(&opcode_vkGetSwapchainCounterEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkGetSwapchainCounterEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1137 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1137);
-    uint64_t cgen_var_1138 = (uint64_t)local_swapchain;
-    stream->putBe64(cgen_var_1138);
+    uint64_t cgen_var_1308;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1308, 1);
+    stream->write((uint64_t*)&cgen_var_1308, 8);
+    uint64_t cgen_var_1309;
+    stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1309, 1);
+    stream->write((uint64_t*)&cgen_var_1309, 8);
     stream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT));
     stream->write((uint64_t*)pCounterValue, sizeof(uint64_t));
     stream->read((uint64_t*)pCounterValue, sizeof(uint64_t));
     pool->freeAll();
     VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0;
     stream->read(&vkGetSwapchainCounterEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetSwapchainCounterEXT_VkResult_return;
 }
 
@@ -16848,10 +18265,12 @@
     resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1139 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1139);
-        uint64_t cgen_var_1140 = (uint64_t)local_swapchain;
-        countingStream->putBe64(cgen_var_1140);
+        uint64_t cgen_var_1310;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1310, 1);
+        countingStream->write((uint64_t*)&cgen_var_1310, 8);
+        uint64_t cgen_var_1311;
+        countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1311, 1);
+        countingStream->write((uint64_t*)&cgen_var_1311, 8);
         marshal_VkRefreshCycleDurationGOOGLE(countingStream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
     }
     uint32_t packetSize_vkGetRefreshCycleDurationGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -16859,15 +18278,19 @@
     uint32_t opcode_vkGetRefreshCycleDurationGOOGLE = OP_vkGetRefreshCycleDurationGOOGLE;
     stream->write(&opcode_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t));
     stream->write(&packetSize_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t));
-    uint64_t cgen_var_1141 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1141);
-    uint64_t cgen_var_1142 = (uint64_t)local_swapchain;
-    stream->putBe64(cgen_var_1142);
+    uint64_t cgen_var_1312;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1312, 1);
+    stream->write((uint64_t*)&cgen_var_1312, 8);
+    uint64_t cgen_var_1313;
+    stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1313, 1);
+    stream->write((uint64_t*)&cgen_var_1313, 8);
     marshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
     unmarshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
     pool->freeAll();
     VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0;
     stream->read(&vkGetRefreshCycleDurationGOOGLE_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetRefreshCycleDurationGOOGLE_VkResult_return;
 }
 
@@ -16889,20 +18312,22 @@
     resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1143 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1143);
-        uint64_t cgen_var_1144 = (uint64_t)local_swapchain;
-        countingStream->putBe64(cgen_var_1144);
+        uint64_t cgen_var_1314;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1314, 1);
+        countingStream->write((uint64_t*)&cgen_var_1314, 8);
+        uint64_t cgen_var_1315;
+        countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1315, 1);
+        countingStream->write((uint64_t*)&cgen_var_1315, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_1145 = (uint64_t)(uintptr_t)pPresentationTimingCount;
-        countingStream->putBe64(cgen_var_1145);
+        uint64_t cgen_var_1316 = (uint64_t)(uintptr_t)pPresentationTimingCount;
+        countingStream->putBe64(cgen_var_1316);
         if (pPresentationTimingCount)
         {
             countingStream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_1146 = (uint64_t)(uintptr_t)pPresentationTimings;
-        countingStream->putBe64(cgen_var_1146);
+        uint64_t cgen_var_1317 = (uint64_t)(uintptr_t)pPresentationTimings;
+        countingStream->putBe64(cgen_var_1317);
         if (pPresentationTimings)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i)
@@ -16916,20 +18341,22 @@
     uint32_t opcode_vkGetPastPresentationTimingGOOGLE = OP_vkGetPastPresentationTimingGOOGLE;
     stream->write(&opcode_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t));
-    uint64_t cgen_var_1147 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1147);
-    uint64_t cgen_var_1148 = (uint64_t)local_swapchain;
-    stream->putBe64(cgen_var_1148);
+    uint64_t cgen_var_1318;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1318, 1);
+    stream->write((uint64_t*)&cgen_var_1318, 8);
+    uint64_t cgen_var_1319;
+    stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1319, 1);
+    stream->write((uint64_t*)&cgen_var_1319, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_1149 = (uint64_t)(uintptr_t)pPresentationTimingCount;
-    stream->putBe64(cgen_var_1149);
+    uint64_t cgen_var_1320 = (uint64_t)(uintptr_t)pPresentationTimingCount;
+    stream->putBe64(cgen_var_1320);
     if (pPresentationTimingCount)
     {
         stream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_1150 = (uint64_t)(uintptr_t)pPresentationTimings;
-    stream->putBe64(cgen_var_1150);
+    uint64_t cgen_var_1321 = (uint64_t)(uintptr_t)pPresentationTimings;
+    stream->putBe64(cgen_var_1321);
     if (pPresentationTimings)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i)
@@ -16965,6 +18392,8 @@
     pool->freeAll();
     VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0;
     stream->read(&vkGetPastPresentationTimingGOOGLE_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetPastPresentationTimingGOOGLE_VkResult_return;
 }
 
@@ -17016,8 +18445,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1153 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1153);
+        uint64_t cgen_var_1324;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1324, 1);
+        countingStream->write((uint64_t*)&cgen_var_1324, 8);
         countingStream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t));
         countingStream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t));
         for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i)
@@ -17030,8 +18460,9 @@
     uint32_t opcode_vkCmdSetDiscardRectangleEXT = OP_vkCmdSetDiscardRectangleEXT;
     stream->write(&opcode_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1154 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1154);
+    uint64_t cgen_var_1325;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1325, 1);
+    stream->write((uint64_t*)&cgen_var_1325, 8);
     stream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t));
     stream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t));
     for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i)
@@ -17091,11 +18522,17 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1155 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1155);
+        uint64_t cgen_var_1326;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1326, 1);
+        countingStream->write((uint64_t*)&cgen_var_1326, 8);
         countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
+        if (((swapchainCount)))
+        {
+            uint64_t* cgen_var_1327;
+            countingStream->alloc((void**)&cgen_var_1327, ((swapchainCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1327, ((swapchainCount)));
+            countingStream->write((uint64_t*)cgen_var_1327, 8);
+        }
         for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
         {
             marshal_VkHdrMetadataEXT(countingStream, (VkHdrMetadataEXT*)(local_pMetadata + i));
@@ -17106,11 +18543,17 @@
     uint32_t opcode_vkSetHdrMetadataEXT = OP_vkSetHdrMetadataEXT;
     stream->write(&opcode_vkSetHdrMetadataEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkSetHdrMetadataEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1156 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1156);
+    uint64_t cgen_var_1328;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1328, 1);
+    stream->write((uint64_t*)&cgen_var_1328, 8);
     stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
+    if (((swapchainCount)))
+    {
+        uint64_t* cgen_var_1329;
+        stream->alloc((void**)&cgen_var_1329, ((swapchainCount)) * 8);
+        stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1329, ((swapchainCount)));
+        stream->write((uint64_t*)cgen_var_1329, 8);
+    }
     for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
     {
         marshal_VkHdrMetadataEXT(stream, (VkHdrMetadataEXT*)(local_pMetadata + i));
@@ -17158,41 +18601,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1157 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_1157);
+        uint64_t cgen_var_1330;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1330, 1);
+        countingStream->write((uint64_t*)&cgen_var_1330, 8);
         marshal_VkIOSSurfaceCreateInfoMVK(countingStream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1158 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1158);
+        uint64_t cgen_var_1331 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1331);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+        uint64_t cgen_var_1332;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1332, 1);
+        countingStream->write((uint64_t*)&cgen_var_1332, 8);
     }
     uint32_t packetSize_vkCreateIOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateIOSSurfaceMVK = OP_vkCreateIOSSurfaceMVK;
     stream->write(&opcode_vkCreateIOSSurfaceMVK, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateIOSSurfaceMVK, sizeof(uint32_t));
-    uint64_t cgen_var_1159 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_1159);
+    uint64_t cgen_var_1333;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1333, 1);
+    stream->write((uint64_t*)&cgen_var_1333, 8);
     marshal_VkIOSSurfaceCreateInfoMVK(stream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1160 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1160);
+    uint64_t cgen_var_1334 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1334);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+    uint64_t cgen_var_1335;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1335, 1);
+    stream->write((uint64_t*)&cgen_var_1335, 8);
+    uint64_t cgen_var_1336;
+    stream->read((uint64_t*)&cgen_var_1336, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1336, (VkSurfaceKHR*)pSurface, 1);
     pool->freeAll();
     VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0;
     stream->read(&vkCreateIOSSurfaceMVK_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateIOSSurfaceMVK_VkResult_return;
 }
 
@@ -17236,41 +18686,48 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1161 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_1161);
+        uint64_t cgen_var_1337;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1337, 1);
+        countingStream->write((uint64_t*)&cgen_var_1337, 8);
         marshal_VkMacOSSurfaceCreateInfoMVK(countingStream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1162 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1162);
+        uint64_t cgen_var_1338 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1338);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+        uint64_t cgen_var_1339;
+        countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1339, 1);
+        countingStream->write((uint64_t*)&cgen_var_1339, 8);
     }
     uint32_t packetSize_vkCreateMacOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateMacOSSurfaceMVK = OP_vkCreateMacOSSurfaceMVK;
     stream->write(&opcode_vkCreateMacOSSurfaceMVK, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateMacOSSurfaceMVK, sizeof(uint32_t));
-    uint64_t cgen_var_1163 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_1163);
+    uint64_t cgen_var_1340;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1340, 1);
+    stream->write((uint64_t*)&cgen_var_1340, 8);
     marshal_VkMacOSSurfaceCreateInfoMVK(stream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1164 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1164);
+    uint64_t cgen_var_1341 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1341);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
+    uint64_t cgen_var_1342;
+    stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1342, 1);
+    stream->write((uint64_t*)&cgen_var_1342, 8);
+    uint64_t cgen_var_1343;
+    stream->read((uint64_t*)&cgen_var_1343, 8);
+    stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1343, (VkSurfaceKHR*)pSurface, 1);
     pool->freeAll();
     VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0;
     stream->read(&vkCreateMacOSSurfaceMVK_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateMacOSSurfaceMVK_VkResult_return;
 }
 
@@ -17304,8 +18761,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1165 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1165);
+        uint64_t cgen_var_1344;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1344, 1);
+        countingStream->write((uint64_t*)&cgen_var_1344, 8);
         marshal_VkDebugUtilsObjectNameInfoEXT(countingStream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
     }
     uint32_t packetSize_vkSetDebugUtilsObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -17313,12 +18771,15 @@
     uint32_t opcode_vkSetDebugUtilsObjectNameEXT = OP_vkSetDebugUtilsObjectNameEXT;
     stream->write(&opcode_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1166 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1166);
+    uint64_t cgen_var_1345;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1345, 1);
+    stream->write((uint64_t*)&cgen_var_1345, 8);
     marshal_VkDebugUtilsObjectNameInfoEXT(stream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
     pool->freeAll();
     VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0;
     stream->read(&vkSetDebugUtilsObjectNameEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkSetDebugUtilsObjectNameEXT_VkResult_return;
 }
 
@@ -17346,8 +18807,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1167 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1167);
+        uint64_t cgen_var_1346;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1346, 1);
+        countingStream->write((uint64_t*)&cgen_var_1346, 8);
         marshal_VkDebugUtilsObjectTagInfoEXT(countingStream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
     }
     uint32_t packetSize_vkSetDebugUtilsObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -17355,12 +18817,15 @@
     uint32_t opcode_vkSetDebugUtilsObjectTagEXT = OP_vkSetDebugUtilsObjectTagEXT;
     stream->write(&opcode_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1168 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1168);
+    uint64_t cgen_var_1347;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1347, 1);
+    stream->write((uint64_t*)&cgen_var_1347, 8);
     marshal_VkDebugUtilsObjectTagInfoEXT(stream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
     pool->freeAll();
     VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0;
     stream->read(&vkSetDebugUtilsObjectTagEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkSetDebugUtilsObjectTagEXT_VkResult_return;
 }
 
@@ -17388,8 +18853,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1169 = (uint64_t)local_queue;
-        countingStream->putBe64(cgen_var_1169);
+        uint64_t cgen_var_1348;
+        countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1348, 1);
+        countingStream->write((uint64_t*)&cgen_var_1348, 8);
         marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
     }
     uint32_t packetSize_vkQueueBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -17397,8 +18863,9 @@
     uint32_t opcode_vkQueueBeginDebugUtilsLabelEXT = OP_vkQueueBeginDebugUtilsLabelEXT;
     stream->write(&opcode_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1170 = (uint64_t)local_queue;
-    stream->putBe64(cgen_var_1170);
+    uint64_t cgen_var_1349;
+    stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1349, 1);
+    stream->write((uint64_t*)&cgen_var_1349, 8);
     marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
     pool->freeAll();
 }
@@ -17415,16 +18882,18 @@
     resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1171 = (uint64_t)local_queue;
-        countingStream->putBe64(cgen_var_1171);
+        uint64_t cgen_var_1350;
+        countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1350, 1);
+        countingStream->write((uint64_t*)&cgen_var_1350, 8);
     }
     uint32_t packetSize_vkQueueEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkQueueEndDebugUtilsLabelEXT = OP_vkQueueEndDebugUtilsLabelEXT;
     stream->write(&opcode_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1172 = (uint64_t)local_queue;
-    stream->putBe64(cgen_var_1172);
+    uint64_t cgen_var_1351;
+    stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1351, 1);
+    stream->write((uint64_t*)&cgen_var_1351, 8);
     pool->freeAll();
 }
 
@@ -17452,8 +18921,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1173 = (uint64_t)local_queue;
-        countingStream->putBe64(cgen_var_1173);
+        uint64_t cgen_var_1352;
+        countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1352, 1);
+        countingStream->write((uint64_t*)&cgen_var_1352, 8);
         marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
     }
     uint32_t packetSize_vkQueueInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -17461,8 +18931,9 @@
     uint32_t opcode_vkQueueInsertDebugUtilsLabelEXT = OP_vkQueueInsertDebugUtilsLabelEXT;
     stream->write(&opcode_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1174 = (uint64_t)local_queue;
-    stream->putBe64(cgen_var_1174);
+    uint64_t cgen_var_1353;
+    stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1353, 1);
+    stream->write((uint64_t*)&cgen_var_1353, 8);
     marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
     pool->freeAll();
 }
@@ -17491,8 +18962,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1175 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1175);
+        uint64_t cgen_var_1354;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1354, 1);
+        countingStream->write((uint64_t*)&cgen_var_1354, 8);
         marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
     }
     uint32_t packetSize_vkCmdBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -17500,8 +18972,9 @@
     uint32_t opcode_vkCmdBeginDebugUtilsLabelEXT = OP_vkCmdBeginDebugUtilsLabelEXT;
     stream->write(&opcode_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1176 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1176);
+    uint64_t cgen_var_1355;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1355, 1);
+    stream->write((uint64_t*)&cgen_var_1355, 8);
     marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
     pool->freeAll();
 }
@@ -17518,16 +18991,18 @@
     resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1177 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1177);
+        uint64_t cgen_var_1356;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1356, 1);
+        countingStream->write((uint64_t*)&cgen_var_1356, 8);
     }
     uint32_t packetSize_vkCmdEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCmdEndDebugUtilsLabelEXT = OP_vkCmdEndDebugUtilsLabelEXT;
     stream->write(&opcode_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1178 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1178);
+    uint64_t cgen_var_1357;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1357, 1);
+    stream->write((uint64_t*)&cgen_var_1357, 8);
     pool->freeAll();
 }
 
@@ -17555,8 +19030,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1179 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1179);
+        uint64_t cgen_var_1358;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1358, 1);
+        countingStream->write((uint64_t*)&cgen_var_1358, 8);
         marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
     }
     uint32_t packetSize_vkCmdInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -17564,8 +19040,9 @@
     uint32_t opcode_vkCmdInsertDebugUtilsLabelEXT = OP_vkCmdInsertDebugUtilsLabelEXT;
     stream->write(&opcode_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1180 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1180);
+    uint64_t cgen_var_1359;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1359, 1);
+    stream->write((uint64_t*)&cgen_var_1359, 8);
     marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
     pool->freeAll();
 }
@@ -17608,38 +19085,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1181 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_1181);
+        uint64_t cgen_var_1360;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1360, 1);
+        countingStream->write((uint64_t*)&cgen_var_1360, 8);
         marshal_VkDebugUtilsMessengerCreateInfoEXT(countingStream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1182 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1182);
+        uint64_t cgen_var_1361 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1361);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT));
+        uint64_t cgen_var_1362;
+        countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1362, 1);
+        countingStream->write((uint64_t*)&cgen_var_1362, 8);
     }
     uint32_t packetSize_vkCreateDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateDebugUtilsMessengerEXT = OP_vkCreateDebugUtilsMessengerEXT;
     stream->write(&opcode_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1183 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_1183);
+    uint64_t cgen_var_1363;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1363, 1);
+    stream->write((uint64_t*)&cgen_var_1363, 8);
     marshal_VkDebugUtilsMessengerCreateInfoEXT(stream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1184 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1184);
+    uint64_t cgen_var_1364 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1364);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT));
+    uint64_t cgen_var_1365;
+    stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1365, 1);
+    stream->write((uint64_t*)&cgen_var_1365, 8);
+    uint64_t cgen_var_1366;
+    stream->read((uint64_t*)&cgen_var_1366, 8);
+    stream->handleMapping()->mapHandles_u64_VkDebugUtilsMessengerEXT(&cgen_var_1366, (VkDebugUtilsMessengerEXT*)pMessenger, 1);
     if (pMessenger)
     {
         resources->createMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)pMessenger, 1);
@@ -17647,6 +19129,8 @@
     pool->freeAll();
     VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0;
     stream->read(&vkCreateDebugUtilsMessengerEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateDebugUtilsMessengerEXT_VkResult_return;
 }
 
@@ -17679,13 +19163,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1185 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_1185);
-        uint64_t cgen_var_1186 = (uint64_t)local_messenger;
-        countingStream->putBe64(cgen_var_1186);
+        uint64_t cgen_var_1367;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1367, 1);
+        countingStream->write((uint64_t*)&cgen_var_1367, 8);
+        uint64_t cgen_var_1368;
+        countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1368, 1);
+        countingStream->write((uint64_t*)&cgen_var_1368, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_1187 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1187);
+        uint64_t cgen_var_1369 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1369);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -17696,13 +19182,15 @@
     uint32_t opcode_vkDestroyDebugUtilsMessengerEXT = OP_vkDestroyDebugUtilsMessengerEXT;
     stream->write(&opcode_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1188 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_1188);
-    uint64_t cgen_var_1189 = (uint64_t)local_messenger;
-    stream->putBe64(cgen_var_1189);
+    uint64_t cgen_var_1370;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1370, 1);
+    stream->write((uint64_t*)&cgen_var_1370, 8);
+    uint64_t cgen_var_1371;
+    stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1371, 1);
+    stream->write((uint64_t*)&cgen_var_1371, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_1190 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1190);
+    uint64_t cgen_var_1372 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1372);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -17741,8 +19229,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1191 = (uint64_t)local_instance;
-        countingStream->putBe64(cgen_var_1191);
+        uint64_t cgen_var_1373;
+        countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1373, 1);
+        countingStream->write((uint64_t*)&cgen_var_1373, 8);
         countingStream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT));
         countingStream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT));
         marshal_VkDebugUtilsMessengerCallbackDataEXT(countingStream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
@@ -17752,8 +19241,9 @@
     uint32_t opcode_vkSubmitDebugUtilsMessageEXT = OP_vkSubmitDebugUtilsMessageEXT;
     stream->write(&opcode_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1192 = (uint64_t)local_instance;
-    stream->putBe64(cgen_var_1192);
+    uint64_t cgen_var_1374;
+    stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1374, 1);
+    stream->write((uint64_t*)&cgen_var_1374, 8);
     stream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT));
     stream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT));
     marshal_VkDebugUtilsMessengerCallbackDataEXT(stream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
@@ -17782,8 +19272,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1193 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1193);
+        uint64_t cgen_var_1375;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1375, 1);
+        countingStream->write((uint64_t*)&cgen_var_1375, 8);
         countingStream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer));
         marshal_VkAndroidHardwareBufferPropertiesANDROID(countingStream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
     }
@@ -17792,14 +19283,17 @@
     uint32_t opcode_vkGetAndroidHardwareBufferPropertiesANDROID = OP_vkGetAndroidHardwareBufferPropertiesANDROID;
     stream->write(&opcode_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t));
     stream->write(&packetSize_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t));
-    uint64_t cgen_var_1194 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1194);
+    uint64_t cgen_var_1376;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1376, 1);
+    stream->write((uint64_t*)&cgen_var_1376, 8);
     stream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer));
     marshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
     unmarshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
     pool->freeAll();
     VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0;
     stream->read(&vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return;
 }
 
@@ -17828,8 +19322,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1195 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1195);
+        uint64_t cgen_var_1377;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1377, 1);
+        countingStream->write((uint64_t*)&cgen_var_1377, 8);
         marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(countingStream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
         countingStream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
     }
@@ -17838,14 +19333,17 @@
     uint32_t opcode_vkGetMemoryAndroidHardwareBufferANDROID = OP_vkGetMemoryAndroidHardwareBufferANDROID;
     stream->write(&opcode_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t));
     stream->write(&packetSize_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t));
-    uint64_t cgen_var_1196 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1196);
+    uint64_t cgen_var_1378;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1378, 1);
+    stream->write((uint64_t*)&cgen_var_1378, 8);
     marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(stream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
     stream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
     stream->read((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
     pool->freeAll();
     VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0;
     stream->read(&vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return;
 }
 
@@ -17885,8 +19383,9 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1197 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1197);
+        uint64_t cgen_var_1379;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1379, 1);
+        countingStream->write((uint64_t*)&cgen_var_1379, 8);
         marshal_VkSampleLocationsInfoEXT(countingStream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
     }
     uint32_t packetSize_vkCmdSetSampleLocationsEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
@@ -17894,8 +19393,9 @@
     uint32_t opcode_vkCmdSetSampleLocationsEXT = OP_vkCmdSetSampleLocationsEXT;
     stream->write(&opcode_vkCmdSetSampleLocationsEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetSampleLocationsEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1198 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1198);
+    uint64_t cgen_var_1380;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1380, 1);
+    stream->write((uint64_t*)&cgen_var_1380, 8);
     marshal_VkSampleLocationsInfoEXT(stream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
     pool->freeAll();
 }
@@ -17916,8 +19416,9 @@
     local_samples = samples;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1199 = (uint64_t)local_physicalDevice;
-        countingStream->putBe64(cgen_var_1199);
+        uint64_t cgen_var_1381;
+        countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1381, 1);
+        countingStream->write((uint64_t*)&cgen_var_1381, 8);
         countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
         marshal_VkMultisamplePropertiesEXT(countingStream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
     }
@@ -17926,8 +19427,9 @@
     uint32_t opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT = OP_vkGetPhysicalDeviceMultisamplePropertiesEXT;
     stream->write(&opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1200 = (uint64_t)local_physicalDevice;
-    stream->putBe64(cgen_var_1200);
+    uint64_t cgen_var_1382;
+    stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1382, 1);
+    stream->write((uint64_t*)&cgen_var_1382, 8);
     stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
     marshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
     unmarshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
@@ -17984,38 +19486,43 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1201 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1201);
+        uint64_t cgen_var_1383;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1383, 1);
+        countingStream->write((uint64_t*)&cgen_var_1383, 8);
         marshal_VkValidationCacheCreateInfoEXT(countingStream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1202 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1202);
+        uint64_t cgen_var_1384 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1384);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
         }
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT));
+        uint64_t cgen_var_1385;
+        countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1385, 1);
+        countingStream->write((uint64_t*)&cgen_var_1385, 8);
     }
     uint32_t packetSize_vkCreateValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkCreateValidationCacheEXT = OP_vkCreateValidationCacheEXT;
     stream->write(&opcode_vkCreateValidationCacheEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkCreateValidationCacheEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1203 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1203);
+    uint64_t cgen_var_1386;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1386, 1);
+    stream->write((uint64_t*)&cgen_var_1386, 8);
     marshal_VkValidationCacheCreateInfoEXT(stream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1204 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1204);
+    uint64_t cgen_var_1387 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1387);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
     }
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT));
-    // WARNING HANDLE TYPE POINTER
-    stream->read((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT));
+    uint64_t cgen_var_1388;
+    stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1388, 1);
+    stream->write((uint64_t*)&cgen_var_1388, 8);
+    uint64_t cgen_var_1389;
+    stream->read((uint64_t*)&cgen_var_1389, 8);
+    stream->handleMapping()->mapHandles_u64_VkValidationCacheEXT(&cgen_var_1389, (VkValidationCacheEXT*)pValidationCache, 1);
     if (pValidationCache)
     {
         resources->createMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)pValidationCache, 1);
@@ -18023,6 +19530,8 @@
     pool->freeAll();
     VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0;
     stream->read(&vkCreateValidationCacheEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkCreateValidationCacheEXT_VkResult_return;
 }
 
@@ -18055,13 +19564,15 @@
     local_pAllocator = nullptr;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1205 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1205);
-        uint64_t cgen_var_1206 = (uint64_t)local_validationCache;
-        countingStream->putBe64(cgen_var_1206);
+        uint64_t cgen_var_1390;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1390, 1);
+        countingStream->write((uint64_t*)&cgen_var_1390, 8);
+        uint64_t cgen_var_1391;
+        countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1391, 1);
+        countingStream->write((uint64_t*)&cgen_var_1391, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_1207 = (uint64_t)(uintptr_t)local_pAllocator;
-        countingStream->putBe64(cgen_var_1207);
+        uint64_t cgen_var_1392 = (uint64_t)(uintptr_t)local_pAllocator;
+        countingStream->putBe64(cgen_var_1392);
         if (local_pAllocator)
         {
             marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -18072,13 +19583,15 @@
     uint32_t opcode_vkDestroyValidationCacheEXT = OP_vkDestroyValidationCacheEXT;
     stream->write(&opcode_vkDestroyValidationCacheEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkDestroyValidationCacheEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1208 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1208);
-    uint64_t cgen_var_1209 = (uint64_t)local_validationCache;
-    stream->putBe64(cgen_var_1209);
+    uint64_t cgen_var_1393;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1393, 1);
+    stream->write((uint64_t*)&cgen_var_1393, 8);
+    uint64_t cgen_var_1394;
+    stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1394, 1);
+    stream->write((uint64_t*)&cgen_var_1394, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_1210 = (uint64_t)(uintptr_t)local_pAllocator;
-    stream->putBe64(cgen_var_1210);
+    uint64_t cgen_var_1395 = (uint64_t)(uintptr_t)local_pAllocator;
+    stream->putBe64(cgen_var_1395);
     if (local_pAllocator)
     {
         marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
@@ -18117,29 +19630,45 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1211 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1211);
-        uint64_t cgen_var_1212 = (uint64_t)local_dstCache;
-        countingStream->putBe64(cgen_var_1212);
+        uint64_t cgen_var_1396;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1396, 1);
+        countingStream->write((uint64_t*)&cgen_var_1396, 8);
+        uint64_t cgen_var_1397;
+        countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1397, 1);
+        countingStream->write((uint64_t*)&cgen_var_1397, 8);
         countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
-        // WARNING HANDLE TYPE POINTER
-        countingStream->write((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkValidationCacheEXT));
+        if (((srcCacheCount)))
+        {
+            uint64_t* cgen_var_1398;
+            countingStream->alloc((void**)&cgen_var_1398, ((srcCacheCount)) * 8);
+            countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1398, ((srcCacheCount)));
+            countingStream->write((uint64_t*)cgen_var_1398, 8);
+        }
     }
     uint32_t packetSize_vkMergeValidationCachesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
     countingStream->rewind();
     uint32_t opcode_vkMergeValidationCachesEXT = OP_vkMergeValidationCachesEXT;
     stream->write(&opcode_vkMergeValidationCachesEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkMergeValidationCachesEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1213 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1213);
-    uint64_t cgen_var_1214 = (uint64_t)local_dstCache;
-    stream->putBe64(cgen_var_1214);
+    uint64_t cgen_var_1399;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1399, 1);
+    stream->write((uint64_t*)&cgen_var_1399, 8);
+    uint64_t cgen_var_1400;
+    stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1400, 1);
+    stream->write((uint64_t*)&cgen_var_1400, 8);
     stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
-    // WARNING HANDLE TYPE POINTER
-    stream->write((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkValidationCacheEXT));
+    if (((srcCacheCount)))
+    {
+        uint64_t* cgen_var_1401;
+        stream->alloc((void**)&cgen_var_1401, ((srcCacheCount)) * 8);
+        stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1401, ((srcCacheCount)));
+        stream->write((uint64_t*)cgen_var_1401, 8);
+    }
     pool->freeAll();
     VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0;
     stream->read(&vkMergeValidationCachesEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkMergeValidationCachesEXT_VkResult_return;
 }
 
@@ -18161,20 +19690,22 @@
     resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&local_validationCache);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1215 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1215);
-        uint64_t cgen_var_1216 = (uint64_t)local_validationCache;
-        countingStream->putBe64(cgen_var_1216);
+        uint64_t cgen_var_1402;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1402, 1);
+        countingStream->write((uint64_t*)&cgen_var_1402, 8);
+        uint64_t cgen_var_1403;
+        countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1403, 1);
+        countingStream->write((uint64_t*)&cgen_var_1403, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_1217 = (uint64_t)(uintptr_t)pDataSize;
-        countingStream->putBe64(cgen_var_1217);
+        uint64_t cgen_var_1404 = (uint64_t)(uintptr_t)pDataSize;
+        countingStream->putBe64(cgen_var_1404);
         if (pDataSize)
         {
             countingStream->write((size_t*)pDataSize, sizeof(size_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_1218 = (uint64_t)(uintptr_t)pData;
-        countingStream->putBe64(cgen_var_1218);
+        uint64_t cgen_var_1405 = (uint64_t)(uintptr_t)pData;
+        countingStream->putBe64(cgen_var_1405);
         if (pData)
         {
             countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
@@ -18185,20 +19716,22 @@
     uint32_t opcode_vkGetValidationCacheDataEXT = OP_vkGetValidationCacheDataEXT;
     stream->write(&opcode_vkGetValidationCacheDataEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkGetValidationCacheDataEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1219 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1219);
-    uint64_t cgen_var_1220 = (uint64_t)local_validationCache;
-    stream->putBe64(cgen_var_1220);
+    uint64_t cgen_var_1406;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1406, 1);
+    stream->write((uint64_t*)&cgen_var_1406, 8);
+    uint64_t cgen_var_1407;
+    stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1407, 1);
+    stream->write((uint64_t*)&cgen_var_1407, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_1221 = (uint64_t)(uintptr_t)pDataSize;
-    stream->putBe64(cgen_var_1221);
+    uint64_t cgen_var_1408 = (uint64_t)(uintptr_t)pDataSize;
+    stream->putBe64(cgen_var_1408);
     if (pDataSize)
     {
         stream->write((size_t*)pDataSize, sizeof(size_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_1222 = (uint64_t)(uintptr_t)pData;
-    stream->putBe64(cgen_var_1222);
+    uint64_t cgen_var_1409 = (uint64_t)(uintptr_t)pData;
+    stream->putBe64(cgen_var_1409);
     if (pData)
     {
         stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
@@ -18228,6 +19761,8 @@
     pool->freeAll();
     VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0;
     stream->read(&vkGetValidationCacheDataEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetValidationCacheDataEXT_VkResult_return;
 }
 
@@ -18262,12 +19797,13 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1225 = (uint64_t)local_device;
-        countingStream->putBe64(cgen_var_1225);
+        uint64_t cgen_var_1412;
+        countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1412, 1);
+        countingStream->write((uint64_t*)&cgen_var_1412, 8);
         countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
         // WARNING PTR CHECK
-        uint64_t cgen_var_1226 = (uint64_t)(uintptr_t)local_pHostPointer;
-        countingStream->putBe64(cgen_var_1226);
+        uint64_t cgen_var_1413 = (uint64_t)(uintptr_t)local_pHostPointer;
+        countingStream->putBe64(cgen_var_1413);
         if (local_pHostPointer)
         {
             countingStream->write((void*)local_pHostPointer, sizeof(uint8_t));
@@ -18279,12 +19815,13 @@
     uint32_t opcode_vkGetMemoryHostPointerPropertiesEXT = OP_vkGetMemoryHostPointerPropertiesEXT;
     stream->write(&opcode_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t));
     stream->write(&packetSize_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t));
-    uint64_t cgen_var_1227 = (uint64_t)local_device;
-    stream->putBe64(cgen_var_1227);
+    uint64_t cgen_var_1414;
+    stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1414, 1);
+    stream->write((uint64_t*)&cgen_var_1414, 8);
     stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
     // WARNING PTR CHECK
-    uint64_t cgen_var_1228 = (uint64_t)(uintptr_t)local_pHostPointer;
-    stream->putBe64(cgen_var_1228);
+    uint64_t cgen_var_1415 = (uint64_t)(uintptr_t)local_pHostPointer;
+    stream->putBe64(cgen_var_1415);
     if (local_pHostPointer)
     {
         stream->write((void*)local_pHostPointer, sizeof(uint8_t));
@@ -18294,6 +19831,8 @@
     pool->freeAll();
     VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0;
     stream->read(&vkGetMemoryHostPointerPropertiesEXT_VkResult_return, sizeof(VkResult));
+    countingStream->clearPool();
+    stream->clearPool();
     return vkGetMemoryHostPointerPropertiesEXT_VkResult_return;
 }
 
@@ -18324,11 +19863,13 @@
     local_marker = marker;
     countingStream->rewind();
     {
-        uint64_t cgen_var_1229 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1229);
+        uint64_t cgen_var_1416;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1416, 1);
+        countingStream->write((uint64_t*)&cgen_var_1416, 8);
         countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
-        uint64_t cgen_var_1230 = (uint64_t)local_dstBuffer;
-        countingStream->putBe64(cgen_var_1230);
+        uint64_t cgen_var_1417;
+        countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1417, 1);
+        countingStream->write((uint64_t*)&cgen_var_1417, 8);
         countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
         countingStream->write((uint32_t*)&local_marker, sizeof(uint32_t));
     }
@@ -18337,11 +19878,13 @@
     uint32_t opcode_vkCmdWriteBufferMarkerAMD = OP_vkCmdWriteBufferMarkerAMD;
     stream->write(&opcode_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t));
-    uint64_t cgen_var_1231 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1231);
+    uint64_t cgen_var_1418;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1418, 1);
+    stream->write((uint64_t*)&cgen_var_1418, 8);
     stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
-    uint64_t cgen_var_1232 = (uint64_t)local_dstBuffer;
-    stream->putBe64(cgen_var_1232);
+    uint64_t cgen_var_1419;
+    stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1419, 1);
+    stream->write((uint64_t*)&cgen_var_1419, 8);
     stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
     stream->write((uint32_t*)&local_marker, sizeof(uint32_t));
     pool->freeAll();
@@ -18374,11 +19917,12 @@
     }
     countingStream->rewind();
     {
-        uint64_t cgen_var_1233 = (uint64_t)local_commandBuffer;
-        countingStream->putBe64(cgen_var_1233);
+        uint64_t cgen_var_1420;
+        countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1420, 1);
+        countingStream->write((uint64_t*)&cgen_var_1420, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_1234 = (uint64_t)(uintptr_t)local_pCheckpointMarker;
-        countingStream->putBe64(cgen_var_1234);
+        uint64_t cgen_var_1421 = (uint64_t)(uintptr_t)local_pCheckpointMarker;
+        countingStream->putBe64(cgen_var_1421);
         if (local_pCheckpointMarker)
         {
             countingStream->write((void*)local_pCheckpointMarker, sizeof(uint8_t));
@@ -18389,11 +19933,12 @@
     uint32_t opcode_vkCmdSetCheckpointNV = OP_vkCmdSetCheckpointNV;
     stream->write(&opcode_vkCmdSetCheckpointNV, sizeof(uint32_t));
     stream->write(&packetSize_vkCmdSetCheckpointNV, sizeof(uint32_t));
-    uint64_t cgen_var_1235 = (uint64_t)local_commandBuffer;
-    stream->putBe64(cgen_var_1235);
+    uint64_t cgen_var_1422;
+    stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1422, 1);
+    stream->write((uint64_t*)&cgen_var_1422, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_1236 = (uint64_t)(uintptr_t)local_pCheckpointMarker;
-    stream->putBe64(cgen_var_1236);
+    uint64_t cgen_var_1423 = (uint64_t)(uintptr_t)local_pCheckpointMarker;
+    stream->putBe64(cgen_var_1423);
     if (local_pCheckpointMarker)
     {
         stream->write((void*)local_pCheckpointMarker, sizeof(uint8_t));
@@ -18415,18 +19960,19 @@
     resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
     countingStream->rewind();
     {
-        uint64_t cgen_var_1237 = (uint64_t)local_queue;
-        countingStream->putBe64(cgen_var_1237);
+        uint64_t cgen_var_1424;
+        countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1424, 1);
+        countingStream->write((uint64_t*)&cgen_var_1424, 8);
         // WARNING PTR CHECK
-        uint64_t cgen_var_1238 = (uint64_t)(uintptr_t)pCheckpointDataCount;
-        countingStream->putBe64(cgen_var_1238);
+        uint64_t cgen_var_1425 = (uint64_t)(uintptr_t)pCheckpointDataCount;
+        countingStream->putBe64(cgen_var_1425);
         if (pCheckpointDataCount)
         {
             countingStream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
         }
         // WARNING PTR CHECK
-        uint64_t cgen_var_1239 = (uint64_t)(uintptr_t)pCheckpointData;
-        countingStream->putBe64(cgen_var_1239);
+        uint64_t cgen_var_1426 = (uint64_t)(uintptr_t)pCheckpointData;
+        countingStream->putBe64(cgen_var_1426);
         if (pCheckpointData)
         {
             for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i)
@@ -18440,18 +19986,19 @@
     uint32_t opcode_vkGetQueueCheckpointDataNV = OP_vkGetQueueCheckpointDataNV;
     stream->write(&opcode_vkGetQueueCheckpointDataNV, sizeof(uint32_t));
     stream->write(&packetSize_vkGetQueueCheckpointDataNV, sizeof(uint32_t));
-    uint64_t cgen_var_1240 = (uint64_t)local_queue;
-    stream->putBe64(cgen_var_1240);
+    uint64_t cgen_var_1427;
+    stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1427, 1);
+    stream->write((uint64_t*)&cgen_var_1427, 8);
     // WARNING PTR CHECK
-    uint64_t cgen_var_1241 = (uint64_t)(uintptr_t)pCheckpointDataCount;
-    stream->putBe64(cgen_var_1241);
+    uint64_t cgen_var_1428 = (uint64_t)(uintptr_t)pCheckpointDataCount;
+    stream->putBe64(cgen_var_1428);
     if (pCheckpointDataCount)
     {
         stream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
     }
     // WARNING PTR CHECK
-    uint64_t cgen_var_1242 = (uint64_t)(uintptr_t)pCheckpointData;
-    stream->putBe64(cgen_var_1242);
+    uint64_t cgen_var_1429 = (uint64_t)(uintptr_t)pCheckpointData;
+    stream->putBe64(cgen_var_1429);
     if (pCheckpointData)
     {
         for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i)
