blob: 9f9805f646292d652947da8f005fb5a92b38dda4 [file] [log] [blame]
Lingfeng Yang6a283672018-11-01 13:37:56 -07001// Copyright (C) 2018 The Android Open Source Project
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002// Copyright (C) 2018 Google Inc.
Lingfeng Yang6a283672018-11-01 13:37:56 -07003//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015
16// Autogenerated module VkEncoder
17// (impl) generated by android/android-emugl/host/libs/libOpenglRender/vulkan-registry/xml/genvk.py -registry android/android-emugl/host/libs/libOpenglRender/vulkan-registry/xml/vk.xml cereal -o android/android-emugl/host/libs/libOpenglRender/vulkan/cereal
18// Please do not modify directly;
19// re-run android/scripts/generate-vulkan-sources.sh,
20// or directly from Python by defining:
21// VULKAN_REGISTRY_XML_DIR : Directory containing genvk.py and vk.xml
22// CEREAL_OUTPUT_DIR: Where to put the generated sources.
23// python3 $VULKAN_REGISTRY_XML_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o $CEREAL_OUTPUT_DIR
24
Lingfeng Yanga126a8a2018-11-01 18:21:40 -070025#include "VkEncoder.h"
Lingfeng Yang6a283672018-11-01 13:37:56 -070026
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070027
Lingfeng Yanga126a8a2018-11-01 18:21:40 -070028#include "IOStream.h"
Lingfeng Yange30d3382018-11-09 08:24:37 -080029#include "Resources.h"
Lingfeng Yang71b596b2018-11-07 18:03:25 -080030#include "ResourceTracker.h"
Lingfeng Yanga126a8a2018-11-01 18:21:40 -070031#include "VulkanStream.h"
32
Lingfeng Yang6f3b6c52018-11-05 14:22:37 -080033#include "android/base/AlignedBuf.h"
Lingfeng Yang71b596b2018-11-07 18:03:25 -080034#include "android/base/Pool.h"
Lingfeng Yang6f3b6c52018-11-05 14:22:37 -080035
Lingfeng Yange71c6422018-11-01 19:29:49 -070036#include "goldfish_vk_marshaling_guest.h"
Lingfeng Yang71b596b2018-11-07 18:03:25 -080037#include "goldfish_vk_deepcopy_guest.h"
38#include "goldfish_vk_handlemap_guest.h"
Lingfeng Yange71c6422018-11-01 19:29:49 -070039
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070040
41
42
43
44
Lingfeng Yang71b596b2018-11-07 18:03:25 -080045using namespace goldfish_vk;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070046
Lingfeng Yang6f3b6c52018-11-05 14:22:37 -080047using android::aligned_buf_alloc;
48using android::aligned_buf_free;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080049using android::base::Pool;
Lingfeng Yang6f3b6c52018-11-05 14:22:37 -080050
Lingfeng Yanga126a8a2018-11-01 18:21:40 -070051class VkEncoder::Impl {
52public:
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070053 Impl(IOStream* stream) : m_stream(stream) { }
54 VulkanCountingStream* countingStream() { return &m_countingStream; }
55 VulkanStream* stream() { return &m_stream; }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080056 Pool* pool() { return &m_pool; }
57 ResourceTracker* resources() { return ResourceTracker::get(); }
Lingfeng Yanga126a8a2018-11-01 18:21:40 -070058private:
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070059 VulkanCountingStream m_countingStream;
60 VulkanStream m_stream;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080061 Pool m_pool { 8, 4096, 64 };
Lingfeng Yanga126a8a2018-11-01 18:21:40 -070062};
63
64VkEncoder::VkEncoder(IOStream *stream) :
65 mImpl(new VkEncoder::Impl(stream)) { }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070066#ifdef VK_VERSION_1_0
67VkResult VkEncoder::vkCreateInstance(
68 const VkInstanceCreateInfo* pCreateInfo,
69 const VkAllocationCallbacks* pAllocator,
70 VkInstance* pInstance)
71{
72 auto stream = mImpl->stream();
73 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080074 auto resources = mImpl->resources();
75 auto pool = mImpl->pool();
76 VkInstanceCreateInfo* local_pCreateInfo;
77 local_pCreateInfo = nullptr;
78 if (pCreateInfo)
79 {
80 local_pCreateInfo = (VkInstanceCreateInfo*)pool->alloc(sizeof(const VkInstanceCreateInfo));
81 deepcopy_VkInstanceCreateInfo(pool, pCreateInfo, (VkInstanceCreateInfo*)(local_pCreateInfo));
82 }
83 if (local_pCreateInfo)
84 {
85 handlemap_VkInstanceCreateInfo(resources->unwrapMapping(), (VkInstanceCreateInfo*)(local_pCreateInfo));
86 }
87 VkAllocationCallbacks* local_pAllocator;
88 local_pAllocator = nullptr;
89 if (pAllocator)
90 {
91 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
92 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
93 }
94 if (local_pAllocator)
95 {
96 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
97 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080098 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070099 countingStream->rewind();
100 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800101 marshal_VkInstanceCreateInfo(countingStream, (VkInstanceCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800102 // WARNING PTR CHECK
103 uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pAllocator;
104 countingStream->putBe64(cgen_var_0);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800105 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700106 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800107 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700108 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800109 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700110 countingStream->write((VkInstance*)pInstance, sizeof(VkInstance));
111 }
112 uint32_t packetSize_vkCreateInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten();
113 countingStream->rewind();
114 uint32_t opcode_vkCreateInstance = OP_vkCreateInstance;
115 stream->write(&opcode_vkCreateInstance, sizeof(uint32_t));
116 stream->write(&packetSize_vkCreateInstance, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800117 marshal_VkInstanceCreateInfo(stream, (VkInstanceCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800118 // WARNING PTR CHECK
119 uint64_t cgen_var_1 = (uint64_t)(uintptr_t)local_pAllocator;
120 stream->putBe64(cgen_var_1);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800121 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700122 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800123 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700124 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800125 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700126 stream->write((VkInstance*)pInstance, sizeof(VkInstance));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800127 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700128 stream->read((VkInstance*)pInstance, sizeof(VkInstance));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800129 if (pInstance)
130 {
131 resources->createMapping()->mapHandles_VkInstance((VkInstance*)pInstance, 1);
132 }
133 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700134 VkResult vkCreateInstance_VkResult_return = (VkResult)0;
135 stream->read(&vkCreateInstance_VkResult_return, sizeof(VkResult));
136 return vkCreateInstance_VkResult_return;
137}
138
139void VkEncoder::vkDestroyInstance(
140 VkInstance instance,
141 const VkAllocationCallbacks* pAllocator)
142{
143 auto stream = mImpl->stream();
144 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800145 auto resources = mImpl->resources();
146 auto pool = mImpl->pool();
Lingfeng Yang9d02e102018-11-10 01:51:46 -0800147 VkInstance local_instance;
148 local_instance = instance;
149 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800150 VkAllocationCallbacks* local_pAllocator;
151 local_pAllocator = nullptr;
152 if (pAllocator)
153 {
154 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
155 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
156 }
157 if (local_pAllocator)
158 {
159 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
160 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -0800161 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700162 countingStream->rewind();
163 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800164 uint64_t cgen_var_2 = (uint64_t)local_instance;
165 countingStream->putBe64(cgen_var_2);
166 // WARNING PTR CHECK
167 uint64_t cgen_var_3 = (uint64_t)(uintptr_t)local_pAllocator;
168 countingStream->putBe64(cgen_var_3);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800169 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700170 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800171 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700172 }
173 }
174 uint32_t packetSize_vkDestroyInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten();
175 countingStream->rewind();
176 uint32_t opcode_vkDestroyInstance = OP_vkDestroyInstance;
177 stream->write(&opcode_vkDestroyInstance, sizeof(uint32_t));
178 stream->write(&packetSize_vkDestroyInstance, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800179 uint64_t cgen_var_4 = (uint64_t)local_instance;
180 stream->putBe64(cgen_var_4);
181 // WARNING PTR CHECK
182 uint64_t cgen_var_5 = (uint64_t)(uintptr_t)local_pAllocator;
183 stream->putBe64(cgen_var_5);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800184 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700185 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800186 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700187 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800188 resources->destroyMapping()->mapHandles_VkInstance((VkInstance*)&instance);
189 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700190}
191
192VkResult VkEncoder::vkEnumeratePhysicalDevices(
193 VkInstance instance,
194 uint32_t* pPhysicalDeviceCount,
195 VkPhysicalDevice* pPhysicalDevices)
196{
197 auto stream = mImpl->stream();
198 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800199 auto resources = mImpl->resources();
200 auto pool = mImpl->pool();
201 VkInstance local_instance;
202 local_instance = instance;
203 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700204 countingStream->rewind();
205 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800206 uint64_t cgen_var_6 = (uint64_t)local_instance;
207 countingStream->putBe64(cgen_var_6);
208 // WARNING PTR CHECK
209 uint64_t cgen_var_7 = (uint64_t)(uintptr_t)pPhysicalDeviceCount;
210 countingStream->putBe64(cgen_var_7);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700211 if (pPhysicalDeviceCount)
212 {
213 countingStream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t));
214 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800215 // WARNING PTR CHECK
216 uint64_t cgen_var_8 = (uint64_t)(uintptr_t)pPhysicalDevices;
217 countingStream->putBe64(cgen_var_8);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700218 if (pPhysicalDevices)
219 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800220 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700221 countingStream->write((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice));
222 }
223 }
224 uint32_t packetSize_vkEnumeratePhysicalDevices = 4 + 4 + (uint32_t)countingStream->bytesWritten();
225 countingStream->rewind();
226 uint32_t opcode_vkEnumeratePhysicalDevices = OP_vkEnumeratePhysicalDevices;
227 stream->write(&opcode_vkEnumeratePhysicalDevices, sizeof(uint32_t));
228 stream->write(&packetSize_vkEnumeratePhysicalDevices, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800229 uint64_t cgen_var_9 = (uint64_t)local_instance;
230 stream->putBe64(cgen_var_9);
231 // WARNING PTR CHECK
232 uint64_t cgen_var_10 = (uint64_t)(uintptr_t)pPhysicalDeviceCount;
233 stream->putBe64(cgen_var_10);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700234 if (pPhysicalDeviceCount)
235 {
236 stream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t));
237 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800238 // WARNING PTR CHECK
239 uint64_t cgen_var_11 = (uint64_t)(uintptr_t)pPhysicalDevices;
240 stream->putBe64(cgen_var_11);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700241 if (pPhysicalDevices)
242 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800243 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700244 stream->write((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice));
245 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800246 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700247 uint32_t* check_pPhysicalDeviceCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800248 check_pPhysicalDeviceCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700249 if (pPhysicalDeviceCount)
250 {
251 if (!(check_pPhysicalDeviceCount))
252 {
253 fprintf(stderr, "fatal: pPhysicalDeviceCount inconsistent between guest and host\n");
254 }
255 stream->read((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t));
256 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800257 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700258 VkPhysicalDevice* check_pPhysicalDevices;
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800259 check_pPhysicalDevices = (VkPhysicalDevice*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700260 if (pPhysicalDevices)
261 {
262 if (!(check_pPhysicalDevices))
263 {
264 fprintf(stderr, "fatal: pPhysicalDevices inconsistent between guest and host\n");
265 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800266 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700267 stream->read((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice));
268 }
Lingfeng Yange30d3382018-11-09 08:24:37 -0800269 if (pPhysicalDevices)
270 {
271 resources->createMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)));
272 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800273 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700274 VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0;
275 stream->read(&vkEnumeratePhysicalDevices_VkResult_return, sizeof(VkResult));
276 return vkEnumeratePhysicalDevices_VkResult_return;
277}
278
279void VkEncoder::vkGetPhysicalDeviceFeatures(
280 VkPhysicalDevice physicalDevice,
281 VkPhysicalDeviceFeatures* pFeatures)
282{
283 auto stream = mImpl->stream();
284 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800285 auto resources = mImpl->resources();
286 auto pool = mImpl->pool();
287 VkPhysicalDevice local_physicalDevice;
288 local_physicalDevice = physicalDevice;
289 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700290 countingStream->rewind();
291 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800292 uint64_t cgen_var_14 = (uint64_t)local_physicalDevice;
293 countingStream->putBe64(cgen_var_14);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700294 marshal_VkPhysicalDeviceFeatures(countingStream, (VkPhysicalDeviceFeatures*)(pFeatures));
295 }
296 uint32_t packetSize_vkGetPhysicalDeviceFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten();
297 countingStream->rewind();
298 uint32_t opcode_vkGetPhysicalDeviceFeatures = OP_vkGetPhysicalDeviceFeatures;
299 stream->write(&opcode_vkGetPhysicalDeviceFeatures, sizeof(uint32_t));
300 stream->write(&packetSize_vkGetPhysicalDeviceFeatures, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800301 uint64_t cgen_var_15 = (uint64_t)local_physicalDevice;
302 stream->putBe64(cgen_var_15);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700303 marshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures));
304 unmarshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800305 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700306}
307
308void VkEncoder::vkGetPhysicalDeviceFormatProperties(
309 VkPhysicalDevice physicalDevice,
310 VkFormat format,
311 VkFormatProperties* pFormatProperties)
312{
313 auto stream = mImpl->stream();
314 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800315 auto resources = mImpl->resources();
316 auto pool = mImpl->pool();
317 VkPhysicalDevice local_physicalDevice;
318 local_physicalDevice = physicalDevice;
319 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
320 VkFormat local_format;
321 local_format = format;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700322 countingStream->rewind();
323 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800324 uint64_t cgen_var_16 = (uint64_t)local_physicalDevice;
325 countingStream->putBe64(cgen_var_16);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800326 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700327 marshal_VkFormatProperties(countingStream, (VkFormatProperties*)(pFormatProperties));
328 }
329 uint32_t packetSize_vkGetPhysicalDeviceFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
330 countingStream->rewind();
331 uint32_t opcode_vkGetPhysicalDeviceFormatProperties = OP_vkGetPhysicalDeviceFormatProperties;
332 stream->write(&opcode_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t));
333 stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800334 uint64_t cgen_var_17 = (uint64_t)local_physicalDevice;
335 stream->putBe64(cgen_var_17);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800336 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700337 marshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties));
338 unmarshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800339 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700340}
341
342VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties(
343 VkPhysicalDevice physicalDevice,
344 VkFormat format,
345 VkImageType type,
346 VkImageTiling tiling,
347 VkImageUsageFlags usage,
348 VkImageCreateFlags flags,
349 VkImageFormatProperties* pImageFormatProperties)
350{
351 auto stream = mImpl->stream();
352 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800353 auto resources = mImpl->resources();
354 auto pool = mImpl->pool();
355 VkPhysicalDevice local_physicalDevice;
356 local_physicalDevice = physicalDevice;
357 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
358 VkFormat local_format;
359 local_format = format;
360 VkImageType local_type;
361 local_type = type;
362 VkImageTiling local_tiling;
363 local_tiling = tiling;
364 VkImageUsageFlags local_usage;
365 local_usage = usage;
366 VkImageCreateFlags local_flags;
367 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700368 countingStream->rewind();
369 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800370 uint64_t cgen_var_18 = (uint64_t)local_physicalDevice;
371 countingStream->putBe64(cgen_var_18);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800372 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
373 countingStream->write((VkImageType*)&local_type, sizeof(VkImageType));
374 countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
375 countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
376 countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700377 marshal_VkImageFormatProperties(countingStream, (VkImageFormatProperties*)(pImageFormatProperties));
378 }
379 uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
380 countingStream->rewind();
381 uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties = OP_vkGetPhysicalDeviceImageFormatProperties;
382 stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t));
383 stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800384 uint64_t cgen_var_19 = (uint64_t)local_physicalDevice;
385 stream->putBe64(cgen_var_19);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800386 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
387 stream->write((VkImageType*)&local_type, sizeof(VkImageType));
388 stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
389 stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
390 stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700391 marshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties));
392 unmarshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800393 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700394 VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0;
395 stream->read(&vkGetPhysicalDeviceImageFormatProperties_VkResult_return, sizeof(VkResult));
396 return vkGetPhysicalDeviceImageFormatProperties_VkResult_return;
397}
398
399void VkEncoder::vkGetPhysicalDeviceProperties(
400 VkPhysicalDevice physicalDevice,
401 VkPhysicalDeviceProperties* pProperties)
402{
403 auto stream = mImpl->stream();
404 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800405 auto resources = mImpl->resources();
406 auto pool = mImpl->pool();
407 VkPhysicalDevice local_physicalDevice;
408 local_physicalDevice = physicalDevice;
409 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700410 countingStream->rewind();
411 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800412 uint64_t cgen_var_20 = (uint64_t)local_physicalDevice;
413 countingStream->putBe64(cgen_var_20);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700414 marshal_VkPhysicalDeviceProperties(countingStream, (VkPhysicalDeviceProperties*)(pProperties));
415 }
416 uint32_t packetSize_vkGetPhysicalDeviceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
417 countingStream->rewind();
418 uint32_t opcode_vkGetPhysicalDeviceProperties = OP_vkGetPhysicalDeviceProperties;
419 stream->write(&opcode_vkGetPhysicalDeviceProperties, sizeof(uint32_t));
420 stream->write(&packetSize_vkGetPhysicalDeviceProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800421 uint64_t cgen_var_21 = (uint64_t)local_physicalDevice;
422 stream->putBe64(cgen_var_21);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700423 marshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties));
424 unmarshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800425 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700426}
427
428void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties(
429 VkPhysicalDevice physicalDevice,
430 uint32_t* pQueueFamilyPropertyCount,
431 VkQueueFamilyProperties* pQueueFamilyProperties)
432{
433 auto stream = mImpl->stream();
434 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800435 auto resources = mImpl->resources();
436 auto pool = mImpl->pool();
437 VkPhysicalDevice local_physicalDevice;
438 local_physicalDevice = physicalDevice;
439 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700440 countingStream->rewind();
441 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800442 uint64_t cgen_var_22 = (uint64_t)local_physicalDevice;
443 countingStream->putBe64(cgen_var_22);
444 // WARNING PTR CHECK
445 uint64_t cgen_var_23 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
446 countingStream->putBe64(cgen_var_23);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700447 if (pQueueFamilyPropertyCount)
448 {
449 countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
450 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800451 // WARNING PTR CHECK
452 uint64_t cgen_var_24 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
453 countingStream->putBe64(cgen_var_24);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700454 if (pQueueFamilyProperties)
455 {
456 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
457 {
458 marshal_VkQueueFamilyProperties(countingStream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i));
459 }
460 }
461 }
462 uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
463 countingStream->rewind();
464 uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties = OP_vkGetPhysicalDeviceQueueFamilyProperties;
465 stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t));
466 stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800467 uint64_t cgen_var_25 = (uint64_t)local_physicalDevice;
468 stream->putBe64(cgen_var_25);
469 // WARNING PTR CHECK
470 uint64_t cgen_var_26 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
471 stream->putBe64(cgen_var_26);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700472 if (pQueueFamilyPropertyCount)
473 {
474 stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
475 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800476 // WARNING PTR CHECK
477 uint64_t cgen_var_27 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
478 stream->putBe64(cgen_var_27);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700479 if (pQueueFamilyProperties)
480 {
481 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
482 {
483 marshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i));
484 }
485 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800486 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700487 uint32_t* check_pQueueFamilyPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800488 check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700489 if (pQueueFamilyPropertyCount)
490 {
491 if (!(check_pQueueFamilyPropertyCount))
492 {
493 fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n");
494 }
495 stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
496 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800497 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700498 VkQueueFamilyProperties* check_pQueueFamilyProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800499 check_pQueueFamilyProperties = (VkQueueFamilyProperties*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700500 if (pQueueFamilyProperties)
501 {
502 if (!(check_pQueueFamilyProperties))
503 {
504 fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n");
505 }
506 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
507 {
508 unmarshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i));
509 }
510 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800511 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700512}
513
514void VkEncoder::vkGetPhysicalDeviceMemoryProperties(
515 VkPhysicalDevice physicalDevice,
516 VkPhysicalDeviceMemoryProperties* pMemoryProperties)
517{
518 auto stream = mImpl->stream();
519 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800520 auto resources = mImpl->resources();
521 auto pool = mImpl->pool();
522 VkPhysicalDevice local_physicalDevice;
523 local_physicalDevice = physicalDevice;
524 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700525 countingStream->rewind();
526 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800527 uint64_t cgen_var_30 = (uint64_t)local_physicalDevice;
528 countingStream->putBe64(cgen_var_30);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700529 marshal_VkPhysicalDeviceMemoryProperties(countingStream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
530 }
531 uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
532 countingStream->rewind();
533 uint32_t opcode_vkGetPhysicalDeviceMemoryProperties = OP_vkGetPhysicalDeviceMemoryProperties;
534 stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t));
535 stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800536 uint64_t cgen_var_31 = (uint64_t)local_physicalDevice;
537 stream->putBe64(cgen_var_31);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700538 marshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
539 unmarshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800540 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700541}
542
543PFN_vkVoidFunction VkEncoder::vkGetInstanceProcAddr(
544 VkInstance instance,
545 const char* pName)
546{
547 auto stream = mImpl->stream();
548 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800549 auto resources = mImpl->resources();
550 auto pool = mImpl->pool();
551 VkInstance local_instance;
552 local_instance = instance;
553 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
554 char* local_pName;
555 local_pName = nullptr;
556 if (pName)
557 {
558 local_pName = pool->strDup(pName);
559 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700560 countingStream->rewind();
561 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800562 uint64_t cgen_var_32 = (uint64_t)local_instance;
563 countingStream->putBe64(cgen_var_32);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800564 countingStream->putString(local_pName);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700565 }
566 uint32_t packetSize_vkGetInstanceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten();
567 countingStream->rewind();
568 uint32_t opcode_vkGetInstanceProcAddr = OP_vkGetInstanceProcAddr;
569 stream->write(&opcode_vkGetInstanceProcAddr, sizeof(uint32_t));
570 stream->write(&packetSize_vkGetInstanceProcAddr, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800571 uint64_t cgen_var_33 = (uint64_t)local_instance;
572 stream->putBe64(cgen_var_33);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800573 stream->putString(local_pName);
574 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700575 PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0;
576 stream->read(&vkGetInstanceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction));
577 return vkGetInstanceProcAddr_PFN_vkVoidFunction_return;
578}
579
580PFN_vkVoidFunction VkEncoder::vkGetDeviceProcAddr(
581 VkDevice device,
582 const char* pName)
583{
584 auto stream = mImpl->stream();
585 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800586 auto resources = mImpl->resources();
587 auto pool = mImpl->pool();
588 VkDevice local_device;
589 local_device = device;
590 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
591 char* local_pName;
592 local_pName = nullptr;
593 if (pName)
594 {
595 local_pName = pool->strDup(pName);
596 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700597 countingStream->rewind();
598 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800599 uint64_t cgen_var_34 = (uint64_t)local_device;
600 countingStream->putBe64(cgen_var_34);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800601 countingStream->putString(local_pName);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700602 }
603 uint32_t packetSize_vkGetDeviceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten();
604 countingStream->rewind();
605 uint32_t opcode_vkGetDeviceProcAddr = OP_vkGetDeviceProcAddr;
606 stream->write(&opcode_vkGetDeviceProcAddr, sizeof(uint32_t));
607 stream->write(&packetSize_vkGetDeviceProcAddr, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800608 uint64_t cgen_var_35 = (uint64_t)local_device;
609 stream->putBe64(cgen_var_35);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800610 stream->putString(local_pName);
611 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700612 PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0;
613 stream->read(&vkGetDeviceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction));
614 return vkGetDeviceProcAddr_PFN_vkVoidFunction_return;
615}
616
617VkResult VkEncoder::vkCreateDevice(
618 VkPhysicalDevice physicalDevice,
619 const VkDeviceCreateInfo* pCreateInfo,
620 const VkAllocationCallbacks* pAllocator,
621 VkDevice* pDevice)
622{
623 auto stream = mImpl->stream();
624 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800625 auto resources = mImpl->resources();
626 auto pool = mImpl->pool();
627 VkPhysicalDevice local_physicalDevice;
628 local_physicalDevice = physicalDevice;
629 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
630 VkDeviceCreateInfo* local_pCreateInfo;
631 local_pCreateInfo = nullptr;
632 if (pCreateInfo)
633 {
634 local_pCreateInfo = (VkDeviceCreateInfo*)pool->alloc(sizeof(const VkDeviceCreateInfo));
635 deepcopy_VkDeviceCreateInfo(pool, pCreateInfo, (VkDeviceCreateInfo*)(local_pCreateInfo));
636 }
637 if (local_pCreateInfo)
638 {
639 handlemap_VkDeviceCreateInfo(resources->unwrapMapping(), (VkDeviceCreateInfo*)(local_pCreateInfo));
640 }
641 VkAllocationCallbacks* local_pAllocator;
642 local_pAllocator = nullptr;
643 if (pAllocator)
644 {
645 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
646 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
647 }
648 if (local_pAllocator)
649 {
650 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
651 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -0800652 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700653 countingStream->rewind();
654 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800655 uint64_t cgen_var_36 = (uint64_t)local_physicalDevice;
656 countingStream->putBe64(cgen_var_36);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800657 marshal_VkDeviceCreateInfo(countingStream, (VkDeviceCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800658 // WARNING PTR CHECK
659 uint64_t cgen_var_37 = (uint64_t)(uintptr_t)local_pAllocator;
660 countingStream->putBe64(cgen_var_37);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800661 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700662 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800663 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700664 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800665 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700666 countingStream->write((VkDevice*)pDevice, sizeof(VkDevice));
667 }
668 uint32_t packetSize_vkCreateDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten();
669 countingStream->rewind();
670 uint32_t opcode_vkCreateDevice = OP_vkCreateDevice;
671 stream->write(&opcode_vkCreateDevice, sizeof(uint32_t));
672 stream->write(&packetSize_vkCreateDevice, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800673 uint64_t cgen_var_38 = (uint64_t)local_physicalDevice;
674 stream->putBe64(cgen_var_38);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800675 marshal_VkDeviceCreateInfo(stream, (VkDeviceCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800676 // WARNING PTR CHECK
677 uint64_t cgen_var_39 = (uint64_t)(uintptr_t)local_pAllocator;
678 stream->putBe64(cgen_var_39);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800679 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700680 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800681 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700682 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800683 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700684 stream->write((VkDevice*)pDevice, sizeof(VkDevice));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800685 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700686 stream->read((VkDevice*)pDevice, sizeof(VkDevice));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800687 if (pDevice)
688 {
689 resources->createMapping()->mapHandles_VkDevice((VkDevice*)pDevice, 1);
690 }
691 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700692 VkResult vkCreateDevice_VkResult_return = (VkResult)0;
693 stream->read(&vkCreateDevice_VkResult_return, sizeof(VkResult));
694 return vkCreateDevice_VkResult_return;
695}
696
697void VkEncoder::vkDestroyDevice(
698 VkDevice device,
699 const VkAllocationCallbacks* pAllocator)
700{
701 auto stream = mImpl->stream();
702 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800703 auto resources = mImpl->resources();
704 auto pool = mImpl->pool();
Lingfeng Yang9d02e102018-11-10 01:51:46 -0800705 VkDevice local_device;
706 local_device = device;
707 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800708 VkAllocationCallbacks* local_pAllocator;
709 local_pAllocator = nullptr;
710 if (pAllocator)
711 {
712 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
713 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
714 }
715 if (local_pAllocator)
716 {
717 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
718 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -0800719 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700720 countingStream->rewind();
721 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800722 uint64_t cgen_var_40 = (uint64_t)local_device;
723 countingStream->putBe64(cgen_var_40);
724 // WARNING PTR CHECK
725 uint64_t cgen_var_41 = (uint64_t)(uintptr_t)local_pAllocator;
726 countingStream->putBe64(cgen_var_41);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800727 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700728 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800729 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700730 }
731 }
732 uint32_t packetSize_vkDestroyDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten();
733 countingStream->rewind();
734 uint32_t opcode_vkDestroyDevice = OP_vkDestroyDevice;
735 stream->write(&opcode_vkDestroyDevice, sizeof(uint32_t));
736 stream->write(&packetSize_vkDestroyDevice, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800737 uint64_t cgen_var_42 = (uint64_t)local_device;
738 stream->putBe64(cgen_var_42);
739 // WARNING PTR CHECK
740 uint64_t cgen_var_43 = (uint64_t)(uintptr_t)local_pAllocator;
741 stream->putBe64(cgen_var_43);
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800742 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700743 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800744 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700745 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800746 resources->destroyMapping()->mapHandles_VkDevice((VkDevice*)&device);
747 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700748}
749
750VkResult VkEncoder::vkEnumerateInstanceExtensionProperties(
751 const char* pLayerName,
752 uint32_t* pPropertyCount,
753 VkExtensionProperties* pProperties)
754{
755 auto stream = mImpl->stream();
756 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800757 auto resources = mImpl->resources();
758 auto pool = mImpl->pool();
759 char* local_pLayerName;
760 local_pLayerName = nullptr;
761 if (pLayerName)
762 {
763 local_pLayerName = pool->strDup(pLayerName);
764 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700765 countingStream->rewind();
766 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800767 countingStream->putString(local_pLayerName);
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800768 // WARNING PTR CHECK
769 uint64_t cgen_var_44 = (uint64_t)(uintptr_t)pPropertyCount;
770 countingStream->putBe64(cgen_var_44);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700771 if (pPropertyCount)
772 {
773 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
774 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800775 // WARNING PTR CHECK
776 uint64_t cgen_var_45 = (uint64_t)(uintptr_t)pProperties;
777 countingStream->putBe64(cgen_var_45);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700778 if (pProperties)
779 {
780 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
781 {
782 marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i));
783 }
784 }
785 }
786 uint32_t packetSize_vkEnumerateInstanceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
787 countingStream->rewind();
788 uint32_t opcode_vkEnumerateInstanceExtensionProperties = OP_vkEnumerateInstanceExtensionProperties;
789 stream->write(&opcode_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t));
790 stream->write(&packetSize_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800791 stream->putString(local_pLayerName);
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800792 // WARNING PTR CHECK
793 uint64_t cgen_var_46 = (uint64_t)(uintptr_t)pPropertyCount;
794 stream->putBe64(cgen_var_46);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700795 if (pPropertyCount)
796 {
797 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
798 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800799 // WARNING PTR CHECK
800 uint64_t cgen_var_47 = (uint64_t)(uintptr_t)pProperties;
801 stream->putBe64(cgen_var_47);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700802 if (pProperties)
803 {
804 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
805 {
806 marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i));
807 }
808 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800809 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700810 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800811 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700812 if (pPropertyCount)
813 {
814 if (!(check_pPropertyCount))
815 {
816 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
817 }
818 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
819 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800820 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700821 VkExtensionProperties* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800822 check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700823 if (pProperties)
824 {
825 if (!(check_pProperties))
826 {
827 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
828 }
829 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
830 {
831 unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i));
832 }
833 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800834 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700835 VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0;
836 stream->read(&vkEnumerateInstanceExtensionProperties_VkResult_return, sizeof(VkResult));
837 return vkEnumerateInstanceExtensionProperties_VkResult_return;
838}
839
840VkResult VkEncoder::vkEnumerateDeviceExtensionProperties(
841 VkPhysicalDevice physicalDevice,
842 const char* pLayerName,
843 uint32_t* pPropertyCount,
844 VkExtensionProperties* pProperties)
845{
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700846 VkResult vkEnumerateDeviceExtensionProperties_VkResult_return = (VkResult)0;
Lingfeng Yang9d02e102018-11-10 01:51:46 -0800847 vkEnumerateDeviceExtensionProperties_VkResult_return = goldfish_vkEnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pPropertyCount, pProperties);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700848 return vkEnumerateDeviceExtensionProperties_VkResult_return;
849}
850
851VkResult VkEncoder::vkEnumerateInstanceLayerProperties(
852 uint32_t* pPropertyCount,
853 VkLayerProperties* pProperties)
854{
855 auto stream = mImpl->stream();
856 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800857 auto resources = mImpl->resources();
858 auto pool = mImpl->pool();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700859 countingStream->rewind();
860 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800861 // WARNING PTR CHECK
862 uint64_t cgen_var_50 = (uint64_t)(uintptr_t)pPropertyCount;
863 countingStream->putBe64(cgen_var_50);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700864 if (pPropertyCount)
865 {
866 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
867 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800868 // WARNING PTR CHECK
869 uint64_t cgen_var_51 = (uint64_t)(uintptr_t)pProperties;
870 countingStream->putBe64(cgen_var_51);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700871 if (pProperties)
872 {
873 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
874 {
875 marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i));
876 }
877 }
878 }
879 uint32_t packetSize_vkEnumerateInstanceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
880 countingStream->rewind();
881 uint32_t opcode_vkEnumerateInstanceLayerProperties = OP_vkEnumerateInstanceLayerProperties;
882 stream->write(&opcode_vkEnumerateInstanceLayerProperties, sizeof(uint32_t));
883 stream->write(&packetSize_vkEnumerateInstanceLayerProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800884 // WARNING PTR CHECK
885 uint64_t cgen_var_52 = (uint64_t)(uintptr_t)pPropertyCount;
886 stream->putBe64(cgen_var_52);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700887 if (pPropertyCount)
888 {
889 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
890 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800891 // WARNING PTR CHECK
892 uint64_t cgen_var_53 = (uint64_t)(uintptr_t)pProperties;
893 stream->putBe64(cgen_var_53);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700894 if (pProperties)
895 {
896 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
897 {
898 marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i));
899 }
900 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800901 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700902 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800903 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700904 if (pPropertyCount)
905 {
906 if (!(check_pPropertyCount))
907 {
908 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
909 }
910 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
911 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800912 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700913 VkLayerProperties* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800914 check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700915 if (pProperties)
916 {
917 if (!(check_pProperties))
918 {
919 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
920 }
921 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
922 {
923 unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i));
924 }
925 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800926 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700927 VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0;
928 stream->read(&vkEnumerateInstanceLayerProperties_VkResult_return, sizeof(VkResult));
929 return vkEnumerateInstanceLayerProperties_VkResult_return;
930}
931
932VkResult VkEncoder::vkEnumerateDeviceLayerProperties(
933 VkPhysicalDevice physicalDevice,
934 uint32_t* pPropertyCount,
935 VkLayerProperties* pProperties)
936{
937 auto stream = mImpl->stream();
938 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800939 auto resources = mImpl->resources();
940 auto pool = mImpl->pool();
941 VkPhysicalDevice local_physicalDevice;
942 local_physicalDevice = physicalDevice;
943 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700944 countingStream->rewind();
945 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800946 uint64_t cgen_var_56 = (uint64_t)local_physicalDevice;
947 countingStream->putBe64(cgen_var_56);
948 // WARNING PTR CHECK
949 uint64_t cgen_var_57 = (uint64_t)(uintptr_t)pPropertyCount;
950 countingStream->putBe64(cgen_var_57);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700951 if (pPropertyCount)
952 {
953 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
954 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800955 // WARNING PTR CHECK
956 uint64_t cgen_var_58 = (uint64_t)(uintptr_t)pProperties;
957 countingStream->putBe64(cgen_var_58);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700958 if (pProperties)
959 {
960 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
961 {
962 marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i));
963 }
964 }
965 }
966 uint32_t packetSize_vkEnumerateDeviceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
967 countingStream->rewind();
968 uint32_t opcode_vkEnumerateDeviceLayerProperties = OP_vkEnumerateDeviceLayerProperties;
969 stream->write(&opcode_vkEnumerateDeviceLayerProperties, sizeof(uint32_t));
970 stream->write(&packetSize_vkEnumerateDeviceLayerProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800971 uint64_t cgen_var_59 = (uint64_t)local_physicalDevice;
972 stream->putBe64(cgen_var_59);
973 // WARNING PTR CHECK
974 uint64_t cgen_var_60 = (uint64_t)(uintptr_t)pPropertyCount;
975 stream->putBe64(cgen_var_60);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700976 if (pPropertyCount)
977 {
978 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
979 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800980 // WARNING PTR CHECK
981 uint64_t cgen_var_61 = (uint64_t)(uintptr_t)pProperties;
982 stream->putBe64(cgen_var_61);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700983 if (pProperties)
984 {
985 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
986 {
987 marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i));
988 }
989 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800990 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700991 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -0800992 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700993 if (pPropertyCount)
994 {
995 if (!(check_pPropertyCount))
996 {
997 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
998 }
999 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
1000 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001001 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001002 VkLayerProperties* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001003 check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001004 if (pProperties)
1005 {
1006 if (!(check_pProperties))
1007 {
1008 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
1009 }
1010 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
1011 {
1012 unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i));
1013 }
1014 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001015 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001016 VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0;
1017 stream->read(&vkEnumerateDeviceLayerProperties_VkResult_return, sizeof(VkResult));
1018 return vkEnumerateDeviceLayerProperties_VkResult_return;
1019}
1020
1021void VkEncoder::vkGetDeviceQueue(
1022 VkDevice device,
1023 uint32_t queueFamilyIndex,
1024 uint32_t queueIndex,
1025 VkQueue* pQueue)
1026{
1027 auto stream = mImpl->stream();
1028 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001029 auto resources = mImpl->resources();
1030 auto pool = mImpl->pool();
1031 VkDevice local_device;
1032 local_device = device;
1033 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1034 uint32_t local_queueFamilyIndex;
1035 local_queueFamilyIndex = queueFamilyIndex;
1036 uint32_t local_queueIndex;
1037 local_queueIndex = queueIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001038 countingStream->rewind();
1039 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001040 uint64_t cgen_var_64 = (uint64_t)local_device;
1041 countingStream->putBe64(cgen_var_64);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001042 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
1043 countingStream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001044 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001045 countingStream->write((VkQueue*)pQueue, sizeof(VkQueue));
1046 }
1047 uint32_t packetSize_vkGetDeviceQueue = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1048 countingStream->rewind();
1049 uint32_t opcode_vkGetDeviceQueue = OP_vkGetDeviceQueue;
1050 stream->write(&opcode_vkGetDeviceQueue, sizeof(uint32_t));
1051 stream->write(&packetSize_vkGetDeviceQueue, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001052 uint64_t cgen_var_65 = (uint64_t)local_device;
1053 stream->putBe64(cgen_var_65);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001054 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
1055 stream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001056 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001057 stream->write((VkQueue*)pQueue, sizeof(VkQueue));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001058 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001059 stream->read((VkQueue*)pQueue, sizeof(VkQueue));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001060 if (pQueue)
1061 {
1062 resources->createMapping()->mapHandles_VkQueue((VkQueue*)pQueue, 1);
1063 }
1064 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001065}
1066
1067VkResult VkEncoder::vkQueueSubmit(
1068 VkQueue queue,
1069 uint32_t submitCount,
1070 const VkSubmitInfo* pSubmits,
1071 VkFence fence)
1072{
1073 auto stream = mImpl->stream();
1074 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001075 auto resources = mImpl->resources();
1076 auto pool = mImpl->pool();
1077 VkQueue local_queue;
1078 local_queue = queue;
1079 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
1080 uint32_t local_submitCount;
1081 local_submitCount = submitCount;
1082 VkSubmitInfo* local_pSubmits;
1083 local_pSubmits = nullptr;
1084 if (pSubmits)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001085 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001086 local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001087 for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i)
1088 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001089 deepcopy_VkSubmitInfo(pool, pSubmits + i, (VkSubmitInfo*)(local_pSubmits + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001090 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001091 }
1092 if (local_pSubmits)
1093 {
1094 for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i)
1095 {
1096 handlemap_VkSubmitInfo(resources->unwrapMapping(), (VkSubmitInfo*)(local_pSubmits + i));
1097 }
1098 }
1099 VkFence local_fence;
1100 local_fence = fence;
1101 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
1102 countingStream->rewind();
1103 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001104 uint64_t cgen_var_66 = (uint64_t)local_queue;
1105 countingStream->putBe64(cgen_var_66);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001106 countingStream->write((uint32_t*)&local_submitCount, sizeof(uint32_t));
1107 for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i)
1108 {
1109 marshal_VkSubmitInfo(countingStream, (VkSubmitInfo*)(local_pSubmits + i));
1110 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001111 uint64_t cgen_var_67 = (uint64_t)local_fence;
1112 countingStream->putBe64(cgen_var_67);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001113 }
1114 uint32_t packetSize_vkQueueSubmit = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1115 countingStream->rewind();
1116 uint32_t opcode_vkQueueSubmit = OP_vkQueueSubmit;
1117 stream->write(&opcode_vkQueueSubmit, sizeof(uint32_t));
1118 stream->write(&packetSize_vkQueueSubmit, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001119 uint64_t cgen_var_68 = (uint64_t)local_queue;
1120 stream->putBe64(cgen_var_68);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001121 stream->write((uint32_t*)&local_submitCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001122 for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i)
1123 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001124 marshal_VkSubmitInfo(stream, (VkSubmitInfo*)(local_pSubmits + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001125 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001126 uint64_t cgen_var_69 = (uint64_t)local_fence;
1127 stream->putBe64(cgen_var_69);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001128 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001129 VkResult vkQueueSubmit_VkResult_return = (VkResult)0;
1130 stream->read(&vkQueueSubmit_VkResult_return, sizeof(VkResult));
1131 return vkQueueSubmit_VkResult_return;
1132}
1133
1134VkResult VkEncoder::vkQueueWaitIdle(
1135 VkQueue queue)
1136{
1137 auto stream = mImpl->stream();
1138 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001139 auto resources = mImpl->resources();
1140 auto pool = mImpl->pool();
1141 VkQueue local_queue;
1142 local_queue = queue;
1143 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001144 countingStream->rewind();
1145 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001146 uint64_t cgen_var_70 = (uint64_t)local_queue;
1147 countingStream->putBe64(cgen_var_70);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001148 }
1149 uint32_t packetSize_vkQueueWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1150 countingStream->rewind();
1151 uint32_t opcode_vkQueueWaitIdle = OP_vkQueueWaitIdle;
1152 stream->write(&opcode_vkQueueWaitIdle, sizeof(uint32_t));
1153 stream->write(&packetSize_vkQueueWaitIdle, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001154 uint64_t cgen_var_71 = (uint64_t)local_queue;
1155 stream->putBe64(cgen_var_71);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001156 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001157 VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0;
1158 stream->read(&vkQueueWaitIdle_VkResult_return, sizeof(VkResult));
1159 return vkQueueWaitIdle_VkResult_return;
1160}
1161
1162VkResult VkEncoder::vkDeviceWaitIdle(
1163 VkDevice device)
1164{
1165 auto stream = mImpl->stream();
1166 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001167 auto resources = mImpl->resources();
1168 auto pool = mImpl->pool();
1169 VkDevice local_device;
1170 local_device = device;
1171 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001172 countingStream->rewind();
1173 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001174 uint64_t cgen_var_72 = (uint64_t)local_device;
1175 countingStream->putBe64(cgen_var_72);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001176 }
1177 uint32_t packetSize_vkDeviceWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1178 countingStream->rewind();
1179 uint32_t opcode_vkDeviceWaitIdle = OP_vkDeviceWaitIdle;
1180 stream->write(&opcode_vkDeviceWaitIdle, sizeof(uint32_t));
1181 stream->write(&packetSize_vkDeviceWaitIdle, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001182 uint64_t cgen_var_73 = (uint64_t)local_device;
1183 stream->putBe64(cgen_var_73);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001184 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001185 VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0;
1186 stream->read(&vkDeviceWaitIdle_VkResult_return, sizeof(VkResult));
1187 return vkDeviceWaitIdle_VkResult_return;
1188}
1189
1190VkResult VkEncoder::vkAllocateMemory(
1191 VkDevice device,
1192 const VkMemoryAllocateInfo* pAllocateInfo,
1193 const VkAllocationCallbacks* pAllocator,
1194 VkDeviceMemory* pMemory)
1195{
1196 auto stream = mImpl->stream();
1197 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001198 auto resources = mImpl->resources();
1199 auto pool = mImpl->pool();
1200 VkDevice local_device;
1201 local_device = device;
1202 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1203 VkMemoryAllocateInfo* local_pAllocateInfo;
1204 local_pAllocateInfo = nullptr;
1205 if (pAllocateInfo)
1206 {
1207 local_pAllocateInfo = (VkMemoryAllocateInfo*)pool->alloc(sizeof(const VkMemoryAllocateInfo));
1208 deepcopy_VkMemoryAllocateInfo(pool, pAllocateInfo, (VkMemoryAllocateInfo*)(local_pAllocateInfo));
1209 }
1210 if (local_pAllocateInfo)
1211 {
1212 handlemap_VkMemoryAllocateInfo(resources->unwrapMapping(), (VkMemoryAllocateInfo*)(local_pAllocateInfo));
1213 }
1214 VkAllocationCallbacks* local_pAllocator;
1215 local_pAllocator = nullptr;
1216 if (pAllocator)
1217 {
1218 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
1219 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
1220 }
1221 if (local_pAllocator)
1222 {
1223 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
1224 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08001225 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001226 countingStream->rewind();
1227 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001228 uint64_t cgen_var_74 = (uint64_t)local_device;
1229 countingStream->putBe64(cgen_var_74);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001230 marshal_VkMemoryAllocateInfo(countingStream, (VkMemoryAllocateInfo*)(local_pAllocateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001231 // WARNING PTR CHECK
1232 uint64_t cgen_var_75 = (uint64_t)(uintptr_t)local_pAllocator;
1233 countingStream->putBe64(cgen_var_75);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001234 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001235 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001236 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001237 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001238 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001239 countingStream->write((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory));
1240 }
1241 uint32_t packetSize_vkAllocateMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1242 countingStream->rewind();
1243 uint32_t opcode_vkAllocateMemory = OP_vkAllocateMemory;
1244 stream->write(&opcode_vkAllocateMemory, sizeof(uint32_t));
1245 stream->write(&packetSize_vkAllocateMemory, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001246 uint64_t cgen_var_76 = (uint64_t)local_device;
1247 stream->putBe64(cgen_var_76);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001248 marshal_VkMemoryAllocateInfo(stream, (VkMemoryAllocateInfo*)(local_pAllocateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001249 // WARNING PTR CHECK
1250 uint64_t cgen_var_77 = (uint64_t)(uintptr_t)local_pAllocator;
1251 stream->putBe64(cgen_var_77);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001252 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001253 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001254 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001255 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001256 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001257 stream->write((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001258 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001259 stream->read((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001260 if (pMemory)
1261 {
1262 resources->createMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)pMemory, 1);
1263 }
Lingfeng Yange30d3382018-11-09 08:24:37 -08001264 goldfish_vkAllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001265 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001266 VkResult vkAllocateMemory_VkResult_return = (VkResult)0;
1267 stream->read(&vkAllocateMemory_VkResult_return, sizeof(VkResult));
1268 return vkAllocateMemory_VkResult_return;
1269}
1270
1271void VkEncoder::vkFreeMemory(
1272 VkDevice device,
1273 VkDeviceMemory memory,
1274 const VkAllocationCallbacks* pAllocator)
1275{
1276 auto stream = mImpl->stream();
1277 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001278 auto resources = mImpl->resources();
1279 auto pool = mImpl->pool();
1280 VkDevice local_device;
1281 local_device = device;
1282 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08001283 VkDeviceMemory local_memory;
1284 local_memory = memory;
1285 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001286 VkAllocationCallbacks* local_pAllocator;
1287 local_pAllocator = nullptr;
1288 if (pAllocator)
1289 {
1290 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
1291 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
1292 }
1293 if (local_pAllocator)
1294 {
1295 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
1296 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08001297 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001298 countingStream->rewind();
1299 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001300 uint64_t cgen_var_78 = (uint64_t)local_device;
1301 countingStream->putBe64(cgen_var_78);
1302 uint64_t cgen_var_79 = (uint64_t)local_memory;
1303 countingStream->putBe64(cgen_var_79);
1304 // WARNING PTR CHECK
1305 uint64_t cgen_var_80 = (uint64_t)(uintptr_t)local_pAllocator;
1306 countingStream->putBe64(cgen_var_80);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001307 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001308 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001309 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001310 }
1311 }
1312 uint32_t packetSize_vkFreeMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1313 countingStream->rewind();
1314 uint32_t opcode_vkFreeMemory = OP_vkFreeMemory;
1315 stream->write(&opcode_vkFreeMemory, sizeof(uint32_t));
1316 stream->write(&packetSize_vkFreeMemory, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001317 uint64_t cgen_var_81 = (uint64_t)local_device;
1318 stream->putBe64(cgen_var_81);
1319 uint64_t cgen_var_82 = (uint64_t)local_memory;
1320 stream->putBe64(cgen_var_82);
1321 // WARNING PTR CHECK
1322 uint64_t cgen_var_83 = (uint64_t)(uintptr_t)local_pAllocator;
1323 stream->putBe64(cgen_var_83);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001324 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001325 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001326 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001327 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001328 resources->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory);
1329 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001330}
1331
1332VkResult VkEncoder::vkMapMemory(
1333 VkDevice device,
1334 VkDeviceMemory memory,
1335 VkDeviceSize offset,
1336 VkDeviceSize size,
1337 VkMemoryMapFlags flags,
1338 void** ppData)
1339{
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001340 VkResult vkMapMemory_VkResult_return = (VkResult)0;
Lingfeng Yange30d3382018-11-09 08:24:37 -08001341 vkMapMemory_VkResult_return = goldfish_vkMapMemory(device, memory, offset, size, flags, ppData);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001342 return vkMapMemory_VkResult_return;
1343}
1344
1345void VkEncoder::vkUnmapMemory(
1346 VkDevice device,
1347 VkDeviceMemory memory)
1348{
Lingfeng Yange30d3382018-11-09 08:24:37 -08001349 goldfish_vkUnmapMemory(device, memory);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001350}
1351
1352VkResult VkEncoder::vkFlushMappedMemoryRanges(
1353 VkDevice device,
1354 uint32_t memoryRangeCount,
1355 const VkMappedMemoryRange* pMemoryRanges)
1356{
1357 auto stream = mImpl->stream();
1358 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001359 auto resources = mImpl->resources();
1360 auto pool = mImpl->pool();
1361 VkDevice local_device;
1362 local_device = device;
1363 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1364 uint32_t local_memoryRangeCount;
1365 local_memoryRangeCount = memoryRangeCount;
1366 VkMappedMemoryRange* local_pMemoryRanges;
1367 local_pMemoryRanges = nullptr;
1368 if (pMemoryRanges)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001369 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001370 local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001371 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1372 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001373 deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
1374 }
1375 }
1376 if (local_pMemoryRanges)
1377 {
1378 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1379 {
1380 handlemap_VkMappedMemoryRange(resources->unwrapMapping(), (VkMappedMemoryRange*)(local_pMemoryRanges + i));
1381 }
1382 }
1383 countingStream->rewind();
1384 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001385 uint64_t cgen_var_84 = (uint64_t)local_device;
1386 countingStream->putBe64(cgen_var_84);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001387 countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
1388 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1389 {
1390 marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001391 }
1392 }
Lingfeng Yange30d3382018-11-09 08:24:37 -08001393 for (uint32_t i = 0; i < memoryRangeCount; ++i)
1394 {
1395 auto range = pMemoryRanges[i];
1396 auto memory = pMemoryRanges[i].memory;
1397 auto size = pMemoryRanges[i].size;
1398 auto offset = pMemoryRanges[i].offset;
1399 auto goldfishMem = as_goldfish_VkDeviceMemory(memory);
1400 size_t streamSize = 0;
1401 if (!goldfishMem) { countingStream->write(&streamSize, sizeof(size_t)); continue; };
1402 auto hostPtr = goldfishMem->ptr;
Lingfeng Yang9d02e102018-11-10 01:51:46 -08001403 auto actualSize = size == VK_WHOLE_SIZE ? goldfishMem->size : size;
Lingfeng Yange30d3382018-11-09 08:24:37 -08001404 if (!hostPtr) { countingStream->write(&streamSize, sizeof(size_t)); continue; };
Lingfeng Yang9d02e102018-11-10 01:51:46 -08001405 streamSize = actualSize;
Lingfeng Yange30d3382018-11-09 08:24:37 -08001406 countingStream->write(&streamSize, sizeof(size_t));
1407 uint8_t* targetRange = hostPtr + offset;
Lingfeng Yang9d02e102018-11-10 01:51:46 -08001408 countingStream->write(targetRange, actualSize);
Lingfeng Yange30d3382018-11-09 08:24:37 -08001409 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001410 uint32_t packetSize_vkFlushMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1411 countingStream->rewind();
1412 uint32_t opcode_vkFlushMappedMemoryRanges = OP_vkFlushMappedMemoryRanges;
1413 stream->write(&opcode_vkFlushMappedMemoryRanges, sizeof(uint32_t));
1414 stream->write(&packetSize_vkFlushMappedMemoryRanges, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001415 uint64_t cgen_var_85 = (uint64_t)local_device;
1416 stream->putBe64(cgen_var_85);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001417 stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001418 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1419 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001420 marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001421 }
Lingfeng Yange30d3382018-11-09 08:24:37 -08001422 for (uint32_t i = 0; i < memoryRangeCount; ++i)
1423 {
1424 auto range = pMemoryRanges[i];
1425 auto memory = pMemoryRanges[i].memory;
1426 auto size = pMemoryRanges[i].size;
1427 auto offset = pMemoryRanges[i].offset;
1428 auto goldfishMem = as_goldfish_VkDeviceMemory(memory);
1429 size_t streamSize = 0;
1430 if (!goldfishMem) { stream->write(&streamSize, sizeof(size_t)); continue; };
1431 auto hostPtr = goldfishMem->ptr;
Lingfeng Yang9d02e102018-11-10 01:51:46 -08001432 auto actualSize = size == VK_WHOLE_SIZE ? goldfishMem->size : size;
Lingfeng Yange30d3382018-11-09 08:24:37 -08001433 if (!hostPtr) { stream->write(&streamSize, sizeof(size_t)); continue; };
Lingfeng Yang9d02e102018-11-10 01:51:46 -08001434 streamSize = actualSize;
Lingfeng Yange30d3382018-11-09 08:24:37 -08001435 stream->write(&streamSize, sizeof(size_t));
1436 uint8_t* targetRange = hostPtr + offset;
Lingfeng Yang9d02e102018-11-10 01:51:46 -08001437 stream->write(targetRange, actualSize);
Lingfeng Yange30d3382018-11-09 08:24:37 -08001438 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001439 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001440 VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0;
1441 stream->read(&vkFlushMappedMemoryRanges_VkResult_return, sizeof(VkResult));
1442 return vkFlushMappedMemoryRanges_VkResult_return;
1443}
1444
1445VkResult VkEncoder::vkInvalidateMappedMemoryRanges(
1446 VkDevice device,
1447 uint32_t memoryRangeCount,
1448 const VkMappedMemoryRange* pMemoryRanges)
1449{
1450 auto stream = mImpl->stream();
1451 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001452 auto resources = mImpl->resources();
1453 auto pool = mImpl->pool();
1454 VkDevice local_device;
1455 local_device = device;
1456 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1457 uint32_t local_memoryRangeCount;
1458 local_memoryRangeCount = memoryRangeCount;
1459 VkMappedMemoryRange* local_pMemoryRanges;
1460 local_pMemoryRanges = nullptr;
1461 if (pMemoryRanges)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001462 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001463 local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001464 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1465 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001466 deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
1467 }
1468 }
1469 if (local_pMemoryRanges)
1470 {
1471 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1472 {
1473 handlemap_VkMappedMemoryRange(resources->unwrapMapping(), (VkMappedMemoryRange*)(local_pMemoryRanges + i));
1474 }
1475 }
1476 countingStream->rewind();
1477 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001478 uint64_t cgen_var_86 = (uint64_t)local_device;
1479 countingStream->putBe64(cgen_var_86);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001480 countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
1481 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1482 {
1483 marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001484 }
1485 }
1486 uint32_t packetSize_vkInvalidateMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1487 countingStream->rewind();
1488 uint32_t opcode_vkInvalidateMappedMemoryRanges = OP_vkInvalidateMappedMemoryRanges;
1489 stream->write(&opcode_vkInvalidateMappedMemoryRanges, sizeof(uint32_t));
1490 stream->write(&packetSize_vkInvalidateMappedMemoryRanges, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001491 uint64_t cgen_var_87 = (uint64_t)local_device;
1492 stream->putBe64(cgen_var_87);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001493 stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001494 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1495 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001496 marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001497 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001498 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001499 VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0;
1500 stream->read(&vkInvalidateMappedMemoryRanges_VkResult_return, sizeof(VkResult));
Lingfeng Yang9d02e102018-11-10 01:51:46 -08001501 for (uint32_t i = 0; i < memoryRangeCount; ++i)
1502 {
1503 auto range = pMemoryRanges[i];
1504 auto memory = pMemoryRanges[i].memory;
1505 auto size = pMemoryRanges[i].size;
1506 auto offset = pMemoryRanges[i].offset;
1507 auto goldfishMem = as_goldfish_VkDeviceMemory(memory);
1508 size_t streamSize = 0;
1509 if (!goldfishMem) { stream->read(&streamSize, sizeof(size_t)); continue; };
1510 auto hostPtr = goldfishMem->ptr;
1511 auto actualSize = size == VK_WHOLE_SIZE ? goldfishMem->size : size;
1512 if (!hostPtr) { stream->read(&streamSize, sizeof(size_t)); continue; };
1513 streamSize = actualSize;
1514 stream->read(&streamSize, sizeof(size_t));
1515 uint8_t* targetRange = hostPtr + offset;
1516 stream->read(targetRange, actualSize);
1517 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001518 return vkInvalidateMappedMemoryRanges_VkResult_return;
1519}
1520
1521void VkEncoder::vkGetDeviceMemoryCommitment(
1522 VkDevice device,
1523 VkDeviceMemory memory,
1524 VkDeviceSize* pCommittedMemoryInBytes)
1525{
1526 auto stream = mImpl->stream();
1527 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001528 auto resources = mImpl->resources();
1529 auto pool = mImpl->pool();
1530 VkDevice local_device;
1531 local_device = device;
1532 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1533 VkDeviceMemory local_memory;
1534 local_memory = memory;
1535 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001536 countingStream->rewind();
1537 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001538 uint64_t cgen_var_88 = (uint64_t)local_device;
1539 countingStream->putBe64(cgen_var_88);
1540 uint64_t cgen_var_89 = (uint64_t)local_memory;
1541 countingStream->putBe64(cgen_var_89);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001542 countingStream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
1543 }
1544 uint32_t packetSize_vkGetDeviceMemoryCommitment = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1545 countingStream->rewind();
1546 uint32_t opcode_vkGetDeviceMemoryCommitment = OP_vkGetDeviceMemoryCommitment;
1547 stream->write(&opcode_vkGetDeviceMemoryCommitment, sizeof(uint32_t));
1548 stream->write(&packetSize_vkGetDeviceMemoryCommitment, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001549 uint64_t cgen_var_90 = (uint64_t)local_device;
1550 stream->putBe64(cgen_var_90);
1551 uint64_t cgen_var_91 = (uint64_t)local_memory;
1552 stream->putBe64(cgen_var_91);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001553 stream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
1554 stream->read((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001555 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001556}
1557
1558VkResult VkEncoder::vkBindBufferMemory(
1559 VkDevice device,
1560 VkBuffer buffer,
1561 VkDeviceMemory memory,
1562 VkDeviceSize memoryOffset)
1563{
1564 auto stream = mImpl->stream();
1565 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001566 auto resources = mImpl->resources();
1567 auto pool = mImpl->pool();
1568 VkDevice local_device;
1569 local_device = device;
1570 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1571 VkBuffer local_buffer;
1572 local_buffer = buffer;
1573 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
1574 VkDeviceMemory local_memory;
1575 local_memory = memory;
1576 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
1577 VkDeviceSize local_memoryOffset;
1578 local_memoryOffset = memoryOffset;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001579 countingStream->rewind();
1580 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001581 uint64_t cgen_var_92 = (uint64_t)local_device;
1582 countingStream->putBe64(cgen_var_92);
1583 uint64_t cgen_var_93 = (uint64_t)local_buffer;
1584 countingStream->putBe64(cgen_var_93);
1585 uint64_t cgen_var_94 = (uint64_t)local_memory;
1586 countingStream->putBe64(cgen_var_94);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001587 countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001588 }
1589 uint32_t packetSize_vkBindBufferMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1590 countingStream->rewind();
1591 uint32_t opcode_vkBindBufferMemory = OP_vkBindBufferMemory;
1592 stream->write(&opcode_vkBindBufferMemory, sizeof(uint32_t));
1593 stream->write(&packetSize_vkBindBufferMemory, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001594 uint64_t cgen_var_95 = (uint64_t)local_device;
1595 stream->putBe64(cgen_var_95);
1596 uint64_t cgen_var_96 = (uint64_t)local_buffer;
1597 stream->putBe64(cgen_var_96);
1598 uint64_t cgen_var_97 = (uint64_t)local_memory;
1599 stream->putBe64(cgen_var_97);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001600 stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
1601 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001602 VkResult vkBindBufferMemory_VkResult_return = (VkResult)0;
1603 stream->read(&vkBindBufferMemory_VkResult_return, sizeof(VkResult));
1604 return vkBindBufferMemory_VkResult_return;
1605}
1606
1607VkResult VkEncoder::vkBindImageMemory(
1608 VkDevice device,
1609 VkImage image,
1610 VkDeviceMemory memory,
1611 VkDeviceSize memoryOffset)
1612{
1613 auto stream = mImpl->stream();
1614 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001615 auto resources = mImpl->resources();
1616 auto pool = mImpl->pool();
1617 VkDevice local_device;
1618 local_device = device;
1619 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1620 VkImage local_image;
1621 local_image = image;
1622 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
1623 VkDeviceMemory local_memory;
1624 local_memory = memory;
1625 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
1626 VkDeviceSize local_memoryOffset;
1627 local_memoryOffset = memoryOffset;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001628 countingStream->rewind();
1629 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001630 uint64_t cgen_var_98 = (uint64_t)local_device;
1631 countingStream->putBe64(cgen_var_98);
1632 uint64_t cgen_var_99 = (uint64_t)local_image;
1633 countingStream->putBe64(cgen_var_99);
1634 uint64_t cgen_var_100 = (uint64_t)local_memory;
1635 countingStream->putBe64(cgen_var_100);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001636 countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001637 }
1638 uint32_t packetSize_vkBindImageMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1639 countingStream->rewind();
1640 uint32_t opcode_vkBindImageMemory = OP_vkBindImageMemory;
1641 stream->write(&opcode_vkBindImageMemory, sizeof(uint32_t));
1642 stream->write(&packetSize_vkBindImageMemory, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001643 uint64_t cgen_var_101 = (uint64_t)local_device;
1644 stream->putBe64(cgen_var_101);
1645 uint64_t cgen_var_102 = (uint64_t)local_image;
1646 stream->putBe64(cgen_var_102);
1647 uint64_t cgen_var_103 = (uint64_t)local_memory;
1648 stream->putBe64(cgen_var_103);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001649 stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
1650 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001651 VkResult vkBindImageMemory_VkResult_return = (VkResult)0;
1652 stream->read(&vkBindImageMemory_VkResult_return, sizeof(VkResult));
1653 return vkBindImageMemory_VkResult_return;
1654}
1655
1656void VkEncoder::vkGetBufferMemoryRequirements(
1657 VkDevice device,
1658 VkBuffer buffer,
1659 VkMemoryRequirements* pMemoryRequirements)
1660{
1661 auto stream = mImpl->stream();
1662 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001663 auto resources = mImpl->resources();
1664 auto pool = mImpl->pool();
1665 VkDevice local_device;
1666 local_device = device;
1667 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1668 VkBuffer local_buffer;
1669 local_buffer = buffer;
1670 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001671 countingStream->rewind();
1672 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001673 uint64_t cgen_var_104 = (uint64_t)local_device;
1674 countingStream->putBe64(cgen_var_104);
1675 uint64_t cgen_var_105 = (uint64_t)local_buffer;
1676 countingStream->putBe64(cgen_var_105);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001677 marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements));
1678 }
1679 uint32_t packetSize_vkGetBufferMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1680 countingStream->rewind();
1681 uint32_t opcode_vkGetBufferMemoryRequirements = OP_vkGetBufferMemoryRequirements;
1682 stream->write(&opcode_vkGetBufferMemoryRequirements, sizeof(uint32_t));
1683 stream->write(&packetSize_vkGetBufferMemoryRequirements, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001684 uint64_t cgen_var_106 = (uint64_t)local_device;
1685 stream->putBe64(cgen_var_106);
1686 uint64_t cgen_var_107 = (uint64_t)local_buffer;
1687 stream->putBe64(cgen_var_107);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001688 marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
1689 unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001690 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001691}
1692
1693void VkEncoder::vkGetImageMemoryRequirements(
1694 VkDevice device,
1695 VkImage image,
1696 VkMemoryRequirements* pMemoryRequirements)
1697{
1698 auto stream = mImpl->stream();
1699 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001700 auto resources = mImpl->resources();
1701 auto pool = mImpl->pool();
1702 VkDevice local_device;
1703 local_device = device;
1704 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1705 VkImage local_image;
1706 local_image = image;
1707 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001708 countingStream->rewind();
1709 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001710 uint64_t cgen_var_108 = (uint64_t)local_device;
1711 countingStream->putBe64(cgen_var_108);
1712 uint64_t cgen_var_109 = (uint64_t)local_image;
1713 countingStream->putBe64(cgen_var_109);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001714 marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements));
1715 }
1716 uint32_t packetSize_vkGetImageMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1717 countingStream->rewind();
1718 uint32_t opcode_vkGetImageMemoryRequirements = OP_vkGetImageMemoryRequirements;
1719 stream->write(&opcode_vkGetImageMemoryRequirements, sizeof(uint32_t));
1720 stream->write(&packetSize_vkGetImageMemoryRequirements, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001721 uint64_t cgen_var_110 = (uint64_t)local_device;
1722 stream->putBe64(cgen_var_110);
1723 uint64_t cgen_var_111 = (uint64_t)local_image;
1724 stream->putBe64(cgen_var_111);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001725 marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
1726 unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001727 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001728}
1729
1730void VkEncoder::vkGetImageSparseMemoryRequirements(
1731 VkDevice device,
1732 VkImage image,
1733 uint32_t* pSparseMemoryRequirementCount,
1734 VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
1735{
1736 auto stream = mImpl->stream();
1737 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001738 auto resources = mImpl->resources();
1739 auto pool = mImpl->pool();
1740 VkDevice local_device;
1741 local_device = device;
1742 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1743 VkImage local_image;
1744 local_image = image;
1745 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001746 countingStream->rewind();
1747 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001748 uint64_t cgen_var_112 = (uint64_t)local_device;
1749 countingStream->putBe64(cgen_var_112);
1750 uint64_t cgen_var_113 = (uint64_t)local_image;
1751 countingStream->putBe64(cgen_var_113);
1752 // WARNING PTR CHECK
1753 uint64_t cgen_var_114 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
1754 countingStream->putBe64(cgen_var_114);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001755 if (pSparseMemoryRequirementCount)
1756 {
1757 countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
1758 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001759 // WARNING PTR CHECK
1760 uint64_t cgen_var_115 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
1761 countingStream->putBe64(cgen_var_115);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001762 if (pSparseMemoryRequirements)
1763 {
1764 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
1765 {
1766 marshal_VkSparseImageMemoryRequirements(countingStream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i));
1767 }
1768 }
1769 }
1770 uint32_t packetSize_vkGetImageSparseMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1771 countingStream->rewind();
1772 uint32_t opcode_vkGetImageSparseMemoryRequirements = OP_vkGetImageSparseMemoryRequirements;
1773 stream->write(&opcode_vkGetImageSparseMemoryRequirements, sizeof(uint32_t));
1774 stream->write(&packetSize_vkGetImageSparseMemoryRequirements, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001775 uint64_t cgen_var_116 = (uint64_t)local_device;
1776 stream->putBe64(cgen_var_116);
1777 uint64_t cgen_var_117 = (uint64_t)local_image;
1778 stream->putBe64(cgen_var_117);
1779 // WARNING PTR CHECK
1780 uint64_t cgen_var_118 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
1781 stream->putBe64(cgen_var_118);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001782 if (pSparseMemoryRequirementCount)
1783 {
1784 stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
1785 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001786 // WARNING PTR CHECK
1787 uint64_t cgen_var_119 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
1788 stream->putBe64(cgen_var_119);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001789 if (pSparseMemoryRequirements)
1790 {
1791 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
1792 {
1793 marshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i));
1794 }
1795 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001796 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001797 uint32_t* check_pSparseMemoryRequirementCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001798 check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001799 if (pSparseMemoryRequirementCount)
1800 {
1801 if (!(check_pSparseMemoryRequirementCount))
1802 {
1803 fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n");
1804 }
1805 stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
1806 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001807 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001808 VkSparseImageMemoryRequirements* check_pSparseMemoryRequirements;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001809 check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001810 if (pSparseMemoryRequirements)
1811 {
1812 if (!(check_pSparseMemoryRequirements))
1813 {
1814 fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n");
1815 }
1816 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
1817 {
1818 unmarshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i));
1819 }
1820 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001821 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001822}
1823
1824void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties(
1825 VkPhysicalDevice physicalDevice,
1826 VkFormat format,
1827 VkImageType type,
1828 VkSampleCountFlagBits samples,
1829 VkImageUsageFlags usage,
1830 VkImageTiling tiling,
1831 uint32_t* pPropertyCount,
1832 VkSparseImageFormatProperties* pProperties)
1833{
1834 auto stream = mImpl->stream();
1835 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001836 auto resources = mImpl->resources();
1837 auto pool = mImpl->pool();
1838 VkPhysicalDevice local_physicalDevice;
1839 local_physicalDevice = physicalDevice;
1840 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
1841 VkFormat local_format;
1842 local_format = format;
1843 VkImageType local_type;
1844 local_type = type;
1845 VkSampleCountFlagBits local_samples;
1846 local_samples = samples;
1847 VkImageUsageFlags local_usage;
1848 local_usage = usage;
1849 VkImageTiling local_tiling;
1850 local_tiling = tiling;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001851 countingStream->rewind();
1852 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001853 uint64_t cgen_var_122 = (uint64_t)local_physicalDevice;
1854 countingStream->putBe64(cgen_var_122);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001855 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
1856 countingStream->write((VkImageType*)&local_type, sizeof(VkImageType));
1857 countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
1858 countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
1859 countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001860 // WARNING PTR CHECK
1861 uint64_t cgen_var_123 = (uint64_t)(uintptr_t)pPropertyCount;
1862 countingStream->putBe64(cgen_var_123);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001863 if (pPropertyCount)
1864 {
1865 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
1866 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001867 // WARNING PTR CHECK
1868 uint64_t cgen_var_124 = (uint64_t)(uintptr_t)pProperties;
1869 countingStream->putBe64(cgen_var_124);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001870 if (pProperties)
1871 {
1872 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
1873 {
1874 marshal_VkSparseImageFormatProperties(countingStream, (VkSparseImageFormatProperties*)(pProperties + i));
1875 }
1876 }
1877 }
1878 uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1879 countingStream->rewind();
1880 uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties = OP_vkGetPhysicalDeviceSparseImageFormatProperties;
1881 stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t));
1882 stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001883 uint64_t cgen_var_125 = (uint64_t)local_physicalDevice;
1884 stream->putBe64(cgen_var_125);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001885 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
1886 stream->write((VkImageType*)&local_type, sizeof(VkImageType));
1887 stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
1888 stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
1889 stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001890 // WARNING PTR CHECK
1891 uint64_t cgen_var_126 = (uint64_t)(uintptr_t)pPropertyCount;
1892 stream->putBe64(cgen_var_126);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001893 if (pPropertyCount)
1894 {
1895 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
1896 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001897 // WARNING PTR CHECK
1898 uint64_t cgen_var_127 = (uint64_t)(uintptr_t)pProperties;
1899 stream->putBe64(cgen_var_127);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001900 if (pProperties)
1901 {
1902 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
1903 {
1904 marshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i));
1905 }
1906 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001907 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001908 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001909 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001910 if (pPropertyCount)
1911 {
1912 if (!(check_pPropertyCount))
1913 {
1914 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
1915 }
1916 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
1917 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001918 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001919 VkSparseImageFormatProperties* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001920 check_pProperties = (VkSparseImageFormatProperties*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001921 if (pProperties)
1922 {
1923 if (!(check_pProperties))
1924 {
1925 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
1926 }
1927 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
1928 {
1929 unmarshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i));
1930 }
1931 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001932 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001933}
1934
1935VkResult VkEncoder::vkQueueBindSparse(
1936 VkQueue queue,
1937 uint32_t bindInfoCount,
1938 const VkBindSparseInfo* pBindInfo,
1939 VkFence fence)
1940{
1941 auto stream = mImpl->stream();
1942 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001943 auto resources = mImpl->resources();
1944 auto pool = mImpl->pool();
1945 VkQueue local_queue;
1946 local_queue = queue;
1947 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
1948 uint32_t local_bindInfoCount;
1949 local_bindInfoCount = bindInfoCount;
1950 VkBindSparseInfo* local_pBindInfo;
1951 local_pBindInfo = nullptr;
1952 if (pBindInfo)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001953 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001954 local_pBindInfo = (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001955 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
1956 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001957 deepcopy_VkBindSparseInfo(pool, pBindInfo + i, (VkBindSparseInfo*)(local_pBindInfo + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001958 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001959 }
1960 if (local_pBindInfo)
1961 {
1962 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
1963 {
1964 handlemap_VkBindSparseInfo(resources->unwrapMapping(), (VkBindSparseInfo*)(local_pBindInfo + i));
1965 }
1966 }
1967 VkFence local_fence;
1968 local_fence = fence;
1969 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
1970 countingStream->rewind();
1971 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001972 uint64_t cgen_var_130 = (uint64_t)local_queue;
1973 countingStream->putBe64(cgen_var_130);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001974 countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
1975 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
1976 {
1977 marshal_VkBindSparseInfo(countingStream, (VkBindSparseInfo*)(local_pBindInfo + i));
1978 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001979 uint64_t cgen_var_131 = (uint64_t)local_fence;
1980 countingStream->putBe64(cgen_var_131);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001981 }
1982 uint32_t packetSize_vkQueueBindSparse = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1983 countingStream->rewind();
1984 uint32_t opcode_vkQueueBindSparse = OP_vkQueueBindSparse;
1985 stream->write(&opcode_vkQueueBindSparse, sizeof(uint32_t));
1986 stream->write(&packetSize_vkQueueBindSparse, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001987 uint64_t cgen_var_132 = (uint64_t)local_queue;
1988 stream->putBe64(cgen_var_132);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001989 stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001990 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
1991 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001992 marshal_VkBindSparseInfo(stream, (VkBindSparseInfo*)(local_pBindInfo + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001993 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08001994 uint64_t cgen_var_133 = (uint64_t)local_fence;
1995 stream->putBe64(cgen_var_133);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001996 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001997 VkResult vkQueueBindSparse_VkResult_return = (VkResult)0;
1998 stream->read(&vkQueueBindSparse_VkResult_return, sizeof(VkResult));
1999 return vkQueueBindSparse_VkResult_return;
2000}
2001
2002VkResult VkEncoder::vkCreateFence(
2003 VkDevice device,
2004 const VkFenceCreateInfo* pCreateInfo,
2005 const VkAllocationCallbacks* pAllocator,
2006 VkFence* pFence)
2007{
2008 auto stream = mImpl->stream();
2009 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002010 auto resources = mImpl->resources();
2011 auto pool = mImpl->pool();
2012 VkDevice local_device;
2013 local_device = device;
2014 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2015 VkFenceCreateInfo* local_pCreateInfo;
2016 local_pCreateInfo = nullptr;
2017 if (pCreateInfo)
2018 {
2019 local_pCreateInfo = (VkFenceCreateInfo*)pool->alloc(sizeof(const VkFenceCreateInfo));
2020 deepcopy_VkFenceCreateInfo(pool, pCreateInfo, (VkFenceCreateInfo*)(local_pCreateInfo));
2021 }
2022 if (local_pCreateInfo)
2023 {
2024 handlemap_VkFenceCreateInfo(resources->unwrapMapping(), (VkFenceCreateInfo*)(local_pCreateInfo));
2025 }
2026 VkAllocationCallbacks* local_pAllocator;
2027 local_pAllocator = nullptr;
2028 if (pAllocator)
2029 {
2030 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2031 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2032 }
2033 if (local_pAllocator)
2034 {
2035 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2036 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002037 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002038 countingStream->rewind();
2039 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002040 uint64_t cgen_var_134 = (uint64_t)local_device;
2041 countingStream->putBe64(cgen_var_134);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002042 marshal_VkFenceCreateInfo(countingStream, (VkFenceCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002043 // WARNING PTR CHECK
2044 uint64_t cgen_var_135 = (uint64_t)(uintptr_t)local_pAllocator;
2045 countingStream->putBe64(cgen_var_135);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002046 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002047 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002048 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002049 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002050 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002051 countingStream->write((VkFence*)pFence, sizeof(VkFence));
2052 }
2053 uint32_t packetSize_vkCreateFence = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2054 countingStream->rewind();
2055 uint32_t opcode_vkCreateFence = OP_vkCreateFence;
2056 stream->write(&opcode_vkCreateFence, sizeof(uint32_t));
2057 stream->write(&packetSize_vkCreateFence, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002058 uint64_t cgen_var_136 = (uint64_t)local_device;
2059 stream->putBe64(cgen_var_136);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002060 marshal_VkFenceCreateInfo(stream, (VkFenceCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002061 // WARNING PTR CHECK
2062 uint64_t cgen_var_137 = (uint64_t)(uintptr_t)local_pAllocator;
2063 stream->putBe64(cgen_var_137);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002064 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002065 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002066 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002067 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002068 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002069 stream->write((VkFence*)pFence, sizeof(VkFence));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002070 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002071 stream->read((VkFence*)pFence, sizeof(VkFence));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002072 if (pFence)
2073 {
2074 resources->createMapping()->mapHandles_VkFence((VkFence*)pFence, 1);
2075 }
2076 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002077 VkResult vkCreateFence_VkResult_return = (VkResult)0;
2078 stream->read(&vkCreateFence_VkResult_return, sizeof(VkResult));
2079 return vkCreateFence_VkResult_return;
2080}
2081
2082void VkEncoder::vkDestroyFence(
2083 VkDevice device,
2084 VkFence fence,
2085 const VkAllocationCallbacks* pAllocator)
2086{
2087 auto stream = mImpl->stream();
2088 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002089 auto resources = mImpl->resources();
2090 auto pool = mImpl->pool();
2091 VkDevice local_device;
2092 local_device = device;
2093 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002094 VkFence local_fence;
2095 local_fence = fence;
2096 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002097 VkAllocationCallbacks* local_pAllocator;
2098 local_pAllocator = nullptr;
2099 if (pAllocator)
2100 {
2101 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2102 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2103 }
2104 if (local_pAllocator)
2105 {
2106 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2107 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002108 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002109 countingStream->rewind();
2110 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002111 uint64_t cgen_var_138 = (uint64_t)local_device;
2112 countingStream->putBe64(cgen_var_138);
2113 uint64_t cgen_var_139 = (uint64_t)local_fence;
2114 countingStream->putBe64(cgen_var_139);
2115 // WARNING PTR CHECK
2116 uint64_t cgen_var_140 = (uint64_t)(uintptr_t)local_pAllocator;
2117 countingStream->putBe64(cgen_var_140);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002118 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002119 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002120 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002121 }
2122 }
2123 uint32_t packetSize_vkDestroyFence = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2124 countingStream->rewind();
2125 uint32_t opcode_vkDestroyFence = OP_vkDestroyFence;
2126 stream->write(&opcode_vkDestroyFence, sizeof(uint32_t));
2127 stream->write(&packetSize_vkDestroyFence, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002128 uint64_t cgen_var_141 = (uint64_t)local_device;
2129 stream->putBe64(cgen_var_141);
2130 uint64_t cgen_var_142 = (uint64_t)local_fence;
2131 stream->putBe64(cgen_var_142);
2132 // WARNING PTR CHECK
2133 uint64_t cgen_var_143 = (uint64_t)(uintptr_t)local_pAllocator;
2134 stream->putBe64(cgen_var_143);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002135 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002136 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002137 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002138 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002139 resources->destroyMapping()->mapHandles_VkFence((VkFence*)&fence);
2140 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002141}
2142
2143VkResult VkEncoder::vkResetFences(
2144 VkDevice device,
2145 uint32_t fenceCount,
2146 const VkFence* pFences)
2147{
2148 auto stream = mImpl->stream();
2149 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002150 auto resources = mImpl->resources();
2151 auto pool = mImpl->pool();
2152 VkDevice local_device;
2153 local_device = device;
2154 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2155 uint32_t local_fenceCount;
2156 local_fenceCount = fenceCount;
2157 VkFence* local_pFences;
2158 local_pFences = nullptr;
2159 if (pFences)
2160 {
2161 local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence));
2162 }
2163 if (local_pFences)
2164 {
2165 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)local_pFences, ((fenceCount)));
2166 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002167 countingStream->rewind();
2168 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002169 uint64_t cgen_var_144 = (uint64_t)local_device;
2170 countingStream->putBe64(cgen_var_144);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002171 countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002172 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002173 countingStream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002174 }
2175 uint32_t packetSize_vkResetFences = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2176 countingStream->rewind();
2177 uint32_t opcode_vkResetFences = OP_vkResetFences;
2178 stream->write(&opcode_vkResetFences, sizeof(uint32_t));
2179 stream->write(&packetSize_vkResetFences, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002180 uint64_t cgen_var_145 = (uint64_t)local_device;
2181 stream->putBe64(cgen_var_145);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002182 stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002183 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002184 stream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
2185 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002186 VkResult vkResetFences_VkResult_return = (VkResult)0;
2187 stream->read(&vkResetFences_VkResult_return, sizeof(VkResult));
2188 return vkResetFences_VkResult_return;
2189}
2190
2191VkResult VkEncoder::vkGetFenceStatus(
2192 VkDevice device,
2193 VkFence fence)
2194{
2195 auto stream = mImpl->stream();
2196 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002197 auto resources = mImpl->resources();
2198 auto pool = mImpl->pool();
2199 VkDevice local_device;
2200 local_device = device;
2201 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2202 VkFence local_fence;
2203 local_fence = fence;
2204 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002205 countingStream->rewind();
2206 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002207 uint64_t cgen_var_146 = (uint64_t)local_device;
2208 countingStream->putBe64(cgen_var_146);
2209 uint64_t cgen_var_147 = (uint64_t)local_fence;
2210 countingStream->putBe64(cgen_var_147);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002211 }
2212 uint32_t packetSize_vkGetFenceStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2213 countingStream->rewind();
2214 uint32_t opcode_vkGetFenceStatus = OP_vkGetFenceStatus;
2215 stream->write(&opcode_vkGetFenceStatus, sizeof(uint32_t));
2216 stream->write(&packetSize_vkGetFenceStatus, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002217 uint64_t cgen_var_148 = (uint64_t)local_device;
2218 stream->putBe64(cgen_var_148);
2219 uint64_t cgen_var_149 = (uint64_t)local_fence;
2220 stream->putBe64(cgen_var_149);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002221 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002222 VkResult vkGetFenceStatus_VkResult_return = (VkResult)0;
2223 stream->read(&vkGetFenceStatus_VkResult_return, sizeof(VkResult));
2224 return vkGetFenceStatus_VkResult_return;
2225}
2226
2227VkResult VkEncoder::vkWaitForFences(
2228 VkDevice device,
2229 uint32_t fenceCount,
2230 const VkFence* pFences,
2231 VkBool32 waitAll,
2232 uint64_t timeout)
2233{
2234 auto stream = mImpl->stream();
2235 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002236 auto resources = mImpl->resources();
2237 auto pool = mImpl->pool();
2238 VkDevice local_device;
2239 local_device = device;
2240 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2241 uint32_t local_fenceCount;
2242 local_fenceCount = fenceCount;
2243 VkFence* local_pFences;
2244 local_pFences = nullptr;
2245 if (pFences)
2246 {
2247 local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence));
2248 }
2249 if (local_pFences)
2250 {
2251 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)local_pFences, ((fenceCount)));
2252 }
2253 VkBool32 local_waitAll;
2254 local_waitAll = waitAll;
2255 uint64_t local_timeout;
2256 local_timeout = timeout;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002257 countingStream->rewind();
2258 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002259 uint64_t cgen_var_150 = (uint64_t)local_device;
2260 countingStream->putBe64(cgen_var_150);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002261 countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002262 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002263 countingStream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
2264 countingStream->write((VkBool32*)&local_waitAll, sizeof(VkBool32));
2265 countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002266 }
2267 uint32_t packetSize_vkWaitForFences = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2268 countingStream->rewind();
2269 uint32_t opcode_vkWaitForFences = OP_vkWaitForFences;
2270 stream->write(&opcode_vkWaitForFences, sizeof(uint32_t));
2271 stream->write(&packetSize_vkWaitForFences, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002272 uint64_t cgen_var_151 = (uint64_t)local_device;
2273 stream->putBe64(cgen_var_151);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002274 stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002275 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002276 stream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
2277 stream->write((VkBool32*)&local_waitAll, sizeof(VkBool32));
2278 stream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
2279 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002280 VkResult vkWaitForFences_VkResult_return = (VkResult)0;
2281 stream->read(&vkWaitForFences_VkResult_return, sizeof(VkResult));
2282 return vkWaitForFences_VkResult_return;
2283}
2284
2285VkResult VkEncoder::vkCreateSemaphore(
2286 VkDevice device,
2287 const VkSemaphoreCreateInfo* pCreateInfo,
2288 const VkAllocationCallbacks* pAllocator,
2289 VkSemaphore* pSemaphore)
2290{
2291 auto stream = mImpl->stream();
2292 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002293 auto resources = mImpl->resources();
2294 auto pool = mImpl->pool();
2295 VkDevice local_device;
2296 local_device = device;
2297 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2298 VkSemaphoreCreateInfo* local_pCreateInfo;
2299 local_pCreateInfo = nullptr;
2300 if (pCreateInfo)
2301 {
2302 local_pCreateInfo = (VkSemaphoreCreateInfo*)pool->alloc(sizeof(const VkSemaphoreCreateInfo));
2303 deepcopy_VkSemaphoreCreateInfo(pool, pCreateInfo, (VkSemaphoreCreateInfo*)(local_pCreateInfo));
2304 }
2305 if (local_pCreateInfo)
2306 {
2307 handlemap_VkSemaphoreCreateInfo(resources->unwrapMapping(), (VkSemaphoreCreateInfo*)(local_pCreateInfo));
2308 }
2309 VkAllocationCallbacks* local_pAllocator;
2310 local_pAllocator = nullptr;
2311 if (pAllocator)
2312 {
2313 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2314 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2315 }
2316 if (local_pAllocator)
2317 {
2318 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2319 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002320 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002321 countingStream->rewind();
2322 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002323 uint64_t cgen_var_152 = (uint64_t)local_device;
2324 countingStream->putBe64(cgen_var_152);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002325 marshal_VkSemaphoreCreateInfo(countingStream, (VkSemaphoreCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002326 // WARNING PTR CHECK
2327 uint64_t cgen_var_153 = (uint64_t)(uintptr_t)local_pAllocator;
2328 countingStream->putBe64(cgen_var_153);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002329 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002330 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002331 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002332 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002333 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002334 countingStream->write((VkSemaphore*)pSemaphore, sizeof(VkSemaphore));
2335 }
2336 uint32_t packetSize_vkCreateSemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2337 countingStream->rewind();
2338 uint32_t opcode_vkCreateSemaphore = OP_vkCreateSemaphore;
2339 stream->write(&opcode_vkCreateSemaphore, sizeof(uint32_t));
2340 stream->write(&packetSize_vkCreateSemaphore, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002341 uint64_t cgen_var_154 = (uint64_t)local_device;
2342 stream->putBe64(cgen_var_154);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002343 marshal_VkSemaphoreCreateInfo(stream, (VkSemaphoreCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002344 // WARNING PTR CHECK
2345 uint64_t cgen_var_155 = (uint64_t)(uintptr_t)local_pAllocator;
2346 stream->putBe64(cgen_var_155);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002347 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002348 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002349 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002350 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002351 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002352 stream->write((VkSemaphore*)pSemaphore, sizeof(VkSemaphore));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002353 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002354 stream->read((VkSemaphore*)pSemaphore, sizeof(VkSemaphore));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002355 if (pSemaphore)
2356 {
2357 resources->createMapping()->mapHandles_VkSemaphore((VkSemaphore*)pSemaphore, 1);
2358 }
2359 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002360 VkResult vkCreateSemaphore_VkResult_return = (VkResult)0;
2361 stream->read(&vkCreateSemaphore_VkResult_return, sizeof(VkResult));
2362 return vkCreateSemaphore_VkResult_return;
2363}
2364
2365void VkEncoder::vkDestroySemaphore(
2366 VkDevice device,
2367 VkSemaphore semaphore,
2368 const VkAllocationCallbacks* pAllocator)
2369{
2370 auto stream = mImpl->stream();
2371 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002372 auto resources = mImpl->resources();
2373 auto pool = mImpl->pool();
2374 VkDevice local_device;
2375 local_device = device;
2376 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002377 VkSemaphore local_semaphore;
2378 local_semaphore = semaphore;
2379 resources->unwrapMapping()->mapHandles_VkSemaphore((VkSemaphore*)&local_semaphore);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002380 VkAllocationCallbacks* local_pAllocator;
2381 local_pAllocator = nullptr;
2382 if (pAllocator)
2383 {
2384 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2385 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2386 }
2387 if (local_pAllocator)
2388 {
2389 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2390 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002391 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002392 countingStream->rewind();
2393 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002394 uint64_t cgen_var_156 = (uint64_t)local_device;
2395 countingStream->putBe64(cgen_var_156);
2396 uint64_t cgen_var_157 = (uint64_t)local_semaphore;
2397 countingStream->putBe64(cgen_var_157);
2398 // WARNING PTR CHECK
2399 uint64_t cgen_var_158 = (uint64_t)(uintptr_t)local_pAllocator;
2400 countingStream->putBe64(cgen_var_158);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002401 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002402 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002403 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002404 }
2405 }
2406 uint32_t packetSize_vkDestroySemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2407 countingStream->rewind();
2408 uint32_t opcode_vkDestroySemaphore = OP_vkDestroySemaphore;
2409 stream->write(&opcode_vkDestroySemaphore, sizeof(uint32_t));
2410 stream->write(&packetSize_vkDestroySemaphore, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002411 uint64_t cgen_var_159 = (uint64_t)local_device;
2412 stream->putBe64(cgen_var_159);
2413 uint64_t cgen_var_160 = (uint64_t)local_semaphore;
2414 stream->putBe64(cgen_var_160);
2415 // WARNING PTR CHECK
2416 uint64_t cgen_var_161 = (uint64_t)(uintptr_t)local_pAllocator;
2417 stream->putBe64(cgen_var_161);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002418 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002419 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002420 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002421 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002422 resources->destroyMapping()->mapHandles_VkSemaphore((VkSemaphore*)&semaphore);
2423 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002424}
2425
2426VkResult VkEncoder::vkCreateEvent(
2427 VkDevice device,
2428 const VkEventCreateInfo* pCreateInfo,
2429 const VkAllocationCallbacks* pAllocator,
2430 VkEvent* pEvent)
2431{
2432 auto stream = mImpl->stream();
2433 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002434 auto resources = mImpl->resources();
2435 auto pool = mImpl->pool();
2436 VkDevice local_device;
2437 local_device = device;
2438 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2439 VkEventCreateInfo* local_pCreateInfo;
2440 local_pCreateInfo = nullptr;
2441 if (pCreateInfo)
2442 {
2443 local_pCreateInfo = (VkEventCreateInfo*)pool->alloc(sizeof(const VkEventCreateInfo));
2444 deepcopy_VkEventCreateInfo(pool, pCreateInfo, (VkEventCreateInfo*)(local_pCreateInfo));
2445 }
2446 if (local_pCreateInfo)
2447 {
2448 handlemap_VkEventCreateInfo(resources->unwrapMapping(), (VkEventCreateInfo*)(local_pCreateInfo));
2449 }
2450 VkAllocationCallbacks* local_pAllocator;
2451 local_pAllocator = nullptr;
2452 if (pAllocator)
2453 {
2454 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2455 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2456 }
2457 if (local_pAllocator)
2458 {
2459 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2460 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002461 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002462 countingStream->rewind();
2463 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002464 uint64_t cgen_var_162 = (uint64_t)local_device;
2465 countingStream->putBe64(cgen_var_162);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002466 marshal_VkEventCreateInfo(countingStream, (VkEventCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002467 // WARNING PTR CHECK
2468 uint64_t cgen_var_163 = (uint64_t)(uintptr_t)local_pAllocator;
2469 countingStream->putBe64(cgen_var_163);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002470 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002471 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002472 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002473 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002474 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002475 countingStream->write((VkEvent*)pEvent, sizeof(VkEvent));
2476 }
2477 uint32_t packetSize_vkCreateEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2478 countingStream->rewind();
2479 uint32_t opcode_vkCreateEvent = OP_vkCreateEvent;
2480 stream->write(&opcode_vkCreateEvent, sizeof(uint32_t));
2481 stream->write(&packetSize_vkCreateEvent, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002482 uint64_t cgen_var_164 = (uint64_t)local_device;
2483 stream->putBe64(cgen_var_164);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002484 marshal_VkEventCreateInfo(stream, (VkEventCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002485 // WARNING PTR CHECK
2486 uint64_t cgen_var_165 = (uint64_t)(uintptr_t)local_pAllocator;
2487 stream->putBe64(cgen_var_165);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002488 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002489 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002490 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002491 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002492 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002493 stream->write((VkEvent*)pEvent, sizeof(VkEvent));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002494 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002495 stream->read((VkEvent*)pEvent, sizeof(VkEvent));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002496 if (pEvent)
2497 {
2498 resources->createMapping()->mapHandles_VkEvent((VkEvent*)pEvent, 1);
2499 }
2500 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002501 VkResult vkCreateEvent_VkResult_return = (VkResult)0;
2502 stream->read(&vkCreateEvent_VkResult_return, sizeof(VkResult));
2503 return vkCreateEvent_VkResult_return;
2504}
2505
2506void VkEncoder::vkDestroyEvent(
2507 VkDevice device,
2508 VkEvent event,
2509 const VkAllocationCallbacks* pAllocator)
2510{
2511 auto stream = mImpl->stream();
2512 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002513 auto resources = mImpl->resources();
2514 auto pool = mImpl->pool();
2515 VkDevice local_device;
2516 local_device = device;
2517 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002518 VkEvent local_event;
2519 local_event = event;
2520 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002521 VkAllocationCallbacks* local_pAllocator;
2522 local_pAllocator = nullptr;
2523 if (pAllocator)
2524 {
2525 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2526 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2527 }
2528 if (local_pAllocator)
2529 {
2530 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2531 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002532 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002533 countingStream->rewind();
2534 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002535 uint64_t cgen_var_166 = (uint64_t)local_device;
2536 countingStream->putBe64(cgen_var_166);
2537 uint64_t cgen_var_167 = (uint64_t)local_event;
2538 countingStream->putBe64(cgen_var_167);
2539 // WARNING PTR CHECK
2540 uint64_t cgen_var_168 = (uint64_t)(uintptr_t)local_pAllocator;
2541 countingStream->putBe64(cgen_var_168);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002542 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002543 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002544 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002545 }
2546 }
2547 uint32_t packetSize_vkDestroyEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2548 countingStream->rewind();
2549 uint32_t opcode_vkDestroyEvent = OP_vkDestroyEvent;
2550 stream->write(&opcode_vkDestroyEvent, sizeof(uint32_t));
2551 stream->write(&packetSize_vkDestroyEvent, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002552 uint64_t cgen_var_169 = (uint64_t)local_device;
2553 stream->putBe64(cgen_var_169);
2554 uint64_t cgen_var_170 = (uint64_t)local_event;
2555 stream->putBe64(cgen_var_170);
2556 // WARNING PTR CHECK
2557 uint64_t cgen_var_171 = (uint64_t)(uintptr_t)local_pAllocator;
2558 stream->putBe64(cgen_var_171);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002559 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002560 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002561 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002562 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002563 resources->destroyMapping()->mapHandles_VkEvent((VkEvent*)&event);
2564 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002565}
2566
2567VkResult VkEncoder::vkGetEventStatus(
2568 VkDevice device,
2569 VkEvent event)
2570{
2571 auto stream = mImpl->stream();
2572 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002573 auto resources = mImpl->resources();
2574 auto pool = mImpl->pool();
2575 VkDevice local_device;
2576 local_device = device;
2577 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2578 VkEvent local_event;
2579 local_event = event;
2580 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002581 countingStream->rewind();
2582 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002583 uint64_t cgen_var_172 = (uint64_t)local_device;
2584 countingStream->putBe64(cgen_var_172);
2585 uint64_t cgen_var_173 = (uint64_t)local_event;
2586 countingStream->putBe64(cgen_var_173);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002587 }
2588 uint32_t packetSize_vkGetEventStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2589 countingStream->rewind();
2590 uint32_t opcode_vkGetEventStatus = OP_vkGetEventStatus;
2591 stream->write(&opcode_vkGetEventStatus, sizeof(uint32_t));
2592 stream->write(&packetSize_vkGetEventStatus, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002593 uint64_t cgen_var_174 = (uint64_t)local_device;
2594 stream->putBe64(cgen_var_174);
2595 uint64_t cgen_var_175 = (uint64_t)local_event;
2596 stream->putBe64(cgen_var_175);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002597 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002598 VkResult vkGetEventStatus_VkResult_return = (VkResult)0;
2599 stream->read(&vkGetEventStatus_VkResult_return, sizeof(VkResult));
2600 return vkGetEventStatus_VkResult_return;
2601}
2602
2603VkResult VkEncoder::vkSetEvent(
2604 VkDevice device,
2605 VkEvent event)
2606{
2607 auto stream = mImpl->stream();
2608 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002609 auto resources = mImpl->resources();
2610 auto pool = mImpl->pool();
2611 VkDevice local_device;
2612 local_device = device;
2613 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2614 VkEvent local_event;
2615 local_event = event;
2616 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002617 countingStream->rewind();
2618 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002619 uint64_t cgen_var_176 = (uint64_t)local_device;
2620 countingStream->putBe64(cgen_var_176);
2621 uint64_t cgen_var_177 = (uint64_t)local_event;
2622 countingStream->putBe64(cgen_var_177);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002623 }
2624 uint32_t packetSize_vkSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2625 countingStream->rewind();
2626 uint32_t opcode_vkSetEvent = OP_vkSetEvent;
2627 stream->write(&opcode_vkSetEvent, sizeof(uint32_t));
2628 stream->write(&packetSize_vkSetEvent, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002629 uint64_t cgen_var_178 = (uint64_t)local_device;
2630 stream->putBe64(cgen_var_178);
2631 uint64_t cgen_var_179 = (uint64_t)local_event;
2632 stream->putBe64(cgen_var_179);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002633 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002634 VkResult vkSetEvent_VkResult_return = (VkResult)0;
2635 stream->read(&vkSetEvent_VkResult_return, sizeof(VkResult));
2636 return vkSetEvent_VkResult_return;
2637}
2638
2639VkResult VkEncoder::vkResetEvent(
2640 VkDevice device,
2641 VkEvent event)
2642{
2643 auto stream = mImpl->stream();
2644 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002645 auto resources = mImpl->resources();
2646 auto pool = mImpl->pool();
2647 VkDevice local_device;
2648 local_device = device;
2649 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2650 VkEvent local_event;
2651 local_event = event;
2652 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002653 countingStream->rewind();
2654 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002655 uint64_t cgen_var_180 = (uint64_t)local_device;
2656 countingStream->putBe64(cgen_var_180);
2657 uint64_t cgen_var_181 = (uint64_t)local_event;
2658 countingStream->putBe64(cgen_var_181);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002659 }
2660 uint32_t packetSize_vkResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2661 countingStream->rewind();
2662 uint32_t opcode_vkResetEvent = OP_vkResetEvent;
2663 stream->write(&opcode_vkResetEvent, sizeof(uint32_t));
2664 stream->write(&packetSize_vkResetEvent, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002665 uint64_t cgen_var_182 = (uint64_t)local_device;
2666 stream->putBe64(cgen_var_182);
2667 uint64_t cgen_var_183 = (uint64_t)local_event;
2668 stream->putBe64(cgen_var_183);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002669 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002670 VkResult vkResetEvent_VkResult_return = (VkResult)0;
2671 stream->read(&vkResetEvent_VkResult_return, sizeof(VkResult));
2672 return vkResetEvent_VkResult_return;
2673}
2674
2675VkResult VkEncoder::vkCreateQueryPool(
2676 VkDevice device,
2677 const VkQueryPoolCreateInfo* pCreateInfo,
2678 const VkAllocationCallbacks* pAllocator,
2679 VkQueryPool* pQueryPool)
2680{
2681 auto stream = mImpl->stream();
2682 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002683 auto resources = mImpl->resources();
2684 auto pool = mImpl->pool();
2685 VkDevice local_device;
2686 local_device = device;
2687 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2688 VkQueryPoolCreateInfo* local_pCreateInfo;
2689 local_pCreateInfo = nullptr;
2690 if (pCreateInfo)
2691 {
2692 local_pCreateInfo = (VkQueryPoolCreateInfo*)pool->alloc(sizeof(const VkQueryPoolCreateInfo));
2693 deepcopy_VkQueryPoolCreateInfo(pool, pCreateInfo, (VkQueryPoolCreateInfo*)(local_pCreateInfo));
2694 }
2695 if (local_pCreateInfo)
2696 {
2697 handlemap_VkQueryPoolCreateInfo(resources->unwrapMapping(), (VkQueryPoolCreateInfo*)(local_pCreateInfo));
2698 }
2699 VkAllocationCallbacks* local_pAllocator;
2700 local_pAllocator = nullptr;
2701 if (pAllocator)
2702 {
2703 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2704 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2705 }
2706 if (local_pAllocator)
2707 {
2708 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2709 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002710 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002711 countingStream->rewind();
2712 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002713 uint64_t cgen_var_184 = (uint64_t)local_device;
2714 countingStream->putBe64(cgen_var_184);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002715 marshal_VkQueryPoolCreateInfo(countingStream, (VkQueryPoolCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002716 // WARNING PTR CHECK
2717 uint64_t cgen_var_185 = (uint64_t)(uintptr_t)local_pAllocator;
2718 countingStream->putBe64(cgen_var_185);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002719 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002720 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002721 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002722 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002723 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002724 countingStream->write((VkQueryPool*)pQueryPool, sizeof(VkQueryPool));
2725 }
2726 uint32_t packetSize_vkCreateQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2727 countingStream->rewind();
2728 uint32_t opcode_vkCreateQueryPool = OP_vkCreateQueryPool;
2729 stream->write(&opcode_vkCreateQueryPool, sizeof(uint32_t));
2730 stream->write(&packetSize_vkCreateQueryPool, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002731 uint64_t cgen_var_186 = (uint64_t)local_device;
2732 stream->putBe64(cgen_var_186);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002733 marshal_VkQueryPoolCreateInfo(stream, (VkQueryPoolCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002734 // WARNING PTR CHECK
2735 uint64_t cgen_var_187 = (uint64_t)(uintptr_t)local_pAllocator;
2736 stream->putBe64(cgen_var_187);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002737 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002738 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002739 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002740 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002741 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002742 stream->write((VkQueryPool*)pQueryPool, sizeof(VkQueryPool));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002743 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002744 stream->read((VkQueryPool*)pQueryPool, sizeof(VkQueryPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002745 if (pQueryPool)
2746 {
2747 resources->createMapping()->mapHandles_VkQueryPool((VkQueryPool*)pQueryPool, 1);
2748 }
2749 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002750 VkResult vkCreateQueryPool_VkResult_return = (VkResult)0;
2751 stream->read(&vkCreateQueryPool_VkResult_return, sizeof(VkResult));
2752 return vkCreateQueryPool_VkResult_return;
2753}
2754
2755void VkEncoder::vkDestroyQueryPool(
2756 VkDevice device,
2757 VkQueryPool queryPool,
2758 const VkAllocationCallbacks* pAllocator)
2759{
2760 auto stream = mImpl->stream();
2761 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002762 auto resources = mImpl->resources();
2763 auto pool = mImpl->pool();
2764 VkDevice local_device;
2765 local_device = device;
2766 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002767 VkQueryPool local_queryPool;
2768 local_queryPool = queryPool;
2769 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002770 VkAllocationCallbacks* local_pAllocator;
2771 local_pAllocator = nullptr;
2772 if (pAllocator)
2773 {
2774 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2775 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2776 }
2777 if (local_pAllocator)
2778 {
2779 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2780 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002781 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002782 countingStream->rewind();
2783 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002784 uint64_t cgen_var_188 = (uint64_t)local_device;
2785 countingStream->putBe64(cgen_var_188);
2786 uint64_t cgen_var_189 = (uint64_t)local_queryPool;
2787 countingStream->putBe64(cgen_var_189);
2788 // WARNING PTR CHECK
2789 uint64_t cgen_var_190 = (uint64_t)(uintptr_t)local_pAllocator;
2790 countingStream->putBe64(cgen_var_190);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002791 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002792 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002793 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002794 }
2795 }
2796 uint32_t packetSize_vkDestroyQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2797 countingStream->rewind();
2798 uint32_t opcode_vkDestroyQueryPool = OP_vkDestroyQueryPool;
2799 stream->write(&opcode_vkDestroyQueryPool, sizeof(uint32_t));
2800 stream->write(&packetSize_vkDestroyQueryPool, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002801 uint64_t cgen_var_191 = (uint64_t)local_device;
2802 stream->putBe64(cgen_var_191);
2803 uint64_t cgen_var_192 = (uint64_t)local_queryPool;
2804 stream->putBe64(cgen_var_192);
2805 // WARNING PTR CHECK
2806 uint64_t cgen_var_193 = (uint64_t)(uintptr_t)local_pAllocator;
2807 stream->putBe64(cgen_var_193);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002808 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002809 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002810 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002811 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002812 resources->destroyMapping()->mapHandles_VkQueryPool((VkQueryPool*)&queryPool);
2813 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002814}
2815
2816VkResult VkEncoder::vkGetQueryPoolResults(
2817 VkDevice device,
2818 VkQueryPool queryPool,
2819 uint32_t firstQuery,
2820 uint32_t queryCount,
2821 size_t dataSize,
2822 void* pData,
2823 VkDeviceSize stride,
2824 VkQueryResultFlags flags)
2825{
2826 auto stream = mImpl->stream();
2827 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002828 auto resources = mImpl->resources();
2829 auto pool = mImpl->pool();
2830 VkDevice local_device;
2831 local_device = device;
2832 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2833 VkQueryPool local_queryPool;
2834 local_queryPool = queryPool;
2835 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
2836 uint32_t local_firstQuery;
2837 local_firstQuery = firstQuery;
2838 uint32_t local_queryCount;
2839 local_queryCount = queryCount;
2840 size_t local_dataSize;
2841 local_dataSize = dataSize;
2842 VkDeviceSize local_stride;
2843 local_stride = stride;
2844 VkQueryResultFlags local_flags;
2845 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002846 countingStream->rewind();
2847 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002848 uint64_t cgen_var_194 = (uint64_t)local_device;
2849 countingStream->putBe64(cgen_var_194);
2850 uint64_t cgen_var_195 = (uint64_t)local_queryPool;
2851 countingStream->putBe64(cgen_var_195);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002852 countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
2853 countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
2854 countingStream->write((size_t*)&local_dataSize, sizeof(size_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002855 countingStream->write((void*)pData, ((dataSize)) * sizeof(uint8_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002856 countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
2857 countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002858 }
2859 uint32_t packetSize_vkGetQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2860 countingStream->rewind();
2861 uint32_t opcode_vkGetQueryPoolResults = OP_vkGetQueryPoolResults;
2862 stream->write(&opcode_vkGetQueryPoolResults, sizeof(uint32_t));
2863 stream->write(&packetSize_vkGetQueryPoolResults, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002864 uint64_t cgen_var_196 = (uint64_t)local_device;
2865 stream->putBe64(cgen_var_196);
2866 uint64_t cgen_var_197 = (uint64_t)local_queryPool;
2867 stream->putBe64(cgen_var_197);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002868 stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
2869 stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
2870 stream->write((size_t*)&local_dataSize, sizeof(size_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002871 stream->write((void*)pData, ((dataSize)) * sizeof(uint8_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002872 stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
2873 stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002874 stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002875 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002876 VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0;
2877 stream->read(&vkGetQueryPoolResults_VkResult_return, sizeof(VkResult));
2878 return vkGetQueryPoolResults_VkResult_return;
2879}
2880
2881VkResult VkEncoder::vkCreateBuffer(
2882 VkDevice device,
2883 const VkBufferCreateInfo* pCreateInfo,
2884 const VkAllocationCallbacks* pAllocator,
2885 VkBuffer* pBuffer)
2886{
2887 auto stream = mImpl->stream();
2888 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002889 auto resources = mImpl->resources();
2890 auto pool = mImpl->pool();
2891 VkDevice local_device;
2892 local_device = device;
2893 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2894 VkBufferCreateInfo* local_pCreateInfo;
2895 local_pCreateInfo = nullptr;
2896 if (pCreateInfo)
2897 {
2898 local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo));
2899 deepcopy_VkBufferCreateInfo(pool, pCreateInfo, (VkBufferCreateInfo*)(local_pCreateInfo));
2900 }
2901 if (local_pCreateInfo)
2902 {
2903 handlemap_VkBufferCreateInfo(resources->unwrapMapping(), (VkBufferCreateInfo*)(local_pCreateInfo));
2904 }
2905 VkAllocationCallbacks* local_pAllocator;
2906 local_pAllocator = nullptr;
2907 if (pAllocator)
2908 {
2909 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2910 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2911 }
2912 if (local_pAllocator)
2913 {
2914 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2915 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002916 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002917 countingStream->rewind();
2918 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002919 uint64_t cgen_var_198 = (uint64_t)local_device;
2920 countingStream->putBe64(cgen_var_198);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002921 marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002922 // WARNING PTR CHECK
2923 uint64_t cgen_var_199 = (uint64_t)(uintptr_t)local_pAllocator;
2924 countingStream->putBe64(cgen_var_199);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002925 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002926 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002927 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002928 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002929 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002930 countingStream->write((VkBuffer*)pBuffer, sizeof(VkBuffer));
2931 }
2932 uint32_t packetSize_vkCreateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2933 countingStream->rewind();
2934 uint32_t opcode_vkCreateBuffer = OP_vkCreateBuffer;
2935 stream->write(&opcode_vkCreateBuffer, sizeof(uint32_t));
2936 stream->write(&packetSize_vkCreateBuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002937 uint64_t cgen_var_200 = (uint64_t)local_device;
2938 stream->putBe64(cgen_var_200);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002939 marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002940 // WARNING PTR CHECK
2941 uint64_t cgen_var_201 = (uint64_t)(uintptr_t)local_pAllocator;
2942 stream->putBe64(cgen_var_201);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002943 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002944 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002945 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002946 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002947 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002948 stream->write((VkBuffer*)pBuffer, sizeof(VkBuffer));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002949 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002950 stream->read((VkBuffer*)pBuffer, sizeof(VkBuffer));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002951 if (pBuffer)
2952 {
2953 resources->createMapping()->mapHandles_VkBuffer((VkBuffer*)pBuffer, 1);
2954 }
2955 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002956 VkResult vkCreateBuffer_VkResult_return = (VkResult)0;
2957 stream->read(&vkCreateBuffer_VkResult_return, sizeof(VkResult));
2958 return vkCreateBuffer_VkResult_return;
2959}
2960
2961void VkEncoder::vkDestroyBuffer(
2962 VkDevice device,
2963 VkBuffer buffer,
2964 const VkAllocationCallbacks* pAllocator)
2965{
2966 auto stream = mImpl->stream();
2967 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002968 auto resources = mImpl->resources();
2969 auto pool = mImpl->pool();
2970 VkDevice local_device;
2971 local_device = device;
2972 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002973 VkBuffer local_buffer;
2974 local_buffer = buffer;
2975 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002976 VkAllocationCallbacks* local_pAllocator;
2977 local_pAllocator = nullptr;
2978 if (pAllocator)
2979 {
2980 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2981 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2982 }
2983 if (local_pAllocator)
2984 {
2985 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2986 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08002987 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002988 countingStream->rewind();
2989 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08002990 uint64_t cgen_var_202 = (uint64_t)local_device;
2991 countingStream->putBe64(cgen_var_202);
2992 uint64_t cgen_var_203 = (uint64_t)local_buffer;
2993 countingStream->putBe64(cgen_var_203);
2994 // WARNING PTR CHECK
2995 uint64_t cgen_var_204 = (uint64_t)(uintptr_t)local_pAllocator;
2996 countingStream->putBe64(cgen_var_204);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002997 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002998 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002999 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003000 }
3001 }
3002 uint32_t packetSize_vkDestroyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3003 countingStream->rewind();
3004 uint32_t opcode_vkDestroyBuffer = OP_vkDestroyBuffer;
3005 stream->write(&opcode_vkDestroyBuffer, sizeof(uint32_t));
3006 stream->write(&packetSize_vkDestroyBuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003007 uint64_t cgen_var_205 = (uint64_t)local_device;
3008 stream->putBe64(cgen_var_205);
3009 uint64_t cgen_var_206 = (uint64_t)local_buffer;
3010 stream->putBe64(cgen_var_206);
3011 // WARNING PTR CHECK
3012 uint64_t cgen_var_207 = (uint64_t)(uintptr_t)local_pAllocator;
3013 stream->putBe64(cgen_var_207);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003014 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003015 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003016 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003017 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003018 resources->destroyMapping()->mapHandles_VkBuffer((VkBuffer*)&buffer);
3019 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003020}
3021
3022VkResult VkEncoder::vkCreateBufferView(
3023 VkDevice device,
3024 const VkBufferViewCreateInfo* pCreateInfo,
3025 const VkAllocationCallbacks* pAllocator,
3026 VkBufferView* pView)
3027{
3028 auto stream = mImpl->stream();
3029 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003030 auto resources = mImpl->resources();
3031 auto pool = mImpl->pool();
3032 VkDevice local_device;
3033 local_device = device;
3034 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3035 VkBufferViewCreateInfo* local_pCreateInfo;
3036 local_pCreateInfo = nullptr;
3037 if (pCreateInfo)
3038 {
3039 local_pCreateInfo = (VkBufferViewCreateInfo*)pool->alloc(sizeof(const VkBufferViewCreateInfo));
3040 deepcopy_VkBufferViewCreateInfo(pool, pCreateInfo, (VkBufferViewCreateInfo*)(local_pCreateInfo));
3041 }
3042 if (local_pCreateInfo)
3043 {
3044 handlemap_VkBufferViewCreateInfo(resources->unwrapMapping(), (VkBufferViewCreateInfo*)(local_pCreateInfo));
3045 }
3046 VkAllocationCallbacks* local_pAllocator;
3047 local_pAllocator = nullptr;
3048 if (pAllocator)
3049 {
3050 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3051 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3052 }
3053 if (local_pAllocator)
3054 {
3055 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3056 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003057 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003058 countingStream->rewind();
3059 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003060 uint64_t cgen_var_208 = (uint64_t)local_device;
3061 countingStream->putBe64(cgen_var_208);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003062 marshal_VkBufferViewCreateInfo(countingStream, (VkBufferViewCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003063 // WARNING PTR CHECK
3064 uint64_t cgen_var_209 = (uint64_t)(uintptr_t)local_pAllocator;
3065 countingStream->putBe64(cgen_var_209);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003066 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003067 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003068 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003069 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003070 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003071 countingStream->write((VkBufferView*)pView, sizeof(VkBufferView));
3072 }
3073 uint32_t packetSize_vkCreateBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3074 countingStream->rewind();
3075 uint32_t opcode_vkCreateBufferView = OP_vkCreateBufferView;
3076 stream->write(&opcode_vkCreateBufferView, sizeof(uint32_t));
3077 stream->write(&packetSize_vkCreateBufferView, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003078 uint64_t cgen_var_210 = (uint64_t)local_device;
3079 stream->putBe64(cgen_var_210);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003080 marshal_VkBufferViewCreateInfo(stream, (VkBufferViewCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003081 // WARNING PTR CHECK
3082 uint64_t cgen_var_211 = (uint64_t)(uintptr_t)local_pAllocator;
3083 stream->putBe64(cgen_var_211);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003084 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003085 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003086 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003087 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003088 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003089 stream->write((VkBufferView*)pView, sizeof(VkBufferView));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003090 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003091 stream->read((VkBufferView*)pView, sizeof(VkBufferView));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003092 if (pView)
3093 {
3094 resources->createMapping()->mapHandles_VkBufferView((VkBufferView*)pView, 1);
3095 }
3096 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003097 VkResult vkCreateBufferView_VkResult_return = (VkResult)0;
3098 stream->read(&vkCreateBufferView_VkResult_return, sizeof(VkResult));
3099 return vkCreateBufferView_VkResult_return;
3100}
3101
3102void VkEncoder::vkDestroyBufferView(
3103 VkDevice device,
3104 VkBufferView bufferView,
3105 const VkAllocationCallbacks* pAllocator)
3106{
3107 auto stream = mImpl->stream();
3108 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003109 auto resources = mImpl->resources();
3110 auto pool = mImpl->pool();
3111 VkDevice local_device;
3112 local_device = device;
3113 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003114 VkBufferView local_bufferView;
3115 local_bufferView = bufferView;
3116 resources->unwrapMapping()->mapHandles_VkBufferView((VkBufferView*)&local_bufferView);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003117 VkAllocationCallbacks* local_pAllocator;
3118 local_pAllocator = nullptr;
3119 if (pAllocator)
3120 {
3121 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3122 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3123 }
3124 if (local_pAllocator)
3125 {
3126 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3127 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003128 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003129 countingStream->rewind();
3130 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003131 uint64_t cgen_var_212 = (uint64_t)local_device;
3132 countingStream->putBe64(cgen_var_212);
3133 uint64_t cgen_var_213 = (uint64_t)local_bufferView;
3134 countingStream->putBe64(cgen_var_213);
3135 // WARNING PTR CHECK
3136 uint64_t cgen_var_214 = (uint64_t)(uintptr_t)local_pAllocator;
3137 countingStream->putBe64(cgen_var_214);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003138 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003139 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003140 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003141 }
3142 }
3143 uint32_t packetSize_vkDestroyBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3144 countingStream->rewind();
3145 uint32_t opcode_vkDestroyBufferView = OP_vkDestroyBufferView;
3146 stream->write(&opcode_vkDestroyBufferView, sizeof(uint32_t));
3147 stream->write(&packetSize_vkDestroyBufferView, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003148 uint64_t cgen_var_215 = (uint64_t)local_device;
3149 stream->putBe64(cgen_var_215);
3150 uint64_t cgen_var_216 = (uint64_t)local_bufferView;
3151 stream->putBe64(cgen_var_216);
3152 // WARNING PTR CHECK
3153 uint64_t cgen_var_217 = (uint64_t)(uintptr_t)local_pAllocator;
3154 stream->putBe64(cgen_var_217);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003155 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003156 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003157 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003158 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003159 resources->destroyMapping()->mapHandles_VkBufferView((VkBufferView*)&bufferView);
3160 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003161}
3162
3163VkResult VkEncoder::vkCreateImage(
3164 VkDevice device,
3165 const VkImageCreateInfo* pCreateInfo,
3166 const VkAllocationCallbacks* pAllocator,
3167 VkImage* pImage)
3168{
3169 auto stream = mImpl->stream();
3170 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003171 auto resources = mImpl->resources();
3172 auto pool = mImpl->pool();
3173 VkDevice local_device;
3174 local_device = device;
3175 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3176 VkImageCreateInfo* local_pCreateInfo;
3177 local_pCreateInfo = nullptr;
3178 if (pCreateInfo)
3179 {
3180 local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo));
3181 deepcopy_VkImageCreateInfo(pool, pCreateInfo, (VkImageCreateInfo*)(local_pCreateInfo));
3182 }
3183 if (local_pCreateInfo)
3184 {
3185 handlemap_VkImageCreateInfo(resources->unwrapMapping(), (VkImageCreateInfo*)(local_pCreateInfo));
3186 }
3187 VkAllocationCallbacks* local_pAllocator;
3188 local_pAllocator = nullptr;
3189 if (pAllocator)
3190 {
3191 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3192 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3193 }
3194 if (local_pAllocator)
3195 {
3196 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3197 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003198 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003199 countingStream->rewind();
3200 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003201 uint64_t cgen_var_218 = (uint64_t)local_device;
3202 countingStream->putBe64(cgen_var_218);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003203 marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003204 // WARNING PTR CHECK
3205 uint64_t cgen_var_219 = (uint64_t)(uintptr_t)local_pAllocator;
3206 countingStream->putBe64(cgen_var_219);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003207 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003208 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003209 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003210 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003211 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003212 countingStream->write((VkImage*)pImage, sizeof(VkImage));
3213 }
3214 uint32_t packetSize_vkCreateImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3215 countingStream->rewind();
3216 uint32_t opcode_vkCreateImage = OP_vkCreateImage;
3217 stream->write(&opcode_vkCreateImage, sizeof(uint32_t));
3218 stream->write(&packetSize_vkCreateImage, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003219 uint64_t cgen_var_220 = (uint64_t)local_device;
3220 stream->putBe64(cgen_var_220);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003221 marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003222 // WARNING PTR CHECK
3223 uint64_t cgen_var_221 = (uint64_t)(uintptr_t)local_pAllocator;
3224 stream->putBe64(cgen_var_221);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003225 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003226 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003227 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003228 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003229 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003230 stream->write((VkImage*)pImage, sizeof(VkImage));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003231 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003232 stream->read((VkImage*)pImage, sizeof(VkImage));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003233 if (pImage)
3234 {
3235 resources->createMapping()->mapHandles_VkImage((VkImage*)pImage, 1);
3236 }
3237 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003238 VkResult vkCreateImage_VkResult_return = (VkResult)0;
3239 stream->read(&vkCreateImage_VkResult_return, sizeof(VkResult));
3240 return vkCreateImage_VkResult_return;
3241}
3242
3243void VkEncoder::vkDestroyImage(
3244 VkDevice device,
3245 VkImage image,
3246 const VkAllocationCallbacks* pAllocator)
3247{
3248 auto stream = mImpl->stream();
3249 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003250 auto resources = mImpl->resources();
3251 auto pool = mImpl->pool();
3252 VkDevice local_device;
3253 local_device = device;
3254 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003255 VkImage local_image;
3256 local_image = image;
3257 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003258 VkAllocationCallbacks* local_pAllocator;
3259 local_pAllocator = nullptr;
3260 if (pAllocator)
3261 {
3262 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3263 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3264 }
3265 if (local_pAllocator)
3266 {
3267 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3268 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003269 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003270 countingStream->rewind();
3271 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003272 uint64_t cgen_var_222 = (uint64_t)local_device;
3273 countingStream->putBe64(cgen_var_222);
3274 uint64_t cgen_var_223 = (uint64_t)local_image;
3275 countingStream->putBe64(cgen_var_223);
3276 // WARNING PTR CHECK
3277 uint64_t cgen_var_224 = (uint64_t)(uintptr_t)local_pAllocator;
3278 countingStream->putBe64(cgen_var_224);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003279 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003280 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003281 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003282 }
3283 }
3284 uint32_t packetSize_vkDestroyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3285 countingStream->rewind();
3286 uint32_t opcode_vkDestroyImage = OP_vkDestroyImage;
3287 stream->write(&opcode_vkDestroyImage, sizeof(uint32_t));
3288 stream->write(&packetSize_vkDestroyImage, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003289 uint64_t cgen_var_225 = (uint64_t)local_device;
3290 stream->putBe64(cgen_var_225);
3291 uint64_t cgen_var_226 = (uint64_t)local_image;
3292 stream->putBe64(cgen_var_226);
3293 // WARNING PTR CHECK
3294 uint64_t cgen_var_227 = (uint64_t)(uintptr_t)local_pAllocator;
3295 stream->putBe64(cgen_var_227);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003296 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003297 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003298 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003299 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003300 resources->destroyMapping()->mapHandles_VkImage((VkImage*)&image);
3301 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003302}
3303
3304void VkEncoder::vkGetImageSubresourceLayout(
3305 VkDevice device,
3306 VkImage image,
3307 const VkImageSubresource* pSubresource,
3308 VkSubresourceLayout* pLayout)
3309{
3310 auto stream = mImpl->stream();
3311 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003312 auto resources = mImpl->resources();
3313 auto pool = mImpl->pool();
3314 VkDevice local_device;
3315 local_device = device;
3316 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3317 VkImage local_image;
3318 local_image = image;
3319 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
3320 VkImageSubresource* local_pSubresource;
3321 local_pSubresource = nullptr;
3322 if (pSubresource)
3323 {
3324 local_pSubresource = (VkImageSubresource*)pool->alloc(sizeof(const VkImageSubresource));
3325 deepcopy_VkImageSubresource(pool, pSubresource, (VkImageSubresource*)(local_pSubresource));
3326 }
3327 if (local_pSubresource)
3328 {
3329 handlemap_VkImageSubresource(resources->unwrapMapping(), (VkImageSubresource*)(local_pSubresource));
3330 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003331 countingStream->rewind();
3332 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003333 uint64_t cgen_var_228 = (uint64_t)local_device;
3334 countingStream->putBe64(cgen_var_228);
3335 uint64_t cgen_var_229 = (uint64_t)local_image;
3336 countingStream->putBe64(cgen_var_229);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003337 marshal_VkImageSubresource(countingStream, (VkImageSubresource*)(local_pSubresource));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003338 marshal_VkSubresourceLayout(countingStream, (VkSubresourceLayout*)(pLayout));
3339 }
3340 uint32_t packetSize_vkGetImageSubresourceLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3341 countingStream->rewind();
3342 uint32_t opcode_vkGetImageSubresourceLayout = OP_vkGetImageSubresourceLayout;
3343 stream->write(&opcode_vkGetImageSubresourceLayout, sizeof(uint32_t));
3344 stream->write(&packetSize_vkGetImageSubresourceLayout, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003345 uint64_t cgen_var_230 = (uint64_t)local_device;
3346 stream->putBe64(cgen_var_230);
3347 uint64_t cgen_var_231 = (uint64_t)local_image;
3348 stream->putBe64(cgen_var_231);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003349 marshal_VkImageSubresource(stream, (VkImageSubresource*)(local_pSubresource));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003350 marshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout));
3351 unmarshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003352 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003353}
3354
3355VkResult VkEncoder::vkCreateImageView(
3356 VkDevice device,
3357 const VkImageViewCreateInfo* pCreateInfo,
3358 const VkAllocationCallbacks* pAllocator,
3359 VkImageView* pView)
3360{
3361 auto stream = mImpl->stream();
3362 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003363 auto resources = mImpl->resources();
3364 auto pool = mImpl->pool();
3365 VkDevice local_device;
3366 local_device = device;
3367 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3368 VkImageViewCreateInfo* local_pCreateInfo;
3369 local_pCreateInfo = nullptr;
3370 if (pCreateInfo)
3371 {
3372 local_pCreateInfo = (VkImageViewCreateInfo*)pool->alloc(sizeof(const VkImageViewCreateInfo));
3373 deepcopy_VkImageViewCreateInfo(pool, pCreateInfo, (VkImageViewCreateInfo*)(local_pCreateInfo));
3374 }
3375 if (local_pCreateInfo)
3376 {
3377 handlemap_VkImageViewCreateInfo(resources->unwrapMapping(), (VkImageViewCreateInfo*)(local_pCreateInfo));
3378 }
3379 VkAllocationCallbacks* local_pAllocator;
3380 local_pAllocator = nullptr;
3381 if (pAllocator)
3382 {
3383 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3384 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3385 }
3386 if (local_pAllocator)
3387 {
3388 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3389 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003390 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003391 countingStream->rewind();
3392 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003393 uint64_t cgen_var_232 = (uint64_t)local_device;
3394 countingStream->putBe64(cgen_var_232);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003395 marshal_VkImageViewCreateInfo(countingStream, (VkImageViewCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003396 // WARNING PTR CHECK
3397 uint64_t cgen_var_233 = (uint64_t)(uintptr_t)local_pAllocator;
3398 countingStream->putBe64(cgen_var_233);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003399 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003400 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003401 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003402 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003403 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003404 countingStream->write((VkImageView*)pView, sizeof(VkImageView));
3405 }
3406 uint32_t packetSize_vkCreateImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3407 countingStream->rewind();
3408 uint32_t opcode_vkCreateImageView = OP_vkCreateImageView;
3409 stream->write(&opcode_vkCreateImageView, sizeof(uint32_t));
3410 stream->write(&packetSize_vkCreateImageView, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003411 uint64_t cgen_var_234 = (uint64_t)local_device;
3412 stream->putBe64(cgen_var_234);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003413 marshal_VkImageViewCreateInfo(stream, (VkImageViewCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003414 // WARNING PTR CHECK
3415 uint64_t cgen_var_235 = (uint64_t)(uintptr_t)local_pAllocator;
3416 stream->putBe64(cgen_var_235);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003417 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003418 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003419 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003420 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003421 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003422 stream->write((VkImageView*)pView, sizeof(VkImageView));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003423 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003424 stream->read((VkImageView*)pView, sizeof(VkImageView));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003425 if (pView)
3426 {
3427 resources->createMapping()->mapHandles_VkImageView((VkImageView*)pView, 1);
3428 }
3429 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003430 VkResult vkCreateImageView_VkResult_return = (VkResult)0;
3431 stream->read(&vkCreateImageView_VkResult_return, sizeof(VkResult));
3432 return vkCreateImageView_VkResult_return;
3433}
3434
3435void VkEncoder::vkDestroyImageView(
3436 VkDevice device,
3437 VkImageView imageView,
3438 const VkAllocationCallbacks* pAllocator)
3439{
3440 auto stream = mImpl->stream();
3441 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003442 auto resources = mImpl->resources();
3443 auto pool = mImpl->pool();
3444 VkDevice local_device;
3445 local_device = device;
3446 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003447 VkImageView local_imageView;
3448 local_imageView = imageView;
3449 resources->unwrapMapping()->mapHandles_VkImageView((VkImageView*)&local_imageView);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003450 VkAllocationCallbacks* local_pAllocator;
3451 local_pAllocator = nullptr;
3452 if (pAllocator)
3453 {
3454 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3455 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3456 }
3457 if (local_pAllocator)
3458 {
3459 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3460 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003461 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003462 countingStream->rewind();
3463 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003464 uint64_t cgen_var_236 = (uint64_t)local_device;
3465 countingStream->putBe64(cgen_var_236);
3466 uint64_t cgen_var_237 = (uint64_t)local_imageView;
3467 countingStream->putBe64(cgen_var_237);
3468 // WARNING PTR CHECK
3469 uint64_t cgen_var_238 = (uint64_t)(uintptr_t)local_pAllocator;
3470 countingStream->putBe64(cgen_var_238);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003471 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003472 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003473 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003474 }
3475 }
3476 uint32_t packetSize_vkDestroyImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3477 countingStream->rewind();
3478 uint32_t opcode_vkDestroyImageView = OP_vkDestroyImageView;
3479 stream->write(&opcode_vkDestroyImageView, sizeof(uint32_t));
3480 stream->write(&packetSize_vkDestroyImageView, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003481 uint64_t cgen_var_239 = (uint64_t)local_device;
3482 stream->putBe64(cgen_var_239);
3483 uint64_t cgen_var_240 = (uint64_t)local_imageView;
3484 stream->putBe64(cgen_var_240);
3485 // WARNING PTR CHECK
3486 uint64_t cgen_var_241 = (uint64_t)(uintptr_t)local_pAllocator;
3487 stream->putBe64(cgen_var_241);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003488 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003489 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003490 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003491 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003492 resources->destroyMapping()->mapHandles_VkImageView((VkImageView*)&imageView);
3493 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003494}
3495
3496VkResult VkEncoder::vkCreateShaderModule(
3497 VkDevice device,
3498 const VkShaderModuleCreateInfo* pCreateInfo,
3499 const VkAllocationCallbacks* pAllocator,
3500 VkShaderModule* pShaderModule)
3501{
3502 auto stream = mImpl->stream();
3503 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003504 auto resources = mImpl->resources();
3505 auto pool = mImpl->pool();
3506 VkDevice local_device;
3507 local_device = device;
3508 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3509 VkShaderModuleCreateInfo* local_pCreateInfo;
3510 local_pCreateInfo = nullptr;
3511 if (pCreateInfo)
3512 {
3513 local_pCreateInfo = (VkShaderModuleCreateInfo*)pool->alloc(sizeof(const VkShaderModuleCreateInfo));
3514 deepcopy_VkShaderModuleCreateInfo(pool, pCreateInfo, (VkShaderModuleCreateInfo*)(local_pCreateInfo));
3515 }
3516 if (local_pCreateInfo)
3517 {
3518 handlemap_VkShaderModuleCreateInfo(resources->unwrapMapping(), (VkShaderModuleCreateInfo*)(local_pCreateInfo));
3519 }
3520 VkAllocationCallbacks* local_pAllocator;
3521 local_pAllocator = nullptr;
3522 if (pAllocator)
3523 {
3524 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3525 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3526 }
3527 if (local_pAllocator)
3528 {
3529 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3530 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003531 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003532 countingStream->rewind();
3533 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003534 uint64_t cgen_var_242 = (uint64_t)local_device;
3535 countingStream->putBe64(cgen_var_242);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003536 marshal_VkShaderModuleCreateInfo(countingStream, (VkShaderModuleCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003537 // WARNING PTR CHECK
3538 uint64_t cgen_var_243 = (uint64_t)(uintptr_t)local_pAllocator;
3539 countingStream->putBe64(cgen_var_243);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003540 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003541 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003542 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003543 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003544 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003545 countingStream->write((VkShaderModule*)pShaderModule, sizeof(VkShaderModule));
3546 }
3547 uint32_t packetSize_vkCreateShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3548 countingStream->rewind();
3549 uint32_t opcode_vkCreateShaderModule = OP_vkCreateShaderModule;
3550 stream->write(&opcode_vkCreateShaderModule, sizeof(uint32_t));
3551 stream->write(&packetSize_vkCreateShaderModule, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003552 uint64_t cgen_var_244 = (uint64_t)local_device;
3553 stream->putBe64(cgen_var_244);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003554 marshal_VkShaderModuleCreateInfo(stream, (VkShaderModuleCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003555 // WARNING PTR CHECK
3556 uint64_t cgen_var_245 = (uint64_t)(uintptr_t)local_pAllocator;
3557 stream->putBe64(cgen_var_245);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003558 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003559 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003560 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003561 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003562 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003563 stream->write((VkShaderModule*)pShaderModule, sizeof(VkShaderModule));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003564 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003565 stream->read((VkShaderModule*)pShaderModule, sizeof(VkShaderModule));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003566 if (pShaderModule)
3567 {
3568 resources->createMapping()->mapHandles_VkShaderModule((VkShaderModule*)pShaderModule, 1);
3569 }
3570 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003571 VkResult vkCreateShaderModule_VkResult_return = (VkResult)0;
3572 stream->read(&vkCreateShaderModule_VkResult_return, sizeof(VkResult));
3573 return vkCreateShaderModule_VkResult_return;
3574}
3575
3576void VkEncoder::vkDestroyShaderModule(
3577 VkDevice device,
3578 VkShaderModule shaderModule,
3579 const VkAllocationCallbacks* pAllocator)
3580{
3581 auto stream = mImpl->stream();
3582 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003583 auto resources = mImpl->resources();
3584 auto pool = mImpl->pool();
3585 VkDevice local_device;
3586 local_device = device;
3587 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003588 VkShaderModule local_shaderModule;
3589 local_shaderModule = shaderModule;
3590 resources->unwrapMapping()->mapHandles_VkShaderModule((VkShaderModule*)&local_shaderModule);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003591 VkAllocationCallbacks* local_pAllocator;
3592 local_pAllocator = nullptr;
3593 if (pAllocator)
3594 {
3595 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3596 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3597 }
3598 if (local_pAllocator)
3599 {
3600 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3601 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003602 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003603 countingStream->rewind();
3604 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003605 uint64_t cgen_var_246 = (uint64_t)local_device;
3606 countingStream->putBe64(cgen_var_246);
3607 uint64_t cgen_var_247 = (uint64_t)local_shaderModule;
3608 countingStream->putBe64(cgen_var_247);
3609 // WARNING PTR CHECK
3610 uint64_t cgen_var_248 = (uint64_t)(uintptr_t)local_pAllocator;
3611 countingStream->putBe64(cgen_var_248);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003612 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003613 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003614 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003615 }
3616 }
3617 uint32_t packetSize_vkDestroyShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3618 countingStream->rewind();
3619 uint32_t opcode_vkDestroyShaderModule = OP_vkDestroyShaderModule;
3620 stream->write(&opcode_vkDestroyShaderModule, sizeof(uint32_t));
3621 stream->write(&packetSize_vkDestroyShaderModule, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003622 uint64_t cgen_var_249 = (uint64_t)local_device;
3623 stream->putBe64(cgen_var_249);
3624 uint64_t cgen_var_250 = (uint64_t)local_shaderModule;
3625 stream->putBe64(cgen_var_250);
3626 // WARNING PTR CHECK
3627 uint64_t cgen_var_251 = (uint64_t)(uintptr_t)local_pAllocator;
3628 stream->putBe64(cgen_var_251);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003629 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003630 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003631 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003632 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003633 resources->destroyMapping()->mapHandles_VkShaderModule((VkShaderModule*)&shaderModule);
3634 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003635}
3636
3637VkResult VkEncoder::vkCreatePipelineCache(
3638 VkDevice device,
3639 const VkPipelineCacheCreateInfo* pCreateInfo,
3640 const VkAllocationCallbacks* pAllocator,
3641 VkPipelineCache* pPipelineCache)
3642{
3643 auto stream = mImpl->stream();
3644 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003645 auto resources = mImpl->resources();
3646 auto pool = mImpl->pool();
3647 VkDevice local_device;
3648 local_device = device;
3649 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3650 VkPipelineCacheCreateInfo* local_pCreateInfo;
3651 local_pCreateInfo = nullptr;
3652 if (pCreateInfo)
3653 {
3654 local_pCreateInfo = (VkPipelineCacheCreateInfo*)pool->alloc(sizeof(const VkPipelineCacheCreateInfo));
3655 deepcopy_VkPipelineCacheCreateInfo(pool, pCreateInfo, (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
3656 }
3657 if (local_pCreateInfo)
3658 {
3659 handlemap_VkPipelineCacheCreateInfo(resources->unwrapMapping(), (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
3660 }
3661 VkAllocationCallbacks* local_pAllocator;
3662 local_pAllocator = nullptr;
3663 if (pAllocator)
3664 {
3665 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3666 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3667 }
3668 if (local_pAllocator)
3669 {
3670 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3671 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003672 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003673 countingStream->rewind();
3674 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003675 uint64_t cgen_var_252 = (uint64_t)local_device;
3676 countingStream->putBe64(cgen_var_252);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003677 marshal_VkPipelineCacheCreateInfo(countingStream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003678 // WARNING PTR CHECK
3679 uint64_t cgen_var_253 = (uint64_t)(uintptr_t)local_pAllocator;
3680 countingStream->putBe64(cgen_var_253);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003681 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003682 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003683 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003684 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003685 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003686 countingStream->write((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache));
3687 }
3688 uint32_t packetSize_vkCreatePipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3689 countingStream->rewind();
3690 uint32_t opcode_vkCreatePipelineCache = OP_vkCreatePipelineCache;
3691 stream->write(&opcode_vkCreatePipelineCache, sizeof(uint32_t));
3692 stream->write(&packetSize_vkCreatePipelineCache, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003693 uint64_t cgen_var_254 = (uint64_t)local_device;
3694 stream->putBe64(cgen_var_254);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003695 marshal_VkPipelineCacheCreateInfo(stream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003696 // WARNING PTR CHECK
3697 uint64_t cgen_var_255 = (uint64_t)(uintptr_t)local_pAllocator;
3698 stream->putBe64(cgen_var_255);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003699 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003700 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003701 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003702 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003703 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003704 stream->write((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003705 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003706 stream->read((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003707 if (pPipelineCache)
3708 {
3709 resources->createMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)pPipelineCache, 1);
3710 }
3711 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003712 VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0;
3713 stream->read(&vkCreatePipelineCache_VkResult_return, sizeof(VkResult));
3714 return vkCreatePipelineCache_VkResult_return;
3715}
3716
3717void VkEncoder::vkDestroyPipelineCache(
3718 VkDevice device,
3719 VkPipelineCache pipelineCache,
3720 const VkAllocationCallbacks* pAllocator)
3721{
3722 auto stream = mImpl->stream();
3723 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003724 auto resources = mImpl->resources();
3725 auto pool = mImpl->pool();
3726 VkDevice local_device;
3727 local_device = device;
3728 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003729 VkPipelineCache local_pipelineCache;
3730 local_pipelineCache = pipelineCache;
3731 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003732 VkAllocationCallbacks* local_pAllocator;
3733 local_pAllocator = nullptr;
3734 if (pAllocator)
3735 {
3736 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3737 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3738 }
3739 if (local_pAllocator)
3740 {
3741 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3742 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003743 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003744 countingStream->rewind();
3745 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003746 uint64_t cgen_var_256 = (uint64_t)local_device;
3747 countingStream->putBe64(cgen_var_256);
3748 uint64_t cgen_var_257 = (uint64_t)local_pipelineCache;
3749 countingStream->putBe64(cgen_var_257);
3750 // WARNING PTR CHECK
3751 uint64_t cgen_var_258 = (uint64_t)(uintptr_t)local_pAllocator;
3752 countingStream->putBe64(cgen_var_258);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003753 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003754 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003755 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003756 }
3757 }
3758 uint32_t packetSize_vkDestroyPipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3759 countingStream->rewind();
3760 uint32_t opcode_vkDestroyPipelineCache = OP_vkDestroyPipelineCache;
3761 stream->write(&opcode_vkDestroyPipelineCache, sizeof(uint32_t));
3762 stream->write(&packetSize_vkDestroyPipelineCache, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003763 uint64_t cgen_var_259 = (uint64_t)local_device;
3764 stream->putBe64(cgen_var_259);
3765 uint64_t cgen_var_260 = (uint64_t)local_pipelineCache;
3766 stream->putBe64(cgen_var_260);
3767 // WARNING PTR CHECK
3768 uint64_t cgen_var_261 = (uint64_t)(uintptr_t)local_pAllocator;
3769 stream->putBe64(cgen_var_261);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003770 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003771 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003772 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003773 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003774 resources->destroyMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&pipelineCache);
3775 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003776}
3777
3778VkResult VkEncoder::vkGetPipelineCacheData(
3779 VkDevice device,
3780 VkPipelineCache pipelineCache,
3781 size_t* pDataSize,
3782 void* pData)
3783{
3784 auto stream = mImpl->stream();
3785 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003786 auto resources = mImpl->resources();
3787 auto pool = mImpl->pool();
3788 VkDevice local_device;
3789 local_device = device;
3790 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3791 VkPipelineCache local_pipelineCache;
3792 local_pipelineCache = pipelineCache;
3793 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003794 countingStream->rewind();
3795 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003796 uint64_t cgen_var_262 = (uint64_t)local_device;
3797 countingStream->putBe64(cgen_var_262);
3798 uint64_t cgen_var_263 = (uint64_t)local_pipelineCache;
3799 countingStream->putBe64(cgen_var_263);
3800 // WARNING PTR CHECK
3801 uint64_t cgen_var_264 = (uint64_t)(uintptr_t)pDataSize;
3802 countingStream->putBe64(cgen_var_264);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003803 if (pDataSize)
3804 {
3805 countingStream->write((size_t*)pDataSize, sizeof(size_t));
3806 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003807 // WARNING PTR CHECK
3808 uint64_t cgen_var_265 = (uint64_t)(uintptr_t)pData;
3809 countingStream->putBe64(cgen_var_265);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003810 if (pData)
3811 {
3812 countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
3813 }
3814 }
3815 uint32_t packetSize_vkGetPipelineCacheData = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3816 countingStream->rewind();
3817 uint32_t opcode_vkGetPipelineCacheData = OP_vkGetPipelineCacheData;
3818 stream->write(&opcode_vkGetPipelineCacheData, sizeof(uint32_t));
3819 stream->write(&packetSize_vkGetPipelineCacheData, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003820 uint64_t cgen_var_266 = (uint64_t)local_device;
3821 stream->putBe64(cgen_var_266);
3822 uint64_t cgen_var_267 = (uint64_t)local_pipelineCache;
3823 stream->putBe64(cgen_var_267);
3824 // WARNING PTR CHECK
3825 uint64_t cgen_var_268 = (uint64_t)(uintptr_t)pDataSize;
3826 stream->putBe64(cgen_var_268);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003827 if (pDataSize)
3828 {
3829 stream->write((size_t*)pDataSize, sizeof(size_t));
3830 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003831 // WARNING PTR CHECK
3832 uint64_t cgen_var_269 = (uint64_t)(uintptr_t)pData;
3833 stream->putBe64(cgen_var_269);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003834 if (pData)
3835 {
3836 stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
3837 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003838 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003839 size_t* check_pDataSize;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003840 check_pDataSize = (size_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003841 if (pDataSize)
3842 {
3843 if (!(check_pDataSize))
3844 {
3845 fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n");
3846 }
3847 stream->read((size_t*)pDataSize, sizeof(size_t));
3848 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003849 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003850 void* check_pData;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003851 check_pData = (void*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003852 if (pData)
3853 {
3854 if (!(check_pData))
3855 {
3856 fprintf(stderr, "fatal: pData inconsistent between guest and host\n");
3857 }
3858 stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
3859 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003860 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003861 VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0;
3862 stream->read(&vkGetPipelineCacheData_VkResult_return, sizeof(VkResult));
3863 return vkGetPipelineCacheData_VkResult_return;
3864}
3865
3866VkResult VkEncoder::vkMergePipelineCaches(
3867 VkDevice device,
3868 VkPipelineCache dstCache,
3869 uint32_t srcCacheCount,
3870 const VkPipelineCache* pSrcCaches)
3871{
3872 auto stream = mImpl->stream();
3873 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003874 auto resources = mImpl->resources();
3875 auto pool = mImpl->pool();
3876 VkDevice local_device;
3877 local_device = device;
3878 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3879 VkPipelineCache local_dstCache;
3880 local_dstCache = dstCache;
3881 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_dstCache);
3882 uint32_t local_srcCacheCount;
3883 local_srcCacheCount = srcCacheCount;
3884 VkPipelineCache* local_pSrcCaches;
3885 local_pSrcCaches = nullptr;
3886 if (pSrcCaches)
3887 {
3888 local_pSrcCaches = (VkPipelineCache*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkPipelineCache));
3889 }
3890 if (local_pSrcCaches)
3891 {
3892 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount)));
3893 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003894 countingStream->rewind();
3895 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003896 uint64_t cgen_var_272 = (uint64_t)local_device;
3897 countingStream->putBe64(cgen_var_272);
3898 uint64_t cgen_var_273 = (uint64_t)local_dstCache;
3899 countingStream->putBe64(cgen_var_273);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003900 countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003901 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003902 countingStream->write((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkPipelineCache));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003903 }
3904 uint32_t packetSize_vkMergePipelineCaches = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3905 countingStream->rewind();
3906 uint32_t opcode_vkMergePipelineCaches = OP_vkMergePipelineCaches;
3907 stream->write(&opcode_vkMergePipelineCaches, sizeof(uint32_t));
3908 stream->write(&packetSize_vkMergePipelineCaches, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003909 uint64_t cgen_var_274 = (uint64_t)local_device;
3910 stream->putBe64(cgen_var_274);
3911 uint64_t cgen_var_275 = (uint64_t)local_dstCache;
3912 stream->putBe64(cgen_var_275);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003913 stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003914 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003915 stream->write((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkPipelineCache));
3916 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003917 VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0;
3918 stream->read(&vkMergePipelineCaches_VkResult_return, sizeof(VkResult));
3919 return vkMergePipelineCaches_VkResult_return;
3920}
3921
3922VkResult VkEncoder::vkCreateGraphicsPipelines(
3923 VkDevice device,
3924 VkPipelineCache pipelineCache,
3925 uint32_t createInfoCount,
3926 const VkGraphicsPipelineCreateInfo* pCreateInfos,
3927 const VkAllocationCallbacks* pAllocator,
3928 VkPipeline* pPipelines)
3929{
3930 auto stream = mImpl->stream();
3931 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003932 auto resources = mImpl->resources();
3933 auto pool = mImpl->pool();
3934 VkDevice local_device;
3935 local_device = device;
3936 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3937 VkPipelineCache local_pipelineCache;
3938 local_pipelineCache = pipelineCache;
3939 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache);
3940 uint32_t local_createInfoCount;
3941 local_createInfoCount = createInfoCount;
3942 VkGraphicsPipelineCreateInfo* local_pCreateInfos;
3943 local_pCreateInfos = nullptr;
3944 if (pCreateInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003945 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003946 local_pCreateInfos = (VkGraphicsPipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkGraphicsPipelineCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003947 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
3948 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003949 deepcopy_VkGraphicsPipelineCreateInfo(pool, pCreateInfos + i, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003950 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003951 }
3952 if (local_pCreateInfos)
3953 {
3954 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003955 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003956 handlemap_VkGraphicsPipelineCreateInfo(resources->unwrapMapping(), (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
3957 }
3958 }
3959 VkAllocationCallbacks* local_pAllocator;
3960 local_pAllocator = nullptr;
3961 if (pAllocator)
3962 {
3963 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3964 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3965 }
3966 if (local_pAllocator)
3967 {
3968 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3969 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08003970 local_pAllocator = nullptr;
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003971 countingStream->rewind();
3972 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003973 uint64_t cgen_var_276 = (uint64_t)local_device;
3974 countingStream->putBe64(cgen_var_276);
3975 uint64_t cgen_var_277 = (uint64_t)local_pipelineCache;
3976 countingStream->putBe64(cgen_var_277);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003977 countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
3978 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
3979 {
3980 marshal_VkGraphicsPipelineCreateInfo(countingStream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
3981 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003982 // WARNING PTR CHECK
3983 uint64_t cgen_var_278 = (uint64_t)(uintptr_t)local_pAllocator;
3984 countingStream->putBe64(cgen_var_278);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003985 if (local_pAllocator)
3986 {
3987 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003988 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003989 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003990 countingStream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
3991 }
3992 uint32_t packetSize_vkCreateGraphicsPipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3993 countingStream->rewind();
3994 uint32_t opcode_vkCreateGraphicsPipelines = OP_vkCreateGraphicsPipelines;
3995 stream->write(&opcode_vkCreateGraphicsPipelines, sizeof(uint32_t));
3996 stream->write(&packetSize_vkCreateGraphicsPipelines, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08003997 uint64_t cgen_var_279 = (uint64_t)local_device;
3998 stream->putBe64(cgen_var_279);
3999 uint64_t cgen_var_280 = (uint64_t)local_pipelineCache;
4000 stream->putBe64(cgen_var_280);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004001 stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004002 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
4003 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004004 marshal_VkGraphicsPipelineCreateInfo(stream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004005 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004006 // WARNING PTR CHECK
4007 uint64_t cgen_var_281 = (uint64_t)(uintptr_t)local_pAllocator;
4008 stream->putBe64(cgen_var_281);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004009 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004010 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004011 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004012 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004013 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004014 stream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004015 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004016 stream->read((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004017 if (pPipelines)
4018 {
4019 resources->createMapping()->mapHandles_VkPipeline((VkPipeline*)pPipelines, ((createInfoCount)));
4020 }
4021 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004022 VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0;
4023 stream->read(&vkCreateGraphicsPipelines_VkResult_return, sizeof(VkResult));
4024 return vkCreateGraphicsPipelines_VkResult_return;
4025}
4026
4027VkResult VkEncoder::vkCreateComputePipelines(
4028 VkDevice device,
4029 VkPipelineCache pipelineCache,
4030 uint32_t createInfoCount,
4031 const VkComputePipelineCreateInfo* pCreateInfos,
4032 const VkAllocationCallbacks* pAllocator,
4033 VkPipeline* pPipelines)
4034{
4035 auto stream = mImpl->stream();
4036 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004037 auto resources = mImpl->resources();
4038 auto pool = mImpl->pool();
4039 VkDevice local_device;
4040 local_device = device;
4041 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4042 VkPipelineCache local_pipelineCache;
4043 local_pipelineCache = pipelineCache;
4044 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache);
4045 uint32_t local_createInfoCount;
4046 local_createInfoCount = createInfoCount;
4047 VkComputePipelineCreateInfo* local_pCreateInfos;
4048 local_pCreateInfos = nullptr;
4049 if (pCreateInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004050 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004051 local_pCreateInfos = (VkComputePipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkComputePipelineCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004052 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
4053 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004054 deepcopy_VkComputePipelineCreateInfo(pool, pCreateInfos + i, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004055 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004056 }
4057 if (local_pCreateInfos)
4058 {
4059 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004060 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004061 handlemap_VkComputePipelineCreateInfo(resources->unwrapMapping(), (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
4062 }
4063 }
4064 VkAllocationCallbacks* local_pAllocator;
4065 local_pAllocator = nullptr;
4066 if (pAllocator)
4067 {
4068 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4069 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4070 }
4071 if (local_pAllocator)
4072 {
4073 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4074 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004075 local_pAllocator = nullptr;
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004076 countingStream->rewind();
4077 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004078 uint64_t cgen_var_282 = (uint64_t)local_device;
4079 countingStream->putBe64(cgen_var_282);
4080 uint64_t cgen_var_283 = (uint64_t)local_pipelineCache;
4081 countingStream->putBe64(cgen_var_283);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004082 countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
4083 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
4084 {
4085 marshal_VkComputePipelineCreateInfo(countingStream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
4086 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004087 // WARNING PTR CHECK
4088 uint64_t cgen_var_284 = (uint64_t)(uintptr_t)local_pAllocator;
4089 countingStream->putBe64(cgen_var_284);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004090 if (local_pAllocator)
4091 {
4092 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004093 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004094 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004095 countingStream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
4096 }
4097 uint32_t packetSize_vkCreateComputePipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4098 countingStream->rewind();
4099 uint32_t opcode_vkCreateComputePipelines = OP_vkCreateComputePipelines;
4100 stream->write(&opcode_vkCreateComputePipelines, sizeof(uint32_t));
4101 stream->write(&packetSize_vkCreateComputePipelines, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004102 uint64_t cgen_var_285 = (uint64_t)local_device;
4103 stream->putBe64(cgen_var_285);
4104 uint64_t cgen_var_286 = (uint64_t)local_pipelineCache;
4105 stream->putBe64(cgen_var_286);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004106 stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004107 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
4108 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004109 marshal_VkComputePipelineCreateInfo(stream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004110 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004111 // WARNING PTR CHECK
4112 uint64_t cgen_var_287 = (uint64_t)(uintptr_t)local_pAllocator;
4113 stream->putBe64(cgen_var_287);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004114 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004115 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004116 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004117 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004118 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004119 stream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004120 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004121 stream->read((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004122 if (pPipelines)
4123 {
4124 resources->createMapping()->mapHandles_VkPipeline((VkPipeline*)pPipelines, ((createInfoCount)));
4125 }
4126 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004127 VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0;
4128 stream->read(&vkCreateComputePipelines_VkResult_return, sizeof(VkResult));
4129 return vkCreateComputePipelines_VkResult_return;
4130}
4131
4132void VkEncoder::vkDestroyPipeline(
4133 VkDevice device,
4134 VkPipeline pipeline,
4135 const VkAllocationCallbacks* pAllocator)
4136{
4137 auto stream = mImpl->stream();
4138 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004139 auto resources = mImpl->resources();
4140 auto pool = mImpl->pool();
4141 VkDevice local_device;
4142 local_device = device;
4143 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004144 VkPipeline local_pipeline;
4145 local_pipeline = pipeline;
4146 resources->unwrapMapping()->mapHandles_VkPipeline((VkPipeline*)&local_pipeline);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004147 VkAllocationCallbacks* local_pAllocator;
4148 local_pAllocator = nullptr;
4149 if (pAllocator)
4150 {
4151 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4152 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4153 }
4154 if (local_pAllocator)
4155 {
4156 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4157 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004158 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004159 countingStream->rewind();
4160 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004161 uint64_t cgen_var_288 = (uint64_t)local_device;
4162 countingStream->putBe64(cgen_var_288);
4163 uint64_t cgen_var_289 = (uint64_t)local_pipeline;
4164 countingStream->putBe64(cgen_var_289);
4165 // WARNING PTR CHECK
4166 uint64_t cgen_var_290 = (uint64_t)(uintptr_t)local_pAllocator;
4167 countingStream->putBe64(cgen_var_290);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004168 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004169 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004170 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004171 }
4172 }
4173 uint32_t packetSize_vkDestroyPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4174 countingStream->rewind();
4175 uint32_t opcode_vkDestroyPipeline = OP_vkDestroyPipeline;
4176 stream->write(&opcode_vkDestroyPipeline, sizeof(uint32_t));
4177 stream->write(&packetSize_vkDestroyPipeline, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004178 uint64_t cgen_var_291 = (uint64_t)local_device;
4179 stream->putBe64(cgen_var_291);
4180 uint64_t cgen_var_292 = (uint64_t)local_pipeline;
4181 stream->putBe64(cgen_var_292);
4182 // WARNING PTR CHECK
4183 uint64_t cgen_var_293 = (uint64_t)(uintptr_t)local_pAllocator;
4184 stream->putBe64(cgen_var_293);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004185 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004186 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004187 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004188 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004189 resources->destroyMapping()->mapHandles_VkPipeline((VkPipeline*)&pipeline);
4190 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004191}
4192
4193VkResult VkEncoder::vkCreatePipelineLayout(
4194 VkDevice device,
4195 const VkPipelineLayoutCreateInfo* pCreateInfo,
4196 const VkAllocationCallbacks* pAllocator,
4197 VkPipelineLayout* pPipelineLayout)
4198{
4199 auto stream = mImpl->stream();
4200 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004201 auto resources = mImpl->resources();
4202 auto pool = mImpl->pool();
4203 VkDevice local_device;
4204 local_device = device;
4205 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4206 VkPipelineLayoutCreateInfo* local_pCreateInfo;
4207 local_pCreateInfo = nullptr;
4208 if (pCreateInfo)
4209 {
4210 local_pCreateInfo = (VkPipelineLayoutCreateInfo*)pool->alloc(sizeof(const VkPipelineLayoutCreateInfo));
4211 deepcopy_VkPipelineLayoutCreateInfo(pool, pCreateInfo, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
4212 }
4213 if (local_pCreateInfo)
4214 {
4215 handlemap_VkPipelineLayoutCreateInfo(resources->unwrapMapping(), (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
4216 }
4217 VkAllocationCallbacks* local_pAllocator;
4218 local_pAllocator = nullptr;
4219 if (pAllocator)
4220 {
4221 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4222 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4223 }
4224 if (local_pAllocator)
4225 {
4226 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4227 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004228 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004229 countingStream->rewind();
4230 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004231 uint64_t cgen_var_294 = (uint64_t)local_device;
4232 countingStream->putBe64(cgen_var_294);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004233 marshal_VkPipelineLayoutCreateInfo(countingStream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004234 // WARNING PTR CHECK
4235 uint64_t cgen_var_295 = (uint64_t)(uintptr_t)local_pAllocator;
4236 countingStream->putBe64(cgen_var_295);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004237 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004238 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004239 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004240 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004241 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004242 countingStream->write((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout));
4243 }
4244 uint32_t packetSize_vkCreatePipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4245 countingStream->rewind();
4246 uint32_t opcode_vkCreatePipelineLayout = OP_vkCreatePipelineLayout;
4247 stream->write(&opcode_vkCreatePipelineLayout, sizeof(uint32_t));
4248 stream->write(&packetSize_vkCreatePipelineLayout, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004249 uint64_t cgen_var_296 = (uint64_t)local_device;
4250 stream->putBe64(cgen_var_296);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004251 marshal_VkPipelineLayoutCreateInfo(stream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004252 // WARNING PTR CHECK
4253 uint64_t cgen_var_297 = (uint64_t)(uintptr_t)local_pAllocator;
4254 stream->putBe64(cgen_var_297);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004255 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004256 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004257 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004258 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004259 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004260 stream->write((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004261 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004262 stream->read((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004263 if (pPipelineLayout)
4264 {
4265 resources->createMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)pPipelineLayout, 1);
4266 }
4267 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004268 VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0;
4269 stream->read(&vkCreatePipelineLayout_VkResult_return, sizeof(VkResult));
4270 return vkCreatePipelineLayout_VkResult_return;
4271}
4272
4273void VkEncoder::vkDestroyPipelineLayout(
4274 VkDevice device,
4275 VkPipelineLayout pipelineLayout,
4276 const VkAllocationCallbacks* pAllocator)
4277{
4278 auto stream = mImpl->stream();
4279 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004280 auto resources = mImpl->resources();
4281 auto pool = mImpl->pool();
4282 VkDevice local_device;
4283 local_device = device;
4284 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004285 VkPipelineLayout local_pipelineLayout;
4286 local_pipelineLayout = pipelineLayout;
4287 resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_pipelineLayout);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004288 VkAllocationCallbacks* local_pAllocator;
4289 local_pAllocator = nullptr;
4290 if (pAllocator)
4291 {
4292 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4293 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4294 }
4295 if (local_pAllocator)
4296 {
4297 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4298 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004299 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004300 countingStream->rewind();
4301 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004302 uint64_t cgen_var_298 = (uint64_t)local_device;
4303 countingStream->putBe64(cgen_var_298);
4304 uint64_t cgen_var_299 = (uint64_t)local_pipelineLayout;
4305 countingStream->putBe64(cgen_var_299);
4306 // WARNING PTR CHECK
4307 uint64_t cgen_var_300 = (uint64_t)(uintptr_t)local_pAllocator;
4308 countingStream->putBe64(cgen_var_300);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004309 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004310 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004311 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004312 }
4313 }
4314 uint32_t packetSize_vkDestroyPipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4315 countingStream->rewind();
4316 uint32_t opcode_vkDestroyPipelineLayout = OP_vkDestroyPipelineLayout;
4317 stream->write(&opcode_vkDestroyPipelineLayout, sizeof(uint32_t));
4318 stream->write(&packetSize_vkDestroyPipelineLayout, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004319 uint64_t cgen_var_301 = (uint64_t)local_device;
4320 stream->putBe64(cgen_var_301);
4321 uint64_t cgen_var_302 = (uint64_t)local_pipelineLayout;
4322 stream->putBe64(cgen_var_302);
4323 // WARNING PTR CHECK
4324 uint64_t cgen_var_303 = (uint64_t)(uintptr_t)local_pAllocator;
4325 stream->putBe64(cgen_var_303);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004326 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004327 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004328 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004329 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004330 resources->destroyMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&pipelineLayout);
4331 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004332}
4333
4334VkResult VkEncoder::vkCreateSampler(
4335 VkDevice device,
4336 const VkSamplerCreateInfo* pCreateInfo,
4337 const VkAllocationCallbacks* pAllocator,
4338 VkSampler* pSampler)
4339{
4340 auto stream = mImpl->stream();
4341 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004342 auto resources = mImpl->resources();
4343 auto pool = mImpl->pool();
4344 VkDevice local_device;
4345 local_device = device;
4346 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4347 VkSamplerCreateInfo* local_pCreateInfo;
4348 local_pCreateInfo = nullptr;
4349 if (pCreateInfo)
4350 {
4351 local_pCreateInfo = (VkSamplerCreateInfo*)pool->alloc(sizeof(const VkSamplerCreateInfo));
4352 deepcopy_VkSamplerCreateInfo(pool, pCreateInfo, (VkSamplerCreateInfo*)(local_pCreateInfo));
4353 }
4354 if (local_pCreateInfo)
4355 {
4356 handlemap_VkSamplerCreateInfo(resources->unwrapMapping(), (VkSamplerCreateInfo*)(local_pCreateInfo));
4357 }
4358 VkAllocationCallbacks* local_pAllocator;
4359 local_pAllocator = nullptr;
4360 if (pAllocator)
4361 {
4362 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4363 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4364 }
4365 if (local_pAllocator)
4366 {
4367 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4368 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004369 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004370 countingStream->rewind();
4371 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004372 uint64_t cgen_var_304 = (uint64_t)local_device;
4373 countingStream->putBe64(cgen_var_304);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004374 marshal_VkSamplerCreateInfo(countingStream, (VkSamplerCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004375 // WARNING PTR CHECK
4376 uint64_t cgen_var_305 = (uint64_t)(uintptr_t)local_pAllocator;
4377 countingStream->putBe64(cgen_var_305);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004378 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004379 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004380 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004381 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004382 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004383 countingStream->write((VkSampler*)pSampler, sizeof(VkSampler));
4384 }
4385 uint32_t packetSize_vkCreateSampler = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4386 countingStream->rewind();
4387 uint32_t opcode_vkCreateSampler = OP_vkCreateSampler;
4388 stream->write(&opcode_vkCreateSampler, sizeof(uint32_t));
4389 stream->write(&packetSize_vkCreateSampler, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004390 uint64_t cgen_var_306 = (uint64_t)local_device;
4391 stream->putBe64(cgen_var_306);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004392 marshal_VkSamplerCreateInfo(stream, (VkSamplerCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004393 // WARNING PTR CHECK
4394 uint64_t cgen_var_307 = (uint64_t)(uintptr_t)local_pAllocator;
4395 stream->putBe64(cgen_var_307);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004396 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004397 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004398 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004399 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004400 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004401 stream->write((VkSampler*)pSampler, sizeof(VkSampler));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004402 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004403 stream->read((VkSampler*)pSampler, sizeof(VkSampler));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004404 if (pSampler)
4405 {
4406 resources->createMapping()->mapHandles_VkSampler((VkSampler*)pSampler, 1);
4407 }
4408 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004409 VkResult vkCreateSampler_VkResult_return = (VkResult)0;
4410 stream->read(&vkCreateSampler_VkResult_return, sizeof(VkResult));
4411 return vkCreateSampler_VkResult_return;
4412}
4413
4414void VkEncoder::vkDestroySampler(
4415 VkDevice device,
4416 VkSampler sampler,
4417 const VkAllocationCallbacks* pAllocator)
4418{
4419 auto stream = mImpl->stream();
4420 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004421 auto resources = mImpl->resources();
4422 auto pool = mImpl->pool();
4423 VkDevice local_device;
4424 local_device = device;
4425 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004426 VkSampler local_sampler;
4427 local_sampler = sampler;
4428 resources->unwrapMapping()->mapHandles_VkSampler((VkSampler*)&local_sampler);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004429 VkAllocationCallbacks* local_pAllocator;
4430 local_pAllocator = nullptr;
4431 if (pAllocator)
4432 {
4433 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4434 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4435 }
4436 if (local_pAllocator)
4437 {
4438 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4439 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004440 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004441 countingStream->rewind();
4442 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004443 uint64_t cgen_var_308 = (uint64_t)local_device;
4444 countingStream->putBe64(cgen_var_308);
4445 uint64_t cgen_var_309 = (uint64_t)local_sampler;
4446 countingStream->putBe64(cgen_var_309);
4447 // WARNING PTR CHECK
4448 uint64_t cgen_var_310 = (uint64_t)(uintptr_t)local_pAllocator;
4449 countingStream->putBe64(cgen_var_310);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004450 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004451 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004452 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004453 }
4454 }
4455 uint32_t packetSize_vkDestroySampler = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4456 countingStream->rewind();
4457 uint32_t opcode_vkDestroySampler = OP_vkDestroySampler;
4458 stream->write(&opcode_vkDestroySampler, sizeof(uint32_t));
4459 stream->write(&packetSize_vkDestroySampler, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004460 uint64_t cgen_var_311 = (uint64_t)local_device;
4461 stream->putBe64(cgen_var_311);
4462 uint64_t cgen_var_312 = (uint64_t)local_sampler;
4463 stream->putBe64(cgen_var_312);
4464 // WARNING PTR CHECK
4465 uint64_t cgen_var_313 = (uint64_t)(uintptr_t)local_pAllocator;
4466 stream->putBe64(cgen_var_313);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004467 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004468 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004469 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004470 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004471 resources->destroyMapping()->mapHandles_VkSampler((VkSampler*)&sampler);
4472 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004473}
4474
4475VkResult VkEncoder::vkCreateDescriptorSetLayout(
4476 VkDevice device,
4477 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
4478 const VkAllocationCallbacks* pAllocator,
4479 VkDescriptorSetLayout* pSetLayout)
4480{
4481 auto stream = mImpl->stream();
4482 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004483 auto resources = mImpl->resources();
4484 auto pool = mImpl->pool();
4485 VkDevice local_device;
4486 local_device = device;
4487 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4488 VkDescriptorSetLayoutCreateInfo* local_pCreateInfo;
4489 local_pCreateInfo = nullptr;
4490 if (pCreateInfo)
4491 {
4492 local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo));
4493 deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
4494 }
4495 if (local_pCreateInfo)
4496 {
4497 handlemap_VkDescriptorSetLayoutCreateInfo(resources->unwrapMapping(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
4498 }
4499 VkAllocationCallbacks* local_pAllocator;
4500 local_pAllocator = nullptr;
4501 if (pAllocator)
4502 {
4503 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4504 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4505 }
4506 if (local_pAllocator)
4507 {
4508 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4509 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004510 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004511 countingStream->rewind();
4512 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004513 uint64_t cgen_var_314 = (uint64_t)local_device;
4514 countingStream->putBe64(cgen_var_314);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004515 marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004516 // WARNING PTR CHECK
4517 uint64_t cgen_var_315 = (uint64_t)(uintptr_t)local_pAllocator;
4518 countingStream->putBe64(cgen_var_315);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004519 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004520 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004521 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004522 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004523 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004524 countingStream->write((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout));
4525 }
4526 uint32_t packetSize_vkCreateDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4527 countingStream->rewind();
4528 uint32_t opcode_vkCreateDescriptorSetLayout = OP_vkCreateDescriptorSetLayout;
4529 stream->write(&opcode_vkCreateDescriptorSetLayout, sizeof(uint32_t));
4530 stream->write(&packetSize_vkCreateDescriptorSetLayout, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004531 uint64_t cgen_var_316 = (uint64_t)local_device;
4532 stream->putBe64(cgen_var_316);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004533 marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004534 // WARNING PTR CHECK
4535 uint64_t cgen_var_317 = (uint64_t)(uintptr_t)local_pAllocator;
4536 stream->putBe64(cgen_var_317);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004537 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004538 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004539 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004540 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004541 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004542 stream->write((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004543 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004544 stream->read((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004545 if (pSetLayout)
4546 {
4547 resources->createMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)pSetLayout, 1);
4548 }
4549 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004550 VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0;
4551 stream->read(&vkCreateDescriptorSetLayout_VkResult_return, sizeof(VkResult));
4552 return vkCreateDescriptorSetLayout_VkResult_return;
4553}
4554
4555void VkEncoder::vkDestroyDescriptorSetLayout(
4556 VkDevice device,
4557 VkDescriptorSetLayout descriptorSetLayout,
4558 const VkAllocationCallbacks* pAllocator)
4559{
4560 auto stream = mImpl->stream();
4561 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004562 auto resources = mImpl->resources();
4563 auto pool = mImpl->pool();
4564 VkDevice local_device;
4565 local_device = device;
4566 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004567 VkDescriptorSetLayout local_descriptorSetLayout;
4568 local_descriptorSetLayout = descriptorSetLayout;
4569 resources->unwrapMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)&local_descriptorSetLayout);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004570 VkAllocationCallbacks* local_pAllocator;
4571 local_pAllocator = nullptr;
4572 if (pAllocator)
4573 {
4574 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4575 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4576 }
4577 if (local_pAllocator)
4578 {
4579 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4580 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004581 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004582 countingStream->rewind();
4583 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004584 uint64_t cgen_var_318 = (uint64_t)local_device;
4585 countingStream->putBe64(cgen_var_318);
4586 uint64_t cgen_var_319 = (uint64_t)local_descriptorSetLayout;
4587 countingStream->putBe64(cgen_var_319);
4588 // WARNING PTR CHECK
4589 uint64_t cgen_var_320 = (uint64_t)(uintptr_t)local_pAllocator;
4590 countingStream->putBe64(cgen_var_320);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004591 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004592 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004593 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004594 }
4595 }
4596 uint32_t packetSize_vkDestroyDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4597 countingStream->rewind();
4598 uint32_t opcode_vkDestroyDescriptorSetLayout = OP_vkDestroyDescriptorSetLayout;
4599 stream->write(&opcode_vkDestroyDescriptorSetLayout, sizeof(uint32_t));
4600 stream->write(&packetSize_vkDestroyDescriptorSetLayout, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004601 uint64_t cgen_var_321 = (uint64_t)local_device;
4602 stream->putBe64(cgen_var_321);
4603 uint64_t cgen_var_322 = (uint64_t)local_descriptorSetLayout;
4604 stream->putBe64(cgen_var_322);
4605 // WARNING PTR CHECK
4606 uint64_t cgen_var_323 = (uint64_t)(uintptr_t)local_pAllocator;
4607 stream->putBe64(cgen_var_323);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004608 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004609 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004610 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004611 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004612 resources->destroyMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)&descriptorSetLayout);
4613 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004614}
4615
4616VkResult VkEncoder::vkCreateDescriptorPool(
4617 VkDevice device,
4618 const VkDescriptorPoolCreateInfo* pCreateInfo,
4619 const VkAllocationCallbacks* pAllocator,
4620 VkDescriptorPool* pDescriptorPool)
4621{
4622 auto stream = mImpl->stream();
4623 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004624 auto resources = mImpl->resources();
4625 auto pool = mImpl->pool();
4626 VkDevice local_device;
4627 local_device = device;
4628 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4629 VkDescriptorPoolCreateInfo* local_pCreateInfo;
4630 local_pCreateInfo = nullptr;
4631 if (pCreateInfo)
4632 {
4633 local_pCreateInfo = (VkDescriptorPoolCreateInfo*)pool->alloc(sizeof(const VkDescriptorPoolCreateInfo));
4634 deepcopy_VkDescriptorPoolCreateInfo(pool, pCreateInfo, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
4635 }
4636 if (local_pCreateInfo)
4637 {
4638 handlemap_VkDescriptorPoolCreateInfo(resources->unwrapMapping(), (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
4639 }
4640 VkAllocationCallbacks* local_pAllocator;
4641 local_pAllocator = nullptr;
4642 if (pAllocator)
4643 {
4644 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4645 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4646 }
4647 if (local_pAllocator)
4648 {
4649 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4650 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004651 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004652 countingStream->rewind();
4653 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004654 uint64_t cgen_var_324 = (uint64_t)local_device;
4655 countingStream->putBe64(cgen_var_324);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004656 marshal_VkDescriptorPoolCreateInfo(countingStream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004657 // WARNING PTR CHECK
4658 uint64_t cgen_var_325 = (uint64_t)(uintptr_t)local_pAllocator;
4659 countingStream->putBe64(cgen_var_325);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004660 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004661 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004662 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004663 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004664 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004665 countingStream->write((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool));
4666 }
4667 uint32_t packetSize_vkCreateDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4668 countingStream->rewind();
4669 uint32_t opcode_vkCreateDescriptorPool = OP_vkCreateDescriptorPool;
4670 stream->write(&opcode_vkCreateDescriptorPool, sizeof(uint32_t));
4671 stream->write(&packetSize_vkCreateDescriptorPool, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004672 uint64_t cgen_var_326 = (uint64_t)local_device;
4673 stream->putBe64(cgen_var_326);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004674 marshal_VkDescriptorPoolCreateInfo(stream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004675 // WARNING PTR CHECK
4676 uint64_t cgen_var_327 = (uint64_t)(uintptr_t)local_pAllocator;
4677 stream->putBe64(cgen_var_327);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004678 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004679 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004680 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004681 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004682 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004683 stream->write((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004684 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004685 stream->read((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004686 if (pDescriptorPool)
4687 {
4688 resources->createMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)pDescriptorPool, 1);
4689 }
4690 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004691 VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0;
4692 stream->read(&vkCreateDescriptorPool_VkResult_return, sizeof(VkResult));
4693 return vkCreateDescriptorPool_VkResult_return;
4694}
4695
4696void VkEncoder::vkDestroyDescriptorPool(
4697 VkDevice device,
4698 VkDescriptorPool descriptorPool,
4699 const VkAllocationCallbacks* pAllocator)
4700{
4701 auto stream = mImpl->stream();
4702 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004703 auto resources = mImpl->resources();
4704 auto pool = mImpl->pool();
4705 VkDevice local_device;
4706 local_device = device;
4707 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004708 VkDescriptorPool local_descriptorPool;
4709 local_descriptorPool = descriptorPool;
4710 resources->unwrapMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&local_descriptorPool);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004711 VkAllocationCallbacks* local_pAllocator;
4712 local_pAllocator = nullptr;
4713 if (pAllocator)
4714 {
4715 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4716 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4717 }
4718 if (local_pAllocator)
4719 {
4720 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4721 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004722 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004723 countingStream->rewind();
4724 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004725 uint64_t cgen_var_328 = (uint64_t)local_device;
4726 countingStream->putBe64(cgen_var_328);
4727 uint64_t cgen_var_329 = (uint64_t)local_descriptorPool;
4728 countingStream->putBe64(cgen_var_329);
4729 // WARNING PTR CHECK
4730 uint64_t cgen_var_330 = (uint64_t)(uintptr_t)local_pAllocator;
4731 countingStream->putBe64(cgen_var_330);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004732 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004733 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004734 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004735 }
4736 }
4737 uint32_t packetSize_vkDestroyDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4738 countingStream->rewind();
4739 uint32_t opcode_vkDestroyDescriptorPool = OP_vkDestroyDescriptorPool;
4740 stream->write(&opcode_vkDestroyDescriptorPool, sizeof(uint32_t));
4741 stream->write(&packetSize_vkDestroyDescriptorPool, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004742 uint64_t cgen_var_331 = (uint64_t)local_device;
4743 stream->putBe64(cgen_var_331);
4744 uint64_t cgen_var_332 = (uint64_t)local_descriptorPool;
4745 stream->putBe64(cgen_var_332);
4746 // WARNING PTR CHECK
4747 uint64_t cgen_var_333 = (uint64_t)(uintptr_t)local_pAllocator;
4748 stream->putBe64(cgen_var_333);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004749 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004750 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004751 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004752 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004753 resources->destroyMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&descriptorPool);
4754 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004755}
4756
4757VkResult VkEncoder::vkResetDescriptorPool(
4758 VkDevice device,
4759 VkDescriptorPool descriptorPool,
4760 VkDescriptorPoolResetFlags flags)
4761{
4762 auto stream = mImpl->stream();
4763 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004764 auto resources = mImpl->resources();
4765 auto pool = mImpl->pool();
4766 VkDevice local_device;
4767 local_device = device;
4768 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4769 VkDescriptorPool local_descriptorPool;
4770 local_descriptorPool = descriptorPool;
4771 resources->unwrapMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&local_descriptorPool);
4772 VkDescriptorPoolResetFlags local_flags;
4773 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004774 countingStream->rewind();
4775 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004776 uint64_t cgen_var_334 = (uint64_t)local_device;
4777 countingStream->putBe64(cgen_var_334);
4778 uint64_t cgen_var_335 = (uint64_t)local_descriptorPool;
4779 countingStream->putBe64(cgen_var_335);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004780 countingStream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004781 }
4782 uint32_t packetSize_vkResetDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4783 countingStream->rewind();
4784 uint32_t opcode_vkResetDescriptorPool = OP_vkResetDescriptorPool;
4785 stream->write(&opcode_vkResetDescriptorPool, sizeof(uint32_t));
4786 stream->write(&packetSize_vkResetDescriptorPool, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004787 uint64_t cgen_var_336 = (uint64_t)local_device;
4788 stream->putBe64(cgen_var_336);
4789 uint64_t cgen_var_337 = (uint64_t)local_descriptorPool;
4790 stream->putBe64(cgen_var_337);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004791 stream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags));
4792 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004793 VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0;
4794 stream->read(&vkResetDescriptorPool_VkResult_return, sizeof(VkResult));
4795 return vkResetDescriptorPool_VkResult_return;
4796}
4797
4798VkResult VkEncoder::vkAllocateDescriptorSets(
4799 VkDevice device,
4800 const VkDescriptorSetAllocateInfo* pAllocateInfo,
4801 VkDescriptorSet* pDescriptorSets)
4802{
4803 auto stream = mImpl->stream();
4804 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004805 auto resources = mImpl->resources();
4806 auto pool = mImpl->pool();
4807 VkDevice local_device;
4808 local_device = device;
4809 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4810 VkDescriptorSetAllocateInfo* local_pAllocateInfo;
4811 local_pAllocateInfo = nullptr;
4812 if (pAllocateInfo)
4813 {
4814 local_pAllocateInfo = (VkDescriptorSetAllocateInfo*)pool->alloc(sizeof(const VkDescriptorSetAllocateInfo));
4815 deepcopy_VkDescriptorSetAllocateInfo(pool, pAllocateInfo, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
4816 }
4817 if (local_pAllocateInfo)
4818 {
4819 handlemap_VkDescriptorSetAllocateInfo(resources->unwrapMapping(), (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
4820 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004821 countingStream->rewind();
4822 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004823 uint64_t cgen_var_338 = (uint64_t)local_device;
4824 countingStream->putBe64(cgen_var_338);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004825 marshal_VkDescriptorSetAllocateInfo(countingStream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004826 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004827 countingStream->write((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet));
4828 }
4829 uint32_t packetSize_vkAllocateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4830 countingStream->rewind();
4831 uint32_t opcode_vkAllocateDescriptorSets = OP_vkAllocateDescriptorSets;
4832 stream->write(&opcode_vkAllocateDescriptorSets, sizeof(uint32_t));
4833 stream->write(&packetSize_vkAllocateDescriptorSets, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004834 uint64_t cgen_var_339 = (uint64_t)local_device;
4835 stream->putBe64(cgen_var_339);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004836 marshal_VkDescriptorSetAllocateInfo(stream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004837 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004838 stream->write((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004839 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004840 stream->read((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004841 if (pDescriptorSets)
4842 {
4843 resources->createMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount);
4844 }
4845 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004846 VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0;
4847 stream->read(&vkAllocateDescriptorSets_VkResult_return, sizeof(VkResult));
4848 return vkAllocateDescriptorSets_VkResult_return;
4849}
4850
4851VkResult VkEncoder::vkFreeDescriptorSets(
4852 VkDevice device,
4853 VkDescriptorPool descriptorPool,
4854 uint32_t descriptorSetCount,
4855 const VkDescriptorSet* pDescriptorSets)
4856{
4857 auto stream = mImpl->stream();
4858 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004859 auto resources = mImpl->resources();
4860 auto pool = mImpl->pool();
4861 VkDevice local_device;
4862 local_device = device;
4863 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4864 VkDescriptorPool local_descriptorPool;
4865 local_descriptorPool = descriptorPool;
4866 resources->unwrapMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&local_descriptorPool);
4867 uint32_t local_descriptorSetCount;
4868 local_descriptorSetCount = descriptorSetCount;
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004869 VkDescriptorSet* local_pDescriptorSets;
4870 local_pDescriptorSets = nullptr;
4871 if (pDescriptorSets)
4872 {
4873 local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet));
4874 }
4875 if (local_pDescriptorSets)
4876 {
4877 resources->unwrapMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)));
4878 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004879 countingStream->rewind();
4880 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004881 uint64_t cgen_var_340 = (uint64_t)local_device;
4882 countingStream->putBe64(cgen_var_340);
4883 uint64_t cgen_var_341 = (uint64_t)local_descriptorPool;
4884 countingStream->putBe64(cgen_var_341);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004885 countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004886 // WARNING PTR CHECK
4887 uint64_t cgen_var_342 = (uint64_t)(uintptr_t)local_pDescriptorSets;
4888 countingStream->putBe64(cgen_var_342);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004889 if (local_pDescriptorSets)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004890 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004891 // WARNING HANDLE TYPE POINTER
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004892 countingStream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004893 }
4894 }
4895 uint32_t packetSize_vkFreeDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4896 countingStream->rewind();
4897 uint32_t opcode_vkFreeDescriptorSets = OP_vkFreeDescriptorSets;
4898 stream->write(&opcode_vkFreeDescriptorSets, sizeof(uint32_t));
4899 stream->write(&packetSize_vkFreeDescriptorSets, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004900 uint64_t cgen_var_343 = (uint64_t)local_device;
4901 stream->putBe64(cgen_var_343);
4902 uint64_t cgen_var_344 = (uint64_t)local_descriptorPool;
4903 stream->putBe64(cgen_var_344);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004904 stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004905 // WARNING PTR CHECK
4906 uint64_t cgen_var_345 = (uint64_t)(uintptr_t)local_pDescriptorSets;
4907 stream->putBe64(cgen_var_345);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004908 if (local_pDescriptorSets)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004909 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004910 // WARNING HANDLE TYPE POINTER
Lingfeng Yang9d02e102018-11-10 01:51:46 -08004911 stream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004912 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004913 if (pDescriptorSets)
4914 {
4915 resources->destroyMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount)));
4916 }
4917 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004918 VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0;
4919 stream->read(&vkFreeDescriptorSets_VkResult_return, sizeof(VkResult));
4920 return vkFreeDescriptorSets_VkResult_return;
4921}
4922
4923void VkEncoder::vkUpdateDescriptorSets(
4924 VkDevice device,
4925 uint32_t descriptorWriteCount,
4926 const VkWriteDescriptorSet* pDescriptorWrites,
4927 uint32_t descriptorCopyCount,
4928 const VkCopyDescriptorSet* pDescriptorCopies)
4929{
4930 auto stream = mImpl->stream();
4931 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004932 auto resources = mImpl->resources();
4933 auto pool = mImpl->pool();
4934 VkDevice local_device;
4935 local_device = device;
4936 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4937 uint32_t local_descriptorWriteCount;
4938 local_descriptorWriteCount = descriptorWriteCount;
4939 VkWriteDescriptorSet* local_pDescriptorWrites;
4940 local_pDescriptorWrites = nullptr;
4941 if (pDescriptorWrites)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004942 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004943 local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004944 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
4945 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004946 deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004947 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004948 }
4949 if (local_pDescriptorWrites)
4950 {
4951 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
4952 {
4953 handlemap_VkWriteDescriptorSet(resources->unwrapMapping(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
4954 }
4955 }
4956 uint32_t local_descriptorCopyCount;
4957 local_descriptorCopyCount = descriptorCopyCount;
4958 VkCopyDescriptorSet* local_pDescriptorCopies;
4959 local_pDescriptorCopies = nullptr;
4960 if (pDescriptorCopies)
4961 {
4962 local_pDescriptorCopies = (VkCopyDescriptorSet*)pool->alloc(((descriptorCopyCount)) * sizeof(const VkCopyDescriptorSet));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004963 for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i)
4964 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004965 deepcopy_VkCopyDescriptorSet(pool, pDescriptorCopies + i, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i));
4966 }
4967 }
4968 if (local_pDescriptorCopies)
4969 {
4970 for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i)
4971 {
4972 handlemap_VkCopyDescriptorSet(resources->unwrapMapping(), (VkCopyDescriptorSet*)(local_pDescriptorCopies + i));
4973 }
4974 }
4975 countingStream->rewind();
4976 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004977 uint64_t cgen_var_346 = (uint64_t)local_device;
4978 countingStream->putBe64(cgen_var_346);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004979 countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
4980 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
4981 {
4982 marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
4983 }
4984 countingStream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t));
4985 for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i)
4986 {
4987 marshal_VkCopyDescriptorSet(countingStream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004988 }
4989 }
4990 uint32_t packetSize_vkUpdateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4991 countingStream->rewind();
4992 uint32_t opcode_vkUpdateDescriptorSets = OP_vkUpdateDescriptorSets;
4993 stream->write(&opcode_vkUpdateDescriptorSets, sizeof(uint32_t));
4994 stream->write(&packetSize_vkUpdateDescriptorSets, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08004995 uint64_t cgen_var_347 = (uint64_t)local_device;
4996 stream->putBe64(cgen_var_347);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004997 stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004998 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
4999 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005000 marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005001 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005002 stream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005003 for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i)
5004 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005005 marshal_VkCopyDescriptorSet(stream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005006 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005007 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005008}
5009
5010VkResult VkEncoder::vkCreateFramebuffer(
5011 VkDevice device,
5012 const VkFramebufferCreateInfo* pCreateInfo,
5013 const VkAllocationCallbacks* pAllocator,
5014 VkFramebuffer* pFramebuffer)
5015{
5016 auto stream = mImpl->stream();
5017 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005018 auto resources = mImpl->resources();
5019 auto pool = mImpl->pool();
5020 VkDevice local_device;
5021 local_device = device;
5022 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
5023 VkFramebufferCreateInfo* local_pCreateInfo;
5024 local_pCreateInfo = nullptr;
5025 if (pCreateInfo)
5026 {
5027 local_pCreateInfo = (VkFramebufferCreateInfo*)pool->alloc(sizeof(const VkFramebufferCreateInfo));
5028 deepcopy_VkFramebufferCreateInfo(pool, pCreateInfo, (VkFramebufferCreateInfo*)(local_pCreateInfo));
5029 }
5030 if (local_pCreateInfo)
5031 {
5032 handlemap_VkFramebufferCreateInfo(resources->unwrapMapping(), (VkFramebufferCreateInfo*)(local_pCreateInfo));
5033 }
5034 VkAllocationCallbacks* local_pAllocator;
5035 local_pAllocator = nullptr;
5036 if (pAllocator)
5037 {
5038 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
5039 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
5040 }
5041 if (local_pAllocator)
5042 {
5043 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
5044 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005045 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005046 countingStream->rewind();
5047 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005048 uint64_t cgen_var_348 = (uint64_t)local_device;
5049 countingStream->putBe64(cgen_var_348);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005050 marshal_VkFramebufferCreateInfo(countingStream, (VkFramebufferCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005051 // WARNING PTR CHECK
5052 uint64_t cgen_var_349 = (uint64_t)(uintptr_t)local_pAllocator;
5053 countingStream->putBe64(cgen_var_349);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005054 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005055 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005056 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005057 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005058 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005059 countingStream->write((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer));
5060 }
5061 uint32_t packetSize_vkCreateFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5062 countingStream->rewind();
5063 uint32_t opcode_vkCreateFramebuffer = OP_vkCreateFramebuffer;
5064 stream->write(&opcode_vkCreateFramebuffer, sizeof(uint32_t));
5065 stream->write(&packetSize_vkCreateFramebuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005066 uint64_t cgen_var_350 = (uint64_t)local_device;
5067 stream->putBe64(cgen_var_350);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005068 marshal_VkFramebufferCreateInfo(stream, (VkFramebufferCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005069 // WARNING PTR CHECK
5070 uint64_t cgen_var_351 = (uint64_t)(uintptr_t)local_pAllocator;
5071 stream->putBe64(cgen_var_351);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005072 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005073 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005074 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005075 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005076 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005077 stream->write((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005078 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005079 stream->read((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005080 if (pFramebuffer)
5081 {
5082 resources->createMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)pFramebuffer, 1);
5083 }
5084 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005085 VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0;
5086 stream->read(&vkCreateFramebuffer_VkResult_return, sizeof(VkResult));
5087 return vkCreateFramebuffer_VkResult_return;
5088}
5089
5090void VkEncoder::vkDestroyFramebuffer(
5091 VkDevice device,
5092 VkFramebuffer framebuffer,
5093 const VkAllocationCallbacks* pAllocator)
5094{
5095 auto stream = mImpl->stream();
5096 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005097 auto resources = mImpl->resources();
5098 auto pool = mImpl->pool();
5099 VkDevice local_device;
5100 local_device = device;
5101 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005102 VkFramebuffer local_framebuffer;
5103 local_framebuffer = framebuffer;
5104 resources->unwrapMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&local_framebuffer);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005105 VkAllocationCallbacks* local_pAllocator;
5106 local_pAllocator = nullptr;
5107 if (pAllocator)
5108 {
5109 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
5110 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
5111 }
5112 if (local_pAllocator)
5113 {
5114 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
5115 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005116 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005117 countingStream->rewind();
5118 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005119 uint64_t cgen_var_352 = (uint64_t)local_device;
5120 countingStream->putBe64(cgen_var_352);
5121 uint64_t cgen_var_353 = (uint64_t)local_framebuffer;
5122 countingStream->putBe64(cgen_var_353);
5123 // WARNING PTR CHECK
5124 uint64_t cgen_var_354 = (uint64_t)(uintptr_t)local_pAllocator;
5125 countingStream->putBe64(cgen_var_354);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005126 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005127 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005128 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005129 }
5130 }
5131 uint32_t packetSize_vkDestroyFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5132 countingStream->rewind();
5133 uint32_t opcode_vkDestroyFramebuffer = OP_vkDestroyFramebuffer;
5134 stream->write(&opcode_vkDestroyFramebuffer, sizeof(uint32_t));
5135 stream->write(&packetSize_vkDestroyFramebuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005136 uint64_t cgen_var_355 = (uint64_t)local_device;
5137 stream->putBe64(cgen_var_355);
5138 uint64_t cgen_var_356 = (uint64_t)local_framebuffer;
5139 stream->putBe64(cgen_var_356);
5140 // WARNING PTR CHECK
5141 uint64_t cgen_var_357 = (uint64_t)(uintptr_t)local_pAllocator;
5142 stream->putBe64(cgen_var_357);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005143 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005144 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005145 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005146 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005147 resources->destroyMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&framebuffer);
5148 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005149}
5150
5151VkResult VkEncoder::vkCreateRenderPass(
5152 VkDevice device,
5153 const VkRenderPassCreateInfo* pCreateInfo,
5154 const VkAllocationCallbacks* pAllocator,
5155 VkRenderPass* pRenderPass)
5156{
5157 auto stream = mImpl->stream();
5158 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005159 auto resources = mImpl->resources();
5160 auto pool = mImpl->pool();
5161 VkDevice local_device;
5162 local_device = device;
5163 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
5164 VkRenderPassCreateInfo* local_pCreateInfo;
5165 local_pCreateInfo = nullptr;
5166 if (pCreateInfo)
5167 {
5168 local_pCreateInfo = (VkRenderPassCreateInfo*)pool->alloc(sizeof(const VkRenderPassCreateInfo));
5169 deepcopy_VkRenderPassCreateInfo(pool, pCreateInfo, (VkRenderPassCreateInfo*)(local_pCreateInfo));
5170 }
5171 if (local_pCreateInfo)
5172 {
5173 handlemap_VkRenderPassCreateInfo(resources->unwrapMapping(), (VkRenderPassCreateInfo*)(local_pCreateInfo));
5174 }
5175 VkAllocationCallbacks* local_pAllocator;
5176 local_pAllocator = nullptr;
5177 if (pAllocator)
5178 {
5179 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
5180 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
5181 }
5182 if (local_pAllocator)
5183 {
5184 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
5185 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005186 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005187 countingStream->rewind();
5188 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005189 uint64_t cgen_var_358 = (uint64_t)local_device;
5190 countingStream->putBe64(cgen_var_358);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005191 marshal_VkRenderPassCreateInfo(countingStream, (VkRenderPassCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005192 // WARNING PTR CHECK
5193 uint64_t cgen_var_359 = (uint64_t)(uintptr_t)local_pAllocator;
5194 countingStream->putBe64(cgen_var_359);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005195 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005196 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005197 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005198 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005199 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005200 countingStream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
5201 }
5202 uint32_t packetSize_vkCreateRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5203 countingStream->rewind();
5204 uint32_t opcode_vkCreateRenderPass = OP_vkCreateRenderPass;
5205 stream->write(&opcode_vkCreateRenderPass, sizeof(uint32_t));
5206 stream->write(&packetSize_vkCreateRenderPass, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005207 uint64_t cgen_var_360 = (uint64_t)local_device;
5208 stream->putBe64(cgen_var_360);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005209 marshal_VkRenderPassCreateInfo(stream, (VkRenderPassCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005210 // WARNING PTR CHECK
5211 uint64_t cgen_var_361 = (uint64_t)(uintptr_t)local_pAllocator;
5212 stream->putBe64(cgen_var_361);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005213 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005214 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005215 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005216 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005217 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005218 stream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005219 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005220 stream->read((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005221 if (pRenderPass)
5222 {
5223 resources->createMapping()->mapHandles_VkRenderPass((VkRenderPass*)pRenderPass, 1);
5224 }
5225 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005226 VkResult vkCreateRenderPass_VkResult_return = (VkResult)0;
5227 stream->read(&vkCreateRenderPass_VkResult_return, sizeof(VkResult));
5228 return vkCreateRenderPass_VkResult_return;
5229}
5230
5231void VkEncoder::vkDestroyRenderPass(
5232 VkDevice device,
5233 VkRenderPass renderPass,
5234 const VkAllocationCallbacks* pAllocator)
5235{
5236 auto stream = mImpl->stream();
5237 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005238 auto resources = mImpl->resources();
5239 auto pool = mImpl->pool();
5240 VkDevice local_device;
5241 local_device = device;
5242 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005243 VkRenderPass local_renderPass;
5244 local_renderPass = renderPass;
5245 resources->unwrapMapping()->mapHandles_VkRenderPass((VkRenderPass*)&local_renderPass);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005246 VkAllocationCallbacks* local_pAllocator;
5247 local_pAllocator = nullptr;
5248 if (pAllocator)
5249 {
5250 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
5251 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
5252 }
5253 if (local_pAllocator)
5254 {
5255 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
5256 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005257 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005258 countingStream->rewind();
5259 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005260 uint64_t cgen_var_362 = (uint64_t)local_device;
5261 countingStream->putBe64(cgen_var_362);
5262 uint64_t cgen_var_363 = (uint64_t)local_renderPass;
5263 countingStream->putBe64(cgen_var_363);
5264 // WARNING PTR CHECK
5265 uint64_t cgen_var_364 = (uint64_t)(uintptr_t)local_pAllocator;
5266 countingStream->putBe64(cgen_var_364);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005267 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005268 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005269 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005270 }
5271 }
5272 uint32_t packetSize_vkDestroyRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5273 countingStream->rewind();
5274 uint32_t opcode_vkDestroyRenderPass = OP_vkDestroyRenderPass;
5275 stream->write(&opcode_vkDestroyRenderPass, sizeof(uint32_t));
5276 stream->write(&packetSize_vkDestroyRenderPass, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005277 uint64_t cgen_var_365 = (uint64_t)local_device;
5278 stream->putBe64(cgen_var_365);
5279 uint64_t cgen_var_366 = (uint64_t)local_renderPass;
5280 stream->putBe64(cgen_var_366);
5281 // WARNING PTR CHECK
5282 uint64_t cgen_var_367 = (uint64_t)(uintptr_t)local_pAllocator;
5283 stream->putBe64(cgen_var_367);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005284 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005285 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005286 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005287 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005288 resources->destroyMapping()->mapHandles_VkRenderPass((VkRenderPass*)&renderPass);
5289 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005290}
5291
5292void VkEncoder::vkGetRenderAreaGranularity(
5293 VkDevice device,
5294 VkRenderPass renderPass,
5295 VkExtent2D* pGranularity)
5296{
5297 auto stream = mImpl->stream();
5298 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005299 auto resources = mImpl->resources();
5300 auto pool = mImpl->pool();
5301 VkDevice local_device;
5302 local_device = device;
5303 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
5304 VkRenderPass local_renderPass;
5305 local_renderPass = renderPass;
5306 resources->unwrapMapping()->mapHandles_VkRenderPass((VkRenderPass*)&local_renderPass);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005307 countingStream->rewind();
5308 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005309 uint64_t cgen_var_368 = (uint64_t)local_device;
5310 countingStream->putBe64(cgen_var_368);
5311 uint64_t cgen_var_369 = (uint64_t)local_renderPass;
5312 countingStream->putBe64(cgen_var_369);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005313 marshal_VkExtent2D(countingStream, (VkExtent2D*)(pGranularity));
5314 }
5315 uint32_t packetSize_vkGetRenderAreaGranularity = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5316 countingStream->rewind();
5317 uint32_t opcode_vkGetRenderAreaGranularity = OP_vkGetRenderAreaGranularity;
5318 stream->write(&opcode_vkGetRenderAreaGranularity, sizeof(uint32_t));
5319 stream->write(&packetSize_vkGetRenderAreaGranularity, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005320 uint64_t cgen_var_370 = (uint64_t)local_device;
5321 stream->putBe64(cgen_var_370);
5322 uint64_t cgen_var_371 = (uint64_t)local_renderPass;
5323 stream->putBe64(cgen_var_371);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005324 marshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity));
5325 unmarshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005326 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005327}
5328
5329VkResult VkEncoder::vkCreateCommandPool(
5330 VkDevice device,
5331 const VkCommandPoolCreateInfo* pCreateInfo,
5332 const VkAllocationCallbacks* pAllocator,
5333 VkCommandPool* pCommandPool)
5334{
5335 auto stream = mImpl->stream();
5336 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005337 auto resources = mImpl->resources();
5338 auto pool = mImpl->pool();
5339 VkDevice local_device;
5340 local_device = device;
5341 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
5342 VkCommandPoolCreateInfo* local_pCreateInfo;
5343 local_pCreateInfo = nullptr;
5344 if (pCreateInfo)
5345 {
5346 local_pCreateInfo = (VkCommandPoolCreateInfo*)pool->alloc(sizeof(const VkCommandPoolCreateInfo));
5347 deepcopy_VkCommandPoolCreateInfo(pool, pCreateInfo, (VkCommandPoolCreateInfo*)(local_pCreateInfo));
5348 }
5349 if (local_pCreateInfo)
5350 {
5351 handlemap_VkCommandPoolCreateInfo(resources->unwrapMapping(), (VkCommandPoolCreateInfo*)(local_pCreateInfo));
5352 }
5353 VkAllocationCallbacks* local_pAllocator;
5354 local_pAllocator = nullptr;
5355 if (pAllocator)
5356 {
5357 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
5358 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
5359 }
5360 if (local_pAllocator)
5361 {
5362 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
5363 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005364 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005365 countingStream->rewind();
5366 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005367 uint64_t cgen_var_372 = (uint64_t)local_device;
5368 countingStream->putBe64(cgen_var_372);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005369 marshal_VkCommandPoolCreateInfo(countingStream, (VkCommandPoolCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005370 // WARNING PTR CHECK
5371 uint64_t cgen_var_373 = (uint64_t)(uintptr_t)local_pAllocator;
5372 countingStream->putBe64(cgen_var_373);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005373 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005374 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005375 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005376 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005377 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005378 countingStream->write((VkCommandPool*)pCommandPool, sizeof(VkCommandPool));
5379 }
5380 uint32_t packetSize_vkCreateCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5381 countingStream->rewind();
5382 uint32_t opcode_vkCreateCommandPool = OP_vkCreateCommandPool;
5383 stream->write(&opcode_vkCreateCommandPool, sizeof(uint32_t));
5384 stream->write(&packetSize_vkCreateCommandPool, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005385 uint64_t cgen_var_374 = (uint64_t)local_device;
5386 stream->putBe64(cgen_var_374);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005387 marshal_VkCommandPoolCreateInfo(stream, (VkCommandPoolCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005388 // WARNING PTR CHECK
5389 uint64_t cgen_var_375 = (uint64_t)(uintptr_t)local_pAllocator;
5390 stream->putBe64(cgen_var_375);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005391 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005392 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005393 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005394 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005395 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005396 stream->write((VkCommandPool*)pCommandPool, sizeof(VkCommandPool));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005397 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005398 stream->read((VkCommandPool*)pCommandPool, sizeof(VkCommandPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005399 if (pCommandPool)
5400 {
5401 resources->createMapping()->mapHandles_VkCommandPool((VkCommandPool*)pCommandPool, 1);
5402 }
5403 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005404 VkResult vkCreateCommandPool_VkResult_return = (VkResult)0;
5405 stream->read(&vkCreateCommandPool_VkResult_return, sizeof(VkResult));
5406 return vkCreateCommandPool_VkResult_return;
5407}
5408
5409void VkEncoder::vkDestroyCommandPool(
5410 VkDevice device,
5411 VkCommandPool commandPool,
5412 const VkAllocationCallbacks* pAllocator)
5413{
5414 auto stream = mImpl->stream();
5415 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005416 auto resources = mImpl->resources();
5417 auto pool = mImpl->pool();
5418 VkDevice local_device;
5419 local_device = device;
5420 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005421 VkCommandPool local_commandPool;
5422 local_commandPool = commandPool;
5423 resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005424 VkAllocationCallbacks* local_pAllocator;
5425 local_pAllocator = nullptr;
5426 if (pAllocator)
5427 {
5428 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
5429 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
5430 }
5431 if (local_pAllocator)
5432 {
5433 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
5434 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005435 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005436 countingStream->rewind();
5437 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005438 uint64_t cgen_var_376 = (uint64_t)local_device;
5439 countingStream->putBe64(cgen_var_376);
5440 uint64_t cgen_var_377 = (uint64_t)local_commandPool;
5441 countingStream->putBe64(cgen_var_377);
5442 // WARNING PTR CHECK
5443 uint64_t cgen_var_378 = (uint64_t)(uintptr_t)local_pAllocator;
5444 countingStream->putBe64(cgen_var_378);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005445 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005446 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005447 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005448 }
5449 }
5450 uint32_t packetSize_vkDestroyCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5451 countingStream->rewind();
5452 uint32_t opcode_vkDestroyCommandPool = OP_vkDestroyCommandPool;
5453 stream->write(&opcode_vkDestroyCommandPool, sizeof(uint32_t));
5454 stream->write(&packetSize_vkDestroyCommandPool, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005455 uint64_t cgen_var_379 = (uint64_t)local_device;
5456 stream->putBe64(cgen_var_379);
5457 uint64_t cgen_var_380 = (uint64_t)local_commandPool;
5458 stream->putBe64(cgen_var_380);
5459 // WARNING PTR CHECK
5460 uint64_t cgen_var_381 = (uint64_t)(uintptr_t)local_pAllocator;
5461 stream->putBe64(cgen_var_381);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005462 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005463 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005464 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005465 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005466 resources->destroyMapping()->mapHandles_VkCommandPool((VkCommandPool*)&commandPool);
5467 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005468}
5469
5470VkResult VkEncoder::vkResetCommandPool(
5471 VkDevice device,
5472 VkCommandPool commandPool,
5473 VkCommandPoolResetFlags flags)
5474{
5475 auto stream = mImpl->stream();
5476 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005477 auto resources = mImpl->resources();
5478 auto pool = mImpl->pool();
5479 VkDevice local_device;
5480 local_device = device;
5481 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
5482 VkCommandPool local_commandPool;
5483 local_commandPool = commandPool;
5484 resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool);
5485 VkCommandPoolResetFlags local_flags;
5486 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005487 countingStream->rewind();
5488 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005489 uint64_t cgen_var_382 = (uint64_t)local_device;
5490 countingStream->putBe64(cgen_var_382);
5491 uint64_t cgen_var_383 = (uint64_t)local_commandPool;
5492 countingStream->putBe64(cgen_var_383);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005493 countingStream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005494 }
5495 uint32_t packetSize_vkResetCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5496 countingStream->rewind();
5497 uint32_t opcode_vkResetCommandPool = OP_vkResetCommandPool;
5498 stream->write(&opcode_vkResetCommandPool, sizeof(uint32_t));
5499 stream->write(&packetSize_vkResetCommandPool, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005500 uint64_t cgen_var_384 = (uint64_t)local_device;
5501 stream->putBe64(cgen_var_384);
5502 uint64_t cgen_var_385 = (uint64_t)local_commandPool;
5503 stream->putBe64(cgen_var_385);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005504 stream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags));
5505 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005506 VkResult vkResetCommandPool_VkResult_return = (VkResult)0;
5507 stream->read(&vkResetCommandPool_VkResult_return, sizeof(VkResult));
5508 return vkResetCommandPool_VkResult_return;
5509}
5510
5511VkResult VkEncoder::vkAllocateCommandBuffers(
5512 VkDevice device,
5513 const VkCommandBufferAllocateInfo* pAllocateInfo,
5514 VkCommandBuffer* pCommandBuffers)
5515{
5516 auto stream = mImpl->stream();
5517 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005518 auto resources = mImpl->resources();
5519 auto pool = mImpl->pool();
5520 VkDevice local_device;
5521 local_device = device;
5522 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
5523 VkCommandBufferAllocateInfo* local_pAllocateInfo;
5524 local_pAllocateInfo = nullptr;
5525 if (pAllocateInfo)
5526 {
5527 local_pAllocateInfo = (VkCommandBufferAllocateInfo*)pool->alloc(sizeof(const VkCommandBufferAllocateInfo));
5528 deepcopy_VkCommandBufferAllocateInfo(pool, pAllocateInfo, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
5529 }
5530 if (local_pAllocateInfo)
5531 {
5532 handlemap_VkCommandBufferAllocateInfo(resources->unwrapMapping(), (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
5533 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005534 countingStream->rewind();
5535 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005536 uint64_t cgen_var_386 = (uint64_t)local_device;
5537 countingStream->putBe64(cgen_var_386);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005538 marshal_VkCommandBufferAllocateInfo(countingStream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005539 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005540 countingStream->write((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer));
5541 }
5542 uint32_t packetSize_vkAllocateCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5543 countingStream->rewind();
5544 uint32_t opcode_vkAllocateCommandBuffers = OP_vkAllocateCommandBuffers;
5545 stream->write(&opcode_vkAllocateCommandBuffers, sizeof(uint32_t));
5546 stream->write(&packetSize_vkAllocateCommandBuffers, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005547 uint64_t cgen_var_387 = (uint64_t)local_device;
5548 stream->putBe64(cgen_var_387);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005549 marshal_VkCommandBufferAllocateInfo(stream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005550 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005551 stream->write((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005552 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005553 stream->read((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005554 if (pCommandBuffers)
5555 {
5556 resources->createMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount);
5557 }
5558 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005559 VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0;
5560 stream->read(&vkAllocateCommandBuffers_VkResult_return, sizeof(VkResult));
5561 return vkAllocateCommandBuffers_VkResult_return;
5562}
5563
5564void VkEncoder::vkFreeCommandBuffers(
5565 VkDevice device,
5566 VkCommandPool commandPool,
5567 uint32_t commandBufferCount,
5568 const VkCommandBuffer* pCommandBuffers)
5569{
5570 auto stream = mImpl->stream();
5571 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005572 auto resources = mImpl->resources();
5573 auto pool = mImpl->pool();
5574 VkDevice local_device;
5575 local_device = device;
5576 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
5577 VkCommandPool local_commandPool;
5578 local_commandPool = commandPool;
5579 resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool);
5580 uint32_t local_commandBufferCount;
5581 local_commandBufferCount = commandBufferCount;
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005582 VkCommandBuffer* local_pCommandBuffers;
5583 local_pCommandBuffers = nullptr;
5584 if (pCommandBuffers)
5585 {
5586 local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer));
5587 }
5588 if (local_pCommandBuffers)
5589 {
5590 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)));
5591 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005592 countingStream->rewind();
5593 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005594 uint64_t cgen_var_388 = (uint64_t)local_device;
5595 countingStream->putBe64(cgen_var_388);
5596 uint64_t cgen_var_389 = (uint64_t)local_commandPool;
5597 countingStream->putBe64(cgen_var_389);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005598 countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005599 // WARNING PTR CHECK
5600 uint64_t cgen_var_390 = (uint64_t)(uintptr_t)local_pCommandBuffers;
5601 countingStream->putBe64(cgen_var_390);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005602 if (local_pCommandBuffers)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005603 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005604 // WARNING HANDLE TYPE POINTER
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005605 countingStream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005606 }
5607 }
5608 uint32_t packetSize_vkFreeCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5609 countingStream->rewind();
5610 uint32_t opcode_vkFreeCommandBuffers = OP_vkFreeCommandBuffers;
5611 stream->write(&opcode_vkFreeCommandBuffers, sizeof(uint32_t));
5612 stream->write(&packetSize_vkFreeCommandBuffers, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005613 uint64_t cgen_var_391 = (uint64_t)local_device;
5614 stream->putBe64(cgen_var_391);
5615 uint64_t cgen_var_392 = (uint64_t)local_commandPool;
5616 stream->putBe64(cgen_var_392);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005617 stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005618 // WARNING PTR CHECK
5619 uint64_t cgen_var_393 = (uint64_t)(uintptr_t)local_pCommandBuffers;
5620 stream->putBe64(cgen_var_393);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005621 if (local_pCommandBuffers)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005622 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005623 // WARNING HANDLE TYPE POINTER
Lingfeng Yang9d02e102018-11-10 01:51:46 -08005624 stream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005625 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005626 if (pCommandBuffers)
5627 {
5628 resources->destroyMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, ((commandBufferCount)));
5629 }
5630 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005631}
5632
5633VkResult VkEncoder::vkBeginCommandBuffer(
5634 VkCommandBuffer commandBuffer,
5635 const VkCommandBufferBeginInfo* pBeginInfo)
5636{
5637 auto stream = mImpl->stream();
5638 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005639 auto resources = mImpl->resources();
5640 auto pool = mImpl->pool();
5641 VkCommandBuffer local_commandBuffer;
5642 local_commandBuffer = commandBuffer;
5643 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5644 VkCommandBufferBeginInfo* local_pBeginInfo;
5645 local_pBeginInfo = nullptr;
5646 if (pBeginInfo)
5647 {
5648 local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo));
5649 deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo));
5650 }
5651 if (local_pBeginInfo)
5652 {
5653 handlemap_VkCommandBufferBeginInfo(resources->unwrapMapping(), (VkCommandBufferBeginInfo*)(local_pBeginInfo));
5654 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005655 countingStream->rewind();
5656 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005657 uint64_t cgen_var_394 = (uint64_t)local_commandBuffer;
5658 countingStream->putBe64(cgen_var_394);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005659 marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005660 }
5661 uint32_t packetSize_vkBeginCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5662 countingStream->rewind();
5663 uint32_t opcode_vkBeginCommandBuffer = OP_vkBeginCommandBuffer;
5664 stream->write(&opcode_vkBeginCommandBuffer, sizeof(uint32_t));
5665 stream->write(&packetSize_vkBeginCommandBuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005666 uint64_t cgen_var_395 = (uint64_t)local_commandBuffer;
5667 stream->putBe64(cgen_var_395);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005668 marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo));
5669 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005670 VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0;
5671 stream->read(&vkBeginCommandBuffer_VkResult_return, sizeof(VkResult));
5672 return vkBeginCommandBuffer_VkResult_return;
5673}
5674
5675VkResult VkEncoder::vkEndCommandBuffer(
5676 VkCommandBuffer commandBuffer)
5677{
5678 auto stream = mImpl->stream();
5679 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005680 auto resources = mImpl->resources();
5681 auto pool = mImpl->pool();
5682 VkCommandBuffer local_commandBuffer;
5683 local_commandBuffer = commandBuffer;
5684 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005685 countingStream->rewind();
5686 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005687 uint64_t cgen_var_396 = (uint64_t)local_commandBuffer;
5688 countingStream->putBe64(cgen_var_396);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005689 }
5690 uint32_t packetSize_vkEndCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5691 countingStream->rewind();
5692 uint32_t opcode_vkEndCommandBuffer = OP_vkEndCommandBuffer;
5693 stream->write(&opcode_vkEndCommandBuffer, sizeof(uint32_t));
5694 stream->write(&packetSize_vkEndCommandBuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005695 uint64_t cgen_var_397 = (uint64_t)local_commandBuffer;
5696 stream->putBe64(cgen_var_397);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005697 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005698 VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0;
5699 stream->read(&vkEndCommandBuffer_VkResult_return, sizeof(VkResult));
5700 return vkEndCommandBuffer_VkResult_return;
5701}
5702
5703VkResult VkEncoder::vkResetCommandBuffer(
5704 VkCommandBuffer commandBuffer,
5705 VkCommandBufferResetFlags flags)
5706{
5707 auto stream = mImpl->stream();
5708 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005709 auto resources = mImpl->resources();
5710 auto pool = mImpl->pool();
5711 VkCommandBuffer local_commandBuffer;
5712 local_commandBuffer = commandBuffer;
5713 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5714 VkCommandBufferResetFlags local_flags;
5715 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005716 countingStream->rewind();
5717 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005718 uint64_t cgen_var_398 = (uint64_t)local_commandBuffer;
5719 countingStream->putBe64(cgen_var_398);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005720 countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005721 }
5722 uint32_t packetSize_vkResetCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5723 countingStream->rewind();
5724 uint32_t opcode_vkResetCommandBuffer = OP_vkResetCommandBuffer;
5725 stream->write(&opcode_vkResetCommandBuffer, sizeof(uint32_t));
5726 stream->write(&packetSize_vkResetCommandBuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005727 uint64_t cgen_var_399 = (uint64_t)local_commandBuffer;
5728 stream->putBe64(cgen_var_399);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005729 stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags));
5730 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005731 VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0;
5732 stream->read(&vkResetCommandBuffer_VkResult_return, sizeof(VkResult));
5733 return vkResetCommandBuffer_VkResult_return;
5734}
5735
5736void VkEncoder::vkCmdBindPipeline(
5737 VkCommandBuffer commandBuffer,
5738 VkPipelineBindPoint pipelineBindPoint,
5739 VkPipeline pipeline)
5740{
5741 auto stream = mImpl->stream();
5742 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005743 auto resources = mImpl->resources();
5744 auto pool = mImpl->pool();
5745 VkCommandBuffer local_commandBuffer;
5746 local_commandBuffer = commandBuffer;
5747 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5748 VkPipelineBindPoint local_pipelineBindPoint;
5749 local_pipelineBindPoint = pipelineBindPoint;
5750 VkPipeline local_pipeline;
5751 local_pipeline = pipeline;
5752 resources->unwrapMapping()->mapHandles_VkPipeline((VkPipeline*)&local_pipeline);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005753 countingStream->rewind();
5754 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005755 uint64_t cgen_var_400 = (uint64_t)local_commandBuffer;
5756 countingStream->putBe64(cgen_var_400);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005757 countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005758 uint64_t cgen_var_401 = (uint64_t)local_pipeline;
5759 countingStream->putBe64(cgen_var_401);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005760 }
5761 uint32_t packetSize_vkCmdBindPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5762 countingStream->rewind();
5763 uint32_t opcode_vkCmdBindPipeline = OP_vkCmdBindPipeline;
5764 stream->write(&opcode_vkCmdBindPipeline, sizeof(uint32_t));
5765 stream->write(&packetSize_vkCmdBindPipeline, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005766 uint64_t cgen_var_402 = (uint64_t)local_commandBuffer;
5767 stream->putBe64(cgen_var_402);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005768 stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005769 uint64_t cgen_var_403 = (uint64_t)local_pipeline;
5770 stream->putBe64(cgen_var_403);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005771 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005772}
5773
5774void VkEncoder::vkCmdSetViewport(
5775 VkCommandBuffer commandBuffer,
5776 uint32_t firstViewport,
5777 uint32_t viewportCount,
5778 const VkViewport* pViewports)
5779{
5780 auto stream = mImpl->stream();
5781 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005782 auto resources = mImpl->resources();
5783 auto pool = mImpl->pool();
5784 VkCommandBuffer local_commandBuffer;
5785 local_commandBuffer = commandBuffer;
5786 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5787 uint32_t local_firstViewport;
5788 local_firstViewport = firstViewport;
5789 uint32_t local_viewportCount;
5790 local_viewportCount = viewportCount;
5791 VkViewport* local_pViewports;
5792 local_pViewports = nullptr;
5793 if (pViewports)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005794 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005795 local_pViewports = (VkViewport*)pool->alloc(((viewportCount)) * sizeof(const VkViewport));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005796 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
5797 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005798 deepcopy_VkViewport(pool, pViewports + i, (VkViewport*)(local_pViewports + i));
5799 }
5800 }
5801 if (local_pViewports)
5802 {
5803 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
5804 {
5805 handlemap_VkViewport(resources->unwrapMapping(), (VkViewport*)(local_pViewports + i));
5806 }
5807 }
5808 countingStream->rewind();
5809 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005810 uint64_t cgen_var_404 = (uint64_t)local_commandBuffer;
5811 countingStream->putBe64(cgen_var_404);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005812 countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
5813 countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
5814 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
5815 {
5816 marshal_VkViewport(countingStream, (VkViewport*)(local_pViewports + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005817 }
5818 }
5819 uint32_t packetSize_vkCmdSetViewport = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5820 countingStream->rewind();
5821 uint32_t opcode_vkCmdSetViewport = OP_vkCmdSetViewport;
5822 stream->write(&opcode_vkCmdSetViewport, sizeof(uint32_t));
5823 stream->write(&packetSize_vkCmdSetViewport, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005824 uint64_t cgen_var_405 = (uint64_t)local_commandBuffer;
5825 stream->putBe64(cgen_var_405);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005826 stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
5827 stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005828 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
5829 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005830 marshal_VkViewport(stream, (VkViewport*)(local_pViewports + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005831 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005832 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005833}
5834
5835void VkEncoder::vkCmdSetScissor(
5836 VkCommandBuffer commandBuffer,
5837 uint32_t firstScissor,
5838 uint32_t scissorCount,
5839 const VkRect2D* pScissors)
5840{
5841 auto stream = mImpl->stream();
5842 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005843 auto resources = mImpl->resources();
5844 auto pool = mImpl->pool();
5845 VkCommandBuffer local_commandBuffer;
5846 local_commandBuffer = commandBuffer;
5847 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5848 uint32_t local_firstScissor;
5849 local_firstScissor = firstScissor;
5850 uint32_t local_scissorCount;
5851 local_scissorCount = scissorCount;
5852 VkRect2D* local_pScissors;
5853 local_pScissors = nullptr;
5854 if (pScissors)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005855 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005856 local_pScissors = (VkRect2D*)pool->alloc(((scissorCount)) * sizeof(const VkRect2D));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005857 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i)
5858 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005859 deepcopy_VkRect2D(pool, pScissors + i, (VkRect2D*)(local_pScissors + i));
5860 }
5861 }
5862 if (local_pScissors)
5863 {
5864 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i)
5865 {
5866 handlemap_VkRect2D(resources->unwrapMapping(), (VkRect2D*)(local_pScissors + i));
5867 }
5868 }
5869 countingStream->rewind();
5870 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005871 uint64_t cgen_var_406 = (uint64_t)local_commandBuffer;
5872 countingStream->putBe64(cgen_var_406);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005873 countingStream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t));
5874 countingStream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t));
5875 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i)
5876 {
5877 marshal_VkRect2D(countingStream, (VkRect2D*)(local_pScissors + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005878 }
5879 }
5880 uint32_t packetSize_vkCmdSetScissor = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5881 countingStream->rewind();
5882 uint32_t opcode_vkCmdSetScissor = OP_vkCmdSetScissor;
5883 stream->write(&opcode_vkCmdSetScissor, sizeof(uint32_t));
5884 stream->write(&packetSize_vkCmdSetScissor, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005885 uint64_t cgen_var_407 = (uint64_t)local_commandBuffer;
5886 stream->putBe64(cgen_var_407);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005887 stream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t));
5888 stream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005889 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i)
5890 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005891 marshal_VkRect2D(stream, (VkRect2D*)(local_pScissors + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005892 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005893 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005894}
5895
5896void VkEncoder::vkCmdSetLineWidth(
5897 VkCommandBuffer commandBuffer,
5898 float lineWidth)
5899{
5900 auto stream = mImpl->stream();
5901 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005902 auto resources = mImpl->resources();
5903 auto pool = mImpl->pool();
5904 VkCommandBuffer local_commandBuffer;
5905 local_commandBuffer = commandBuffer;
5906 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5907 float local_lineWidth;
5908 local_lineWidth = lineWidth;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005909 countingStream->rewind();
5910 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005911 uint64_t cgen_var_408 = (uint64_t)local_commandBuffer;
5912 countingStream->putBe64(cgen_var_408);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005913 countingStream->write((float*)&local_lineWidth, sizeof(float));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005914 }
5915 uint32_t packetSize_vkCmdSetLineWidth = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5916 countingStream->rewind();
5917 uint32_t opcode_vkCmdSetLineWidth = OP_vkCmdSetLineWidth;
5918 stream->write(&opcode_vkCmdSetLineWidth, sizeof(uint32_t));
5919 stream->write(&packetSize_vkCmdSetLineWidth, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005920 uint64_t cgen_var_409 = (uint64_t)local_commandBuffer;
5921 stream->putBe64(cgen_var_409);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005922 stream->write((float*)&local_lineWidth, sizeof(float));
5923 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005924}
5925
5926void VkEncoder::vkCmdSetDepthBias(
5927 VkCommandBuffer commandBuffer,
5928 float depthBiasConstantFactor,
5929 float depthBiasClamp,
5930 float depthBiasSlopeFactor)
5931{
5932 auto stream = mImpl->stream();
5933 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005934 auto resources = mImpl->resources();
5935 auto pool = mImpl->pool();
5936 VkCommandBuffer local_commandBuffer;
5937 local_commandBuffer = commandBuffer;
5938 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5939 float local_depthBiasConstantFactor;
5940 local_depthBiasConstantFactor = depthBiasConstantFactor;
5941 float local_depthBiasClamp;
5942 local_depthBiasClamp = depthBiasClamp;
5943 float local_depthBiasSlopeFactor;
5944 local_depthBiasSlopeFactor = depthBiasSlopeFactor;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005945 countingStream->rewind();
5946 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005947 uint64_t cgen_var_410 = (uint64_t)local_commandBuffer;
5948 countingStream->putBe64(cgen_var_410);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005949 countingStream->write((float*)&local_depthBiasConstantFactor, sizeof(float));
5950 countingStream->write((float*)&local_depthBiasClamp, sizeof(float));
5951 countingStream->write((float*)&local_depthBiasSlopeFactor, sizeof(float));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005952 }
5953 uint32_t packetSize_vkCmdSetDepthBias = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5954 countingStream->rewind();
5955 uint32_t opcode_vkCmdSetDepthBias = OP_vkCmdSetDepthBias;
5956 stream->write(&opcode_vkCmdSetDepthBias, sizeof(uint32_t));
5957 stream->write(&packetSize_vkCmdSetDepthBias, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005958 uint64_t cgen_var_411 = (uint64_t)local_commandBuffer;
5959 stream->putBe64(cgen_var_411);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005960 stream->write((float*)&local_depthBiasConstantFactor, sizeof(float));
5961 stream->write((float*)&local_depthBiasClamp, sizeof(float));
5962 stream->write((float*)&local_depthBiasSlopeFactor, sizeof(float));
5963 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005964}
5965
5966void VkEncoder::vkCmdSetBlendConstants(
5967 VkCommandBuffer commandBuffer,
5968 const float blendConstants)
5969{
5970 auto stream = mImpl->stream();
5971 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005972 auto resources = mImpl->resources();
5973 auto pool = mImpl->pool();
5974 VkCommandBuffer local_commandBuffer;
5975 local_commandBuffer = commandBuffer;
5976 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5977 float local_blendConstants[4];
5978 memcpy(&local_blendConstants, &blendConstants, 4 * sizeof(const float));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005979 countingStream->rewind();
5980 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005981 uint64_t cgen_var_412 = (uint64_t)local_commandBuffer;
5982 countingStream->putBe64(cgen_var_412);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005983 countingStream->write((float*)&local_blendConstants, 4 * sizeof(float));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005984 }
5985 uint32_t packetSize_vkCmdSetBlendConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5986 countingStream->rewind();
5987 uint32_t opcode_vkCmdSetBlendConstants = OP_vkCmdSetBlendConstants;
5988 stream->write(&opcode_vkCmdSetBlendConstants, sizeof(uint32_t));
5989 stream->write(&packetSize_vkCmdSetBlendConstants, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08005990 uint64_t cgen_var_413 = (uint64_t)local_commandBuffer;
5991 stream->putBe64(cgen_var_413);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005992 stream->write((float*)&local_blendConstants, 4 * sizeof(float));
5993 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005994}
5995
5996void VkEncoder::vkCmdSetDepthBounds(
5997 VkCommandBuffer commandBuffer,
5998 float minDepthBounds,
5999 float maxDepthBounds)
6000{
6001 auto stream = mImpl->stream();
6002 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006003 auto resources = mImpl->resources();
6004 auto pool = mImpl->pool();
6005 VkCommandBuffer local_commandBuffer;
6006 local_commandBuffer = commandBuffer;
6007 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6008 float local_minDepthBounds;
6009 local_minDepthBounds = minDepthBounds;
6010 float local_maxDepthBounds;
6011 local_maxDepthBounds = maxDepthBounds;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006012 countingStream->rewind();
6013 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006014 uint64_t cgen_var_414 = (uint64_t)local_commandBuffer;
6015 countingStream->putBe64(cgen_var_414);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006016 countingStream->write((float*)&local_minDepthBounds, sizeof(float));
6017 countingStream->write((float*)&local_maxDepthBounds, sizeof(float));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006018 }
6019 uint32_t packetSize_vkCmdSetDepthBounds = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6020 countingStream->rewind();
6021 uint32_t opcode_vkCmdSetDepthBounds = OP_vkCmdSetDepthBounds;
6022 stream->write(&opcode_vkCmdSetDepthBounds, sizeof(uint32_t));
6023 stream->write(&packetSize_vkCmdSetDepthBounds, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006024 uint64_t cgen_var_415 = (uint64_t)local_commandBuffer;
6025 stream->putBe64(cgen_var_415);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006026 stream->write((float*)&local_minDepthBounds, sizeof(float));
6027 stream->write((float*)&local_maxDepthBounds, sizeof(float));
6028 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006029}
6030
6031void VkEncoder::vkCmdSetStencilCompareMask(
6032 VkCommandBuffer commandBuffer,
6033 VkStencilFaceFlags faceMask,
6034 uint32_t compareMask)
6035{
6036 auto stream = mImpl->stream();
6037 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006038 auto resources = mImpl->resources();
6039 auto pool = mImpl->pool();
6040 VkCommandBuffer local_commandBuffer;
6041 local_commandBuffer = commandBuffer;
6042 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6043 VkStencilFaceFlags local_faceMask;
6044 local_faceMask = faceMask;
6045 uint32_t local_compareMask;
6046 local_compareMask = compareMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006047 countingStream->rewind();
6048 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006049 uint64_t cgen_var_416 = (uint64_t)local_commandBuffer;
6050 countingStream->putBe64(cgen_var_416);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006051 countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
6052 countingStream->write((uint32_t*)&local_compareMask, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006053 }
6054 uint32_t packetSize_vkCmdSetStencilCompareMask = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6055 countingStream->rewind();
6056 uint32_t opcode_vkCmdSetStencilCompareMask = OP_vkCmdSetStencilCompareMask;
6057 stream->write(&opcode_vkCmdSetStencilCompareMask, sizeof(uint32_t));
6058 stream->write(&packetSize_vkCmdSetStencilCompareMask, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006059 uint64_t cgen_var_417 = (uint64_t)local_commandBuffer;
6060 stream->putBe64(cgen_var_417);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006061 stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
6062 stream->write((uint32_t*)&local_compareMask, sizeof(uint32_t));
6063 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006064}
6065
6066void VkEncoder::vkCmdSetStencilWriteMask(
6067 VkCommandBuffer commandBuffer,
6068 VkStencilFaceFlags faceMask,
6069 uint32_t writeMask)
6070{
6071 auto stream = mImpl->stream();
6072 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006073 auto resources = mImpl->resources();
6074 auto pool = mImpl->pool();
6075 VkCommandBuffer local_commandBuffer;
6076 local_commandBuffer = commandBuffer;
6077 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6078 VkStencilFaceFlags local_faceMask;
6079 local_faceMask = faceMask;
6080 uint32_t local_writeMask;
6081 local_writeMask = writeMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006082 countingStream->rewind();
6083 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006084 uint64_t cgen_var_418 = (uint64_t)local_commandBuffer;
6085 countingStream->putBe64(cgen_var_418);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006086 countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
6087 countingStream->write((uint32_t*)&local_writeMask, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006088 }
6089 uint32_t packetSize_vkCmdSetStencilWriteMask = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6090 countingStream->rewind();
6091 uint32_t opcode_vkCmdSetStencilWriteMask = OP_vkCmdSetStencilWriteMask;
6092 stream->write(&opcode_vkCmdSetStencilWriteMask, sizeof(uint32_t));
6093 stream->write(&packetSize_vkCmdSetStencilWriteMask, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006094 uint64_t cgen_var_419 = (uint64_t)local_commandBuffer;
6095 stream->putBe64(cgen_var_419);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006096 stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
6097 stream->write((uint32_t*)&local_writeMask, sizeof(uint32_t));
6098 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006099}
6100
6101void VkEncoder::vkCmdSetStencilReference(
6102 VkCommandBuffer commandBuffer,
6103 VkStencilFaceFlags faceMask,
6104 uint32_t reference)
6105{
6106 auto stream = mImpl->stream();
6107 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006108 auto resources = mImpl->resources();
6109 auto pool = mImpl->pool();
6110 VkCommandBuffer local_commandBuffer;
6111 local_commandBuffer = commandBuffer;
6112 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6113 VkStencilFaceFlags local_faceMask;
6114 local_faceMask = faceMask;
6115 uint32_t local_reference;
6116 local_reference = reference;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006117 countingStream->rewind();
6118 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006119 uint64_t cgen_var_420 = (uint64_t)local_commandBuffer;
6120 countingStream->putBe64(cgen_var_420);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006121 countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
6122 countingStream->write((uint32_t*)&local_reference, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006123 }
6124 uint32_t packetSize_vkCmdSetStencilReference = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6125 countingStream->rewind();
6126 uint32_t opcode_vkCmdSetStencilReference = OP_vkCmdSetStencilReference;
6127 stream->write(&opcode_vkCmdSetStencilReference, sizeof(uint32_t));
6128 stream->write(&packetSize_vkCmdSetStencilReference, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006129 uint64_t cgen_var_421 = (uint64_t)local_commandBuffer;
6130 stream->putBe64(cgen_var_421);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006131 stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
6132 stream->write((uint32_t*)&local_reference, sizeof(uint32_t));
6133 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006134}
6135
6136void VkEncoder::vkCmdBindDescriptorSets(
6137 VkCommandBuffer commandBuffer,
6138 VkPipelineBindPoint pipelineBindPoint,
6139 VkPipelineLayout layout,
6140 uint32_t firstSet,
6141 uint32_t descriptorSetCount,
6142 const VkDescriptorSet* pDescriptorSets,
6143 uint32_t dynamicOffsetCount,
6144 const uint32_t* pDynamicOffsets)
6145{
6146 auto stream = mImpl->stream();
6147 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006148 auto resources = mImpl->resources();
6149 auto pool = mImpl->pool();
6150 VkCommandBuffer local_commandBuffer;
6151 local_commandBuffer = commandBuffer;
6152 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6153 VkPipelineBindPoint local_pipelineBindPoint;
6154 local_pipelineBindPoint = pipelineBindPoint;
6155 VkPipelineLayout local_layout;
6156 local_layout = layout;
6157 resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout);
6158 uint32_t local_firstSet;
6159 local_firstSet = firstSet;
6160 uint32_t local_descriptorSetCount;
6161 local_descriptorSetCount = descriptorSetCount;
6162 VkDescriptorSet* local_pDescriptorSets;
6163 local_pDescriptorSets = nullptr;
6164 if (pDescriptorSets)
6165 {
6166 local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet));
6167 }
6168 if (local_pDescriptorSets)
6169 {
6170 resources->unwrapMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)));
6171 }
6172 uint32_t local_dynamicOffsetCount;
6173 local_dynamicOffsetCount = dynamicOffsetCount;
6174 uint32_t* local_pDynamicOffsets;
6175 local_pDynamicOffsets = nullptr;
6176 if (pDynamicOffsets)
6177 {
6178 local_pDynamicOffsets = (uint32_t*)pool->dupArray(pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(const uint32_t));
6179 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006180 countingStream->rewind();
6181 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006182 uint64_t cgen_var_422 = (uint64_t)local_commandBuffer;
6183 countingStream->putBe64(cgen_var_422);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006184 countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006185 uint64_t cgen_var_423 = (uint64_t)local_layout;
6186 countingStream->putBe64(cgen_var_423);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006187 countingStream->write((uint32_t*)&local_firstSet, sizeof(uint32_t));
6188 countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006189 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006190 countingStream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet));
6191 countingStream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t));
6192 countingStream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006193 }
6194 uint32_t packetSize_vkCmdBindDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6195 countingStream->rewind();
6196 uint32_t opcode_vkCmdBindDescriptorSets = OP_vkCmdBindDescriptorSets;
6197 stream->write(&opcode_vkCmdBindDescriptorSets, sizeof(uint32_t));
6198 stream->write(&packetSize_vkCmdBindDescriptorSets, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006199 uint64_t cgen_var_424 = (uint64_t)local_commandBuffer;
6200 stream->putBe64(cgen_var_424);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006201 stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006202 uint64_t cgen_var_425 = (uint64_t)local_layout;
6203 stream->putBe64(cgen_var_425);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006204 stream->write((uint32_t*)&local_firstSet, sizeof(uint32_t));
6205 stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006206 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006207 stream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet));
6208 stream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t));
6209 stream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t));
6210 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006211}
6212
6213void VkEncoder::vkCmdBindIndexBuffer(
6214 VkCommandBuffer commandBuffer,
6215 VkBuffer buffer,
6216 VkDeviceSize offset,
6217 VkIndexType indexType)
6218{
6219 auto stream = mImpl->stream();
6220 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006221 auto resources = mImpl->resources();
6222 auto pool = mImpl->pool();
6223 VkCommandBuffer local_commandBuffer;
6224 local_commandBuffer = commandBuffer;
6225 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6226 VkBuffer local_buffer;
6227 local_buffer = buffer;
6228 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
6229 VkDeviceSize local_offset;
6230 local_offset = offset;
6231 VkIndexType local_indexType;
6232 local_indexType = indexType;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006233 countingStream->rewind();
6234 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006235 uint64_t cgen_var_426 = (uint64_t)local_commandBuffer;
6236 countingStream->putBe64(cgen_var_426);
6237 uint64_t cgen_var_427 = (uint64_t)local_buffer;
6238 countingStream->putBe64(cgen_var_427);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006239 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
6240 countingStream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006241 }
6242 uint32_t packetSize_vkCmdBindIndexBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6243 countingStream->rewind();
6244 uint32_t opcode_vkCmdBindIndexBuffer = OP_vkCmdBindIndexBuffer;
6245 stream->write(&opcode_vkCmdBindIndexBuffer, sizeof(uint32_t));
6246 stream->write(&packetSize_vkCmdBindIndexBuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006247 uint64_t cgen_var_428 = (uint64_t)local_commandBuffer;
6248 stream->putBe64(cgen_var_428);
6249 uint64_t cgen_var_429 = (uint64_t)local_buffer;
6250 stream->putBe64(cgen_var_429);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006251 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
6252 stream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType));
6253 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006254}
6255
6256void VkEncoder::vkCmdBindVertexBuffers(
6257 VkCommandBuffer commandBuffer,
6258 uint32_t firstBinding,
6259 uint32_t bindingCount,
6260 const VkBuffer* pBuffers,
6261 const VkDeviceSize* pOffsets)
6262{
6263 auto stream = mImpl->stream();
6264 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006265 auto resources = mImpl->resources();
6266 auto pool = mImpl->pool();
6267 VkCommandBuffer local_commandBuffer;
6268 local_commandBuffer = commandBuffer;
6269 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6270 uint32_t local_firstBinding;
6271 local_firstBinding = firstBinding;
6272 uint32_t local_bindingCount;
6273 local_bindingCount = bindingCount;
6274 VkBuffer* local_pBuffers;
6275 local_pBuffers = nullptr;
6276 if (pBuffers)
6277 {
6278 local_pBuffers = (VkBuffer*)pool->dupArray(pBuffers, ((bindingCount)) * sizeof(const VkBuffer));
6279 }
6280 if (local_pBuffers)
6281 {
6282 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)local_pBuffers, ((bindingCount)));
6283 }
6284 VkDeviceSize* local_pOffsets;
6285 local_pOffsets = nullptr;
6286 if (pOffsets)
6287 {
6288 local_pOffsets = (VkDeviceSize*)pool->dupArray(pOffsets, ((bindingCount)) * sizeof(const VkDeviceSize));
6289 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006290 countingStream->rewind();
6291 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006292 uint64_t cgen_var_430 = (uint64_t)local_commandBuffer;
6293 countingStream->putBe64(cgen_var_430);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006294 countingStream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t));
6295 countingStream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006296 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006297 countingStream->write((VkBuffer*)local_pBuffers, ((bindingCount)) * sizeof(VkBuffer));
6298 countingStream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006299 }
6300 uint32_t packetSize_vkCmdBindVertexBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6301 countingStream->rewind();
6302 uint32_t opcode_vkCmdBindVertexBuffers = OP_vkCmdBindVertexBuffers;
6303 stream->write(&opcode_vkCmdBindVertexBuffers, sizeof(uint32_t));
6304 stream->write(&packetSize_vkCmdBindVertexBuffers, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006305 uint64_t cgen_var_431 = (uint64_t)local_commandBuffer;
6306 stream->putBe64(cgen_var_431);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006307 stream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t));
6308 stream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006309 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006310 stream->write((VkBuffer*)local_pBuffers, ((bindingCount)) * sizeof(VkBuffer));
6311 stream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize));
6312 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006313}
6314
6315void VkEncoder::vkCmdDraw(
6316 VkCommandBuffer commandBuffer,
6317 uint32_t vertexCount,
6318 uint32_t instanceCount,
6319 uint32_t firstVertex,
6320 uint32_t firstInstance)
6321{
6322 auto stream = mImpl->stream();
6323 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006324 auto resources = mImpl->resources();
6325 auto pool = mImpl->pool();
6326 VkCommandBuffer local_commandBuffer;
6327 local_commandBuffer = commandBuffer;
6328 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6329 uint32_t local_vertexCount;
6330 local_vertexCount = vertexCount;
6331 uint32_t local_instanceCount;
6332 local_instanceCount = instanceCount;
6333 uint32_t local_firstVertex;
6334 local_firstVertex = firstVertex;
6335 uint32_t local_firstInstance;
6336 local_firstInstance = firstInstance;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006337 countingStream->rewind();
6338 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006339 uint64_t cgen_var_432 = (uint64_t)local_commandBuffer;
6340 countingStream->putBe64(cgen_var_432);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006341 countingStream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t));
6342 countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
6343 countingStream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t));
6344 countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006345 }
6346 uint32_t packetSize_vkCmdDraw = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6347 countingStream->rewind();
6348 uint32_t opcode_vkCmdDraw = OP_vkCmdDraw;
6349 stream->write(&opcode_vkCmdDraw, sizeof(uint32_t));
6350 stream->write(&packetSize_vkCmdDraw, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006351 uint64_t cgen_var_433 = (uint64_t)local_commandBuffer;
6352 stream->putBe64(cgen_var_433);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006353 stream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t));
6354 stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
6355 stream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t));
6356 stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t));
6357 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006358}
6359
6360void VkEncoder::vkCmdDrawIndexed(
6361 VkCommandBuffer commandBuffer,
6362 uint32_t indexCount,
6363 uint32_t instanceCount,
6364 uint32_t firstIndex,
6365 int32_t vertexOffset,
6366 uint32_t firstInstance)
6367{
6368 auto stream = mImpl->stream();
6369 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006370 auto resources = mImpl->resources();
6371 auto pool = mImpl->pool();
6372 VkCommandBuffer local_commandBuffer;
6373 local_commandBuffer = commandBuffer;
6374 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6375 uint32_t local_indexCount;
6376 local_indexCount = indexCount;
6377 uint32_t local_instanceCount;
6378 local_instanceCount = instanceCount;
6379 uint32_t local_firstIndex;
6380 local_firstIndex = firstIndex;
6381 int32_t local_vertexOffset;
6382 local_vertexOffset = vertexOffset;
6383 uint32_t local_firstInstance;
6384 local_firstInstance = firstInstance;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006385 countingStream->rewind();
6386 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006387 uint64_t cgen_var_434 = (uint64_t)local_commandBuffer;
6388 countingStream->putBe64(cgen_var_434);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006389 countingStream->write((uint32_t*)&local_indexCount, sizeof(uint32_t));
6390 countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
6391 countingStream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t));
6392 countingStream->write((int32_t*)&local_vertexOffset, sizeof(int32_t));
6393 countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006394 }
6395 uint32_t packetSize_vkCmdDrawIndexed = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6396 countingStream->rewind();
6397 uint32_t opcode_vkCmdDrawIndexed = OP_vkCmdDrawIndexed;
6398 stream->write(&opcode_vkCmdDrawIndexed, sizeof(uint32_t));
6399 stream->write(&packetSize_vkCmdDrawIndexed, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006400 uint64_t cgen_var_435 = (uint64_t)local_commandBuffer;
6401 stream->putBe64(cgen_var_435);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006402 stream->write((uint32_t*)&local_indexCount, sizeof(uint32_t));
6403 stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
6404 stream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t));
6405 stream->write((int32_t*)&local_vertexOffset, sizeof(int32_t));
6406 stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t));
6407 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006408}
6409
6410void VkEncoder::vkCmdDrawIndirect(
6411 VkCommandBuffer commandBuffer,
6412 VkBuffer buffer,
6413 VkDeviceSize offset,
6414 uint32_t drawCount,
6415 uint32_t stride)
6416{
6417 auto stream = mImpl->stream();
6418 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006419 auto resources = mImpl->resources();
6420 auto pool = mImpl->pool();
6421 VkCommandBuffer local_commandBuffer;
6422 local_commandBuffer = commandBuffer;
6423 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6424 VkBuffer local_buffer;
6425 local_buffer = buffer;
6426 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
6427 VkDeviceSize local_offset;
6428 local_offset = offset;
6429 uint32_t local_drawCount;
6430 local_drawCount = drawCount;
6431 uint32_t local_stride;
6432 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006433 countingStream->rewind();
6434 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006435 uint64_t cgen_var_436 = (uint64_t)local_commandBuffer;
6436 countingStream->putBe64(cgen_var_436);
6437 uint64_t cgen_var_437 = (uint64_t)local_buffer;
6438 countingStream->putBe64(cgen_var_437);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006439 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
6440 countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
6441 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006442 }
6443 uint32_t packetSize_vkCmdDrawIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6444 countingStream->rewind();
6445 uint32_t opcode_vkCmdDrawIndirect = OP_vkCmdDrawIndirect;
6446 stream->write(&opcode_vkCmdDrawIndirect, sizeof(uint32_t));
6447 stream->write(&packetSize_vkCmdDrawIndirect, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006448 uint64_t cgen_var_438 = (uint64_t)local_commandBuffer;
6449 stream->putBe64(cgen_var_438);
6450 uint64_t cgen_var_439 = (uint64_t)local_buffer;
6451 stream->putBe64(cgen_var_439);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006452 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
6453 stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
6454 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
6455 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006456}
6457
6458void VkEncoder::vkCmdDrawIndexedIndirect(
6459 VkCommandBuffer commandBuffer,
6460 VkBuffer buffer,
6461 VkDeviceSize offset,
6462 uint32_t drawCount,
6463 uint32_t stride)
6464{
6465 auto stream = mImpl->stream();
6466 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006467 auto resources = mImpl->resources();
6468 auto pool = mImpl->pool();
6469 VkCommandBuffer local_commandBuffer;
6470 local_commandBuffer = commandBuffer;
6471 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6472 VkBuffer local_buffer;
6473 local_buffer = buffer;
6474 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
6475 VkDeviceSize local_offset;
6476 local_offset = offset;
6477 uint32_t local_drawCount;
6478 local_drawCount = drawCount;
6479 uint32_t local_stride;
6480 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006481 countingStream->rewind();
6482 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006483 uint64_t cgen_var_440 = (uint64_t)local_commandBuffer;
6484 countingStream->putBe64(cgen_var_440);
6485 uint64_t cgen_var_441 = (uint64_t)local_buffer;
6486 countingStream->putBe64(cgen_var_441);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006487 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
6488 countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
6489 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006490 }
6491 uint32_t packetSize_vkCmdDrawIndexedIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6492 countingStream->rewind();
6493 uint32_t opcode_vkCmdDrawIndexedIndirect = OP_vkCmdDrawIndexedIndirect;
6494 stream->write(&opcode_vkCmdDrawIndexedIndirect, sizeof(uint32_t));
6495 stream->write(&packetSize_vkCmdDrawIndexedIndirect, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006496 uint64_t cgen_var_442 = (uint64_t)local_commandBuffer;
6497 stream->putBe64(cgen_var_442);
6498 uint64_t cgen_var_443 = (uint64_t)local_buffer;
6499 stream->putBe64(cgen_var_443);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006500 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
6501 stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
6502 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
6503 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006504}
6505
6506void VkEncoder::vkCmdDispatch(
6507 VkCommandBuffer commandBuffer,
6508 uint32_t groupCountX,
6509 uint32_t groupCountY,
6510 uint32_t groupCountZ)
6511{
6512 auto stream = mImpl->stream();
6513 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006514 auto resources = mImpl->resources();
6515 auto pool = mImpl->pool();
6516 VkCommandBuffer local_commandBuffer;
6517 local_commandBuffer = commandBuffer;
6518 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6519 uint32_t local_groupCountX;
6520 local_groupCountX = groupCountX;
6521 uint32_t local_groupCountY;
6522 local_groupCountY = groupCountY;
6523 uint32_t local_groupCountZ;
6524 local_groupCountZ = groupCountZ;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006525 countingStream->rewind();
6526 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006527 uint64_t cgen_var_444 = (uint64_t)local_commandBuffer;
6528 countingStream->putBe64(cgen_var_444);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006529 countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
6530 countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
6531 countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006532 }
6533 uint32_t packetSize_vkCmdDispatch = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6534 countingStream->rewind();
6535 uint32_t opcode_vkCmdDispatch = OP_vkCmdDispatch;
6536 stream->write(&opcode_vkCmdDispatch, sizeof(uint32_t));
6537 stream->write(&packetSize_vkCmdDispatch, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006538 uint64_t cgen_var_445 = (uint64_t)local_commandBuffer;
6539 stream->putBe64(cgen_var_445);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006540 stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
6541 stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
6542 stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
6543 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006544}
6545
6546void VkEncoder::vkCmdDispatchIndirect(
6547 VkCommandBuffer commandBuffer,
6548 VkBuffer buffer,
6549 VkDeviceSize offset)
6550{
6551 auto stream = mImpl->stream();
6552 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006553 auto resources = mImpl->resources();
6554 auto pool = mImpl->pool();
6555 VkCommandBuffer local_commandBuffer;
6556 local_commandBuffer = commandBuffer;
6557 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6558 VkBuffer local_buffer;
6559 local_buffer = buffer;
6560 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
6561 VkDeviceSize local_offset;
6562 local_offset = offset;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006563 countingStream->rewind();
6564 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006565 uint64_t cgen_var_446 = (uint64_t)local_commandBuffer;
6566 countingStream->putBe64(cgen_var_446);
6567 uint64_t cgen_var_447 = (uint64_t)local_buffer;
6568 countingStream->putBe64(cgen_var_447);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006569 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006570 }
6571 uint32_t packetSize_vkCmdDispatchIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6572 countingStream->rewind();
6573 uint32_t opcode_vkCmdDispatchIndirect = OP_vkCmdDispatchIndirect;
6574 stream->write(&opcode_vkCmdDispatchIndirect, sizeof(uint32_t));
6575 stream->write(&packetSize_vkCmdDispatchIndirect, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006576 uint64_t cgen_var_448 = (uint64_t)local_commandBuffer;
6577 stream->putBe64(cgen_var_448);
6578 uint64_t cgen_var_449 = (uint64_t)local_buffer;
6579 stream->putBe64(cgen_var_449);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006580 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
6581 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006582}
6583
6584void VkEncoder::vkCmdCopyBuffer(
6585 VkCommandBuffer commandBuffer,
6586 VkBuffer srcBuffer,
6587 VkBuffer dstBuffer,
6588 uint32_t regionCount,
6589 const VkBufferCopy* pRegions)
6590{
6591 auto stream = mImpl->stream();
6592 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006593 auto resources = mImpl->resources();
6594 auto pool = mImpl->pool();
6595 VkCommandBuffer local_commandBuffer;
6596 local_commandBuffer = commandBuffer;
6597 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6598 VkBuffer local_srcBuffer;
6599 local_srcBuffer = srcBuffer;
6600 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_srcBuffer);
6601 VkBuffer local_dstBuffer;
6602 local_dstBuffer = dstBuffer;
6603 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
6604 uint32_t local_regionCount;
6605 local_regionCount = regionCount;
6606 VkBufferCopy* local_pRegions;
6607 local_pRegions = nullptr;
6608 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006609 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006610 local_pRegions = (VkBufferCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferCopy));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006611 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6612 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006613 deepcopy_VkBufferCopy(pool, pRegions + i, (VkBufferCopy*)(local_pRegions + i));
6614 }
6615 }
6616 if (local_pRegions)
6617 {
6618 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6619 {
6620 handlemap_VkBufferCopy(resources->unwrapMapping(), (VkBufferCopy*)(local_pRegions + i));
6621 }
6622 }
6623 countingStream->rewind();
6624 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006625 uint64_t cgen_var_450 = (uint64_t)local_commandBuffer;
6626 countingStream->putBe64(cgen_var_450);
6627 uint64_t cgen_var_451 = (uint64_t)local_srcBuffer;
6628 countingStream->putBe64(cgen_var_451);
6629 uint64_t cgen_var_452 = (uint64_t)local_dstBuffer;
6630 countingStream->putBe64(cgen_var_452);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006631 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
6632 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6633 {
6634 marshal_VkBufferCopy(countingStream, (VkBufferCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006635 }
6636 }
6637 uint32_t packetSize_vkCmdCopyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6638 countingStream->rewind();
6639 uint32_t opcode_vkCmdCopyBuffer = OP_vkCmdCopyBuffer;
6640 stream->write(&opcode_vkCmdCopyBuffer, sizeof(uint32_t));
6641 stream->write(&packetSize_vkCmdCopyBuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006642 uint64_t cgen_var_453 = (uint64_t)local_commandBuffer;
6643 stream->putBe64(cgen_var_453);
6644 uint64_t cgen_var_454 = (uint64_t)local_srcBuffer;
6645 stream->putBe64(cgen_var_454);
6646 uint64_t cgen_var_455 = (uint64_t)local_dstBuffer;
6647 stream->putBe64(cgen_var_455);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006648 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006649 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6650 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006651 marshal_VkBufferCopy(stream, (VkBufferCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006652 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006653 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006654}
6655
6656void VkEncoder::vkCmdCopyImage(
6657 VkCommandBuffer commandBuffer,
6658 VkImage srcImage,
6659 VkImageLayout srcImageLayout,
6660 VkImage dstImage,
6661 VkImageLayout dstImageLayout,
6662 uint32_t regionCount,
6663 const VkImageCopy* pRegions)
6664{
6665 auto stream = mImpl->stream();
6666 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006667 auto resources = mImpl->resources();
6668 auto pool = mImpl->pool();
6669 VkCommandBuffer local_commandBuffer;
6670 local_commandBuffer = commandBuffer;
6671 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6672 VkImage local_srcImage;
6673 local_srcImage = srcImage;
6674 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage);
6675 VkImageLayout local_srcImageLayout;
6676 local_srcImageLayout = srcImageLayout;
6677 VkImage local_dstImage;
6678 local_dstImage = dstImage;
6679 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage);
6680 VkImageLayout local_dstImageLayout;
6681 local_dstImageLayout = dstImageLayout;
6682 uint32_t local_regionCount;
6683 local_regionCount = regionCount;
6684 VkImageCopy* local_pRegions;
6685 local_pRegions = nullptr;
6686 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006687 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006688 local_pRegions = (VkImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkImageCopy));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006689 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6690 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006691 deepcopy_VkImageCopy(pool, pRegions + i, (VkImageCopy*)(local_pRegions + i));
6692 }
6693 }
6694 if (local_pRegions)
6695 {
6696 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6697 {
6698 handlemap_VkImageCopy(resources->unwrapMapping(), (VkImageCopy*)(local_pRegions + i));
6699 }
6700 }
6701 countingStream->rewind();
6702 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006703 uint64_t cgen_var_456 = (uint64_t)local_commandBuffer;
6704 countingStream->putBe64(cgen_var_456);
6705 uint64_t cgen_var_457 = (uint64_t)local_srcImage;
6706 countingStream->putBe64(cgen_var_457);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006707 countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006708 uint64_t cgen_var_458 = (uint64_t)local_dstImage;
6709 countingStream->putBe64(cgen_var_458);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006710 countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6711 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
6712 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6713 {
6714 marshal_VkImageCopy(countingStream, (VkImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006715 }
6716 }
6717 uint32_t packetSize_vkCmdCopyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6718 countingStream->rewind();
6719 uint32_t opcode_vkCmdCopyImage = OP_vkCmdCopyImage;
6720 stream->write(&opcode_vkCmdCopyImage, sizeof(uint32_t));
6721 stream->write(&packetSize_vkCmdCopyImage, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006722 uint64_t cgen_var_459 = (uint64_t)local_commandBuffer;
6723 stream->putBe64(cgen_var_459);
6724 uint64_t cgen_var_460 = (uint64_t)local_srcImage;
6725 stream->putBe64(cgen_var_460);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006726 stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006727 uint64_t cgen_var_461 = (uint64_t)local_dstImage;
6728 stream->putBe64(cgen_var_461);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006729 stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6730 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006731 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6732 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006733 marshal_VkImageCopy(stream, (VkImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006734 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006735 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006736}
6737
6738void VkEncoder::vkCmdBlitImage(
6739 VkCommandBuffer commandBuffer,
6740 VkImage srcImage,
6741 VkImageLayout srcImageLayout,
6742 VkImage dstImage,
6743 VkImageLayout dstImageLayout,
6744 uint32_t regionCount,
6745 const VkImageBlit* pRegions,
6746 VkFilter filter)
6747{
6748 auto stream = mImpl->stream();
6749 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006750 auto resources = mImpl->resources();
6751 auto pool = mImpl->pool();
6752 VkCommandBuffer local_commandBuffer;
6753 local_commandBuffer = commandBuffer;
6754 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6755 VkImage local_srcImage;
6756 local_srcImage = srcImage;
6757 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage);
6758 VkImageLayout local_srcImageLayout;
6759 local_srcImageLayout = srcImageLayout;
6760 VkImage local_dstImage;
6761 local_dstImage = dstImage;
6762 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage);
6763 VkImageLayout local_dstImageLayout;
6764 local_dstImageLayout = dstImageLayout;
6765 uint32_t local_regionCount;
6766 local_regionCount = regionCount;
6767 VkImageBlit* local_pRegions;
6768 local_pRegions = nullptr;
6769 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006770 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006771 local_pRegions = (VkImageBlit*)pool->alloc(((regionCount)) * sizeof(const VkImageBlit));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006772 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6773 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006774 deepcopy_VkImageBlit(pool, pRegions + i, (VkImageBlit*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006775 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006776 }
6777 if (local_pRegions)
6778 {
6779 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6780 {
6781 handlemap_VkImageBlit(resources->unwrapMapping(), (VkImageBlit*)(local_pRegions + i));
6782 }
6783 }
6784 VkFilter local_filter;
6785 local_filter = filter;
6786 countingStream->rewind();
6787 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006788 uint64_t cgen_var_462 = (uint64_t)local_commandBuffer;
6789 countingStream->putBe64(cgen_var_462);
6790 uint64_t cgen_var_463 = (uint64_t)local_srcImage;
6791 countingStream->putBe64(cgen_var_463);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006792 countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006793 uint64_t cgen_var_464 = (uint64_t)local_dstImage;
6794 countingStream->putBe64(cgen_var_464);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006795 countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6796 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
6797 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6798 {
6799 marshal_VkImageBlit(countingStream, (VkImageBlit*)(local_pRegions + i));
6800 }
6801 countingStream->write((VkFilter*)&local_filter, sizeof(VkFilter));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006802 }
6803 uint32_t packetSize_vkCmdBlitImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6804 countingStream->rewind();
6805 uint32_t opcode_vkCmdBlitImage = OP_vkCmdBlitImage;
6806 stream->write(&opcode_vkCmdBlitImage, sizeof(uint32_t));
6807 stream->write(&packetSize_vkCmdBlitImage, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006808 uint64_t cgen_var_465 = (uint64_t)local_commandBuffer;
6809 stream->putBe64(cgen_var_465);
6810 uint64_t cgen_var_466 = (uint64_t)local_srcImage;
6811 stream->putBe64(cgen_var_466);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006812 stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006813 uint64_t cgen_var_467 = (uint64_t)local_dstImage;
6814 stream->putBe64(cgen_var_467);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006815 stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6816 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006817 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6818 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006819 marshal_VkImageBlit(stream, (VkImageBlit*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006820 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006821 stream->write((VkFilter*)&local_filter, sizeof(VkFilter));
6822 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006823}
6824
6825void VkEncoder::vkCmdCopyBufferToImage(
6826 VkCommandBuffer commandBuffer,
6827 VkBuffer srcBuffer,
6828 VkImage dstImage,
6829 VkImageLayout dstImageLayout,
6830 uint32_t regionCount,
6831 const VkBufferImageCopy* pRegions)
6832{
6833 auto stream = mImpl->stream();
6834 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006835 auto resources = mImpl->resources();
6836 auto pool = mImpl->pool();
6837 VkCommandBuffer local_commandBuffer;
6838 local_commandBuffer = commandBuffer;
6839 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6840 VkBuffer local_srcBuffer;
6841 local_srcBuffer = srcBuffer;
6842 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_srcBuffer);
6843 VkImage local_dstImage;
6844 local_dstImage = dstImage;
6845 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage);
6846 VkImageLayout local_dstImageLayout;
6847 local_dstImageLayout = dstImageLayout;
6848 uint32_t local_regionCount;
6849 local_regionCount = regionCount;
6850 VkBufferImageCopy* local_pRegions;
6851 local_pRegions = nullptr;
6852 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006853 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006854 local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006855 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6856 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006857 deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i));
6858 }
6859 }
6860 if (local_pRegions)
6861 {
6862 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6863 {
6864 handlemap_VkBufferImageCopy(resources->unwrapMapping(), (VkBufferImageCopy*)(local_pRegions + i));
6865 }
6866 }
6867 countingStream->rewind();
6868 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006869 uint64_t cgen_var_468 = (uint64_t)local_commandBuffer;
6870 countingStream->putBe64(cgen_var_468);
6871 uint64_t cgen_var_469 = (uint64_t)local_srcBuffer;
6872 countingStream->putBe64(cgen_var_469);
6873 uint64_t cgen_var_470 = (uint64_t)local_dstImage;
6874 countingStream->putBe64(cgen_var_470);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006875 countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6876 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
6877 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6878 {
6879 marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006880 }
6881 }
6882 uint32_t packetSize_vkCmdCopyBufferToImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6883 countingStream->rewind();
6884 uint32_t opcode_vkCmdCopyBufferToImage = OP_vkCmdCopyBufferToImage;
6885 stream->write(&opcode_vkCmdCopyBufferToImage, sizeof(uint32_t));
6886 stream->write(&packetSize_vkCmdCopyBufferToImage, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006887 uint64_t cgen_var_471 = (uint64_t)local_commandBuffer;
6888 stream->putBe64(cgen_var_471);
6889 uint64_t cgen_var_472 = (uint64_t)local_srcBuffer;
6890 stream->putBe64(cgen_var_472);
6891 uint64_t cgen_var_473 = (uint64_t)local_dstImage;
6892 stream->putBe64(cgen_var_473);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006893 stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6894 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006895 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6896 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006897 marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006898 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006899 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006900}
6901
6902void VkEncoder::vkCmdCopyImageToBuffer(
6903 VkCommandBuffer commandBuffer,
6904 VkImage srcImage,
6905 VkImageLayout srcImageLayout,
6906 VkBuffer dstBuffer,
6907 uint32_t regionCount,
6908 const VkBufferImageCopy* pRegions)
6909{
6910 auto stream = mImpl->stream();
6911 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006912 auto resources = mImpl->resources();
6913 auto pool = mImpl->pool();
6914 VkCommandBuffer local_commandBuffer;
6915 local_commandBuffer = commandBuffer;
6916 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6917 VkImage local_srcImage;
6918 local_srcImage = srcImage;
6919 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage);
6920 VkImageLayout local_srcImageLayout;
6921 local_srcImageLayout = srcImageLayout;
6922 VkBuffer local_dstBuffer;
6923 local_dstBuffer = dstBuffer;
6924 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
6925 uint32_t local_regionCount;
6926 local_regionCount = regionCount;
6927 VkBufferImageCopy* local_pRegions;
6928 local_pRegions = nullptr;
6929 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006930 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006931 local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006932 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6933 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006934 deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i));
6935 }
6936 }
6937 if (local_pRegions)
6938 {
6939 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6940 {
6941 handlemap_VkBufferImageCopy(resources->unwrapMapping(), (VkBufferImageCopy*)(local_pRegions + i));
6942 }
6943 }
6944 countingStream->rewind();
6945 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006946 uint64_t cgen_var_474 = (uint64_t)local_commandBuffer;
6947 countingStream->putBe64(cgen_var_474);
6948 uint64_t cgen_var_475 = (uint64_t)local_srcImage;
6949 countingStream->putBe64(cgen_var_475);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006950 countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006951 uint64_t cgen_var_476 = (uint64_t)local_dstBuffer;
6952 countingStream->putBe64(cgen_var_476);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006953 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
6954 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6955 {
6956 marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006957 }
6958 }
6959 uint32_t packetSize_vkCmdCopyImageToBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6960 countingStream->rewind();
6961 uint32_t opcode_vkCmdCopyImageToBuffer = OP_vkCmdCopyImageToBuffer;
6962 stream->write(&opcode_vkCmdCopyImageToBuffer, sizeof(uint32_t));
6963 stream->write(&packetSize_vkCmdCopyImageToBuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006964 uint64_t cgen_var_477 = (uint64_t)local_commandBuffer;
6965 stream->putBe64(cgen_var_477);
6966 uint64_t cgen_var_478 = (uint64_t)local_srcImage;
6967 stream->putBe64(cgen_var_478);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006968 stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08006969 uint64_t cgen_var_479 = (uint64_t)local_dstBuffer;
6970 stream->putBe64(cgen_var_479);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006971 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006972 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6973 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006974 marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006975 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006976 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006977}
6978
6979void VkEncoder::vkCmdUpdateBuffer(
6980 VkCommandBuffer commandBuffer,
6981 VkBuffer dstBuffer,
6982 VkDeviceSize dstOffset,
6983 VkDeviceSize dataSize,
6984 const void* pData)
6985{
6986 auto stream = mImpl->stream();
6987 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006988 auto resources = mImpl->resources();
6989 auto pool = mImpl->pool();
6990 VkCommandBuffer local_commandBuffer;
6991 local_commandBuffer = commandBuffer;
6992 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6993 VkBuffer local_dstBuffer;
6994 local_dstBuffer = dstBuffer;
6995 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
6996 VkDeviceSize local_dstOffset;
6997 local_dstOffset = dstOffset;
6998 VkDeviceSize local_dataSize;
6999 local_dataSize = dataSize;
7000 void* local_pData;
7001 local_pData = nullptr;
7002 if (pData)
7003 {
7004 local_pData = (void*)pool->dupArray(pData, ((dataSize)) * sizeof(const uint8_t));
7005 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007006 countingStream->rewind();
7007 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007008 uint64_t cgen_var_480 = (uint64_t)local_commandBuffer;
7009 countingStream->putBe64(cgen_var_480);
7010 uint64_t cgen_var_481 = (uint64_t)local_dstBuffer;
7011 countingStream->putBe64(cgen_var_481);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007012 countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
7013 countingStream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize));
7014 countingStream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007015 }
7016 uint32_t packetSize_vkCmdUpdateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7017 countingStream->rewind();
7018 uint32_t opcode_vkCmdUpdateBuffer = OP_vkCmdUpdateBuffer;
7019 stream->write(&opcode_vkCmdUpdateBuffer, sizeof(uint32_t));
7020 stream->write(&packetSize_vkCmdUpdateBuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007021 uint64_t cgen_var_482 = (uint64_t)local_commandBuffer;
7022 stream->putBe64(cgen_var_482);
7023 uint64_t cgen_var_483 = (uint64_t)local_dstBuffer;
7024 stream->putBe64(cgen_var_483);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007025 stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
7026 stream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize));
7027 stream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t));
7028 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007029}
7030
7031void VkEncoder::vkCmdFillBuffer(
7032 VkCommandBuffer commandBuffer,
7033 VkBuffer dstBuffer,
7034 VkDeviceSize dstOffset,
7035 VkDeviceSize size,
7036 uint32_t data)
7037{
7038 auto stream = mImpl->stream();
7039 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007040 auto resources = mImpl->resources();
7041 auto pool = mImpl->pool();
7042 VkCommandBuffer local_commandBuffer;
7043 local_commandBuffer = commandBuffer;
7044 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7045 VkBuffer local_dstBuffer;
7046 local_dstBuffer = dstBuffer;
7047 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
7048 VkDeviceSize local_dstOffset;
7049 local_dstOffset = dstOffset;
7050 VkDeviceSize local_size;
7051 local_size = size;
7052 uint32_t local_data;
7053 local_data = data;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007054 countingStream->rewind();
7055 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007056 uint64_t cgen_var_484 = (uint64_t)local_commandBuffer;
7057 countingStream->putBe64(cgen_var_484);
7058 uint64_t cgen_var_485 = (uint64_t)local_dstBuffer;
7059 countingStream->putBe64(cgen_var_485);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007060 countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
7061 countingStream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize));
7062 countingStream->write((uint32_t*)&local_data, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007063 }
7064 uint32_t packetSize_vkCmdFillBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7065 countingStream->rewind();
7066 uint32_t opcode_vkCmdFillBuffer = OP_vkCmdFillBuffer;
7067 stream->write(&opcode_vkCmdFillBuffer, sizeof(uint32_t));
7068 stream->write(&packetSize_vkCmdFillBuffer, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007069 uint64_t cgen_var_486 = (uint64_t)local_commandBuffer;
7070 stream->putBe64(cgen_var_486);
7071 uint64_t cgen_var_487 = (uint64_t)local_dstBuffer;
7072 stream->putBe64(cgen_var_487);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007073 stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
7074 stream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize));
7075 stream->write((uint32_t*)&local_data, sizeof(uint32_t));
7076 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007077}
7078
7079void VkEncoder::vkCmdClearColorImage(
7080 VkCommandBuffer commandBuffer,
7081 VkImage image,
7082 VkImageLayout imageLayout,
7083 const VkClearColorValue* pColor,
7084 uint32_t rangeCount,
7085 const VkImageSubresourceRange* pRanges)
7086{
7087 auto stream = mImpl->stream();
7088 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007089 auto resources = mImpl->resources();
7090 auto pool = mImpl->pool();
7091 VkCommandBuffer local_commandBuffer;
7092 local_commandBuffer = commandBuffer;
7093 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7094 VkImage local_image;
7095 local_image = image;
7096 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
7097 VkImageLayout local_imageLayout;
7098 local_imageLayout = imageLayout;
7099 VkClearColorValue* local_pColor;
7100 local_pColor = nullptr;
7101 if (pColor)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007102 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007103 local_pColor = (VkClearColorValue*)pool->alloc(sizeof(const VkClearColorValue));
7104 deepcopy_VkClearColorValue(pool, pColor, (VkClearColorValue*)(local_pColor));
7105 }
7106 if (local_pColor)
7107 {
7108 handlemap_VkClearColorValue(resources->unwrapMapping(), (VkClearColorValue*)(local_pColor));
7109 }
7110 uint32_t local_rangeCount;
7111 local_rangeCount = rangeCount;
7112 VkImageSubresourceRange* local_pRanges;
7113 local_pRanges = nullptr;
7114 if (pRanges)
7115 {
7116 local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007117 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
7118 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007119 deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i));
7120 }
7121 }
7122 if (local_pRanges)
7123 {
7124 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
7125 {
7126 handlemap_VkImageSubresourceRange(resources->unwrapMapping(), (VkImageSubresourceRange*)(local_pRanges + i));
7127 }
7128 }
7129 countingStream->rewind();
7130 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007131 uint64_t cgen_var_488 = (uint64_t)local_commandBuffer;
7132 countingStream->putBe64(cgen_var_488);
7133 uint64_t cgen_var_489 = (uint64_t)local_image;
7134 countingStream->putBe64(cgen_var_489);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007135 countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
7136 marshal_VkClearColorValue(countingStream, (VkClearColorValue*)(local_pColor));
7137 countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
7138 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
7139 {
7140 marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007141 }
7142 }
7143 uint32_t packetSize_vkCmdClearColorImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7144 countingStream->rewind();
7145 uint32_t opcode_vkCmdClearColorImage = OP_vkCmdClearColorImage;
7146 stream->write(&opcode_vkCmdClearColorImage, sizeof(uint32_t));
7147 stream->write(&packetSize_vkCmdClearColorImage, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007148 uint64_t cgen_var_490 = (uint64_t)local_commandBuffer;
7149 stream->putBe64(cgen_var_490);
7150 uint64_t cgen_var_491 = (uint64_t)local_image;
7151 stream->putBe64(cgen_var_491);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007152 stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
7153 marshal_VkClearColorValue(stream, (VkClearColorValue*)(local_pColor));
7154 stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007155 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
7156 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007157 marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007158 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007159 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007160}
7161
7162void VkEncoder::vkCmdClearDepthStencilImage(
7163 VkCommandBuffer commandBuffer,
7164 VkImage image,
7165 VkImageLayout imageLayout,
7166 const VkClearDepthStencilValue* pDepthStencil,
7167 uint32_t rangeCount,
7168 const VkImageSubresourceRange* pRanges)
7169{
7170 auto stream = mImpl->stream();
7171 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007172 auto resources = mImpl->resources();
7173 auto pool = mImpl->pool();
7174 VkCommandBuffer local_commandBuffer;
7175 local_commandBuffer = commandBuffer;
7176 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7177 VkImage local_image;
7178 local_image = image;
7179 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
7180 VkImageLayout local_imageLayout;
7181 local_imageLayout = imageLayout;
7182 VkClearDepthStencilValue* local_pDepthStencil;
7183 local_pDepthStencil = nullptr;
7184 if (pDepthStencil)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007185 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007186 local_pDepthStencil = (VkClearDepthStencilValue*)pool->alloc(sizeof(const VkClearDepthStencilValue));
7187 deepcopy_VkClearDepthStencilValue(pool, pDepthStencil, (VkClearDepthStencilValue*)(local_pDepthStencil));
7188 }
7189 if (local_pDepthStencil)
7190 {
7191 handlemap_VkClearDepthStencilValue(resources->unwrapMapping(), (VkClearDepthStencilValue*)(local_pDepthStencil));
7192 }
7193 uint32_t local_rangeCount;
7194 local_rangeCount = rangeCount;
7195 VkImageSubresourceRange* local_pRanges;
7196 local_pRanges = nullptr;
7197 if (pRanges)
7198 {
7199 local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007200 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
7201 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007202 deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i));
7203 }
7204 }
7205 if (local_pRanges)
7206 {
7207 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
7208 {
7209 handlemap_VkImageSubresourceRange(resources->unwrapMapping(), (VkImageSubresourceRange*)(local_pRanges + i));
7210 }
7211 }
7212 countingStream->rewind();
7213 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007214 uint64_t cgen_var_492 = (uint64_t)local_commandBuffer;
7215 countingStream->putBe64(cgen_var_492);
7216 uint64_t cgen_var_493 = (uint64_t)local_image;
7217 countingStream->putBe64(cgen_var_493);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007218 countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
7219 marshal_VkClearDepthStencilValue(countingStream, (VkClearDepthStencilValue*)(local_pDepthStencil));
7220 countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
7221 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
7222 {
7223 marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007224 }
7225 }
7226 uint32_t packetSize_vkCmdClearDepthStencilImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7227 countingStream->rewind();
7228 uint32_t opcode_vkCmdClearDepthStencilImage = OP_vkCmdClearDepthStencilImage;
7229 stream->write(&opcode_vkCmdClearDepthStencilImage, sizeof(uint32_t));
7230 stream->write(&packetSize_vkCmdClearDepthStencilImage, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007231 uint64_t cgen_var_494 = (uint64_t)local_commandBuffer;
7232 stream->putBe64(cgen_var_494);
7233 uint64_t cgen_var_495 = (uint64_t)local_image;
7234 stream->putBe64(cgen_var_495);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007235 stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
7236 marshal_VkClearDepthStencilValue(stream, (VkClearDepthStencilValue*)(local_pDepthStencil));
7237 stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007238 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
7239 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007240 marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007241 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007242 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007243}
7244
7245void VkEncoder::vkCmdClearAttachments(
7246 VkCommandBuffer commandBuffer,
7247 uint32_t attachmentCount,
7248 const VkClearAttachment* pAttachments,
7249 uint32_t rectCount,
7250 const VkClearRect* pRects)
7251{
7252 auto stream = mImpl->stream();
7253 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007254 auto resources = mImpl->resources();
7255 auto pool = mImpl->pool();
7256 VkCommandBuffer local_commandBuffer;
7257 local_commandBuffer = commandBuffer;
7258 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7259 uint32_t local_attachmentCount;
7260 local_attachmentCount = attachmentCount;
7261 VkClearAttachment* local_pAttachments;
7262 local_pAttachments = nullptr;
7263 if (pAttachments)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007264 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007265 local_pAttachments = (VkClearAttachment*)pool->alloc(((attachmentCount)) * sizeof(const VkClearAttachment));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007266 for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i)
7267 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007268 deepcopy_VkClearAttachment(pool, pAttachments + i, (VkClearAttachment*)(local_pAttachments + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007269 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007270 }
7271 if (local_pAttachments)
7272 {
7273 for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i)
7274 {
7275 handlemap_VkClearAttachment(resources->unwrapMapping(), (VkClearAttachment*)(local_pAttachments + i));
7276 }
7277 }
7278 uint32_t local_rectCount;
7279 local_rectCount = rectCount;
7280 VkClearRect* local_pRects;
7281 local_pRects = nullptr;
7282 if (pRects)
7283 {
7284 local_pRects = (VkClearRect*)pool->alloc(((rectCount)) * sizeof(const VkClearRect));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007285 for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i)
7286 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007287 deepcopy_VkClearRect(pool, pRects + i, (VkClearRect*)(local_pRects + i));
7288 }
7289 }
7290 if (local_pRects)
7291 {
7292 for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i)
7293 {
7294 handlemap_VkClearRect(resources->unwrapMapping(), (VkClearRect*)(local_pRects + i));
7295 }
7296 }
7297 countingStream->rewind();
7298 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007299 uint64_t cgen_var_496 = (uint64_t)local_commandBuffer;
7300 countingStream->putBe64(cgen_var_496);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007301 countingStream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t));
7302 for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i)
7303 {
7304 marshal_VkClearAttachment(countingStream, (VkClearAttachment*)(local_pAttachments + i));
7305 }
7306 countingStream->write((uint32_t*)&local_rectCount, sizeof(uint32_t));
7307 for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i)
7308 {
7309 marshal_VkClearRect(countingStream, (VkClearRect*)(local_pRects + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007310 }
7311 }
7312 uint32_t packetSize_vkCmdClearAttachments = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7313 countingStream->rewind();
7314 uint32_t opcode_vkCmdClearAttachments = OP_vkCmdClearAttachments;
7315 stream->write(&opcode_vkCmdClearAttachments, sizeof(uint32_t));
7316 stream->write(&packetSize_vkCmdClearAttachments, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007317 uint64_t cgen_var_497 = (uint64_t)local_commandBuffer;
7318 stream->putBe64(cgen_var_497);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007319 stream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007320 for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i)
7321 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007322 marshal_VkClearAttachment(stream, (VkClearAttachment*)(local_pAttachments + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007323 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007324 stream->write((uint32_t*)&local_rectCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007325 for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i)
7326 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007327 marshal_VkClearRect(stream, (VkClearRect*)(local_pRects + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007328 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007329 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007330}
7331
7332void VkEncoder::vkCmdResolveImage(
7333 VkCommandBuffer commandBuffer,
7334 VkImage srcImage,
7335 VkImageLayout srcImageLayout,
7336 VkImage dstImage,
7337 VkImageLayout dstImageLayout,
7338 uint32_t regionCount,
7339 const VkImageResolve* pRegions)
7340{
7341 auto stream = mImpl->stream();
7342 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007343 auto resources = mImpl->resources();
7344 auto pool = mImpl->pool();
7345 VkCommandBuffer local_commandBuffer;
7346 local_commandBuffer = commandBuffer;
7347 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7348 VkImage local_srcImage;
7349 local_srcImage = srcImage;
7350 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage);
7351 VkImageLayout local_srcImageLayout;
7352 local_srcImageLayout = srcImageLayout;
7353 VkImage local_dstImage;
7354 local_dstImage = dstImage;
7355 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage);
7356 VkImageLayout local_dstImageLayout;
7357 local_dstImageLayout = dstImageLayout;
7358 uint32_t local_regionCount;
7359 local_regionCount = regionCount;
7360 VkImageResolve* local_pRegions;
7361 local_pRegions = nullptr;
7362 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007363 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007364 local_pRegions = (VkImageResolve*)pool->alloc(((regionCount)) * sizeof(const VkImageResolve));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007365 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
7366 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007367 deepcopy_VkImageResolve(pool, pRegions + i, (VkImageResolve*)(local_pRegions + i));
7368 }
7369 }
7370 if (local_pRegions)
7371 {
7372 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
7373 {
7374 handlemap_VkImageResolve(resources->unwrapMapping(), (VkImageResolve*)(local_pRegions + i));
7375 }
7376 }
7377 countingStream->rewind();
7378 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007379 uint64_t cgen_var_498 = (uint64_t)local_commandBuffer;
7380 countingStream->putBe64(cgen_var_498);
7381 uint64_t cgen_var_499 = (uint64_t)local_srcImage;
7382 countingStream->putBe64(cgen_var_499);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007383 countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007384 uint64_t cgen_var_500 = (uint64_t)local_dstImage;
7385 countingStream->putBe64(cgen_var_500);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007386 countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
7387 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
7388 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
7389 {
7390 marshal_VkImageResolve(countingStream, (VkImageResolve*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007391 }
7392 }
7393 uint32_t packetSize_vkCmdResolveImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7394 countingStream->rewind();
7395 uint32_t opcode_vkCmdResolveImage = OP_vkCmdResolveImage;
7396 stream->write(&opcode_vkCmdResolveImage, sizeof(uint32_t));
7397 stream->write(&packetSize_vkCmdResolveImage, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007398 uint64_t cgen_var_501 = (uint64_t)local_commandBuffer;
7399 stream->putBe64(cgen_var_501);
7400 uint64_t cgen_var_502 = (uint64_t)local_srcImage;
7401 stream->putBe64(cgen_var_502);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007402 stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007403 uint64_t cgen_var_503 = (uint64_t)local_dstImage;
7404 stream->putBe64(cgen_var_503);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007405 stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
7406 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007407 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
7408 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007409 marshal_VkImageResolve(stream, (VkImageResolve*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007410 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007411 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007412}
7413
7414void VkEncoder::vkCmdSetEvent(
7415 VkCommandBuffer commandBuffer,
7416 VkEvent event,
7417 VkPipelineStageFlags stageMask)
7418{
7419 auto stream = mImpl->stream();
7420 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007421 auto resources = mImpl->resources();
7422 auto pool = mImpl->pool();
7423 VkCommandBuffer local_commandBuffer;
7424 local_commandBuffer = commandBuffer;
7425 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7426 VkEvent local_event;
7427 local_event = event;
7428 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
7429 VkPipelineStageFlags local_stageMask;
7430 local_stageMask = stageMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007431 countingStream->rewind();
7432 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007433 uint64_t cgen_var_504 = (uint64_t)local_commandBuffer;
7434 countingStream->putBe64(cgen_var_504);
7435 uint64_t cgen_var_505 = (uint64_t)local_event;
7436 countingStream->putBe64(cgen_var_505);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007437 countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007438 }
7439 uint32_t packetSize_vkCmdSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7440 countingStream->rewind();
7441 uint32_t opcode_vkCmdSetEvent = OP_vkCmdSetEvent;
7442 stream->write(&opcode_vkCmdSetEvent, sizeof(uint32_t));
7443 stream->write(&packetSize_vkCmdSetEvent, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007444 uint64_t cgen_var_506 = (uint64_t)local_commandBuffer;
7445 stream->putBe64(cgen_var_506);
7446 uint64_t cgen_var_507 = (uint64_t)local_event;
7447 stream->putBe64(cgen_var_507);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007448 stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
7449 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007450}
7451
7452void VkEncoder::vkCmdResetEvent(
7453 VkCommandBuffer commandBuffer,
7454 VkEvent event,
7455 VkPipelineStageFlags stageMask)
7456{
7457 auto stream = mImpl->stream();
7458 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007459 auto resources = mImpl->resources();
7460 auto pool = mImpl->pool();
7461 VkCommandBuffer local_commandBuffer;
7462 local_commandBuffer = commandBuffer;
7463 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7464 VkEvent local_event;
7465 local_event = event;
7466 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
7467 VkPipelineStageFlags local_stageMask;
7468 local_stageMask = stageMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007469 countingStream->rewind();
7470 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007471 uint64_t cgen_var_508 = (uint64_t)local_commandBuffer;
7472 countingStream->putBe64(cgen_var_508);
7473 uint64_t cgen_var_509 = (uint64_t)local_event;
7474 countingStream->putBe64(cgen_var_509);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007475 countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007476 }
7477 uint32_t packetSize_vkCmdResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7478 countingStream->rewind();
7479 uint32_t opcode_vkCmdResetEvent = OP_vkCmdResetEvent;
7480 stream->write(&opcode_vkCmdResetEvent, sizeof(uint32_t));
7481 stream->write(&packetSize_vkCmdResetEvent, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007482 uint64_t cgen_var_510 = (uint64_t)local_commandBuffer;
7483 stream->putBe64(cgen_var_510);
7484 uint64_t cgen_var_511 = (uint64_t)local_event;
7485 stream->putBe64(cgen_var_511);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007486 stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
7487 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007488}
7489
7490void VkEncoder::vkCmdWaitEvents(
7491 VkCommandBuffer commandBuffer,
7492 uint32_t eventCount,
7493 const VkEvent* pEvents,
7494 VkPipelineStageFlags srcStageMask,
7495 VkPipelineStageFlags dstStageMask,
7496 uint32_t memoryBarrierCount,
7497 const VkMemoryBarrier* pMemoryBarriers,
7498 uint32_t bufferMemoryBarrierCount,
7499 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
7500 uint32_t imageMemoryBarrierCount,
7501 const VkImageMemoryBarrier* pImageMemoryBarriers)
7502{
7503 auto stream = mImpl->stream();
7504 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007505 auto resources = mImpl->resources();
7506 auto pool = mImpl->pool();
7507 VkCommandBuffer local_commandBuffer;
7508 local_commandBuffer = commandBuffer;
7509 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7510 uint32_t local_eventCount;
7511 local_eventCount = eventCount;
7512 VkEvent* local_pEvents;
7513 local_pEvents = nullptr;
7514 if (pEvents)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007515 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007516 local_pEvents = (VkEvent*)pool->dupArray(pEvents, ((eventCount)) * sizeof(const VkEvent));
7517 }
7518 if (local_pEvents)
7519 {
7520 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)local_pEvents, ((eventCount)));
7521 }
7522 VkPipelineStageFlags local_srcStageMask;
7523 local_srcStageMask = srcStageMask;
7524 VkPipelineStageFlags local_dstStageMask;
7525 local_dstStageMask = dstStageMask;
7526 uint32_t local_memoryBarrierCount;
7527 local_memoryBarrierCount = memoryBarrierCount;
7528 VkMemoryBarrier* local_pMemoryBarriers;
7529 local_pMemoryBarriers = nullptr;
7530 if (pMemoryBarriers)
7531 {
7532 local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007533 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
7534 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007535 deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007536 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007537 }
7538 if (local_pMemoryBarriers)
7539 {
7540 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
7541 {
7542 handlemap_VkMemoryBarrier(resources->unwrapMapping(), (VkMemoryBarrier*)(local_pMemoryBarriers + i));
7543 }
7544 }
7545 uint32_t local_bufferMemoryBarrierCount;
7546 local_bufferMemoryBarrierCount = bufferMemoryBarrierCount;
7547 VkBufferMemoryBarrier* local_pBufferMemoryBarriers;
7548 local_pBufferMemoryBarriers = nullptr;
7549 if (pBufferMemoryBarriers)
7550 {
7551 local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007552 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
7553 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007554 deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007555 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007556 }
7557 if (local_pBufferMemoryBarriers)
7558 {
7559 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
7560 {
7561 handlemap_VkBufferMemoryBarrier(resources->unwrapMapping(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
7562 }
7563 }
7564 uint32_t local_imageMemoryBarrierCount;
7565 local_imageMemoryBarrierCount = imageMemoryBarrierCount;
7566 VkImageMemoryBarrier* local_pImageMemoryBarriers;
7567 local_pImageMemoryBarriers = nullptr;
7568 if (pImageMemoryBarriers)
7569 {
7570 local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007571 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
7572 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007573 deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
7574 }
7575 }
7576 if (local_pImageMemoryBarriers)
7577 {
7578 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
7579 {
7580 handlemap_VkImageMemoryBarrier(resources->unwrapMapping(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
7581 }
7582 }
7583 countingStream->rewind();
7584 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007585 uint64_t cgen_var_512 = (uint64_t)local_commandBuffer;
7586 countingStream->putBe64(cgen_var_512);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007587 countingStream->write((uint32_t*)&local_eventCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007588 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007589 countingStream->write((VkEvent*)local_pEvents, ((eventCount)) * sizeof(VkEvent));
7590 countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
7591 countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
7592 countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
7593 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
7594 {
7595 marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
7596 }
7597 countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t));
7598 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
7599 {
7600 marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
7601 }
7602 countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t));
7603 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
7604 {
7605 marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007606 }
7607 }
7608 uint32_t packetSize_vkCmdWaitEvents = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7609 countingStream->rewind();
7610 uint32_t opcode_vkCmdWaitEvents = OP_vkCmdWaitEvents;
7611 stream->write(&opcode_vkCmdWaitEvents, sizeof(uint32_t));
7612 stream->write(&packetSize_vkCmdWaitEvents, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007613 uint64_t cgen_var_513 = (uint64_t)local_commandBuffer;
7614 stream->putBe64(cgen_var_513);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007615 stream->write((uint32_t*)&local_eventCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007616 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007617 stream->write((VkEvent*)local_pEvents, ((eventCount)) * sizeof(VkEvent));
7618 stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
7619 stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
7620 stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007621 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
7622 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007623 marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007624 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007625 stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007626 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
7627 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007628 marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007629 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007630 stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007631 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
7632 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007633 marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007634 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007635 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007636}
7637
7638void VkEncoder::vkCmdPipelineBarrier(
7639 VkCommandBuffer commandBuffer,
7640 VkPipelineStageFlags srcStageMask,
7641 VkPipelineStageFlags dstStageMask,
7642 VkDependencyFlags dependencyFlags,
7643 uint32_t memoryBarrierCount,
7644 const VkMemoryBarrier* pMemoryBarriers,
7645 uint32_t bufferMemoryBarrierCount,
7646 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
7647 uint32_t imageMemoryBarrierCount,
7648 const VkImageMemoryBarrier* pImageMemoryBarriers)
7649{
7650 auto stream = mImpl->stream();
7651 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007652 auto resources = mImpl->resources();
7653 auto pool = mImpl->pool();
7654 VkCommandBuffer local_commandBuffer;
7655 local_commandBuffer = commandBuffer;
7656 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7657 VkPipelineStageFlags local_srcStageMask;
7658 local_srcStageMask = srcStageMask;
7659 VkPipelineStageFlags local_dstStageMask;
7660 local_dstStageMask = dstStageMask;
7661 VkDependencyFlags local_dependencyFlags;
7662 local_dependencyFlags = dependencyFlags;
7663 uint32_t local_memoryBarrierCount;
7664 local_memoryBarrierCount = memoryBarrierCount;
7665 VkMemoryBarrier* local_pMemoryBarriers;
7666 local_pMemoryBarriers = nullptr;
7667 if (pMemoryBarriers)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007668 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007669 local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007670 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
7671 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007672 deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007673 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007674 }
7675 if (local_pMemoryBarriers)
7676 {
7677 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
7678 {
7679 handlemap_VkMemoryBarrier(resources->unwrapMapping(), (VkMemoryBarrier*)(local_pMemoryBarriers + i));
7680 }
7681 }
7682 uint32_t local_bufferMemoryBarrierCount;
7683 local_bufferMemoryBarrierCount = bufferMemoryBarrierCount;
7684 VkBufferMemoryBarrier* local_pBufferMemoryBarriers;
7685 local_pBufferMemoryBarriers = nullptr;
7686 if (pBufferMemoryBarriers)
7687 {
7688 local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007689 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
7690 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007691 deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007692 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007693 }
7694 if (local_pBufferMemoryBarriers)
7695 {
7696 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
7697 {
7698 handlemap_VkBufferMemoryBarrier(resources->unwrapMapping(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
7699 }
7700 }
7701 uint32_t local_imageMemoryBarrierCount;
7702 local_imageMemoryBarrierCount = imageMemoryBarrierCount;
7703 VkImageMemoryBarrier* local_pImageMemoryBarriers;
7704 local_pImageMemoryBarriers = nullptr;
7705 if (pImageMemoryBarriers)
7706 {
7707 local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007708 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
7709 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007710 deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
7711 }
7712 }
7713 if (local_pImageMemoryBarriers)
7714 {
7715 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
7716 {
7717 handlemap_VkImageMemoryBarrier(resources->unwrapMapping(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
7718 }
7719 }
7720 countingStream->rewind();
7721 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007722 uint64_t cgen_var_514 = (uint64_t)local_commandBuffer;
7723 countingStream->putBe64(cgen_var_514);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007724 countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
7725 countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
7726 countingStream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags));
7727 countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
7728 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
7729 {
7730 marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
7731 }
7732 countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t));
7733 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
7734 {
7735 marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
7736 }
7737 countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t));
7738 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
7739 {
7740 marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007741 }
7742 }
7743 uint32_t packetSize_vkCmdPipelineBarrier = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7744 countingStream->rewind();
7745 uint32_t opcode_vkCmdPipelineBarrier = OP_vkCmdPipelineBarrier;
7746 stream->write(&opcode_vkCmdPipelineBarrier, sizeof(uint32_t));
7747 stream->write(&packetSize_vkCmdPipelineBarrier, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007748 uint64_t cgen_var_515 = (uint64_t)local_commandBuffer;
7749 stream->putBe64(cgen_var_515);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007750 stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
7751 stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
7752 stream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags));
7753 stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007754 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
7755 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007756 marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007757 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007758 stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007759 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
7760 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007761 marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007762 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007763 stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007764 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
7765 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007766 marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007767 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007768 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007769}
7770
7771void VkEncoder::vkCmdBeginQuery(
7772 VkCommandBuffer commandBuffer,
7773 VkQueryPool queryPool,
7774 uint32_t query,
7775 VkQueryControlFlags flags)
7776{
7777 auto stream = mImpl->stream();
7778 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007779 auto resources = mImpl->resources();
7780 auto pool = mImpl->pool();
7781 VkCommandBuffer local_commandBuffer;
7782 local_commandBuffer = commandBuffer;
7783 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7784 VkQueryPool local_queryPool;
7785 local_queryPool = queryPool;
7786 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
7787 uint32_t local_query;
7788 local_query = query;
7789 VkQueryControlFlags local_flags;
7790 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007791 countingStream->rewind();
7792 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007793 uint64_t cgen_var_516 = (uint64_t)local_commandBuffer;
7794 countingStream->putBe64(cgen_var_516);
7795 uint64_t cgen_var_517 = (uint64_t)local_queryPool;
7796 countingStream->putBe64(cgen_var_517);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007797 countingStream->write((uint32_t*)&local_query, sizeof(uint32_t));
7798 countingStream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007799 }
7800 uint32_t packetSize_vkCmdBeginQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7801 countingStream->rewind();
7802 uint32_t opcode_vkCmdBeginQuery = OP_vkCmdBeginQuery;
7803 stream->write(&opcode_vkCmdBeginQuery, sizeof(uint32_t));
7804 stream->write(&packetSize_vkCmdBeginQuery, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007805 uint64_t cgen_var_518 = (uint64_t)local_commandBuffer;
7806 stream->putBe64(cgen_var_518);
7807 uint64_t cgen_var_519 = (uint64_t)local_queryPool;
7808 stream->putBe64(cgen_var_519);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007809 stream->write((uint32_t*)&local_query, sizeof(uint32_t));
7810 stream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags));
7811 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007812}
7813
7814void VkEncoder::vkCmdEndQuery(
7815 VkCommandBuffer commandBuffer,
7816 VkQueryPool queryPool,
7817 uint32_t query)
7818{
7819 auto stream = mImpl->stream();
7820 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007821 auto resources = mImpl->resources();
7822 auto pool = mImpl->pool();
7823 VkCommandBuffer local_commandBuffer;
7824 local_commandBuffer = commandBuffer;
7825 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7826 VkQueryPool local_queryPool;
7827 local_queryPool = queryPool;
7828 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
7829 uint32_t local_query;
7830 local_query = query;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007831 countingStream->rewind();
7832 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007833 uint64_t cgen_var_520 = (uint64_t)local_commandBuffer;
7834 countingStream->putBe64(cgen_var_520);
7835 uint64_t cgen_var_521 = (uint64_t)local_queryPool;
7836 countingStream->putBe64(cgen_var_521);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007837 countingStream->write((uint32_t*)&local_query, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007838 }
7839 uint32_t packetSize_vkCmdEndQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7840 countingStream->rewind();
7841 uint32_t opcode_vkCmdEndQuery = OP_vkCmdEndQuery;
7842 stream->write(&opcode_vkCmdEndQuery, sizeof(uint32_t));
7843 stream->write(&packetSize_vkCmdEndQuery, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007844 uint64_t cgen_var_522 = (uint64_t)local_commandBuffer;
7845 stream->putBe64(cgen_var_522);
7846 uint64_t cgen_var_523 = (uint64_t)local_queryPool;
7847 stream->putBe64(cgen_var_523);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007848 stream->write((uint32_t*)&local_query, sizeof(uint32_t));
7849 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007850}
7851
7852void VkEncoder::vkCmdResetQueryPool(
7853 VkCommandBuffer commandBuffer,
7854 VkQueryPool queryPool,
7855 uint32_t firstQuery,
7856 uint32_t queryCount)
7857{
7858 auto stream = mImpl->stream();
7859 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007860 auto resources = mImpl->resources();
7861 auto pool = mImpl->pool();
7862 VkCommandBuffer local_commandBuffer;
7863 local_commandBuffer = commandBuffer;
7864 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7865 VkQueryPool local_queryPool;
7866 local_queryPool = queryPool;
7867 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
7868 uint32_t local_firstQuery;
7869 local_firstQuery = firstQuery;
7870 uint32_t local_queryCount;
7871 local_queryCount = queryCount;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007872 countingStream->rewind();
7873 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007874 uint64_t cgen_var_524 = (uint64_t)local_commandBuffer;
7875 countingStream->putBe64(cgen_var_524);
7876 uint64_t cgen_var_525 = (uint64_t)local_queryPool;
7877 countingStream->putBe64(cgen_var_525);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007878 countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
7879 countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007880 }
7881 uint32_t packetSize_vkCmdResetQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7882 countingStream->rewind();
7883 uint32_t opcode_vkCmdResetQueryPool = OP_vkCmdResetQueryPool;
7884 stream->write(&opcode_vkCmdResetQueryPool, sizeof(uint32_t));
7885 stream->write(&packetSize_vkCmdResetQueryPool, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007886 uint64_t cgen_var_526 = (uint64_t)local_commandBuffer;
7887 stream->putBe64(cgen_var_526);
7888 uint64_t cgen_var_527 = (uint64_t)local_queryPool;
7889 stream->putBe64(cgen_var_527);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007890 stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
7891 stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
7892 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007893}
7894
7895void VkEncoder::vkCmdWriteTimestamp(
7896 VkCommandBuffer commandBuffer,
7897 VkPipelineStageFlagBits pipelineStage,
7898 VkQueryPool queryPool,
7899 uint32_t query)
7900{
7901 auto stream = mImpl->stream();
7902 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007903 auto resources = mImpl->resources();
7904 auto pool = mImpl->pool();
7905 VkCommandBuffer local_commandBuffer;
7906 local_commandBuffer = commandBuffer;
7907 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7908 VkPipelineStageFlagBits local_pipelineStage;
7909 local_pipelineStage = pipelineStage;
7910 VkQueryPool local_queryPool;
7911 local_queryPool = queryPool;
7912 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
7913 uint32_t local_query;
7914 local_query = query;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007915 countingStream->rewind();
7916 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007917 uint64_t cgen_var_528 = (uint64_t)local_commandBuffer;
7918 countingStream->putBe64(cgen_var_528);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007919 countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007920 uint64_t cgen_var_529 = (uint64_t)local_queryPool;
7921 countingStream->putBe64(cgen_var_529);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007922 countingStream->write((uint32_t*)&local_query, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007923 }
7924 uint32_t packetSize_vkCmdWriteTimestamp = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7925 countingStream->rewind();
7926 uint32_t opcode_vkCmdWriteTimestamp = OP_vkCmdWriteTimestamp;
7927 stream->write(&opcode_vkCmdWriteTimestamp, sizeof(uint32_t));
7928 stream->write(&packetSize_vkCmdWriteTimestamp, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007929 uint64_t cgen_var_530 = (uint64_t)local_commandBuffer;
7930 stream->putBe64(cgen_var_530);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007931 stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007932 uint64_t cgen_var_531 = (uint64_t)local_queryPool;
7933 stream->putBe64(cgen_var_531);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007934 stream->write((uint32_t*)&local_query, sizeof(uint32_t));
7935 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007936}
7937
7938void VkEncoder::vkCmdCopyQueryPoolResults(
7939 VkCommandBuffer commandBuffer,
7940 VkQueryPool queryPool,
7941 uint32_t firstQuery,
7942 uint32_t queryCount,
7943 VkBuffer dstBuffer,
7944 VkDeviceSize dstOffset,
7945 VkDeviceSize stride,
7946 VkQueryResultFlags flags)
7947{
7948 auto stream = mImpl->stream();
7949 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007950 auto resources = mImpl->resources();
7951 auto pool = mImpl->pool();
7952 VkCommandBuffer local_commandBuffer;
7953 local_commandBuffer = commandBuffer;
7954 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7955 VkQueryPool local_queryPool;
7956 local_queryPool = queryPool;
7957 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
7958 uint32_t local_firstQuery;
7959 local_firstQuery = firstQuery;
7960 uint32_t local_queryCount;
7961 local_queryCount = queryCount;
7962 VkBuffer local_dstBuffer;
7963 local_dstBuffer = dstBuffer;
7964 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
7965 VkDeviceSize local_dstOffset;
7966 local_dstOffset = dstOffset;
7967 VkDeviceSize local_stride;
7968 local_stride = stride;
7969 VkQueryResultFlags local_flags;
7970 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007971 countingStream->rewind();
7972 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007973 uint64_t cgen_var_532 = (uint64_t)local_commandBuffer;
7974 countingStream->putBe64(cgen_var_532);
7975 uint64_t cgen_var_533 = (uint64_t)local_queryPool;
7976 countingStream->putBe64(cgen_var_533);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007977 countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
7978 countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007979 uint64_t cgen_var_534 = (uint64_t)local_dstBuffer;
7980 countingStream->putBe64(cgen_var_534);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007981 countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
7982 countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
7983 countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007984 }
7985 uint32_t packetSize_vkCmdCopyQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7986 countingStream->rewind();
7987 uint32_t opcode_vkCmdCopyQueryPoolResults = OP_vkCmdCopyQueryPoolResults;
7988 stream->write(&opcode_vkCmdCopyQueryPoolResults, sizeof(uint32_t));
7989 stream->write(&packetSize_vkCmdCopyQueryPoolResults, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007990 uint64_t cgen_var_535 = (uint64_t)local_commandBuffer;
7991 stream->putBe64(cgen_var_535);
7992 uint64_t cgen_var_536 = (uint64_t)local_queryPool;
7993 stream->putBe64(cgen_var_536);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007994 stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
7995 stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08007996 uint64_t cgen_var_537 = (uint64_t)local_dstBuffer;
7997 stream->putBe64(cgen_var_537);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007998 stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
7999 stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
8000 stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
8001 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008002}
8003
8004void VkEncoder::vkCmdPushConstants(
8005 VkCommandBuffer commandBuffer,
8006 VkPipelineLayout layout,
8007 VkShaderStageFlags stageFlags,
8008 uint32_t offset,
8009 uint32_t size,
8010 const void* pValues)
8011{
8012 auto stream = mImpl->stream();
8013 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008014 auto resources = mImpl->resources();
8015 auto pool = mImpl->pool();
8016 VkCommandBuffer local_commandBuffer;
8017 local_commandBuffer = commandBuffer;
8018 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
8019 VkPipelineLayout local_layout;
8020 local_layout = layout;
8021 resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout);
8022 VkShaderStageFlags local_stageFlags;
8023 local_stageFlags = stageFlags;
8024 uint32_t local_offset;
8025 local_offset = offset;
8026 uint32_t local_size;
8027 local_size = size;
8028 void* local_pValues;
8029 local_pValues = nullptr;
8030 if (pValues)
8031 {
8032 local_pValues = (void*)pool->dupArray(pValues, ((size)) * sizeof(const uint8_t));
8033 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008034 countingStream->rewind();
8035 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008036 uint64_t cgen_var_538 = (uint64_t)local_commandBuffer;
8037 countingStream->putBe64(cgen_var_538);
8038 uint64_t cgen_var_539 = (uint64_t)local_layout;
8039 countingStream->putBe64(cgen_var_539);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008040 countingStream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags));
8041 countingStream->write((uint32_t*)&local_offset, sizeof(uint32_t));
8042 countingStream->write((uint32_t*)&local_size, sizeof(uint32_t));
8043 countingStream->write((void*)local_pValues, ((size)) * sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008044 }
8045 uint32_t packetSize_vkCmdPushConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8046 countingStream->rewind();
8047 uint32_t opcode_vkCmdPushConstants = OP_vkCmdPushConstants;
8048 stream->write(&opcode_vkCmdPushConstants, sizeof(uint32_t));
8049 stream->write(&packetSize_vkCmdPushConstants, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008050 uint64_t cgen_var_540 = (uint64_t)local_commandBuffer;
8051 stream->putBe64(cgen_var_540);
8052 uint64_t cgen_var_541 = (uint64_t)local_layout;
8053 stream->putBe64(cgen_var_541);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008054 stream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags));
8055 stream->write((uint32_t*)&local_offset, sizeof(uint32_t));
8056 stream->write((uint32_t*)&local_size, sizeof(uint32_t));
8057 stream->write((void*)local_pValues, ((size)) * sizeof(uint8_t));
8058 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008059}
8060
8061void VkEncoder::vkCmdBeginRenderPass(
8062 VkCommandBuffer commandBuffer,
8063 const VkRenderPassBeginInfo* pRenderPassBegin,
8064 VkSubpassContents contents)
8065{
8066 auto stream = mImpl->stream();
8067 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008068 auto resources = mImpl->resources();
8069 auto pool = mImpl->pool();
8070 VkCommandBuffer local_commandBuffer;
8071 local_commandBuffer = commandBuffer;
8072 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
8073 VkRenderPassBeginInfo* local_pRenderPassBegin;
8074 local_pRenderPassBegin = nullptr;
8075 if (pRenderPassBegin)
8076 {
8077 local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo));
8078 deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
8079 }
8080 if (local_pRenderPassBegin)
8081 {
8082 handlemap_VkRenderPassBeginInfo(resources->unwrapMapping(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
8083 }
8084 VkSubpassContents local_contents;
8085 local_contents = contents;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008086 countingStream->rewind();
8087 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008088 uint64_t cgen_var_542 = (uint64_t)local_commandBuffer;
8089 countingStream->putBe64(cgen_var_542);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008090 marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
8091 countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008092 }
8093 uint32_t packetSize_vkCmdBeginRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8094 countingStream->rewind();
8095 uint32_t opcode_vkCmdBeginRenderPass = OP_vkCmdBeginRenderPass;
8096 stream->write(&opcode_vkCmdBeginRenderPass, sizeof(uint32_t));
8097 stream->write(&packetSize_vkCmdBeginRenderPass, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008098 uint64_t cgen_var_543 = (uint64_t)local_commandBuffer;
8099 stream->putBe64(cgen_var_543);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008100 marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
8101 stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
8102 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008103}
8104
8105void VkEncoder::vkCmdNextSubpass(
8106 VkCommandBuffer commandBuffer,
8107 VkSubpassContents contents)
8108{
8109 auto stream = mImpl->stream();
8110 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008111 auto resources = mImpl->resources();
8112 auto pool = mImpl->pool();
8113 VkCommandBuffer local_commandBuffer;
8114 local_commandBuffer = commandBuffer;
8115 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
8116 VkSubpassContents local_contents;
8117 local_contents = contents;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008118 countingStream->rewind();
8119 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008120 uint64_t cgen_var_544 = (uint64_t)local_commandBuffer;
8121 countingStream->putBe64(cgen_var_544);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008122 countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008123 }
8124 uint32_t packetSize_vkCmdNextSubpass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8125 countingStream->rewind();
8126 uint32_t opcode_vkCmdNextSubpass = OP_vkCmdNextSubpass;
8127 stream->write(&opcode_vkCmdNextSubpass, sizeof(uint32_t));
8128 stream->write(&packetSize_vkCmdNextSubpass, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008129 uint64_t cgen_var_545 = (uint64_t)local_commandBuffer;
8130 stream->putBe64(cgen_var_545);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008131 stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
8132 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008133}
8134
8135void VkEncoder::vkCmdEndRenderPass(
8136 VkCommandBuffer commandBuffer)
8137{
8138 auto stream = mImpl->stream();
8139 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008140 auto resources = mImpl->resources();
8141 auto pool = mImpl->pool();
8142 VkCommandBuffer local_commandBuffer;
8143 local_commandBuffer = commandBuffer;
8144 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008145 countingStream->rewind();
8146 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008147 uint64_t cgen_var_546 = (uint64_t)local_commandBuffer;
8148 countingStream->putBe64(cgen_var_546);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008149 }
8150 uint32_t packetSize_vkCmdEndRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8151 countingStream->rewind();
8152 uint32_t opcode_vkCmdEndRenderPass = OP_vkCmdEndRenderPass;
8153 stream->write(&opcode_vkCmdEndRenderPass, sizeof(uint32_t));
8154 stream->write(&packetSize_vkCmdEndRenderPass, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008155 uint64_t cgen_var_547 = (uint64_t)local_commandBuffer;
8156 stream->putBe64(cgen_var_547);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008157 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008158}
8159
8160void VkEncoder::vkCmdExecuteCommands(
8161 VkCommandBuffer commandBuffer,
8162 uint32_t commandBufferCount,
8163 const VkCommandBuffer* pCommandBuffers)
8164{
8165 auto stream = mImpl->stream();
8166 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008167 auto resources = mImpl->resources();
8168 auto pool = mImpl->pool();
8169 VkCommandBuffer local_commandBuffer;
8170 local_commandBuffer = commandBuffer;
8171 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
8172 uint32_t local_commandBufferCount;
8173 local_commandBufferCount = commandBufferCount;
8174 VkCommandBuffer* local_pCommandBuffers;
8175 local_pCommandBuffers = nullptr;
8176 if (pCommandBuffers)
8177 {
8178 local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer));
8179 }
8180 if (local_pCommandBuffers)
8181 {
8182 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)));
8183 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008184 countingStream->rewind();
8185 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008186 uint64_t cgen_var_548 = (uint64_t)local_commandBuffer;
8187 countingStream->putBe64(cgen_var_548);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008188 countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008189 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008190 countingStream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008191 }
8192 uint32_t packetSize_vkCmdExecuteCommands = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8193 countingStream->rewind();
8194 uint32_t opcode_vkCmdExecuteCommands = OP_vkCmdExecuteCommands;
8195 stream->write(&opcode_vkCmdExecuteCommands, sizeof(uint32_t));
8196 stream->write(&packetSize_vkCmdExecuteCommands, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008197 uint64_t cgen_var_549 = (uint64_t)local_commandBuffer;
8198 stream->putBe64(cgen_var_549);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008199 stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008200 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008201 stream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer));
8202 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008203}
8204
8205#endif
8206#ifdef VK_VERSION_1_1
8207VkResult VkEncoder::vkEnumerateInstanceVersion(
8208 uint32_t* pApiVersion)
8209{
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008210 VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0;
Lingfeng Yang9d02e102018-11-10 01:51:46 -08008211 vkEnumerateInstanceVersion_VkResult_return = goldfish_vkEnumerateInstanceVersion(pApiVersion);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008212 return vkEnumerateInstanceVersion_VkResult_return;
8213}
8214
8215VkResult VkEncoder::vkBindBufferMemory2(
8216 VkDevice device,
8217 uint32_t bindInfoCount,
8218 const VkBindBufferMemoryInfo* pBindInfos)
8219{
8220 auto stream = mImpl->stream();
8221 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008222 auto resources = mImpl->resources();
8223 auto pool = mImpl->pool();
8224 VkDevice local_device;
8225 local_device = device;
8226 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8227 uint32_t local_bindInfoCount;
8228 local_bindInfoCount = bindInfoCount;
8229 VkBindBufferMemoryInfo* local_pBindInfos;
8230 local_pBindInfos = nullptr;
8231 if (pBindInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008232 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008233 local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008234 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
8235 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008236 deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
8237 }
8238 }
8239 if (local_pBindInfos)
8240 {
8241 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
8242 {
8243 handlemap_VkBindBufferMemoryInfo(resources->unwrapMapping(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
8244 }
8245 }
8246 countingStream->rewind();
8247 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008248 uint64_t cgen_var_550 = (uint64_t)local_device;
8249 countingStream->putBe64(cgen_var_550);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008250 countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
8251 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
8252 {
8253 marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008254 }
8255 }
8256 uint32_t packetSize_vkBindBufferMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8257 countingStream->rewind();
8258 uint32_t opcode_vkBindBufferMemory2 = OP_vkBindBufferMemory2;
8259 stream->write(&opcode_vkBindBufferMemory2, sizeof(uint32_t));
8260 stream->write(&packetSize_vkBindBufferMemory2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008261 uint64_t cgen_var_551 = (uint64_t)local_device;
8262 stream->putBe64(cgen_var_551);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008263 stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008264 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
8265 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008266 marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008267 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008268 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008269 VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0;
8270 stream->read(&vkBindBufferMemory2_VkResult_return, sizeof(VkResult));
8271 return vkBindBufferMemory2_VkResult_return;
8272}
8273
8274VkResult VkEncoder::vkBindImageMemory2(
8275 VkDevice device,
8276 uint32_t bindInfoCount,
8277 const VkBindImageMemoryInfo* pBindInfos)
8278{
8279 auto stream = mImpl->stream();
8280 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008281 auto resources = mImpl->resources();
8282 auto pool = mImpl->pool();
8283 VkDevice local_device;
8284 local_device = device;
8285 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8286 uint32_t local_bindInfoCount;
8287 local_bindInfoCount = bindInfoCount;
8288 VkBindImageMemoryInfo* local_pBindInfos;
8289 local_pBindInfos = nullptr;
8290 if (pBindInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008291 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008292 local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008293 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
8294 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008295 deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
8296 }
8297 }
8298 if (local_pBindInfos)
8299 {
8300 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
8301 {
8302 handlemap_VkBindImageMemoryInfo(resources->unwrapMapping(), (VkBindImageMemoryInfo*)(local_pBindInfos + i));
8303 }
8304 }
8305 countingStream->rewind();
8306 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008307 uint64_t cgen_var_552 = (uint64_t)local_device;
8308 countingStream->putBe64(cgen_var_552);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008309 countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
8310 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
8311 {
8312 marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008313 }
8314 }
8315 uint32_t packetSize_vkBindImageMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8316 countingStream->rewind();
8317 uint32_t opcode_vkBindImageMemory2 = OP_vkBindImageMemory2;
8318 stream->write(&opcode_vkBindImageMemory2, sizeof(uint32_t));
8319 stream->write(&packetSize_vkBindImageMemory2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008320 uint64_t cgen_var_553 = (uint64_t)local_device;
8321 stream->putBe64(cgen_var_553);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008322 stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008323 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
8324 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008325 marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008326 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008327 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008328 VkResult vkBindImageMemory2_VkResult_return = (VkResult)0;
8329 stream->read(&vkBindImageMemory2_VkResult_return, sizeof(VkResult));
8330 return vkBindImageMemory2_VkResult_return;
8331}
8332
8333void VkEncoder::vkGetDeviceGroupPeerMemoryFeatures(
8334 VkDevice device,
8335 uint32_t heapIndex,
8336 uint32_t localDeviceIndex,
8337 uint32_t remoteDeviceIndex,
8338 VkPeerMemoryFeatureFlags* pPeerMemoryFeatures)
8339{
8340 auto stream = mImpl->stream();
8341 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008342 auto resources = mImpl->resources();
8343 auto pool = mImpl->pool();
8344 VkDevice local_device;
8345 local_device = device;
8346 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8347 uint32_t local_heapIndex;
8348 local_heapIndex = heapIndex;
8349 uint32_t local_localDeviceIndex;
8350 local_localDeviceIndex = localDeviceIndex;
8351 uint32_t local_remoteDeviceIndex;
8352 local_remoteDeviceIndex = remoteDeviceIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008353 countingStream->rewind();
8354 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008355 uint64_t cgen_var_554 = (uint64_t)local_device;
8356 countingStream->putBe64(cgen_var_554);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008357 countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
8358 countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
8359 countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008360 countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
8361 }
8362 uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8363 countingStream->rewind();
8364 uint32_t opcode_vkGetDeviceGroupPeerMemoryFeatures = OP_vkGetDeviceGroupPeerMemoryFeatures;
8365 stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t));
8366 stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008367 uint64_t cgen_var_555 = (uint64_t)local_device;
8368 stream->putBe64(cgen_var_555);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008369 stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
8370 stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
8371 stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008372 stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
8373 stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008374 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008375}
8376
8377void VkEncoder::vkCmdSetDeviceMask(
8378 VkCommandBuffer commandBuffer,
8379 uint32_t deviceMask)
8380{
8381 auto stream = mImpl->stream();
8382 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008383 auto resources = mImpl->resources();
8384 auto pool = mImpl->pool();
8385 VkCommandBuffer local_commandBuffer;
8386 local_commandBuffer = commandBuffer;
8387 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
8388 uint32_t local_deviceMask;
8389 local_deviceMask = deviceMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008390 countingStream->rewind();
8391 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008392 uint64_t cgen_var_556 = (uint64_t)local_commandBuffer;
8393 countingStream->putBe64(cgen_var_556);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008394 countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008395 }
8396 uint32_t packetSize_vkCmdSetDeviceMask = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8397 countingStream->rewind();
8398 uint32_t opcode_vkCmdSetDeviceMask = OP_vkCmdSetDeviceMask;
8399 stream->write(&opcode_vkCmdSetDeviceMask, sizeof(uint32_t));
8400 stream->write(&packetSize_vkCmdSetDeviceMask, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008401 uint64_t cgen_var_557 = (uint64_t)local_commandBuffer;
8402 stream->putBe64(cgen_var_557);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008403 stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
8404 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008405}
8406
8407void VkEncoder::vkCmdDispatchBase(
8408 VkCommandBuffer commandBuffer,
8409 uint32_t baseGroupX,
8410 uint32_t baseGroupY,
8411 uint32_t baseGroupZ,
8412 uint32_t groupCountX,
8413 uint32_t groupCountY,
8414 uint32_t groupCountZ)
8415{
8416 auto stream = mImpl->stream();
8417 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008418 auto resources = mImpl->resources();
8419 auto pool = mImpl->pool();
8420 VkCommandBuffer local_commandBuffer;
8421 local_commandBuffer = commandBuffer;
8422 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
8423 uint32_t local_baseGroupX;
8424 local_baseGroupX = baseGroupX;
8425 uint32_t local_baseGroupY;
8426 local_baseGroupY = baseGroupY;
8427 uint32_t local_baseGroupZ;
8428 local_baseGroupZ = baseGroupZ;
8429 uint32_t local_groupCountX;
8430 local_groupCountX = groupCountX;
8431 uint32_t local_groupCountY;
8432 local_groupCountY = groupCountY;
8433 uint32_t local_groupCountZ;
8434 local_groupCountZ = groupCountZ;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008435 countingStream->rewind();
8436 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008437 uint64_t cgen_var_558 = (uint64_t)local_commandBuffer;
8438 countingStream->putBe64(cgen_var_558);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008439 countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
8440 countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
8441 countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
8442 countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
8443 countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
8444 countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008445 }
8446 uint32_t packetSize_vkCmdDispatchBase = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8447 countingStream->rewind();
8448 uint32_t opcode_vkCmdDispatchBase = OP_vkCmdDispatchBase;
8449 stream->write(&opcode_vkCmdDispatchBase, sizeof(uint32_t));
8450 stream->write(&packetSize_vkCmdDispatchBase, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008451 uint64_t cgen_var_559 = (uint64_t)local_commandBuffer;
8452 stream->putBe64(cgen_var_559);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008453 stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
8454 stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
8455 stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
8456 stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
8457 stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
8458 stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
8459 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008460}
8461
8462VkResult VkEncoder::vkEnumeratePhysicalDeviceGroups(
8463 VkInstance instance,
8464 uint32_t* pPhysicalDeviceGroupCount,
8465 VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties)
8466{
8467 auto stream = mImpl->stream();
8468 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008469 auto resources = mImpl->resources();
8470 auto pool = mImpl->pool();
8471 VkInstance local_instance;
8472 local_instance = instance;
8473 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008474 countingStream->rewind();
8475 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008476 uint64_t cgen_var_560 = (uint64_t)local_instance;
8477 countingStream->putBe64(cgen_var_560);
8478 // WARNING PTR CHECK
8479 uint64_t cgen_var_561 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
8480 countingStream->putBe64(cgen_var_561);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008481 if (pPhysicalDeviceGroupCount)
8482 {
8483 countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
8484 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008485 // WARNING PTR CHECK
8486 uint64_t cgen_var_562 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
8487 countingStream->putBe64(cgen_var_562);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008488 if (pPhysicalDeviceGroupProperties)
8489 {
8490 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
8491 {
8492 marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
8493 }
8494 }
8495 }
8496 uint32_t packetSize_vkEnumeratePhysicalDeviceGroups = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8497 countingStream->rewind();
8498 uint32_t opcode_vkEnumeratePhysicalDeviceGroups = OP_vkEnumeratePhysicalDeviceGroups;
8499 stream->write(&opcode_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t));
8500 stream->write(&packetSize_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008501 uint64_t cgen_var_563 = (uint64_t)local_instance;
8502 stream->putBe64(cgen_var_563);
8503 // WARNING PTR CHECK
8504 uint64_t cgen_var_564 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
8505 stream->putBe64(cgen_var_564);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008506 if (pPhysicalDeviceGroupCount)
8507 {
8508 stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
8509 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008510 // WARNING PTR CHECK
8511 uint64_t cgen_var_565 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
8512 stream->putBe64(cgen_var_565);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008513 if (pPhysicalDeviceGroupProperties)
8514 {
8515 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
8516 {
8517 marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
8518 }
8519 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008520 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008521 uint32_t* check_pPhysicalDeviceGroupCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008522 check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008523 if (pPhysicalDeviceGroupCount)
8524 {
8525 if (!(check_pPhysicalDeviceGroupCount))
8526 {
8527 fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n");
8528 }
8529 stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
8530 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008531 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008532 VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008533 check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008534 if (pPhysicalDeviceGroupProperties)
8535 {
8536 if (!(check_pPhysicalDeviceGroupProperties))
8537 {
8538 fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n");
8539 }
8540 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
8541 {
8542 unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
8543 }
8544 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008545 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008546 VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0;
8547 stream->read(&vkEnumeratePhysicalDeviceGroups_VkResult_return, sizeof(VkResult));
8548 return vkEnumeratePhysicalDeviceGroups_VkResult_return;
8549}
8550
8551void VkEncoder::vkGetImageMemoryRequirements2(
8552 VkDevice device,
8553 const VkImageMemoryRequirementsInfo2* pInfo,
8554 VkMemoryRequirements2* pMemoryRequirements)
8555{
8556 auto stream = mImpl->stream();
8557 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008558 auto resources = mImpl->resources();
8559 auto pool = mImpl->pool();
8560 VkDevice local_device;
8561 local_device = device;
8562 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8563 VkImageMemoryRequirementsInfo2* local_pInfo;
8564 local_pInfo = nullptr;
8565 if (pInfo)
8566 {
8567 local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2));
8568 deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
8569 }
8570 if (local_pInfo)
8571 {
8572 handlemap_VkImageMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageMemoryRequirementsInfo2*)(local_pInfo));
8573 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008574 countingStream->rewind();
8575 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008576 uint64_t cgen_var_568 = (uint64_t)local_device;
8577 countingStream->putBe64(cgen_var_568);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008578 marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008579 marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
8580 }
8581 uint32_t packetSize_vkGetImageMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8582 countingStream->rewind();
8583 uint32_t opcode_vkGetImageMemoryRequirements2 = OP_vkGetImageMemoryRequirements2;
8584 stream->write(&opcode_vkGetImageMemoryRequirements2, sizeof(uint32_t));
8585 stream->write(&packetSize_vkGetImageMemoryRequirements2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008586 uint64_t cgen_var_569 = (uint64_t)local_device;
8587 stream->putBe64(cgen_var_569);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008588 marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008589 marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
8590 unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008591 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008592}
8593
8594void VkEncoder::vkGetBufferMemoryRequirements2(
8595 VkDevice device,
8596 const VkBufferMemoryRequirementsInfo2* pInfo,
8597 VkMemoryRequirements2* pMemoryRequirements)
8598{
8599 auto stream = mImpl->stream();
8600 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008601 auto resources = mImpl->resources();
8602 auto pool = mImpl->pool();
8603 VkDevice local_device;
8604 local_device = device;
8605 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8606 VkBufferMemoryRequirementsInfo2* local_pInfo;
8607 local_pInfo = nullptr;
8608 if (pInfo)
8609 {
8610 local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2));
8611 deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
8612 }
8613 if (local_pInfo)
8614 {
8615 handlemap_VkBufferMemoryRequirementsInfo2(resources->unwrapMapping(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
8616 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008617 countingStream->rewind();
8618 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008619 uint64_t cgen_var_570 = (uint64_t)local_device;
8620 countingStream->putBe64(cgen_var_570);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008621 marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008622 marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
8623 }
8624 uint32_t packetSize_vkGetBufferMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8625 countingStream->rewind();
8626 uint32_t opcode_vkGetBufferMemoryRequirements2 = OP_vkGetBufferMemoryRequirements2;
8627 stream->write(&opcode_vkGetBufferMemoryRequirements2, sizeof(uint32_t));
8628 stream->write(&packetSize_vkGetBufferMemoryRequirements2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008629 uint64_t cgen_var_571 = (uint64_t)local_device;
8630 stream->putBe64(cgen_var_571);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008631 marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008632 marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
8633 unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008634 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008635}
8636
8637void VkEncoder::vkGetImageSparseMemoryRequirements2(
8638 VkDevice device,
8639 const VkImageSparseMemoryRequirementsInfo2* pInfo,
8640 uint32_t* pSparseMemoryRequirementCount,
8641 VkSparseImageMemoryRequirements2* pSparseMemoryRequirements)
8642{
8643 auto stream = mImpl->stream();
8644 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008645 auto resources = mImpl->resources();
8646 auto pool = mImpl->pool();
8647 VkDevice local_device;
8648 local_device = device;
8649 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8650 VkImageSparseMemoryRequirementsInfo2* local_pInfo;
8651 local_pInfo = nullptr;
8652 if (pInfo)
8653 {
8654 local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2));
8655 deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
8656 }
8657 if (local_pInfo)
8658 {
8659 handlemap_VkImageSparseMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
8660 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008661 countingStream->rewind();
8662 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008663 uint64_t cgen_var_572 = (uint64_t)local_device;
8664 countingStream->putBe64(cgen_var_572);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008665 marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008666 // WARNING PTR CHECK
8667 uint64_t cgen_var_573 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
8668 countingStream->putBe64(cgen_var_573);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008669 if (pSparseMemoryRequirementCount)
8670 {
8671 countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
8672 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008673 // WARNING PTR CHECK
8674 uint64_t cgen_var_574 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
8675 countingStream->putBe64(cgen_var_574);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008676 if (pSparseMemoryRequirements)
8677 {
8678 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
8679 {
8680 marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
8681 }
8682 }
8683 }
8684 uint32_t packetSize_vkGetImageSparseMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8685 countingStream->rewind();
8686 uint32_t opcode_vkGetImageSparseMemoryRequirements2 = OP_vkGetImageSparseMemoryRequirements2;
8687 stream->write(&opcode_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t));
8688 stream->write(&packetSize_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008689 uint64_t cgen_var_575 = (uint64_t)local_device;
8690 stream->putBe64(cgen_var_575);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008691 marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008692 // WARNING PTR CHECK
8693 uint64_t cgen_var_576 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
8694 stream->putBe64(cgen_var_576);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008695 if (pSparseMemoryRequirementCount)
8696 {
8697 stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
8698 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008699 // WARNING PTR CHECK
8700 uint64_t cgen_var_577 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
8701 stream->putBe64(cgen_var_577);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008702 if (pSparseMemoryRequirements)
8703 {
8704 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
8705 {
8706 marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
8707 }
8708 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008709 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008710 uint32_t* check_pSparseMemoryRequirementCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008711 check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008712 if (pSparseMemoryRequirementCount)
8713 {
8714 if (!(check_pSparseMemoryRequirementCount))
8715 {
8716 fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n");
8717 }
8718 stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
8719 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008720 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008721 VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008722 check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008723 if (pSparseMemoryRequirements)
8724 {
8725 if (!(check_pSparseMemoryRequirements))
8726 {
8727 fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n");
8728 }
8729 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
8730 {
8731 unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
8732 }
8733 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008734 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008735}
8736
8737void VkEncoder::vkGetPhysicalDeviceFeatures2(
8738 VkPhysicalDevice physicalDevice,
8739 VkPhysicalDeviceFeatures2* pFeatures)
8740{
8741 auto stream = mImpl->stream();
8742 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008743 auto resources = mImpl->resources();
8744 auto pool = mImpl->pool();
8745 VkPhysicalDevice local_physicalDevice;
8746 local_physicalDevice = physicalDevice;
8747 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008748 countingStream->rewind();
8749 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008750 uint64_t cgen_var_580 = (uint64_t)local_physicalDevice;
8751 countingStream->putBe64(cgen_var_580);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008752 marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures));
8753 }
8754 uint32_t packetSize_vkGetPhysicalDeviceFeatures2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8755 countingStream->rewind();
8756 uint32_t opcode_vkGetPhysicalDeviceFeatures2 = OP_vkGetPhysicalDeviceFeatures2;
8757 stream->write(&opcode_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t));
8758 stream->write(&packetSize_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008759 uint64_t cgen_var_581 = (uint64_t)local_physicalDevice;
8760 stream->putBe64(cgen_var_581);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008761 marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
8762 unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008763 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008764}
8765
8766void VkEncoder::vkGetPhysicalDeviceProperties2(
8767 VkPhysicalDevice physicalDevice,
8768 VkPhysicalDeviceProperties2* pProperties)
8769{
Lingfeng Yang9d02e102018-11-10 01:51:46 -08008770 goldfish_vkGetPhysicalDeviceProperties2(physicalDevice, pProperties);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008771}
8772
8773void VkEncoder::vkGetPhysicalDeviceFormatProperties2(
8774 VkPhysicalDevice physicalDevice,
8775 VkFormat format,
8776 VkFormatProperties2* pFormatProperties)
8777{
8778 auto stream = mImpl->stream();
8779 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008780 auto resources = mImpl->resources();
8781 auto pool = mImpl->pool();
8782 VkPhysicalDevice local_physicalDevice;
8783 local_physicalDevice = physicalDevice;
8784 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8785 VkFormat local_format;
8786 local_format = format;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008787 countingStream->rewind();
8788 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008789 uint64_t cgen_var_582 = (uint64_t)local_physicalDevice;
8790 countingStream->putBe64(cgen_var_582);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008791 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008792 marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties));
8793 }
8794 uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8795 countingStream->rewind();
8796 uint32_t opcode_vkGetPhysicalDeviceFormatProperties2 = OP_vkGetPhysicalDeviceFormatProperties2;
8797 stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t));
8798 stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008799 uint64_t cgen_var_583 = (uint64_t)local_physicalDevice;
8800 stream->putBe64(cgen_var_583);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008801 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008802 marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
8803 unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008804 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008805}
8806
8807VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2(
8808 VkPhysicalDevice physicalDevice,
8809 const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
8810 VkImageFormatProperties2* pImageFormatProperties)
8811{
8812 auto stream = mImpl->stream();
8813 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008814 auto resources = mImpl->resources();
8815 auto pool = mImpl->pool();
8816 VkPhysicalDevice local_physicalDevice;
8817 local_physicalDevice = physicalDevice;
8818 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8819 VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo;
8820 local_pImageFormatInfo = nullptr;
8821 if (pImageFormatInfo)
8822 {
8823 local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2));
8824 deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
8825 }
8826 if (local_pImageFormatInfo)
8827 {
8828 handlemap_VkPhysicalDeviceImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
8829 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008830 countingStream->rewind();
8831 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008832 uint64_t cgen_var_584 = (uint64_t)local_physicalDevice;
8833 countingStream->putBe64(cgen_var_584);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008834 marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008835 marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties));
8836 }
8837 uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8838 countingStream->rewind();
8839 uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2 = OP_vkGetPhysicalDeviceImageFormatProperties2;
8840 stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t));
8841 stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008842 uint64_t cgen_var_585 = (uint64_t)local_physicalDevice;
8843 stream->putBe64(cgen_var_585);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008844 marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008845 marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
8846 unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008847 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008848 VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0;
8849 stream->read(&vkGetPhysicalDeviceImageFormatProperties2_VkResult_return, sizeof(VkResult));
8850 return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return;
8851}
8852
8853void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2(
8854 VkPhysicalDevice physicalDevice,
8855 uint32_t* pQueueFamilyPropertyCount,
8856 VkQueueFamilyProperties2* pQueueFamilyProperties)
8857{
8858 auto stream = mImpl->stream();
8859 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008860 auto resources = mImpl->resources();
8861 auto pool = mImpl->pool();
8862 VkPhysicalDevice local_physicalDevice;
8863 local_physicalDevice = physicalDevice;
8864 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008865 countingStream->rewind();
8866 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008867 uint64_t cgen_var_586 = (uint64_t)local_physicalDevice;
8868 countingStream->putBe64(cgen_var_586);
8869 // WARNING PTR CHECK
8870 uint64_t cgen_var_587 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
8871 countingStream->putBe64(cgen_var_587);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008872 if (pQueueFamilyPropertyCount)
8873 {
8874 countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
8875 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008876 // WARNING PTR CHECK
8877 uint64_t cgen_var_588 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
8878 countingStream->putBe64(cgen_var_588);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008879 if (pQueueFamilyProperties)
8880 {
8881 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
8882 {
8883 marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
8884 }
8885 }
8886 }
8887 uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8888 countingStream->rewind();
8889 uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2 = OP_vkGetPhysicalDeviceQueueFamilyProperties2;
8890 stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t));
8891 stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008892 uint64_t cgen_var_589 = (uint64_t)local_physicalDevice;
8893 stream->putBe64(cgen_var_589);
8894 // WARNING PTR CHECK
8895 uint64_t cgen_var_590 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
8896 stream->putBe64(cgen_var_590);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008897 if (pQueueFamilyPropertyCount)
8898 {
8899 stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
8900 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008901 // WARNING PTR CHECK
8902 uint64_t cgen_var_591 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
8903 stream->putBe64(cgen_var_591);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008904 if (pQueueFamilyProperties)
8905 {
8906 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
8907 {
8908 marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
8909 }
8910 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008911 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008912 uint32_t* check_pQueueFamilyPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008913 check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008914 if (pQueueFamilyPropertyCount)
8915 {
8916 if (!(check_pQueueFamilyPropertyCount))
8917 {
8918 fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n");
8919 }
8920 stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
8921 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008922 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008923 VkQueueFamilyProperties2* check_pQueueFamilyProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008924 check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008925 if (pQueueFamilyProperties)
8926 {
8927 if (!(check_pQueueFamilyProperties))
8928 {
8929 fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n");
8930 }
8931 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
8932 {
8933 unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
8934 }
8935 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008936 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008937}
8938
8939void VkEncoder::vkGetPhysicalDeviceMemoryProperties2(
8940 VkPhysicalDevice physicalDevice,
8941 VkPhysicalDeviceMemoryProperties2* pMemoryProperties)
8942{
8943 auto stream = mImpl->stream();
8944 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008945 auto resources = mImpl->resources();
8946 auto pool = mImpl->pool();
8947 VkPhysicalDevice local_physicalDevice;
8948 local_physicalDevice = physicalDevice;
8949 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008950 countingStream->rewind();
8951 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008952 uint64_t cgen_var_594 = (uint64_t)local_physicalDevice;
8953 countingStream->putBe64(cgen_var_594);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008954 marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
8955 }
8956 uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8957 countingStream->rewind();
8958 uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2 = OP_vkGetPhysicalDeviceMemoryProperties2;
8959 stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t));
8960 stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008961 uint64_t cgen_var_595 = (uint64_t)local_physicalDevice;
8962 stream->putBe64(cgen_var_595);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008963 marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
8964 unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008965 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008966}
8967
8968void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2(
8969 VkPhysicalDevice physicalDevice,
8970 const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
8971 uint32_t* pPropertyCount,
8972 VkSparseImageFormatProperties2* pProperties)
8973{
8974 auto stream = mImpl->stream();
8975 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008976 auto resources = mImpl->resources();
8977 auto pool = mImpl->pool();
8978 VkPhysicalDevice local_physicalDevice;
8979 local_physicalDevice = physicalDevice;
8980 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8981 VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo;
8982 local_pFormatInfo = nullptr;
8983 if (pFormatInfo)
8984 {
8985 local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2));
8986 deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
8987 }
8988 if (local_pFormatInfo)
8989 {
8990 handlemap_VkPhysicalDeviceSparseImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
8991 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008992 countingStream->rewind();
8993 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008994 uint64_t cgen_var_596 = (uint64_t)local_physicalDevice;
8995 countingStream->putBe64(cgen_var_596);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008996 marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08008997 // WARNING PTR CHECK
8998 uint64_t cgen_var_597 = (uint64_t)(uintptr_t)pPropertyCount;
8999 countingStream->putBe64(cgen_var_597);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009000 if (pPropertyCount)
9001 {
9002 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
9003 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009004 // WARNING PTR CHECK
9005 uint64_t cgen_var_598 = (uint64_t)(uintptr_t)pProperties;
9006 countingStream->putBe64(cgen_var_598);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009007 if (pProperties)
9008 {
9009 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9010 {
9011 marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i));
9012 }
9013 }
9014 }
9015 uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9016 countingStream->rewind();
9017 uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2 = OP_vkGetPhysicalDeviceSparseImageFormatProperties2;
9018 stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t));
9019 stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009020 uint64_t cgen_var_599 = (uint64_t)local_physicalDevice;
9021 stream->putBe64(cgen_var_599);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009022 marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009023 // WARNING PTR CHECK
9024 uint64_t cgen_var_600 = (uint64_t)(uintptr_t)pPropertyCount;
9025 stream->putBe64(cgen_var_600);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009026 if (pPropertyCount)
9027 {
9028 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
9029 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009030 // WARNING PTR CHECK
9031 uint64_t cgen_var_601 = (uint64_t)(uintptr_t)pProperties;
9032 stream->putBe64(cgen_var_601);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009033 if (pProperties)
9034 {
9035 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9036 {
9037 marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i));
9038 }
9039 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009040 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009041 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009042 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009043 if (pPropertyCount)
9044 {
9045 if (!(check_pPropertyCount))
9046 {
9047 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
9048 }
9049 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
9050 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009051 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009052 VkSparseImageFormatProperties2* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009053 check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009054 if (pProperties)
9055 {
9056 if (!(check_pProperties))
9057 {
9058 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
9059 }
9060 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9061 {
9062 unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i));
9063 }
9064 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009065 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009066}
9067
9068void VkEncoder::vkTrimCommandPool(
9069 VkDevice device,
9070 VkCommandPool commandPool,
9071 VkCommandPoolTrimFlags flags)
9072{
9073 auto stream = mImpl->stream();
9074 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009075 auto resources = mImpl->resources();
9076 auto pool = mImpl->pool();
9077 VkDevice local_device;
9078 local_device = device;
9079 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9080 VkCommandPool local_commandPool;
9081 local_commandPool = commandPool;
9082 resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool);
9083 VkCommandPoolTrimFlags local_flags;
9084 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009085 countingStream->rewind();
9086 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009087 uint64_t cgen_var_604 = (uint64_t)local_device;
9088 countingStream->putBe64(cgen_var_604);
9089 uint64_t cgen_var_605 = (uint64_t)local_commandPool;
9090 countingStream->putBe64(cgen_var_605);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009091 countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009092 }
9093 uint32_t packetSize_vkTrimCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9094 countingStream->rewind();
9095 uint32_t opcode_vkTrimCommandPool = OP_vkTrimCommandPool;
9096 stream->write(&opcode_vkTrimCommandPool, sizeof(uint32_t));
9097 stream->write(&packetSize_vkTrimCommandPool, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009098 uint64_t cgen_var_606 = (uint64_t)local_device;
9099 stream->putBe64(cgen_var_606);
9100 uint64_t cgen_var_607 = (uint64_t)local_commandPool;
9101 stream->putBe64(cgen_var_607);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009102 stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
9103 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009104}
9105
9106void VkEncoder::vkGetDeviceQueue2(
9107 VkDevice device,
9108 const VkDeviceQueueInfo2* pQueueInfo,
9109 VkQueue* pQueue)
9110{
9111 auto stream = mImpl->stream();
9112 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009113 auto resources = mImpl->resources();
9114 auto pool = mImpl->pool();
9115 VkDevice local_device;
9116 local_device = device;
9117 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9118 VkDeviceQueueInfo2* local_pQueueInfo;
9119 local_pQueueInfo = nullptr;
9120 if (pQueueInfo)
9121 {
9122 local_pQueueInfo = (VkDeviceQueueInfo2*)pool->alloc(sizeof(const VkDeviceQueueInfo2));
9123 deepcopy_VkDeviceQueueInfo2(pool, pQueueInfo, (VkDeviceQueueInfo2*)(local_pQueueInfo));
9124 }
9125 if (local_pQueueInfo)
9126 {
9127 handlemap_VkDeviceQueueInfo2(resources->unwrapMapping(), (VkDeviceQueueInfo2*)(local_pQueueInfo));
9128 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009129 countingStream->rewind();
9130 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009131 uint64_t cgen_var_608 = (uint64_t)local_device;
9132 countingStream->putBe64(cgen_var_608);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009133 marshal_VkDeviceQueueInfo2(countingStream, (VkDeviceQueueInfo2*)(local_pQueueInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009134 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009135 countingStream->write((VkQueue*)pQueue, sizeof(VkQueue));
9136 }
9137 uint32_t packetSize_vkGetDeviceQueue2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9138 countingStream->rewind();
9139 uint32_t opcode_vkGetDeviceQueue2 = OP_vkGetDeviceQueue2;
9140 stream->write(&opcode_vkGetDeviceQueue2, sizeof(uint32_t));
9141 stream->write(&packetSize_vkGetDeviceQueue2, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009142 uint64_t cgen_var_609 = (uint64_t)local_device;
9143 stream->putBe64(cgen_var_609);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009144 marshal_VkDeviceQueueInfo2(stream, (VkDeviceQueueInfo2*)(local_pQueueInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009145 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009146 stream->write((VkQueue*)pQueue, sizeof(VkQueue));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009147 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009148 stream->read((VkQueue*)pQueue, sizeof(VkQueue));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009149 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009150}
9151
9152VkResult VkEncoder::vkCreateSamplerYcbcrConversion(
9153 VkDevice device,
9154 const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
9155 const VkAllocationCallbacks* pAllocator,
9156 VkSamplerYcbcrConversion* pYcbcrConversion)
9157{
9158 auto stream = mImpl->stream();
9159 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009160 auto resources = mImpl->resources();
9161 auto pool = mImpl->pool();
9162 VkDevice local_device;
9163 local_device = device;
9164 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9165 VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo;
9166 local_pCreateInfo = nullptr;
9167 if (pCreateInfo)
9168 {
9169 local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo));
9170 deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
9171 }
9172 if (local_pCreateInfo)
9173 {
9174 handlemap_VkSamplerYcbcrConversionCreateInfo(resources->unwrapMapping(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
9175 }
9176 VkAllocationCallbacks* local_pAllocator;
9177 local_pAllocator = nullptr;
9178 if (pAllocator)
9179 {
9180 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
9181 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
9182 }
9183 if (local_pAllocator)
9184 {
9185 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
9186 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08009187 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009188 countingStream->rewind();
9189 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009190 uint64_t cgen_var_610 = (uint64_t)local_device;
9191 countingStream->putBe64(cgen_var_610);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009192 marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009193 // WARNING PTR CHECK
9194 uint64_t cgen_var_611 = (uint64_t)(uintptr_t)local_pAllocator;
9195 countingStream->putBe64(cgen_var_611);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009196 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009197 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009198 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009199 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009200 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009201 countingStream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
9202 }
9203 uint32_t packetSize_vkCreateSamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9204 countingStream->rewind();
9205 uint32_t opcode_vkCreateSamplerYcbcrConversion = OP_vkCreateSamplerYcbcrConversion;
9206 stream->write(&opcode_vkCreateSamplerYcbcrConversion, sizeof(uint32_t));
9207 stream->write(&packetSize_vkCreateSamplerYcbcrConversion, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009208 uint64_t cgen_var_612 = (uint64_t)local_device;
9209 stream->putBe64(cgen_var_612);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009210 marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009211 // WARNING PTR CHECK
9212 uint64_t cgen_var_613 = (uint64_t)(uintptr_t)local_pAllocator;
9213 stream->putBe64(cgen_var_613);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009214 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009215 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009216 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009217 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009218 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009219 stream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009220 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009221 stream->read((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009222 if (pYcbcrConversion)
9223 {
9224 resources->createMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)pYcbcrConversion, 1);
9225 }
9226 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009227 VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0;
9228 stream->read(&vkCreateSamplerYcbcrConversion_VkResult_return, sizeof(VkResult));
9229 return vkCreateSamplerYcbcrConversion_VkResult_return;
9230}
9231
9232void VkEncoder::vkDestroySamplerYcbcrConversion(
9233 VkDevice device,
9234 VkSamplerYcbcrConversion ycbcrConversion,
9235 const VkAllocationCallbacks* pAllocator)
9236{
9237 auto stream = mImpl->stream();
9238 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009239 auto resources = mImpl->resources();
9240 auto pool = mImpl->pool();
9241 VkDevice local_device;
9242 local_device = device;
9243 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08009244 VkSamplerYcbcrConversion local_ycbcrConversion;
9245 local_ycbcrConversion = ycbcrConversion;
9246 resources->unwrapMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&local_ycbcrConversion);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009247 VkAllocationCallbacks* local_pAllocator;
9248 local_pAllocator = nullptr;
9249 if (pAllocator)
9250 {
9251 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
9252 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
9253 }
9254 if (local_pAllocator)
9255 {
9256 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
9257 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08009258 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009259 countingStream->rewind();
9260 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009261 uint64_t cgen_var_614 = (uint64_t)local_device;
9262 countingStream->putBe64(cgen_var_614);
9263 uint64_t cgen_var_615 = (uint64_t)local_ycbcrConversion;
9264 countingStream->putBe64(cgen_var_615);
9265 // WARNING PTR CHECK
9266 uint64_t cgen_var_616 = (uint64_t)(uintptr_t)local_pAllocator;
9267 countingStream->putBe64(cgen_var_616);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009268 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009269 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009270 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009271 }
9272 }
9273 uint32_t packetSize_vkDestroySamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9274 countingStream->rewind();
9275 uint32_t opcode_vkDestroySamplerYcbcrConversion = OP_vkDestroySamplerYcbcrConversion;
9276 stream->write(&opcode_vkDestroySamplerYcbcrConversion, sizeof(uint32_t));
9277 stream->write(&packetSize_vkDestroySamplerYcbcrConversion, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009278 uint64_t cgen_var_617 = (uint64_t)local_device;
9279 stream->putBe64(cgen_var_617);
9280 uint64_t cgen_var_618 = (uint64_t)local_ycbcrConversion;
9281 stream->putBe64(cgen_var_618);
9282 // WARNING PTR CHECK
9283 uint64_t cgen_var_619 = (uint64_t)(uintptr_t)local_pAllocator;
9284 stream->putBe64(cgen_var_619);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009285 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009286 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009287 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009288 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009289 resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion);
9290 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009291}
9292
9293VkResult VkEncoder::vkCreateDescriptorUpdateTemplate(
9294 VkDevice device,
9295 const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
9296 const VkAllocationCallbacks* pAllocator,
9297 VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate)
9298{
9299 auto stream = mImpl->stream();
9300 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009301 auto resources = mImpl->resources();
9302 auto pool = mImpl->pool();
9303 VkDevice local_device;
9304 local_device = device;
9305 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9306 VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo;
9307 local_pCreateInfo = nullptr;
9308 if (pCreateInfo)
9309 {
9310 local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo));
9311 deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
9312 }
9313 if (local_pCreateInfo)
9314 {
9315 handlemap_VkDescriptorUpdateTemplateCreateInfo(resources->unwrapMapping(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
9316 }
9317 VkAllocationCallbacks* local_pAllocator;
9318 local_pAllocator = nullptr;
9319 if (pAllocator)
9320 {
9321 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
9322 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
9323 }
9324 if (local_pAllocator)
9325 {
9326 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
9327 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08009328 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009329 countingStream->rewind();
9330 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009331 uint64_t cgen_var_620 = (uint64_t)local_device;
9332 countingStream->putBe64(cgen_var_620);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009333 marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009334 // WARNING PTR CHECK
9335 uint64_t cgen_var_621 = (uint64_t)(uintptr_t)local_pAllocator;
9336 countingStream->putBe64(cgen_var_621);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009337 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009338 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009339 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009340 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009341 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009342 countingStream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
9343 }
9344 uint32_t packetSize_vkCreateDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9345 countingStream->rewind();
9346 uint32_t opcode_vkCreateDescriptorUpdateTemplate = OP_vkCreateDescriptorUpdateTemplate;
9347 stream->write(&opcode_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t));
9348 stream->write(&packetSize_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009349 uint64_t cgen_var_622 = (uint64_t)local_device;
9350 stream->putBe64(cgen_var_622);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009351 marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009352 // WARNING PTR CHECK
9353 uint64_t cgen_var_623 = (uint64_t)(uintptr_t)local_pAllocator;
9354 stream->putBe64(cgen_var_623);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009355 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009356 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009357 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009358 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009359 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009360 stream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009361 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009362 stream->read((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009363 if (pDescriptorUpdateTemplate)
9364 {
9365 resources->createMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1);
9366 }
9367 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009368 VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0;
9369 stream->read(&vkCreateDescriptorUpdateTemplate_VkResult_return, sizeof(VkResult));
9370 return vkCreateDescriptorUpdateTemplate_VkResult_return;
9371}
9372
9373void VkEncoder::vkDestroyDescriptorUpdateTemplate(
9374 VkDevice device,
9375 VkDescriptorUpdateTemplate descriptorUpdateTemplate,
9376 const VkAllocationCallbacks* pAllocator)
9377{
9378 auto stream = mImpl->stream();
9379 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009380 auto resources = mImpl->resources();
9381 auto pool = mImpl->pool();
9382 VkDevice local_device;
9383 local_device = device;
9384 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08009385 VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
9386 local_descriptorUpdateTemplate = descriptorUpdateTemplate;
9387 resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009388 VkAllocationCallbacks* local_pAllocator;
9389 local_pAllocator = nullptr;
9390 if (pAllocator)
9391 {
9392 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
9393 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
9394 }
9395 if (local_pAllocator)
9396 {
9397 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
9398 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08009399 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009400 countingStream->rewind();
9401 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009402 uint64_t cgen_var_624 = (uint64_t)local_device;
9403 countingStream->putBe64(cgen_var_624);
9404 uint64_t cgen_var_625 = (uint64_t)local_descriptorUpdateTemplate;
9405 countingStream->putBe64(cgen_var_625);
9406 // WARNING PTR CHECK
9407 uint64_t cgen_var_626 = (uint64_t)(uintptr_t)local_pAllocator;
9408 countingStream->putBe64(cgen_var_626);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009409 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009410 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009411 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009412 }
9413 }
9414 uint32_t packetSize_vkDestroyDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9415 countingStream->rewind();
9416 uint32_t opcode_vkDestroyDescriptorUpdateTemplate = OP_vkDestroyDescriptorUpdateTemplate;
9417 stream->write(&opcode_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t));
9418 stream->write(&packetSize_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009419 uint64_t cgen_var_627 = (uint64_t)local_device;
9420 stream->putBe64(cgen_var_627);
9421 uint64_t cgen_var_628 = (uint64_t)local_descriptorUpdateTemplate;
9422 stream->putBe64(cgen_var_628);
9423 // WARNING PTR CHECK
9424 uint64_t cgen_var_629 = (uint64_t)(uintptr_t)local_pAllocator;
9425 stream->putBe64(cgen_var_629);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009426 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009427 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009428 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009429 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009430 resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate);
9431 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009432}
9433
9434void VkEncoder::vkUpdateDescriptorSetWithTemplate(
9435 VkDevice device,
9436 VkDescriptorSet descriptorSet,
9437 VkDescriptorUpdateTemplate descriptorUpdateTemplate,
9438 const void* pData)
9439{
9440 auto stream = mImpl->stream();
9441 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009442 auto resources = mImpl->resources();
9443 auto pool = mImpl->pool();
9444 VkDevice local_device;
9445 local_device = device;
9446 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9447 VkDescriptorSet local_descriptorSet;
9448 local_descriptorSet = descriptorSet;
9449 resources->unwrapMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)&local_descriptorSet);
9450 VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
9451 local_descriptorUpdateTemplate = descriptorUpdateTemplate;
9452 resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate);
9453 void* local_pData;
9454 local_pData = nullptr;
9455 if (pData)
9456 {
9457 local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t));
9458 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009459 countingStream->rewind();
9460 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009461 uint64_t cgen_var_630 = (uint64_t)local_device;
9462 countingStream->putBe64(cgen_var_630);
9463 uint64_t cgen_var_631 = (uint64_t)local_descriptorSet;
9464 countingStream->putBe64(cgen_var_631);
9465 uint64_t cgen_var_632 = (uint64_t)local_descriptorUpdateTemplate;
9466 countingStream->putBe64(cgen_var_632);
9467 // WARNING PTR CHECK
9468 uint64_t cgen_var_633 = (uint64_t)(uintptr_t)local_pData;
9469 countingStream->putBe64(cgen_var_633);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009470 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009471 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009472 countingStream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009473 }
9474 }
9475 uint32_t packetSize_vkUpdateDescriptorSetWithTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9476 countingStream->rewind();
9477 uint32_t opcode_vkUpdateDescriptorSetWithTemplate = OP_vkUpdateDescriptorSetWithTemplate;
9478 stream->write(&opcode_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t));
9479 stream->write(&packetSize_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009480 uint64_t cgen_var_634 = (uint64_t)local_device;
9481 stream->putBe64(cgen_var_634);
9482 uint64_t cgen_var_635 = (uint64_t)local_descriptorSet;
9483 stream->putBe64(cgen_var_635);
9484 uint64_t cgen_var_636 = (uint64_t)local_descriptorUpdateTemplate;
9485 stream->putBe64(cgen_var_636);
9486 // WARNING PTR CHECK
9487 uint64_t cgen_var_637 = (uint64_t)(uintptr_t)local_pData;
9488 stream->putBe64(cgen_var_637);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009489 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009490 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009491 stream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009492 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009493 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009494}
9495
9496void VkEncoder::vkGetPhysicalDeviceExternalBufferProperties(
9497 VkPhysicalDevice physicalDevice,
9498 const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
9499 VkExternalBufferProperties* pExternalBufferProperties)
9500{
9501 auto stream = mImpl->stream();
9502 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009503 auto resources = mImpl->resources();
9504 auto pool = mImpl->pool();
9505 VkPhysicalDevice local_physicalDevice;
9506 local_physicalDevice = physicalDevice;
9507 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9508 VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo;
9509 local_pExternalBufferInfo = nullptr;
9510 if (pExternalBufferInfo)
9511 {
9512 local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo));
9513 deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
9514 }
9515 if (local_pExternalBufferInfo)
9516 {
9517 handlemap_VkPhysicalDeviceExternalBufferInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
9518 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009519 countingStream->rewind();
9520 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009521 uint64_t cgen_var_638 = (uint64_t)local_physicalDevice;
9522 countingStream->putBe64(cgen_var_638);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009523 marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009524 marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties));
9525 }
9526 uint32_t packetSize_vkGetPhysicalDeviceExternalBufferProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9527 countingStream->rewind();
9528 uint32_t opcode_vkGetPhysicalDeviceExternalBufferProperties = OP_vkGetPhysicalDeviceExternalBufferProperties;
9529 stream->write(&opcode_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t));
9530 stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009531 uint64_t cgen_var_639 = (uint64_t)local_physicalDevice;
9532 stream->putBe64(cgen_var_639);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009533 marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009534 marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
9535 unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009536 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009537}
9538
9539void VkEncoder::vkGetPhysicalDeviceExternalFenceProperties(
9540 VkPhysicalDevice physicalDevice,
9541 const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
9542 VkExternalFenceProperties* pExternalFenceProperties)
9543{
9544 auto stream = mImpl->stream();
9545 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009546 auto resources = mImpl->resources();
9547 auto pool = mImpl->pool();
9548 VkPhysicalDevice local_physicalDevice;
9549 local_physicalDevice = physicalDevice;
9550 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9551 VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo;
9552 local_pExternalFenceInfo = nullptr;
9553 if (pExternalFenceInfo)
9554 {
9555 local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo));
9556 deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
9557 }
9558 if (local_pExternalFenceInfo)
9559 {
9560 handlemap_VkPhysicalDeviceExternalFenceInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
9561 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009562 countingStream->rewind();
9563 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009564 uint64_t cgen_var_640 = (uint64_t)local_physicalDevice;
9565 countingStream->putBe64(cgen_var_640);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009566 marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009567 marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties));
9568 }
9569 uint32_t packetSize_vkGetPhysicalDeviceExternalFenceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9570 countingStream->rewind();
9571 uint32_t opcode_vkGetPhysicalDeviceExternalFenceProperties = OP_vkGetPhysicalDeviceExternalFenceProperties;
9572 stream->write(&opcode_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t));
9573 stream->write(&packetSize_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009574 uint64_t cgen_var_641 = (uint64_t)local_physicalDevice;
9575 stream->putBe64(cgen_var_641);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009576 marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009577 marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
9578 unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009579 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009580}
9581
9582void VkEncoder::vkGetPhysicalDeviceExternalSemaphoreProperties(
9583 VkPhysicalDevice physicalDevice,
9584 const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
9585 VkExternalSemaphoreProperties* pExternalSemaphoreProperties)
9586{
9587 auto stream = mImpl->stream();
9588 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009589 auto resources = mImpl->resources();
9590 auto pool = mImpl->pool();
9591 VkPhysicalDevice local_physicalDevice;
9592 local_physicalDevice = physicalDevice;
9593 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9594 VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo;
9595 local_pExternalSemaphoreInfo = nullptr;
9596 if (pExternalSemaphoreInfo)
9597 {
9598 local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo));
9599 deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
9600 }
9601 if (local_pExternalSemaphoreInfo)
9602 {
9603 handlemap_VkPhysicalDeviceExternalSemaphoreInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
9604 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009605 countingStream->rewind();
9606 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009607 uint64_t cgen_var_642 = (uint64_t)local_physicalDevice;
9608 countingStream->putBe64(cgen_var_642);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009609 marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009610 marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
9611 }
9612 uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9613 countingStream->rewind();
9614 uint32_t opcode_vkGetPhysicalDeviceExternalSemaphoreProperties = OP_vkGetPhysicalDeviceExternalSemaphoreProperties;
9615 stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t));
9616 stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009617 uint64_t cgen_var_643 = (uint64_t)local_physicalDevice;
9618 stream->putBe64(cgen_var_643);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009619 marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009620 marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
9621 unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009622 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009623}
9624
9625void VkEncoder::vkGetDescriptorSetLayoutSupport(
9626 VkDevice device,
9627 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
9628 VkDescriptorSetLayoutSupport* pSupport)
9629{
9630 auto stream = mImpl->stream();
9631 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009632 auto resources = mImpl->resources();
9633 auto pool = mImpl->pool();
9634 VkDevice local_device;
9635 local_device = device;
9636 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9637 VkDescriptorSetLayoutCreateInfo* local_pCreateInfo;
9638 local_pCreateInfo = nullptr;
9639 if (pCreateInfo)
9640 {
9641 local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo));
9642 deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
9643 }
9644 if (local_pCreateInfo)
9645 {
9646 handlemap_VkDescriptorSetLayoutCreateInfo(resources->unwrapMapping(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
9647 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009648 countingStream->rewind();
9649 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009650 uint64_t cgen_var_644 = (uint64_t)local_device;
9651 countingStream->putBe64(cgen_var_644);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009652 marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009653 marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport));
9654 }
9655 uint32_t packetSize_vkGetDescriptorSetLayoutSupport = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9656 countingStream->rewind();
9657 uint32_t opcode_vkGetDescriptorSetLayoutSupport = OP_vkGetDescriptorSetLayoutSupport;
9658 stream->write(&opcode_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t));
9659 stream->write(&packetSize_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009660 uint64_t cgen_var_645 = (uint64_t)local_device;
9661 stream->putBe64(cgen_var_645);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009662 marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009663 marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
9664 unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009665 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009666}
9667
9668#endif
9669#ifdef VK_KHR_surface
9670void VkEncoder::vkDestroySurfaceKHR(
9671 VkInstance instance,
9672 VkSurfaceKHR surface,
9673 const VkAllocationCallbacks* pAllocator)
9674{
9675 auto stream = mImpl->stream();
9676 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009677 auto resources = mImpl->resources();
9678 auto pool = mImpl->pool();
9679 VkInstance local_instance;
9680 local_instance = instance;
9681 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
Lingfeng Yang9d02e102018-11-10 01:51:46 -08009682 VkSurfaceKHR local_surface;
9683 local_surface = surface;
9684 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009685 VkAllocationCallbacks* local_pAllocator;
9686 local_pAllocator = nullptr;
9687 if (pAllocator)
9688 {
9689 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
9690 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
9691 }
9692 if (local_pAllocator)
9693 {
9694 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
9695 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -08009696 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009697 countingStream->rewind();
9698 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009699 uint64_t cgen_var_646 = (uint64_t)local_instance;
9700 countingStream->putBe64(cgen_var_646);
9701 uint64_t cgen_var_647 = (uint64_t)local_surface;
9702 countingStream->putBe64(cgen_var_647);
9703 // WARNING PTR CHECK
9704 uint64_t cgen_var_648 = (uint64_t)(uintptr_t)local_pAllocator;
9705 countingStream->putBe64(cgen_var_648);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009706 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009707 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009708 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009709 }
9710 }
9711 uint32_t packetSize_vkDestroySurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9712 countingStream->rewind();
9713 uint32_t opcode_vkDestroySurfaceKHR = OP_vkDestroySurfaceKHR;
9714 stream->write(&opcode_vkDestroySurfaceKHR, sizeof(uint32_t));
9715 stream->write(&packetSize_vkDestroySurfaceKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009716 uint64_t cgen_var_649 = (uint64_t)local_instance;
9717 stream->putBe64(cgen_var_649);
9718 uint64_t cgen_var_650 = (uint64_t)local_surface;
9719 stream->putBe64(cgen_var_650);
9720 // WARNING PTR CHECK
9721 uint64_t cgen_var_651 = (uint64_t)(uintptr_t)local_pAllocator;
9722 stream->putBe64(cgen_var_651);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009723 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009724 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009725 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009726 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009727 resources->destroyMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&surface);
9728 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009729}
9730
9731VkResult VkEncoder::vkGetPhysicalDeviceSurfaceSupportKHR(
9732 VkPhysicalDevice physicalDevice,
9733 uint32_t queueFamilyIndex,
9734 VkSurfaceKHR surface,
9735 VkBool32* pSupported)
9736{
9737 auto stream = mImpl->stream();
9738 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009739 auto resources = mImpl->resources();
9740 auto pool = mImpl->pool();
9741 VkPhysicalDevice local_physicalDevice;
9742 local_physicalDevice = physicalDevice;
9743 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9744 uint32_t local_queueFamilyIndex;
9745 local_queueFamilyIndex = queueFamilyIndex;
9746 VkSurfaceKHR local_surface;
9747 local_surface = surface;
9748 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009749 countingStream->rewind();
9750 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009751 uint64_t cgen_var_652 = (uint64_t)local_physicalDevice;
9752 countingStream->putBe64(cgen_var_652);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009753 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009754 uint64_t cgen_var_653 = (uint64_t)local_surface;
9755 countingStream->putBe64(cgen_var_653);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009756 countingStream->write((VkBool32*)pSupported, sizeof(VkBool32));
9757 }
9758 uint32_t packetSize_vkGetPhysicalDeviceSurfaceSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9759 countingStream->rewind();
9760 uint32_t opcode_vkGetPhysicalDeviceSurfaceSupportKHR = OP_vkGetPhysicalDeviceSurfaceSupportKHR;
9761 stream->write(&opcode_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t));
9762 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009763 uint64_t cgen_var_654 = (uint64_t)local_physicalDevice;
9764 stream->putBe64(cgen_var_654);
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009765 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009766 uint64_t cgen_var_655 = (uint64_t)local_surface;
9767 stream->putBe64(cgen_var_655);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009768 stream->write((VkBool32*)pSupported, sizeof(VkBool32));
9769 stream->read((VkBool32*)pSupported, sizeof(VkBool32));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009770 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009771 VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0;
9772 stream->read(&vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return, sizeof(VkResult));
9773 return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return;
9774}
9775
9776VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
9777 VkPhysicalDevice physicalDevice,
9778 VkSurfaceKHR surface,
9779 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities)
9780{
9781 auto stream = mImpl->stream();
9782 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009783 auto resources = mImpl->resources();
9784 auto pool = mImpl->pool();
9785 VkPhysicalDevice local_physicalDevice;
9786 local_physicalDevice = physicalDevice;
9787 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9788 VkSurfaceKHR local_surface;
9789 local_surface = surface;
9790 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009791 countingStream->rewind();
9792 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009793 uint64_t cgen_var_656 = (uint64_t)local_physicalDevice;
9794 countingStream->putBe64(cgen_var_656);
9795 uint64_t cgen_var_657 = (uint64_t)local_surface;
9796 countingStream->putBe64(cgen_var_657);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009797 marshal_VkSurfaceCapabilitiesKHR(countingStream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
9798 }
9799 uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9800 countingStream->rewind();
9801 uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
9802 stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t));
9803 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009804 uint64_t cgen_var_658 = (uint64_t)local_physicalDevice;
9805 stream->putBe64(cgen_var_658);
9806 uint64_t cgen_var_659 = (uint64_t)local_surface;
9807 stream->putBe64(cgen_var_659);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009808 marshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
9809 unmarshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009810 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009811 VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0;
9812 stream->read(&vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return, sizeof(VkResult));
9813 return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return;
9814}
9815
9816VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormatsKHR(
9817 VkPhysicalDevice physicalDevice,
9818 VkSurfaceKHR surface,
9819 uint32_t* pSurfaceFormatCount,
9820 VkSurfaceFormatKHR* pSurfaceFormats)
9821{
9822 auto stream = mImpl->stream();
9823 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009824 auto resources = mImpl->resources();
9825 auto pool = mImpl->pool();
9826 VkPhysicalDevice local_physicalDevice;
9827 local_physicalDevice = physicalDevice;
9828 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9829 VkSurfaceKHR local_surface;
9830 local_surface = surface;
9831 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009832 countingStream->rewind();
9833 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009834 uint64_t cgen_var_660 = (uint64_t)local_physicalDevice;
9835 countingStream->putBe64(cgen_var_660);
9836 uint64_t cgen_var_661 = (uint64_t)local_surface;
9837 countingStream->putBe64(cgen_var_661);
9838 // WARNING PTR CHECK
9839 uint64_t cgen_var_662 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
9840 countingStream->putBe64(cgen_var_662);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009841 if (pSurfaceFormatCount)
9842 {
9843 countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
9844 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009845 // WARNING PTR CHECK
9846 uint64_t cgen_var_663 = (uint64_t)(uintptr_t)pSurfaceFormats;
9847 countingStream->putBe64(cgen_var_663);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009848 if (pSurfaceFormats)
9849 {
9850 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
9851 {
9852 marshal_VkSurfaceFormatKHR(countingStream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i));
9853 }
9854 }
9855 }
9856 uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9857 countingStream->rewind();
9858 uint32_t opcode_vkGetPhysicalDeviceSurfaceFormatsKHR = OP_vkGetPhysicalDeviceSurfaceFormatsKHR;
9859 stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t));
9860 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009861 uint64_t cgen_var_664 = (uint64_t)local_physicalDevice;
9862 stream->putBe64(cgen_var_664);
9863 uint64_t cgen_var_665 = (uint64_t)local_surface;
9864 stream->putBe64(cgen_var_665);
9865 // WARNING PTR CHECK
9866 uint64_t cgen_var_666 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
9867 stream->putBe64(cgen_var_666);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009868 if (pSurfaceFormatCount)
9869 {
9870 stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
9871 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009872 // WARNING PTR CHECK
9873 uint64_t cgen_var_667 = (uint64_t)(uintptr_t)pSurfaceFormats;
9874 stream->putBe64(cgen_var_667);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009875 if (pSurfaceFormats)
9876 {
9877 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
9878 {
9879 marshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i));
9880 }
9881 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009882 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009883 uint32_t* check_pSurfaceFormatCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009884 check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009885 if (pSurfaceFormatCount)
9886 {
9887 if (!(check_pSurfaceFormatCount))
9888 {
9889 fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n");
9890 }
9891 stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
9892 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009893 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009894 VkSurfaceFormatKHR* check_pSurfaceFormats;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009895 check_pSurfaceFormats = (VkSurfaceFormatKHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009896 if (pSurfaceFormats)
9897 {
9898 if (!(check_pSurfaceFormats))
9899 {
9900 fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n");
9901 }
9902 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
9903 {
9904 unmarshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i));
9905 }
9906 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009907 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009908 VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0;
9909 stream->read(&vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return, sizeof(VkResult));
9910 return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return;
9911}
9912
9913VkResult VkEncoder::vkGetPhysicalDeviceSurfacePresentModesKHR(
9914 VkPhysicalDevice physicalDevice,
9915 VkSurfaceKHR surface,
9916 uint32_t* pPresentModeCount,
9917 VkPresentModeKHR* pPresentModes)
9918{
9919 auto stream = mImpl->stream();
9920 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009921 auto resources = mImpl->resources();
9922 auto pool = mImpl->pool();
9923 VkPhysicalDevice local_physicalDevice;
9924 local_physicalDevice = physicalDevice;
9925 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9926 VkSurfaceKHR local_surface;
9927 local_surface = surface;
9928 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009929 countingStream->rewind();
9930 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009931 uint64_t cgen_var_670 = (uint64_t)local_physicalDevice;
9932 countingStream->putBe64(cgen_var_670);
9933 uint64_t cgen_var_671 = (uint64_t)local_surface;
9934 countingStream->putBe64(cgen_var_671);
9935 // WARNING PTR CHECK
9936 uint64_t cgen_var_672 = (uint64_t)(uintptr_t)pPresentModeCount;
9937 countingStream->putBe64(cgen_var_672);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009938 if (pPresentModeCount)
9939 {
9940 countingStream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t));
9941 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009942 // WARNING PTR CHECK
9943 uint64_t cgen_var_673 = (uint64_t)(uintptr_t)pPresentModes;
9944 countingStream->putBe64(cgen_var_673);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009945 if (pPresentModes)
9946 {
9947 countingStream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
9948 }
9949 }
9950 uint32_t packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9951 countingStream->rewind();
9952 uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModesKHR = OP_vkGetPhysicalDeviceSurfacePresentModesKHR;
9953 stream->write(&opcode_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t));
9954 stream->write(&packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009955 uint64_t cgen_var_674 = (uint64_t)local_physicalDevice;
9956 stream->putBe64(cgen_var_674);
9957 uint64_t cgen_var_675 = (uint64_t)local_surface;
9958 stream->putBe64(cgen_var_675);
9959 // WARNING PTR CHECK
9960 uint64_t cgen_var_676 = (uint64_t)(uintptr_t)pPresentModeCount;
9961 stream->putBe64(cgen_var_676);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009962 if (pPresentModeCount)
9963 {
9964 stream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t));
9965 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009966 // WARNING PTR CHECK
9967 uint64_t cgen_var_677 = (uint64_t)(uintptr_t)pPresentModes;
9968 stream->putBe64(cgen_var_677);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009969 if (pPresentModes)
9970 {
9971 stream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
9972 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009973 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009974 uint32_t* check_pPresentModeCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009975 check_pPresentModeCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009976 if (pPresentModeCount)
9977 {
9978 if (!(check_pPresentModeCount))
9979 {
9980 fprintf(stderr, "fatal: pPresentModeCount inconsistent between guest and host\n");
9981 }
9982 stream->read((uint32_t*)pPresentModeCount, sizeof(uint32_t));
9983 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009984 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009985 VkPresentModeKHR* check_pPresentModes;
Lingfeng Yang77dc2512018-11-17 12:48:37 -08009986 check_pPresentModes = (VkPresentModeKHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009987 if (pPresentModes)
9988 {
9989 if (!(check_pPresentModes))
9990 {
9991 fprintf(stderr, "fatal: pPresentModes inconsistent between guest and host\n");
9992 }
9993 stream->read((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
9994 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009995 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009996 VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0;
9997 stream->read(&vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return, sizeof(VkResult));
9998 return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return;
9999}
10000
10001#endif
10002#ifdef VK_KHR_swapchain
10003VkResult VkEncoder::vkCreateSwapchainKHR(
10004 VkDevice device,
10005 const VkSwapchainCreateInfoKHR* pCreateInfo,
10006 const VkAllocationCallbacks* pAllocator,
10007 VkSwapchainKHR* pSwapchain)
10008{
10009 auto stream = mImpl->stream();
10010 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010011 auto resources = mImpl->resources();
10012 auto pool = mImpl->pool();
10013 VkDevice local_device;
10014 local_device = device;
10015 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
10016 VkSwapchainCreateInfoKHR* local_pCreateInfo;
10017 local_pCreateInfo = nullptr;
10018 if (pCreateInfo)
10019 {
10020 local_pCreateInfo = (VkSwapchainCreateInfoKHR*)pool->alloc(sizeof(const VkSwapchainCreateInfoKHR));
10021 deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfo, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
10022 }
10023 if (local_pCreateInfo)
10024 {
10025 handlemap_VkSwapchainCreateInfoKHR(resources->unwrapMapping(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
10026 }
10027 VkAllocationCallbacks* local_pAllocator;
10028 local_pAllocator = nullptr;
10029 if (pAllocator)
10030 {
10031 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10032 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10033 }
10034 if (local_pAllocator)
10035 {
10036 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10037 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080010038 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010039 countingStream->rewind();
10040 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010041 uint64_t cgen_var_680 = (uint64_t)local_device;
10042 countingStream->putBe64(cgen_var_680);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010043 marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010044 // WARNING PTR CHECK
10045 uint64_t cgen_var_681 = (uint64_t)(uintptr_t)local_pAllocator;
10046 countingStream->putBe64(cgen_var_681);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010047 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010048 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010049 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010050 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010051 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010052 countingStream->write((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR));
10053 }
10054 uint32_t packetSize_vkCreateSwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10055 countingStream->rewind();
10056 uint32_t opcode_vkCreateSwapchainKHR = OP_vkCreateSwapchainKHR;
10057 stream->write(&opcode_vkCreateSwapchainKHR, sizeof(uint32_t));
10058 stream->write(&packetSize_vkCreateSwapchainKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010059 uint64_t cgen_var_682 = (uint64_t)local_device;
10060 stream->putBe64(cgen_var_682);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010061 marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010062 // WARNING PTR CHECK
10063 uint64_t cgen_var_683 = (uint64_t)(uintptr_t)local_pAllocator;
10064 stream->putBe64(cgen_var_683);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010065 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010066 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010067 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010068 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010069 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010070 stream->write((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010071 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010072 stream->read((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010073 if (pSwapchain)
10074 {
10075 resources->createMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)pSwapchain, 1);
10076 }
10077 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010078 VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0;
10079 stream->read(&vkCreateSwapchainKHR_VkResult_return, sizeof(VkResult));
10080 return vkCreateSwapchainKHR_VkResult_return;
10081}
10082
10083void VkEncoder::vkDestroySwapchainKHR(
10084 VkDevice device,
10085 VkSwapchainKHR swapchain,
10086 const VkAllocationCallbacks* pAllocator)
10087{
10088 auto stream = mImpl->stream();
10089 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010090 auto resources = mImpl->resources();
10091 auto pool = mImpl->pool();
10092 VkDevice local_device;
10093 local_device = device;
10094 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -080010095 VkSwapchainKHR local_swapchain;
10096 local_swapchain = swapchain;
10097 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010098 VkAllocationCallbacks* local_pAllocator;
10099 local_pAllocator = nullptr;
10100 if (pAllocator)
10101 {
10102 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10103 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10104 }
10105 if (local_pAllocator)
10106 {
10107 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10108 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080010109 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010110 countingStream->rewind();
10111 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010112 uint64_t cgen_var_684 = (uint64_t)local_device;
10113 countingStream->putBe64(cgen_var_684);
10114 uint64_t cgen_var_685 = (uint64_t)local_swapchain;
10115 countingStream->putBe64(cgen_var_685);
10116 // WARNING PTR CHECK
10117 uint64_t cgen_var_686 = (uint64_t)(uintptr_t)local_pAllocator;
10118 countingStream->putBe64(cgen_var_686);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010119 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010120 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010121 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010122 }
10123 }
10124 uint32_t packetSize_vkDestroySwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10125 countingStream->rewind();
10126 uint32_t opcode_vkDestroySwapchainKHR = OP_vkDestroySwapchainKHR;
10127 stream->write(&opcode_vkDestroySwapchainKHR, sizeof(uint32_t));
10128 stream->write(&packetSize_vkDestroySwapchainKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010129 uint64_t cgen_var_687 = (uint64_t)local_device;
10130 stream->putBe64(cgen_var_687);
10131 uint64_t cgen_var_688 = (uint64_t)local_swapchain;
10132 stream->putBe64(cgen_var_688);
10133 // WARNING PTR CHECK
10134 uint64_t cgen_var_689 = (uint64_t)(uintptr_t)local_pAllocator;
10135 stream->putBe64(cgen_var_689);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010136 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010137 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010138 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010139 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010140 resources->destroyMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&swapchain);
10141 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010142}
10143
10144VkResult VkEncoder::vkGetSwapchainImagesKHR(
10145 VkDevice device,
10146 VkSwapchainKHR swapchain,
10147 uint32_t* pSwapchainImageCount,
10148 VkImage* pSwapchainImages)
10149{
10150 auto stream = mImpl->stream();
10151 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010152 auto resources = mImpl->resources();
10153 auto pool = mImpl->pool();
10154 VkDevice local_device;
10155 local_device = device;
10156 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
10157 VkSwapchainKHR local_swapchain;
10158 local_swapchain = swapchain;
10159 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010160 countingStream->rewind();
10161 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010162 uint64_t cgen_var_690 = (uint64_t)local_device;
10163 countingStream->putBe64(cgen_var_690);
10164 uint64_t cgen_var_691 = (uint64_t)local_swapchain;
10165 countingStream->putBe64(cgen_var_691);
10166 // WARNING PTR CHECK
10167 uint64_t cgen_var_692 = (uint64_t)(uintptr_t)pSwapchainImageCount;
10168 countingStream->putBe64(cgen_var_692);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010169 if (pSwapchainImageCount)
10170 {
10171 countingStream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t));
10172 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010173 // WARNING PTR CHECK
10174 uint64_t cgen_var_693 = (uint64_t)(uintptr_t)pSwapchainImages;
10175 countingStream->putBe64(cgen_var_693);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010176 if (pSwapchainImages)
10177 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010178 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010179 countingStream->write((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage));
10180 }
10181 }
10182 uint32_t packetSize_vkGetSwapchainImagesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10183 countingStream->rewind();
10184 uint32_t opcode_vkGetSwapchainImagesKHR = OP_vkGetSwapchainImagesKHR;
10185 stream->write(&opcode_vkGetSwapchainImagesKHR, sizeof(uint32_t));
10186 stream->write(&packetSize_vkGetSwapchainImagesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010187 uint64_t cgen_var_694 = (uint64_t)local_device;
10188 stream->putBe64(cgen_var_694);
10189 uint64_t cgen_var_695 = (uint64_t)local_swapchain;
10190 stream->putBe64(cgen_var_695);
10191 // WARNING PTR CHECK
10192 uint64_t cgen_var_696 = (uint64_t)(uintptr_t)pSwapchainImageCount;
10193 stream->putBe64(cgen_var_696);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010194 if (pSwapchainImageCount)
10195 {
10196 stream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t));
10197 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010198 // WARNING PTR CHECK
10199 uint64_t cgen_var_697 = (uint64_t)(uintptr_t)pSwapchainImages;
10200 stream->putBe64(cgen_var_697);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010201 if (pSwapchainImages)
10202 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010203 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010204 stream->write((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage));
10205 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010206 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010207 uint32_t* check_pSwapchainImageCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010208 check_pSwapchainImageCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010209 if (pSwapchainImageCount)
10210 {
10211 if (!(check_pSwapchainImageCount))
10212 {
10213 fprintf(stderr, "fatal: pSwapchainImageCount inconsistent between guest and host\n");
10214 }
10215 stream->read((uint32_t*)pSwapchainImageCount, sizeof(uint32_t));
10216 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010217 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010218 VkImage* check_pSwapchainImages;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010219 check_pSwapchainImages = (VkImage*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010220 if (pSwapchainImages)
10221 {
10222 if (!(check_pSwapchainImages))
10223 {
10224 fprintf(stderr, "fatal: pSwapchainImages inconsistent between guest and host\n");
10225 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010226 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010227 stream->read((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage));
10228 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010229 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010230 VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0;
10231 stream->read(&vkGetSwapchainImagesKHR_VkResult_return, sizeof(VkResult));
10232 return vkGetSwapchainImagesKHR_VkResult_return;
10233}
10234
10235VkResult VkEncoder::vkAcquireNextImageKHR(
10236 VkDevice device,
10237 VkSwapchainKHR swapchain,
10238 uint64_t timeout,
10239 VkSemaphore semaphore,
10240 VkFence fence,
10241 uint32_t* pImageIndex)
10242{
10243 auto stream = mImpl->stream();
10244 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010245 auto resources = mImpl->resources();
10246 auto pool = mImpl->pool();
10247 VkDevice local_device;
10248 local_device = device;
10249 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
10250 VkSwapchainKHR local_swapchain;
10251 local_swapchain = swapchain;
10252 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
10253 uint64_t local_timeout;
10254 local_timeout = timeout;
10255 VkSemaphore local_semaphore;
10256 local_semaphore = semaphore;
10257 resources->unwrapMapping()->mapHandles_VkSemaphore((VkSemaphore*)&local_semaphore);
10258 VkFence local_fence;
10259 local_fence = fence;
10260 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010261 countingStream->rewind();
10262 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010263 uint64_t cgen_var_700 = (uint64_t)local_device;
10264 countingStream->putBe64(cgen_var_700);
10265 uint64_t cgen_var_701 = (uint64_t)local_swapchain;
10266 countingStream->putBe64(cgen_var_701);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010267 countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010268 uint64_t cgen_var_702 = (uint64_t)local_semaphore;
10269 countingStream->putBe64(cgen_var_702);
10270 uint64_t cgen_var_703 = (uint64_t)local_fence;
10271 countingStream->putBe64(cgen_var_703);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010272 countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
10273 }
10274 uint32_t packetSize_vkAcquireNextImageKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10275 countingStream->rewind();
10276 uint32_t opcode_vkAcquireNextImageKHR = OP_vkAcquireNextImageKHR;
10277 stream->write(&opcode_vkAcquireNextImageKHR, sizeof(uint32_t));
10278 stream->write(&packetSize_vkAcquireNextImageKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010279 uint64_t cgen_var_704 = (uint64_t)local_device;
10280 stream->putBe64(cgen_var_704);
10281 uint64_t cgen_var_705 = (uint64_t)local_swapchain;
10282 stream->putBe64(cgen_var_705);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010283 stream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010284 uint64_t cgen_var_706 = (uint64_t)local_semaphore;
10285 stream->putBe64(cgen_var_706);
10286 uint64_t cgen_var_707 = (uint64_t)local_fence;
10287 stream->putBe64(cgen_var_707);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010288 stream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
10289 stream->read((uint32_t*)pImageIndex, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010290 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010291 VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0;
10292 stream->read(&vkAcquireNextImageKHR_VkResult_return, sizeof(VkResult));
10293 return vkAcquireNextImageKHR_VkResult_return;
10294}
10295
10296VkResult VkEncoder::vkQueuePresentKHR(
10297 VkQueue queue,
10298 const VkPresentInfoKHR* pPresentInfo)
10299{
10300 auto stream = mImpl->stream();
10301 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010302 auto resources = mImpl->resources();
10303 auto pool = mImpl->pool();
10304 VkQueue local_queue;
10305 local_queue = queue;
10306 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
10307 VkPresentInfoKHR* local_pPresentInfo;
10308 local_pPresentInfo = nullptr;
10309 if (pPresentInfo)
10310 {
10311 local_pPresentInfo = (VkPresentInfoKHR*)pool->alloc(sizeof(const VkPresentInfoKHR));
10312 deepcopy_VkPresentInfoKHR(pool, pPresentInfo, (VkPresentInfoKHR*)(local_pPresentInfo));
10313 }
10314 if (local_pPresentInfo)
10315 {
10316 handlemap_VkPresentInfoKHR(resources->unwrapMapping(), (VkPresentInfoKHR*)(local_pPresentInfo));
10317 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010318 countingStream->rewind();
10319 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010320 uint64_t cgen_var_708 = (uint64_t)local_queue;
10321 countingStream->putBe64(cgen_var_708);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010322 marshal_VkPresentInfoKHR(countingStream, (VkPresentInfoKHR*)(local_pPresentInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010323 }
10324 uint32_t packetSize_vkQueuePresentKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10325 countingStream->rewind();
10326 uint32_t opcode_vkQueuePresentKHR = OP_vkQueuePresentKHR;
10327 stream->write(&opcode_vkQueuePresentKHR, sizeof(uint32_t));
10328 stream->write(&packetSize_vkQueuePresentKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010329 uint64_t cgen_var_709 = (uint64_t)local_queue;
10330 stream->putBe64(cgen_var_709);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010331 marshal_VkPresentInfoKHR(stream, (VkPresentInfoKHR*)(local_pPresentInfo));
10332 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010333 VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0;
10334 stream->read(&vkQueuePresentKHR_VkResult_return, sizeof(VkResult));
10335 return vkQueuePresentKHR_VkResult_return;
10336}
10337
10338VkResult VkEncoder::vkGetDeviceGroupPresentCapabilitiesKHR(
10339 VkDevice device,
10340 VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities)
10341{
10342 auto stream = mImpl->stream();
10343 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010344 auto resources = mImpl->resources();
10345 auto pool = mImpl->pool();
10346 VkDevice local_device;
10347 local_device = device;
10348 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010349 countingStream->rewind();
10350 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010351 uint64_t cgen_var_710 = (uint64_t)local_device;
10352 countingStream->putBe64(cgen_var_710);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010353 marshal_VkDeviceGroupPresentCapabilitiesKHR(countingStream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
10354 }
10355 uint32_t packetSize_vkGetDeviceGroupPresentCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10356 countingStream->rewind();
10357 uint32_t opcode_vkGetDeviceGroupPresentCapabilitiesKHR = OP_vkGetDeviceGroupPresentCapabilitiesKHR;
10358 stream->write(&opcode_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t));
10359 stream->write(&packetSize_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010360 uint64_t cgen_var_711 = (uint64_t)local_device;
10361 stream->putBe64(cgen_var_711);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010362 marshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
10363 unmarshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010364 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010365 VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0;
10366 stream->read(&vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return, sizeof(VkResult));
10367 return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return;
10368}
10369
10370VkResult VkEncoder::vkGetDeviceGroupSurfacePresentModesKHR(
10371 VkDevice device,
10372 VkSurfaceKHR surface,
10373 VkDeviceGroupPresentModeFlagsKHR* pModes)
10374{
10375 auto stream = mImpl->stream();
10376 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010377 auto resources = mImpl->resources();
10378 auto pool = mImpl->pool();
10379 VkDevice local_device;
10380 local_device = device;
10381 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
10382 VkSurfaceKHR local_surface;
10383 local_surface = surface;
10384 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010385 countingStream->rewind();
10386 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010387 uint64_t cgen_var_712 = (uint64_t)local_device;
10388 countingStream->putBe64(cgen_var_712);
10389 uint64_t cgen_var_713 = (uint64_t)local_surface;
10390 countingStream->putBe64(cgen_var_713);
10391 // WARNING PTR CHECK
10392 uint64_t cgen_var_714 = (uint64_t)(uintptr_t)pModes;
10393 countingStream->putBe64(cgen_var_714);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010394 if (pModes)
10395 {
10396 countingStream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR));
10397 }
10398 }
10399 uint32_t packetSize_vkGetDeviceGroupSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10400 countingStream->rewind();
10401 uint32_t opcode_vkGetDeviceGroupSurfacePresentModesKHR = OP_vkGetDeviceGroupSurfacePresentModesKHR;
10402 stream->write(&opcode_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t));
10403 stream->write(&packetSize_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010404 uint64_t cgen_var_715 = (uint64_t)local_device;
10405 stream->putBe64(cgen_var_715);
10406 uint64_t cgen_var_716 = (uint64_t)local_surface;
10407 stream->putBe64(cgen_var_716);
10408 // WARNING PTR CHECK
10409 uint64_t cgen_var_717 = (uint64_t)(uintptr_t)pModes;
10410 stream->putBe64(cgen_var_717);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010411 if (pModes)
10412 {
10413 stream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR));
10414 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010415 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010416 VkDeviceGroupPresentModeFlagsKHR* check_pModes;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010417 check_pModes = (VkDeviceGroupPresentModeFlagsKHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010418 if (pModes)
10419 {
10420 if (!(check_pModes))
10421 {
10422 fprintf(stderr, "fatal: pModes inconsistent between guest and host\n");
10423 }
10424 stream->read((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR));
10425 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010426 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010427 VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0;
10428 stream->read(&vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return, sizeof(VkResult));
10429 return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return;
10430}
10431
10432VkResult VkEncoder::vkGetPhysicalDevicePresentRectanglesKHR(
10433 VkPhysicalDevice physicalDevice,
10434 VkSurfaceKHR surface,
10435 uint32_t* pRectCount,
10436 VkRect2D* pRects)
10437{
10438 auto stream = mImpl->stream();
10439 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010440 auto resources = mImpl->resources();
10441 auto pool = mImpl->pool();
10442 VkPhysicalDevice local_physicalDevice;
10443 local_physicalDevice = physicalDevice;
10444 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10445 VkSurfaceKHR local_surface;
10446 local_surface = surface;
10447 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010448 countingStream->rewind();
10449 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010450 uint64_t cgen_var_719 = (uint64_t)local_physicalDevice;
10451 countingStream->putBe64(cgen_var_719);
10452 uint64_t cgen_var_720 = (uint64_t)local_surface;
10453 countingStream->putBe64(cgen_var_720);
10454 // WARNING PTR CHECK
10455 uint64_t cgen_var_721 = (uint64_t)(uintptr_t)pRectCount;
10456 countingStream->putBe64(cgen_var_721);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010457 if (pRectCount)
10458 {
10459 countingStream->write((uint32_t*)pRectCount, sizeof(uint32_t));
10460 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010461 // WARNING PTR CHECK
10462 uint64_t cgen_var_722 = (uint64_t)(uintptr_t)pRects;
10463 countingStream->putBe64(cgen_var_722);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010464 if (pRects)
10465 {
10466 for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i)
10467 {
10468 marshal_VkRect2D(countingStream, (VkRect2D*)(pRects + i));
10469 }
10470 }
10471 }
10472 uint32_t packetSize_vkGetPhysicalDevicePresentRectanglesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10473 countingStream->rewind();
10474 uint32_t opcode_vkGetPhysicalDevicePresentRectanglesKHR = OP_vkGetPhysicalDevicePresentRectanglesKHR;
10475 stream->write(&opcode_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t));
10476 stream->write(&packetSize_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010477 uint64_t cgen_var_723 = (uint64_t)local_physicalDevice;
10478 stream->putBe64(cgen_var_723);
10479 uint64_t cgen_var_724 = (uint64_t)local_surface;
10480 stream->putBe64(cgen_var_724);
10481 // WARNING PTR CHECK
10482 uint64_t cgen_var_725 = (uint64_t)(uintptr_t)pRectCount;
10483 stream->putBe64(cgen_var_725);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010484 if (pRectCount)
10485 {
10486 stream->write((uint32_t*)pRectCount, sizeof(uint32_t));
10487 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010488 // WARNING PTR CHECK
10489 uint64_t cgen_var_726 = (uint64_t)(uintptr_t)pRects;
10490 stream->putBe64(cgen_var_726);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010491 if (pRects)
10492 {
10493 for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i)
10494 {
10495 marshal_VkRect2D(stream, (VkRect2D*)(pRects + i));
10496 }
10497 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010498 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010499 uint32_t* check_pRectCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010500 check_pRectCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010501 if (pRectCount)
10502 {
10503 if (!(check_pRectCount))
10504 {
10505 fprintf(stderr, "fatal: pRectCount inconsistent between guest and host\n");
10506 }
10507 stream->read((uint32_t*)pRectCount, sizeof(uint32_t));
10508 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010509 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010510 VkRect2D* check_pRects;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010511 check_pRects = (VkRect2D*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010512 if (pRects)
10513 {
10514 if (!(check_pRects))
10515 {
10516 fprintf(stderr, "fatal: pRects inconsistent between guest and host\n");
10517 }
10518 for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i)
10519 {
10520 unmarshal_VkRect2D(stream, (VkRect2D*)(pRects + i));
10521 }
10522 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010523 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010524 VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0;
10525 stream->read(&vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return, sizeof(VkResult));
10526 return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return;
10527}
10528
10529VkResult VkEncoder::vkAcquireNextImage2KHR(
10530 VkDevice device,
10531 const VkAcquireNextImageInfoKHR* pAcquireInfo,
10532 uint32_t* pImageIndex)
10533{
10534 auto stream = mImpl->stream();
10535 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010536 auto resources = mImpl->resources();
10537 auto pool = mImpl->pool();
10538 VkDevice local_device;
10539 local_device = device;
10540 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
10541 VkAcquireNextImageInfoKHR* local_pAcquireInfo;
10542 local_pAcquireInfo = nullptr;
10543 if (pAcquireInfo)
10544 {
10545 local_pAcquireInfo = (VkAcquireNextImageInfoKHR*)pool->alloc(sizeof(const VkAcquireNextImageInfoKHR));
10546 deepcopy_VkAcquireNextImageInfoKHR(pool, pAcquireInfo, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
10547 }
10548 if (local_pAcquireInfo)
10549 {
10550 handlemap_VkAcquireNextImageInfoKHR(resources->unwrapMapping(), (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
10551 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010552 countingStream->rewind();
10553 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010554 uint64_t cgen_var_729 = (uint64_t)local_device;
10555 countingStream->putBe64(cgen_var_729);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010556 marshal_VkAcquireNextImageInfoKHR(countingStream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010557 countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
10558 }
10559 uint32_t packetSize_vkAcquireNextImage2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10560 countingStream->rewind();
10561 uint32_t opcode_vkAcquireNextImage2KHR = OP_vkAcquireNextImage2KHR;
10562 stream->write(&opcode_vkAcquireNextImage2KHR, sizeof(uint32_t));
10563 stream->write(&packetSize_vkAcquireNextImage2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010564 uint64_t cgen_var_730 = (uint64_t)local_device;
10565 stream->putBe64(cgen_var_730);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010566 marshal_VkAcquireNextImageInfoKHR(stream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010567 stream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
10568 stream->read((uint32_t*)pImageIndex, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010569 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010570 VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0;
10571 stream->read(&vkAcquireNextImage2KHR_VkResult_return, sizeof(VkResult));
10572 return vkAcquireNextImage2KHR_VkResult_return;
10573}
10574
10575#endif
10576#ifdef VK_KHR_display
10577VkResult VkEncoder::vkGetPhysicalDeviceDisplayPropertiesKHR(
10578 VkPhysicalDevice physicalDevice,
10579 uint32_t* pPropertyCount,
10580 VkDisplayPropertiesKHR* pProperties)
10581{
10582 auto stream = mImpl->stream();
10583 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010584 auto resources = mImpl->resources();
10585 auto pool = mImpl->pool();
10586 VkPhysicalDevice local_physicalDevice;
10587 local_physicalDevice = physicalDevice;
10588 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010589 countingStream->rewind();
10590 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010591 uint64_t cgen_var_731 = (uint64_t)local_physicalDevice;
10592 countingStream->putBe64(cgen_var_731);
10593 // WARNING PTR CHECK
10594 uint64_t cgen_var_732 = (uint64_t)(uintptr_t)pPropertyCount;
10595 countingStream->putBe64(cgen_var_732);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010596 if (pPropertyCount)
10597 {
10598 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
10599 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010600 // WARNING PTR CHECK
10601 uint64_t cgen_var_733 = (uint64_t)(uintptr_t)pProperties;
10602 countingStream->putBe64(cgen_var_733);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010603 if (pProperties)
10604 {
10605 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
10606 {
10607 marshal_VkDisplayPropertiesKHR(countingStream, (VkDisplayPropertiesKHR*)(pProperties + i));
10608 }
10609 }
10610 }
10611 uint32_t packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10612 countingStream->rewind();
10613 uint32_t opcode_vkGetPhysicalDeviceDisplayPropertiesKHR = OP_vkGetPhysicalDeviceDisplayPropertiesKHR;
10614 stream->write(&opcode_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t));
10615 stream->write(&packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010616 uint64_t cgen_var_734 = (uint64_t)local_physicalDevice;
10617 stream->putBe64(cgen_var_734);
10618 // WARNING PTR CHECK
10619 uint64_t cgen_var_735 = (uint64_t)(uintptr_t)pPropertyCount;
10620 stream->putBe64(cgen_var_735);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010621 if (pPropertyCount)
10622 {
10623 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
10624 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010625 // WARNING PTR CHECK
10626 uint64_t cgen_var_736 = (uint64_t)(uintptr_t)pProperties;
10627 stream->putBe64(cgen_var_736);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010628 if (pProperties)
10629 {
10630 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
10631 {
10632 marshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i));
10633 }
10634 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010635 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010636 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010637 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010638 if (pPropertyCount)
10639 {
10640 if (!(check_pPropertyCount))
10641 {
10642 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
10643 }
10644 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
10645 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010646 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010647 VkDisplayPropertiesKHR* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010648 check_pProperties = (VkDisplayPropertiesKHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010649 if (pProperties)
10650 {
10651 if (!(check_pProperties))
10652 {
10653 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
10654 }
10655 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
10656 {
10657 unmarshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i));
10658 }
10659 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010660 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010661 VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0;
10662 stream->read(&vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return, sizeof(VkResult));
10663 return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return;
10664}
10665
10666VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
10667 VkPhysicalDevice physicalDevice,
10668 uint32_t* pPropertyCount,
10669 VkDisplayPlanePropertiesKHR* pProperties)
10670{
10671 auto stream = mImpl->stream();
10672 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010673 auto resources = mImpl->resources();
10674 auto pool = mImpl->pool();
10675 VkPhysicalDevice local_physicalDevice;
10676 local_physicalDevice = physicalDevice;
10677 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010678 countingStream->rewind();
10679 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010680 uint64_t cgen_var_739 = (uint64_t)local_physicalDevice;
10681 countingStream->putBe64(cgen_var_739);
10682 // WARNING PTR CHECK
10683 uint64_t cgen_var_740 = (uint64_t)(uintptr_t)pPropertyCount;
10684 countingStream->putBe64(cgen_var_740);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010685 if (pPropertyCount)
10686 {
10687 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
10688 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010689 // WARNING PTR CHECK
10690 uint64_t cgen_var_741 = (uint64_t)(uintptr_t)pProperties;
10691 countingStream->putBe64(cgen_var_741);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010692 if (pProperties)
10693 {
10694 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
10695 {
10696 marshal_VkDisplayPlanePropertiesKHR(countingStream, (VkDisplayPlanePropertiesKHR*)(pProperties + i));
10697 }
10698 }
10699 }
10700 uint32_t packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10701 countingStream->rewind();
10702 uint32_t opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR;
10703 stream->write(&opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t));
10704 stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010705 uint64_t cgen_var_742 = (uint64_t)local_physicalDevice;
10706 stream->putBe64(cgen_var_742);
10707 // WARNING PTR CHECK
10708 uint64_t cgen_var_743 = (uint64_t)(uintptr_t)pPropertyCount;
10709 stream->putBe64(cgen_var_743);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010710 if (pPropertyCount)
10711 {
10712 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
10713 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010714 // WARNING PTR CHECK
10715 uint64_t cgen_var_744 = (uint64_t)(uintptr_t)pProperties;
10716 stream->putBe64(cgen_var_744);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010717 if (pProperties)
10718 {
10719 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
10720 {
10721 marshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i));
10722 }
10723 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010724 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010725 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010726 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010727 if (pPropertyCount)
10728 {
10729 if (!(check_pPropertyCount))
10730 {
10731 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
10732 }
10733 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
10734 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010735 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010736 VkDisplayPlanePropertiesKHR* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010737 check_pProperties = (VkDisplayPlanePropertiesKHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010738 if (pProperties)
10739 {
10740 if (!(check_pProperties))
10741 {
10742 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
10743 }
10744 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
10745 {
10746 unmarshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i));
10747 }
10748 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010749 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010750 VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0;
10751 stream->read(&vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return, sizeof(VkResult));
10752 return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return;
10753}
10754
10755VkResult VkEncoder::vkGetDisplayPlaneSupportedDisplaysKHR(
10756 VkPhysicalDevice physicalDevice,
10757 uint32_t planeIndex,
10758 uint32_t* pDisplayCount,
10759 VkDisplayKHR* pDisplays)
10760{
10761 auto stream = mImpl->stream();
10762 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010763 auto resources = mImpl->resources();
10764 auto pool = mImpl->pool();
10765 VkPhysicalDevice local_physicalDevice;
10766 local_physicalDevice = physicalDevice;
10767 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10768 uint32_t local_planeIndex;
10769 local_planeIndex = planeIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010770 countingStream->rewind();
10771 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010772 uint64_t cgen_var_747 = (uint64_t)local_physicalDevice;
10773 countingStream->putBe64(cgen_var_747);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010774 countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010775 // WARNING PTR CHECK
10776 uint64_t cgen_var_748 = (uint64_t)(uintptr_t)pDisplayCount;
10777 countingStream->putBe64(cgen_var_748);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010778 if (pDisplayCount)
10779 {
10780 countingStream->write((uint32_t*)pDisplayCount, sizeof(uint32_t));
10781 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010782 // WARNING PTR CHECK
10783 uint64_t cgen_var_749 = (uint64_t)(uintptr_t)pDisplays;
10784 countingStream->putBe64(cgen_var_749);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010785 if (pDisplays)
10786 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010787 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010788 countingStream->write((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR));
10789 }
10790 }
10791 uint32_t packetSize_vkGetDisplayPlaneSupportedDisplaysKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10792 countingStream->rewind();
10793 uint32_t opcode_vkGetDisplayPlaneSupportedDisplaysKHR = OP_vkGetDisplayPlaneSupportedDisplaysKHR;
10794 stream->write(&opcode_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t));
10795 stream->write(&packetSize_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010796 uint64_t cgen_var_750 = (uint64_t)local_physicalDevice;
10797 stream->putBe64(cgen_var_750);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010798 stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010799 // WARNING PTR CHECK
10800 uint64_t cgen_var_751 = (uint64_t)(uintptr_t)pDisplayCount;
10801 stream->putBe64(cgen_var_751);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010802 if (pDisplayCount)
10803 {
10804 stream->write((uint32_t*)pDisplayCount, sizeof(uint32_t));
10805 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010806 // WARNING PTR CHECK
10807 uint64_t cgen_var_752 = (uint64_t)(uintptr_t)pDisplays;
10808 stream->putBe64(cgen_var_752);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010809 if (pDisplays)
10810 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010811 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010812 stream->write((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR));
10813 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010814 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010815 uint32_t* check_pDisplayCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010816 check_pDisplayCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010817 if (pDisplayCount)
10818 {
10819 if (!(check_pDisplayCount))
10820 {
10821 fprintf(stderr, "fatal: pDisplayCount inconsistent between guest and host\n");
10822 }
10823 stream->read((uint32_t*)pDisplayCount, sizeof(uint32_t));
10824 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010825 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010826 VkDisplayKHR* check_pDisplays;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010827 check_pDisplays = (VkDisplayKHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010828 if (pDisplays)
10829 {
10830 if (!(check_pDisplays))
10831 {
10832 fprintf(stderr, "fatal: pDisplays inconsistent between guest and host\n");
10833 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010834 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010835 stream->read((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR));
10836 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010837 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010838 VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0;
10839 stream->read(&vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return, sizeof(VkResult));
10840 return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return;
10841}
10842
10843VkResult VkEncoder::vkGetDisplayModePropertiesKHR(
10844 VkPhysicalDevice physicalDevice,
10845 VkDisplayKHR display,
10846 uint32_t* pPropertyCount,
10847 VkDisplayModePropertiesKHR* pProperties)
10848{
10849 auto stream = mImpl->stream();
10850 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010851 auto resources = mImpl->resources();
10852 auto pool = mImpl->pool();
10853 VkPhysicalDevice local_physicalDevice;
10854 local_physicalDevice = physicalDevice;
10855 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10856 VkDisplayKHR local_display;
10857 local_display = display;
10858 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010859 countingStream->rewind();
10860 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010861 uint64_t cgen_var_755 = (uint64_t)local_physicalDevice;
10862 countingStream->putBe64(cgen_var_755);
10863 uint64_t cgen_var_756 = (uint64_t)local_display;
10864 countingStream->putBe64(cgen_var_756);
10865 // WARNING PTR CHECK
10866 uint64_t cgen_var_757 = (uint64_t)(uintptr_t)pPropertyCount;
10867 countingStream->putBe64(cgen_var_757);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010868 if (pPropertyCount)
10869 {
10870 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
10871 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010872 // WARNING PTR CHECK
10873 uint64_t cgen_var_758 = (uint64_t)(uintptr_t)pProperties;
10874 countingStream->putBe64(cgen_var_758);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010875 if (pProperties)
10876 {
10877 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
10878 {
10879 marshal_VkDisplayModePropertiesKHR(countingStream, (VkDisplayModePropertiesKHR*)(pProperties + i));
10880 }
10881 }
10882 }
10883 uint32_t packetSize_vkGetDisplayModePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10884 countingStream->rewind();
10885 uint32_t opcode_vkGetDisplayModePropertiesKHR = OP_vkGetDisplayModePropertiesKHR;
10886 stream->write(&opcode_vkGetDisplayModePropertiesKHR, sizeof(uint32_t));
10887 stream->write(&packetSize_vkGetDisplayModePropertiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010888 uint64_t cgen_var_759 = (uint64_t)local_physicalDevice;
10889 stream->putBe64(cgen_var_759);
10890 uint64_t cgen_var_760 = (uint64_t)local_display;
10891 stream->putBe64(cgen_var_760);
10892 // WARNING PTR CHECK
10893 uint64_t cgen_var_761 = (uint64_t)(uintptr_t)pPropertyCount;
10894 stream->putBe64(cgen_var_761);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010895 if (pPropertyCount)
10896 {
10897 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
10898 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010899 // WARNING PTR CHECK
10900 uint64_t cgen_var_762 = (uint64_t)(uintptr_t)pProperties;
10901 stream->putBe64(cgen_var_762);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010902 if (pProperties)
10903 {
10904 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
10905 {
10906 marshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i));
10907 }
10908 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010909 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010910 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010911 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010912 if (pPropertyCount)
10913 {
10914 if (!(check_pPropertyCount))
10915 {
10916 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
10917 }
10918 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
10919 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010920 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010921 VkDisplayModePropertiesKHR* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010922 check_pProperties = (VkDisplayModePropertiesKHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010923 if (pProperties)
10924 {
10925 if (!(check_pProperties))
10926 {
10927 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
10928 }
10929 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
10930 {
10931 unmarshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i));
10932 }
10933 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010934 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010935 VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0;
10936 stream->read(&vkGetDisplayModePropertiesKHR_VkResult_return, sizeof(VkResult));
10937 return vkGetDisplayModePropertiesKHR_VkResult_return;
10938}
10939
10940VkResult VkEncoder::vkCreateDisplayModeKHR(
10941 VkPhysicalDevice physicalDevice,
10942 VkDisplayKHR display,
10943 const VkDisplayModeCreateInfoKHR* pCreateInfo,
10944 const VkAllocationCallbacks* pAllocator,
10945 VkDisplayModeKHR* pMode)
10946{
10947 auto stream = mImpl->stream();
10948 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010949 auto resources = mImpl->resources();
10950 auto pool = mImpl->pool();
10951 VkPhysicalDevice local_physicalDevice;
10952 local_physicalDevice = physicalDevice;
10953 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10954 VkDisplayKHR local_display;
10955 local_display = display;
10956 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
10957 VkDisplayModeCreateInfoKHR* local_pCreateInfo;
10958 local_pCreateInfo = nullptr;
10959 if (pCreateInfo)
10960 {
10961 local_pCreateInfo = (VkDisplayModeCreateInfoKHR*)pool->alloc(sizeof(const VkDisplayModeCreateInfoKHR));
10962 deepcopy_VkDisplayModeCreateInfoKHR(pool, pCreateInfo, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
10963 }
10964 if (local_pCreateInfo)
10965 {
10966 handlemap_VkDisplayModeCreateInfoKHR(resources->unwrapMapping(), (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
10967 }
10968 VkAllocationCallbacks* local_pAllocator;
10969 local_pAllocator = nullptr;
10970 if (pAllocator)
10971 {
10972 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10973 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10974 }
10975 if (local_pAllocator)
10976 {
10977 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10978 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080010979 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010980 countingStream->rewind();
10981 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010982 uint64_t cgen_var_765 = (uint64_t)local_physicalDevice;
10983 countingStream->putBe64(cgen_var_765);
10984 uint64_t cgen_var_766 = (uint64_t)local_display;
10985 countingStream->putBe64(cgen_var_766);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010986 marshal_VkDisplayModeCreateInfoKHR(countingStream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010987 // WARNING PTR CHECK
10988 uint64_t cgen_var_767 = (uint64_t)(uintptr_t)local_pAllocator;
10989 countingStream->putBe64(cgen_var_767);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010990 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010991 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010992 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010993 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080010994 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010995 countingStream->write((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR));
10996 }
10997 uint32_t packetSize_vkCreateDisplayModeKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10998 countingStream->rewind();
10999 uint32_t opcode_vkCreateDisplayModeKHR = OP_vkCreateDisplayModeKHR;
11000 stream->write(&opcode_vkCreateDisplayModeKHR, sizeof(uint32_t));
11001 stream->write(&packetSize_vkCreateDisplayModeKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011002 uint64_t cgen_var_768 = (uint64_t)local_physicalDevice;
11003 stream->putBe64(cgen_var_768);
11004 uint64_t cgen_var_769 = (uint64_t)local_display;
11005 stream->putBe64(cgen_var_769);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011006 marshal_VkDisplayModeCreateInfoKHR(stream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011007 // WARNING PTR CHECK
11008 uint64_t cgen_var_770 = (uint64_t)(uintptr_t)local_pAllocator;
11009 stream->putBe64(cgen_var_770);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011010 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011011 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011012 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011013 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011014 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011015 stream->write((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011016 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011017 stream->read((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011018 if (pMode)
11019 {
11020 resources->createMapping()->mapHandles_VkDisplayModeKHR((VkDisplayModeKHR*)pMode, 1);
11021 }
11022 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011023 VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0;
11024 stream->read(&vkCreateDisplayModeKHR_VkResult_return, sizeof(VkResult));
11025 return vkCreateDisplayModeKHR_VkResult_return;
11026}
11027
11028VkResult VkEncoder::vkGetDisplayPlaneCapabilitiesKHR(
11029 VkPhysicalDevice physicalDevice,
11030 VkDisplayModeKHR mode,
11031 uint32_t planeIndex,
11032 VkDisplayPlaneCapabilitiesKHR* pCapabilities)
11033{
11034 auto stream = mImpl->stream();
11035 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011036 auto resources = mImpl->resources();
11037 auto pool = mImpl->pool();
11038 VkPhysicalDevice local_physicalDevice;
11039 local_physicalDevice = physicalDevice;
11040 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
11041 VkDisplayModeKHR local_mode;
11042 local_mode = mode;
11043 resources->unwrapMapping()->mapHandles_VkDisplayModeKHR((VkDisplayModeKHR*)&local_mode);
11044 uint32_t local_planeIndex;
11045 local_planeIndex = planeIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011046 countingStream->rewind();
11047 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011048 uint64_t cgen_var_771 = (uint64_t)local_physicalDevice;
11049 countingStream->putBe64(cgen_var_771);
11050 uint64_t cgen_var_772 = (uint64_t)local_mode;
11051 countingStream->putBe64(cgen_var_772);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011052 countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011053 marshal_VkDisplayPlaneCapabilitiesKHR(countingStream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
11054 }
11055 uint32_t packetSize_vkGetDisplayPlaneCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11056 countingStream->rewind();
11057 uint32_t opcode_vkGetDisplayPlaneCapabilitiesKHR = OP_vkGetDisplayPlaneCapabilitiesKHR;
11058 stream->write(&opcode_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t));
11059 stream->write(&packetSize_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011060 uint64_t cgen_var_773 = (uint64_t)local_physicalDevice;
11061 stream->putBe64(cgen_var_773);
11062 uint64_t cgen_var_774 = (uint64_t)local_mode;
11063 stream->putBe64(cgen_var_774);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011064 stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011065 marshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
11066 unmarshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011067 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011068 VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0;
11069 stream->read(&vkGetDisplayPlaneCapabilitiesKHR_VkResult_return, sizeof(VkResult));
11070 return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return;
11071}
11072
11073VkResult VkEncoder::vkCreateDisplayPlaneSurfaceKHR(
11074 VkInstance instance,
11075 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
11076 const VkAllocationCallbacks* pAllocator,
11077 VkSurfaceKHR* pSurface)
11078{
11079 auto stream = mImpl->stream();
11080 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011081 auto resources = mImpl->resources();
11082 auto pool = mImpl->pool();
11083 VkInstance local_instance;
11084 local_instance = instance;
11085 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
11086 VkDisplaySurfaceCreateInfoKHR* local_pCreateInfo;
11087 local_pCreateInfo = nullptr;
11088 if (pCreateInfo)
11089 {
11090 local_pCreateInfo = (VkDisplaySurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkDisplaySurfaceCreateInfoKHR));
11091 deepcopy_VkDisplaySurfaceCreateInfoKHR(pool, pCreateInfo, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
11092 }
11093 if (local_pCreateInfo)
11094 {
11095 handlemap_VkDisplaySurfaceCreateInfoKHR(resources->unwrapMapping(), (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
11096 }
11097 VkAllocationCallbacks* local_pAllocator;
11098 local_pAllocator = nullptr;
11099 if (pAllocator)
11100 {
11101 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
11102 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
11103 }
11104 if (local_pAllocator)
11105 {
11106 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
11107 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080011108 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011109 countingStream->rewind();
11110 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011111 uint64_t cgen_var_775 = (uint64_t)local_instance;
11112 countingStream->putBe64(cgen_var_775);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011113 marshal_VkDisplaySurfaceCreateInfoKHR(countingStream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011114 // WARNING PTR CHECK
11115 uint64_t cgen_var_776 = (uint64_t)(uintptr_t)local_pAllocator;
11116 countingStream->putBe64(cgen_var_776);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011117 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011118 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011119 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011120 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011121 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011122 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
11123 }
11124 uint32_t packetSize_vkCreateDisplayPlaneSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11125 countingStream->rewind();
11126 uint32_t opcode_vkCreateDisplayPlaneSurfaceKHR = OP_vkCreateDisplayPlaneSurfaceKHR;
11127 stream->write(&opcode_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t));
11128 stream->write(&packetSize_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011129 uint64_t cgen_var_777 = (uint64_t)local_instance;
11130 stream->putBe64(cgen_var_777);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011131 marshal_VkDisplaySurfaceCreateInfoKHR(stream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011132 // WARNING PTR CHECK
11133 uint64_t cgen_var_778 = (uint64_t)(uintptr_t)local_pAllocator;
11134 stream->putBe64(cgen_var_778);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011135 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011136 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011137 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011138 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011139 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011140 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011141 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011142 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011143 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011144 VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0;
11145 stream->read(&vkCreateDisplayPlaneSurfaceKHR_VkResult_return, sizeof(VkResult));
11146 return vkCreateDisplayPlaneSurfaceKHR_VkResult_return;
11147}
11148
11149#endif
11150#ifdef VK_KHR_display_swapchain
11151VkResult VkEncoder::vkCreateSharedSwapchainsKHR(
11152 VkDevice device,
11153 uint32_t swapchainCount,
11154 const VkSwapchainCreateInfoKHR* pCreateInfos,
11155 const VkAllocationCallbacks* pAllocator,
11156 VkSwapchainKHR* pSwapchains)
11157{
11158 auto stream = mImpl->stream();
11159 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011160 auto resources = mImpl->resources();
11161 auto pool = mImpl->pool();
11162 VkDevice local_device;
11163 local_device = device;
11164 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11165 uint32_t local_swapchainCount;
11166 local_swapchainCount = swapchainCount;
11167 VkSwapchainCreateInfoKHR* local_pCreateInfos;
11168 local_pCreateInfos = nullptr;
11169 if (pCreateInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011170 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011171 local_pCreateInfos = (VkSwapchainCreateInfoKHR*)pool->alloc(((swapchainCount)) * sizeof(const VkSwapchainCreateInfoKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011172 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
11173 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011174 deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfos + i, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011175 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011176 }
11177 if (local_pCreateInfos)
11178 {
11179 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011180 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011181 handlemap_VkSwapchainCreateInfoKHR(resources->unwrapMapping(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
11182 }
11183 }
11184 VkAllocationCallbacks* local_pAllocator;
11185 local_pAllocator = nullptr;
11186 if (pAllocator)
11187 {
11188 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
11189 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
11190 }
11191 if (local_pAllocator)
11192 {
11193 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
11194 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080011195 local_pAllocator = nullptr;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011196 countingStream->rewind();
11197 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011198 uint64_t cgen_var_779 = (uint64_t)local_device;
11199 countingStream->putBe64(cgen_var_779);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011200 countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
11201 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
11202 {
11203 marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
11204 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011205 // WARNING PTR CHECK
11206 uint64_t cgen_var_780 = (uint64_t)(uintptr_t)local_pAllocator;
11207 countingStream->putBe64(cgen_var_780);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011208 if (local_pAllocator)
11209 {
11210 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011211 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011212 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011213 countingStream->write((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
11214 }
11215 uint32_t packetSize_vkCreateSharedSwapchainsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11216 countingStream->rewind();
11217 uint32_t opcode_vkCreateSharedSwapchainsKHR = OP_vkCreateSharedSwapchainsKHR;
11218 stream->write(&opcode_vkCreateSharedSwapchainsKHR, sizeof(uint32_t));
11219 stream->write(&packetSize_vkCreateSharedSwapchainsKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011220 uint64_t cgen_var_781 = (uint64_t)local_device;
11221 stream->putBe64(cgen_var_781);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011222 stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011223 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
11224 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011225 marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011226 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011227 // WARNING PTR CHECK
11228 uint64_t cgen_var_782 = (uint64_t)(uintptr_t)local_pAllocator;
11229 stream->putBe64(cgen_var_782);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011230 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011231 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011232 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011233 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011234 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011235 stream->write((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011236 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011237 stream->read((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011238 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011239 VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0;
11240 stream->read(&vkCreateSharedSwapchainsKHR_VkResult_return, sizeof(VkResult));
11241 return vkCreateSharedSwapchainsKHR_VkResult_return;
11242}
11243
11244#endif
11245#ifdef VK_KHR_xlib_surface
11246VkResult VkEncoder::vkCreateXlibSurfaceKHR(
11247 VkInstance instance,
11248 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
11249 const VkAllocationCallbacks* pAllocator,
11250 VkSurfaceKHR* pSurface)
11251{
11252 auto stream = mImpl->stream();
11253 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011254 auto resources = mImpl->resources();
11255 auto pool = mImpl->pool();
11256 VkInstance local_instance;
11257 local_instance = instance;
11258 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
11259 VkXlibSurfaceCreateInfoKHR* local_pCreateInfo;
11260 local_pCreateInfo = nullptr;
11261 if (pCreateInfo)
11262 {
11263 local_pCreateInfo = (VkXlibSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXlibSurfaceCreateInfoKHR));
11264 deepcopy_VkXlibSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
11265 }
11266 if (local_pCreateInfo)
11267 {
11268 handlemap_VkXlibSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
11269 }
11270 VkAllocationCallbacks* local_pAllocator;
11271 local_pAllocator = nullptr;
11272 if (pAllocator)
11273 {
11274 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
11275 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
11276 }
11277 if (local_pAllocator)
11278 {
11279 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
11280 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080011281 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011282 countingStream->rewind();
11283 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011284 uint64_t cgen_var_783 = (uint64_t)local_instance;
11285 countingStream->putBe64(cgen_var_783);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011286 marshal_VkXlibSurfaceCreateInfoKHR(countingStream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011287 // WARNING PTR CHECK
11288 uint64_t cgen_var_784 = (uint64_t)(uintptr_t)local_pAllocator;
11289 countingStream->putBe64(cgen_var_784);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011290 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011291 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011292 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011293 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011294 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011295 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
11296 }
11297 uint32_t packetSize_vkCreateXlibSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11298 countingStream->rewind();
11299 uint32_t opcode_vkCreateXlibSurfaceKHR = OP_vkCreateXlibSurfaceKHR;
11300 stream->write(&opcode_vkCreateXlibSurfaceKHR, sizeof(uint32_t));
11301 stream->write(&packetSize_vkCreateXlibSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011302 uint64_t cgen_var_785 = (uint64_t)local_instance;
11303 stream->putBe64(cgen_var_785);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011304 marshal_VkXlibSurfaceCreateInfoKHR(stream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011305 // WARNING PTR CHECK
11306 uint64_t cgen_var_786 = (uint64_t)(uintptr_t)local_pAllocator;
11307 stream->putBe64(cgen_var_786);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011308 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011309 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011310 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011311 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011312 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011313 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011314 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011315 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011316 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011317 VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0;
11318 stream->read(&vkCreateXlibSurfaceKHR_VkResult_return, sizeof(VkResult));
11319 return vkCreateXlibSurfaceKHR_VkResult_return;
11320}
11321
11322VkBool32 VkEncoder::vkGetPhysicalDeviceXlibPresentationSupportKHR(
11323 VkPhysicalDevice physicalDevice,
11324 uint32_t queueFamilyIndex,
11325 Display* dpy,
11326 VisualID visualID)
11327{
11328 auto stream = mImpl->stream();
11329 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011330 auto resources = mImpl->resources();
11331 auto pool = mImpl->pool();
11332 VkPhysicalDevice local_physicalDevice;
11333 local_physicalDevice = physicalDevice;
11334 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
11335 uint32_t local_queueFamilyIndex;
11336 local_queueFamilyIndex = queueFamilyIndex;
11337 VisualID local_visualID;
11338 local_visualID = visualID;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011339 countingStream->rewind();
11340 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011341 uint64_t cgen_var_787 = (uint64_t)local_physicalDevice;
11342 countingStream->putBe64(cgen_var_787);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011343 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011344 countingStream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011345 countingStream->write((VisualID*)&local_visualID, sizeof(VisualID));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011346 }
11347 uint32_t packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11348 countingStream->rewind();
11349 uint32_t opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR = OP_vkGetPhysicalDeviceXlibPresentationSupportKHR;
11350 stream->write(&opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t));
11351 stream->write(&packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011352 uint64_t cgen_var_788 = (uint64_t)local_physicalDevice;
11353 stream->putBe64(cgen_var_788);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011354 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011355 stream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011356 stream->write((VisualID*)&local_visualID, sizeof(VisualID));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011357 stream->read((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011358 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011359 VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0;
11360 stream->read(&vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
11361 return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return;
11362}
11363
11364#endif
11365#ifdef VK_KHR_xcb_surface
11366VkResult VkEncoder::vkCreateXcbSurfaceKHR(
11367 VkInstance instance,
11368 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
11369 const VkAllocationCallbacks* pAllocator,
11370 VkSurfaceKHR* pSurface)
11371{
11372 auto stream = mImpl->stream();
11373 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011374 auto resources = mImpl->resources();
11375 auto pool = mImpl->pool();
11376 VkInstance local_instance;
11377 local_instance = instance;
11378 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
11379 VkXcbSurfaceCreateInfoKHR* local_pCreateInfo;
11380 local_pCreateInfo = nullptr;
11381 if (pCreateInfo)
11382 {
11383 local_pCreateInfo = (VkXcbSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXcbSurfaceCreateInfoKHR));
11384 deepcopy_VkXcbSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
11385 }
11386 if (local_pCreateInfo)
11387 {
11388 handlemap_VkXcbSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
11389 }
11390 VkAllocationCallbacks* local_pAllocator;
11391 local_pAllocator = nullptr;
11392 if (pAllocator)
11393 {
11394 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
11395 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
11396 }
11397 if (local_pAllocator)
11398 {
11399 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
11400 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080011401 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011402 countingStream->rewind();
11403 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011404 uint64_t cgen_var_789 = (uint64_t)local_instance;
11405 countingStream->putBe64(cgen_var_789);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011406 marshal_VkXcbSurfaceCreateInfoKHR(countingStream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011407 // WARNING PTR CHECK
11408 uint64_t cgen_var_790 = (uint64_t)(uintptr_t)local_pAllocator;
11409 countingStream->putBe64(cgen_var_790);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011410 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011411 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011412 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011413 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011414 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011415 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
11416 }
11417 uint32_t packetSize_vkCreateXcbSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11418 countingStream->rewind();
11419 uint32_t opcode_vkCreateXcbSurfaceKHR = OP_vkCreateXcbSurfaceKHR;
11420 stream->write(&opcode_vkCreateXcbSurfaceKHR, sizeof(uint32_t));
11421 stream->write(&packetSize_vkCreateXcbSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011422 uint64_t cgen_var_791 = (uint64_t)local_instance;
11423 stream->putBe64(cgen_var_791);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011424 marshal_VkXcbSurfaceCreateInfoKHR(stream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011425 // WARNING PTR CHECK
11426 uint64_t cgen_var_792 = (uint64_t)(uintptr_t)local_pAllocator;
11427 stream->putBe64(cgen_var_792);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011428 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011429 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011430 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011431 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011432 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011433 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011434 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011435 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011436 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011437 VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0;
11438 stream->read(&vkCreateXcbSurfaceKHR_VkResult_return, sizeof(VkResult));
11439 return vkCreateXcbSurfaceKHR_VkResult_return;
11440}
11441
11442VkBool32 VkEncoder::vkGetPhysicalDeviceXcbPresentationSupportKHR(
11443 VkPhysicalDevice physicalDevice,
11444 uint32_t queueFamilyIndex,
11445 xcb_connection_t* connection,
11446 xcb_visualid_t visual_id)
11447{
11448 auto stream = mImpl->stream();
11449 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011450 auto resources = mImpl->resources();
11451 auto pool = mImpl->pool();
11452 VkPhysicalDevice local_physicalDevice;
11453 local_physicalDevice = physicalDevice;
11454 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
11455 uint32_t local_queueFamilyIndex;
11456 local_queueFamilyIndex = queueFamilyIndex;
11457 xcb_visualid_t local_visual_id;
11458 local_visual_id = visual_id;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011459 countingStream->rewind();
11460 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011461 uint64_t cgen_var_793 = (uint64_t)local_physicalDevice;
11462 countingStream->putBe64(cgen_var_793);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011463 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011464 countingStream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011465 countingStream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011466 }
11467 uint32_t packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11468 countingStream->rewind();
11469 uint32_t opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR = OP_vkGetPhysicalDeviceXcbPresentationSupportKHR;
11470 stream->write(&opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t));
11471 stream->write(&packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011472 uint64_t cgen_var_794 = (uint64_t)local_physicalDevice;
11473 stream->putBe64(cgen_var_794);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011474 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011475 stream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011476 stream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011477 stream->read((xcb_connection_t*)connection, sizeof(xcb_connection_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011478 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011479 VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0;
11480 stream->read(&vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
11481 return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return;
11482}
11483
11484#endif
11485#ifdef VK_KHR_wayland_surface
11486VkResult VkEncoder::vkCreateWaylandSurfaceKHR(
11487 VkInstance instance,
11488 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
11489 const VkAllocationCallbacks* pAllocator,
11490 VkSurfaceKHR* pSurface)
11491{
11492 auto stream = mImpl->stream();
11493 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011494 auto resources = mImpl->resources();
11495 auto pool = mImpl->pool();
11496 VkInstance local_instance;
11497 local_instance = instance;
11498 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
11499 VkWaylandSurfaceCreateInfoKHR* local_pCreateInfo;
11500 local_pCreateInfo = nullptr;
11501 if (pCreateInfo)
11502 {
11503 local_pCreateInfo = (VkWaylandSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWaylandSurfaceCreateInfoKHR));
11504 deepcopy_VkWaylandSurfaceCreateInfoKHR(pool, pCreateInfo, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
11505 }
11506 if (local_pCreateInfo)
11507 {
11508 handlemap_VkWaylandSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
11509 }
11510 VkAllocationCallbacks* local_pAllocator;
11511 local_pAllocator = nullptr;
11512 if (pAllocator)
11513 {
11514 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
11515 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
11516 }
11517 if (local_pAllocator)
11518 {
11519 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
11520 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080011521 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011522 countingStream->rewind();
11523 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011524 uint64_t cgen_var_795 = (uint64_t)local_instance;
11525 countingStream->putBe64(cgen_var_795);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011526 marshal_VkWaylandSurfaceCreateInfoKHR(countingStream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011527 // WARNING PTR CHECK
11528 uint64_t cgen_var_796 = (uint64_t)(uintptr_t)local_pAllocator;
11529 countingStream->putBe64(cgen_var_796);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011530 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011531 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011532 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011533 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011534 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011535 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
11536 }
11537 uint32_t packetSize_vkCreateWaylandSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11538 countingStream->rewind();
11539 uint32_t opcode_vkCreateWaylandSurfaceKHR = OP_vkCreateWaylandSurfaceKHR;
11540 stream->write(&opcode_vkCreateWaylandSurfaceKHR, sizeof(uint32_t));
11541 stream->write(&packetSize_vkCreateWaylandSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011542 uint64_t cgen_var_797 = (uint64_t)local_instance;
11543 stream->putBe64(cgen_var_797);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011544 marshal_VkWaylandSurfaceCreateInfoKHR(stream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011545 // WARNING PTR CHECK
11546 uint64_t cgen_var_798 = (uint64_t)(uintptr_t)local_pAllocator;
11547 stream->putBe64(cgen_var_798);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011548 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011549 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011550 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011551 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011552 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011553 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011554 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011555 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011556 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011557 VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0;
11558 stream->read(&vkCreateWaylandSurfaceKHR_VkResult_return, sizeof(VkResult));
11559 return vkCreateWaylandSurfaceKHR_VkResult_return;
11560}
11561
11562VkBool32 VkEncoder::vkGetPhysicalDeviceWaylandPresentationSupportKHR(
11563 VkPhysicalDevice physicalDevice,
11564 uint32_t queueFamilyIndex,
11565 wl_display* display)
11566{
11567 auto stream = mImpl->stream();
11568 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011569 auto resources = mImpl->resources();
11570 auto pool = mImpl->pool();
11571 VkPhysicalDevice local_physicalDevice;
11572 local_physicalDevice = physicalDevice;
11573 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
11574 uint32_t local_queueFamilyIndex;
11575 local_queueFamilyIndex = queueFamilyIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011576 countingStream->rewind();
11577 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011578 uint64_t cgen_var_799 = (uint64_t)local_physicalDevice;
11579 countingStream->putBe64(cgen_var_799);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011580 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011581 countingStream->write((wl_display*)display, sizeof(wl_display));
11582 }
11583 uint32_t packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11584 countingStream->rewind();
11585 uint32_t opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR = OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR;
11586 stream->write(&opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t));
11587 stream->write(&packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011588 uint64_t cgen_var_800 = (uint64_t)local_physicalDevice;
11589 stream->putBe64(cgen_var_800);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011590 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011591 stream->write((wl_display*)display, sizeof(wl_display));
11592 stream->read((wl_display*)display, sizeof(wl_display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011593 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011594 VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0;
11595 stream->read(&vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
11596 return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return;
11597}
11598
11599#endif
11600#ifdef VK_KHR_mir_surface
11601VkResult VkEncoder::vkCreateMirSurfaceKHR(
11602 VkInstance instance,
11603 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
11604 const VkAllocationCallbacks* pAllocator,
11605 VkSurfaceKHR* pSurface)
11606{
11607 auto stream = mImpl->stream();
11608 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011609 auto resources = mImpl->resources();
11610 auto pool = mImpl->pool();
11611 VkInstance local_instance;
11612 local_instance = instance;
11613 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
11614 VkMirSurfaceCreateInfoKHR* local_pCreateInfo;
11615 local_pCreateInfo = nullptr;
11616 if (pCreateInfo)
11617 {
11618 local_pCreateInfo = (VkMirSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkMirSurfaceCreateInfoKHR));
11619 deepcopy_VkMirSurfaceCreateInfoKHR(pool, pCreateInfo, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo));
11620 }
11621 if (local_pCreateInfo)
11622 {
11623 handlemap_VkMirSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo));
11624 }
11625 VkAllocationCallbacks* local_pAllocator;
11626 local_pAllocator = nullptr;
11627 if (pAllocator)
11628 {
11629 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
11630 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
11631 }
11632 if (local_pAllocator)
11633 {
11634 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
11635 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080011636 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011637 countingStream->rewind();
11638 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011639 uint64_t cgen_var_801 = (uint64_t)local_instance;
11640 countingStream->putBe64(cgen_var_801);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011641 marshal_VkMirSurfaceCreateInfoKHR(countingStream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011642 // WARNING PTR CHECK
11643 uint64_t cgen_var_802 = (uint64_t)(uintptr_t)local_pAllocator;
11644 countingStream->putBe64(cgen_var_802);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011645 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011646 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011647 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011648 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011649 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011650 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
11651 }
11652 uint32_t packetSize_vkCreateMirSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11653 countingStream->rewind();
11654 uint32_t opcode_vkCreateMirSurfaceKHR = OP_vkCreateMirSurfaceKHR;
11655 stream->write(&opcode_vkCreateMirSurfaceKHR, sizeof(uint32_t));
11656 stream->write(&packetSize_vkCreateMirSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011657 uint64_t cgen_var_803 = (uint64_t)local_instance;
11658 stream->putBe64(cgen_var_803);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011659 marshal_VkMirSurfaceCreateInfoKHR(stream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011660 // WARNING PTR CHECK
11661 uint64_t cgen_var_804 = (uint64_t)(uintptr_t)local_pAllocator;
11662 stream->putBe64(cgen_var_804);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011663 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011664 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011665 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011666 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011667 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011668 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011669 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011670 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011671 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011672 VkResult vkCreateMirSurfaceKHR_VkResult_return = (VkResult)0;
11673 stream->read(&vkCreateMirSurfaceKHR_VkResult_return, sizeof(VkResult));
11674 return vkCreateMirSurfaceKHR_VkResult_return;
11675}
11676
11677VkBool32 VkEncoder::vkGetPhysicalDeviceMirPresentationSupportKHR(
11678 VkPhysicalDevice physicalDevice,
11679 uint32_t queueFamilyIndex,
11680 MirConnection* connection)
11681{
11682 auto stream = mImpl->stream();
11683 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011684 auto resources = mImpl->resources();
11685 auto pool = mImpl->pool();
11686 VkPhysicalDevice local_physicalDevice;
11687 local_physicalDevice = physicalDevice;
11688 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
11689 uint32_t local_queueFamilyIndex;
11690 local_queueFamilyIndex = queueFamilyIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011691 countingStream->rewind();
11692 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011693 uint64_t cgen_var_805 = (uint64_t)local_physicalDevice;
11694 countingStream->putBe64(cgen_var_805);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011695 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011696 countingStream->write((MirConnection*)connection, sizeof(MirConnection));
11697 }
11698 uint32_t packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11699 countingStream->rewind();
11700 uint32_t opcode_vkGetPhysicalDeviceMirPresentationSupportKHR = OP_vkGetPhysicalDeviceMirPresentationSupportKHR;
11701 stream->write(&opcode_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t));
11702 stream->write(&packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011703 uint64_t cgen_var_806 = (uint64_t)local_physicalDevice;
11704 stream->putBe64(cgen_var_806);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011705 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011706 stream->write((MirConnection*)connection, sizeof(MirConnection));
11707 stream->read((MirConnection*)connection, sizeof(MirConnection));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011708 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011709 VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return = (VkBool32)0;
11710 stream->read(&vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
11711 return vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return;
11712}
11713
11714#endif
11715#ifdef VK_KHR_android_surface
11716VkResult VkEncoder::vkCreateAndroidSurfaceKHR(
11717 VkInstance instance,
11718 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
11719 const VkAllocationCallbacks* pAllocator,
11720 VkSurfaceKHR* pSurface)
11721{
11722 auto stream = mImpl->stream();
11723 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011724 auto resources = mImpl->resources();
11725 auto pool = mImpl->pool();
11726 VkInstance local_instance;
11727 local_instance = instance;
11728 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
11729 VkAndroidSurfaceCreateInfoKHR* local_pCreateInfo;
11730 local_pCreateInfo = nullptr;
11731 if (pCreateInfo)
11732 {
11733 local_pCreateInfo = (VkAndroidSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkAndroidSurfaceCreateInfoKHR));
11734 deepcopy_VkAndroidSurfaceCreateInfoKHR(pool, pCreateInfo, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
11735 }
11736 if (local_pCreateInfo)
11737 {
11738 handlemap_VkAndroidSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
11739 }
11740 VkAllocationCallbacks* local_pAllocator;
11741 local_pAllocator = nullptr;
11742 if (pAllocator)
11743 {
11744 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
11745 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
11746 }
11747 if (local_pAllocator)
11748 {
11749 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
11750 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080011751 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011752 countingStream->rewind();
11753 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011754 uint64_t cgen_var_807 = (uint64_t)local_instance;
11755 countingStream->putBe64(cgen_var_807);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011756 marshal_VkAndroidSurfaceCreateInfoKHR(countingStream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011757 // WARNING PTR CHECK
11758 uint64_t cgen_var_808 = (uint64_t)(uintptr_t)local_pAllocator;
11759 countingStream->putBe64(cgen_var_808);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011760 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011761 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011762 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011763 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011764 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011765 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
11766 }
11767 uint32_t packetSize_vkCreateAndroidSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11768 countingStream->rewind();
11769 uint32_t opcode_vkCreateAndroidSurfaceKHR = OP_vkCreateAndroidSurfaceKHR;
11770 stream->write(&opcode_vkCreateAndroidSurfaceKHR, sizeof(uint32_t));
11771 stream->write(&packetSize_vkCreateAndroidSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011772 uint64_t cgen_var_809 = (uint64_t)local_instance;
11773 stream->putBe64(cgen_var_809);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011774 marshal_VkAndroidSurfaceCreateInfoKHR(stream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011775 // WARNING PTR CHECK
11776 uint64_t cgen_var_810 = (uint64_t)(uintptr_t)local_pAllocator;
11777 stream->putBe64(cgen_var_810);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011778 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011779 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011780 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011781 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011782 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011783 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011784 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011785 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011786 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011787 VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0;
11788 stream->read(&vkCreateAndroidSurfaceKHR_VkResult_return, sizeof(VkResult));
11789 return vkCreateAndroidSurfaceKHR_VkResult_return;
11790}
11791
11792#endif
11793#ifdef VK_KHR_win32_surface
11794VkResult VkEncoder::vkCreateWin32SurfaceKHR(
11795 VkInstance instance,
11796 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
11797 const VkAllocationCallbacks* pAllocator,
11798 VkSurfaceKHR* pSurface)
11799{
11800 auto stream = mImpl->stream();
11801 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011802 auto resources = mImpl->resources();
11803 auto pool = mImpl->pool();
11804 VkInstance local_instance;
11805 local_instance = instance;
11806 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
11807 VkWin32SurfaceCreateInfoKHR* local_pCreateInfo;
11808 local_pCreateInfo = nullptr;
11809 if (pCreateInfo)
11810 {
11811 local_pCreateInfo = (VkWin32SurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWin32SurfaceCreateInfoKHR));
11812 deepcopy_VkWin32SurfaceCreateInfoKHR(pool, pCreateInfo, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
11813 }
11814 if (local_pCreateInfo)
11815 {
11816 handlemap_VkWin32SurfaceCreateInfoKHR(resources->unwrapMapping(), (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
11817 }
11818 VkAllocationCallbacks* local_pAllocator;
11819 local_pAllocator = nullptr;
11820 if (pAllocator)
11821 {
11822 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
11823 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
11824 }
11825 if (local_pAllocator)
11826 {
11827 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
11828 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080011829 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011830 countingStream->rewind();
11831 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011832 uint64_t cgen_var_811 = (uint64_t)local_instance;
11833 countingStream->putBe64(cgen_var_811);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011834 marshal_VkWin32SurfaceCreateInfoKHR(countingStream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011835 // WARNING PTR CHECK
11836 uint64_t cgen_var_812 = (uint64_t)(uintptr_t)local_pAllocator;
11837 countingStream->putBe64(cgen_var_812);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011838 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011839 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011840 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011841 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011842 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011843 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
11844 }
11845 uint32_t packetSize_vkCreateWin32SurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11846 countingStream->rewind();
11847 uint32_t opcode_vkCreateWin32SurfaceKHR = OP_vkCreateWin32SurfaceKHR;
11848 stream->write(&opcode_vkCreateWin32SurfaceKHR, sizeof(uint32_t));
11849 stream->write(&packetSize_vkCreateWin32SurfaceKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011850 uint64_t cgen_var_813 = (uint64_t)local_instance;
11851 stream->putBe64(cgen_var_813);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011852 marshal_VkWin32SurfaceCreateInfoKHR(stream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011853 // WARNING PTR CHECK
11854 uint64_t cgen_var_814 = (uint64_t)(uintptr_t)local_pAllocator;
11855 stream->putBe64(cgen_var_814);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011856 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011857 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011858 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011859 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011860 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011861 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011862 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011863 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011864 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011865 VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0;
11866 stream->read(&vkCreateWin32SurfaceKHR_VkResult_return, sizeof(VkResult));
11867 return vkCreateWin32SurfaceKHR_VkResult_return;
11868}
11869
11870VkBool32 VkEncoder::vkGetPhysicalDeviceWin32PresentationSupportKHR(
11871 VkPhysicalDevice physicalDevice,
11872 uint32_t queueFamilyIndex)
11873{
11874 auto stream = mImpl->stream();
11875 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011876 auto resources = mImpl->resources();
11877 auto pool = mImpl->pool();
11878 VkPhysicalDevice local_physicalDevice;
11879 local_physicalDevice = physicalDevice;
11880 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
11881 uint32_t local_queueFamilyIndex;
11882 local_queueFamilyIndex = queueFamilyIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011883 countingStream->rewind();
11884 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011885 uint64_t cgen_var_815 = (uint64_t)local_physicalDevice;
11886 countingStream->putBe64(cgen_var_815);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011887 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011888 }
11889 uint32_t packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11890 countingStream->rewind();
11891 uint32_t opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR = OP_vkGetPhysicalDeviceWin32PresentationSupportKHR;
11892 stream->write(&opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t));
11893 stream->write(&packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011894 uint64_t cgen_var_816 = (uint64_t)local_physicalDevice;
11895 stream->putBe64(cgen_var_816);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011896 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
11897 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011898 VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0;
11899 stream->read(&vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
11900 return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return;
11901}
11902
11903#endif
11904#ifdef VK_KHR_sampler_mirror_clamp_to_edge
11905#endif
11906#ifdef VK_KHR_multiview
11907#endif
11908#ifdef VK_KHR_get_physical_device_properties2
11909void VkEncoder::vkGetPhysicalDeviceFeatures2KHR(
11910 VkPhysicalDevice physicalDevice,
11911 VkPhysicalDeviceFeatures2* pFeatures)
11912{
11913 auto stream = mImpl->stream();
11914 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011915 auto resources = mImpl->resources();
11916 auto pool = mImpl->pool();
11917 VkPhysicalDevice local_physicalDevice;
11918 local_physicalDevice = physicalDevice;
11919 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011920 countingStream->rewind();
11921 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011922 uint64_t cgen_var_817 = (uint64_t)local_physicalDevice;
11923 countingStream->putBe64(cgen_var_817);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011924 marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures));
11925 }
11926 uint32_t packetSize_vkGetPhysicalDeviceFeatures2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11927 countingStream->rewind();
11928 uint32_t opcode_vkGetPhysicalDeviceFeatures2KHR = OP_vkGetPhysicalDeviceFeatures2KHR;
11929 stream->write(&opcode_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t));
11930 stream->write(&packetSize_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011931 uint64_t cgen_var_818 = (uint64_t)local_physicalDevice;
11932 stream->putBe64(cgen_var_818);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011933 marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
11934 unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011935 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011936}
11937
11938void VkEncoder::vkGetPhysicalDeviceProperties2KHR(
11939 VkPhysicalDevice physicalDevice,
11940 VkPhysicalDeviceProperties2* pProperties)
11941{
11942 auto stream = mImpl->stream();
11943 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011944 auto resources = mImpl->resources();
11945 auto pool = mImpl->pool();
11946 VkPhysicalDevice local_physicalDevice;
11947 local_physicalDevice = physicalDevice;
11948 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011949 countingStream->rewind();
11950 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011951 uint64_t cgen_var_819 = (uint64_t)local_physicalDevice;
11952 countingStream->putBe64(cgen_var_819);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011953 marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties));
11954 }
11955 uint32_t packetSize_vkGetPhysicalDeviceProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11956 countingStream->rewind();
11957 uint32_t opcode_vkGetPhysicalDeviceProperties2KHR = OP_vkGetPhysicalDeviceProperties2KHR;
11958 stream->write(&opcode_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t));
11959 stream->write(&packetSize_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011960 uint64_t cgen_var_820 = (uint64_t)local_physicalDevice;
11961 stream->putBe64(cgen_var_820);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011962 marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties));
11963 unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011964 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011965}
11966
11967void VkEncoder::vkGetPhysicalDeviceFormatProperties2KHR(
11968 VkPhysicalDevice physicalDevice,
11969 VkFormat format,
11970 VkFormatProperties2* pFormatProperties)
11971{
11972 auto stream = mImpl->stream();
11973 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011974 auto resources = mImpl->resources();
11975 auto pool = mImpl->pool();
11976 VkPhysicalDevice local_physicalDevice;
11977 local_physicalDevice = physicalDevice;
11978 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
11979 VkFormat local_format;
11980 local_format = format;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011981 countingStream->rewind();
11982 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011983 uint64_t cgen_var_821 = (uint64_t)local_physicalDevice;
11984 countingStream->putBe64(cgen_var_821);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011985 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011986 marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties));
11987 }
11988 uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11989 countingStream->rewind();
11990 uint32_t opcode_vkGetPhysicalDeviceFormatProperties2KHR = OP_vkGetPhysicalDeviceFormatProperties2KHR;
11991 stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t));
11992 stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080011993 uint64_t cgen_var_822 = (uint64_t)local_physicalDevice;
11994 stream->putBe64(cgen_var_822);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011995 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011996 marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
11997 unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011998 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011999}
12000
12001VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2KHR(
12002 VkPhysicalDevice physicalDevice,
12003 const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
12004 VkImageFormatProperties2* pImageFormatProperties)
12005{
12006 auto stream = mImpl->stream();
12007 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012008 auto resources = mImpl->resources();
12009 auto pool = mImpl->pool();
12010 VkPhysicalDevice local_physicalDevice;
12011 local_physicalDevice = physicalDevice;
12012 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
12013 VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo;
12014 local_pImageFormatInfo = nullptr;
12015 if (pImageFormatInfo)
12016 {
12017 local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2));
12018 deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
12019 }
12020 if (local_pImageFormatInfo)
12021 {
12022 handlemap_VkPhysicalDeviceImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
12023 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012024 countingStream->rewind();
12025 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012026 uint64_t cgen_var_823 = (uint64_t)local_physicalDevice;
12027 countingStream->putBe64(cgen_var_823);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012028 marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012029 marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties));
12030 }
12031 uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12032 countingStream->rewind();
12033 uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2KHR = OP_vkGetPhysicalDeviceImageFormatProperties2KHR;
12034 stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t));
12035 stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012036 uint64_t cgen_var_824 = (uint64_t)local_physicalDevice;
12037 stream->putBe64(cgen_var_824);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012038 marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012039 marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
12040 unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012041 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012042 VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0;
12043 stream->read(&vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return, sizeof(VkResult));
12044 return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return;
12045}
12046
12047void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2KHR(
12048 VkPhysicalDevice physicalDevice,
12049 uint32_t* pQueueFamilyPropertyCount,
12050 VkQueueFamilyProperties2* pQueueFamilyProperties)
12051{
12052 auto stream = mImpl->stream();
12053 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012054 auto resources = mImpl->resources();
12055 auto pool = mImpl->pool();
12056 VkPhysicalDevice local_physicalDevice;
12057 local_physicalDevice = physicalDevice;
12058 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012059 countingStream->rewind();
12060 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012061 uint64_t cgen_var_825 = (uint64_t)local_physicalDevice;
12062 countingStream->putBe64(cgen_var_825);
12063 // WARNING PTR CHECK
12064 uint64_t cgen_var_826 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
12065 countingStream->putBe64(cgen_var_826);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012066 if (pQueueFamilyPropertyCount)
12067 {
12068 countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
12069 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012070 // WARNING PTR CHECK
12071 uint64_t cgen_var_827 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
12072 countingStream->putBe64(cgen_var_827);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012073 if (pQueueFamilyProperties)
12074 {
12075 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
12076 {
12077 marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
12078 }
12079 }
12080 }
12081 uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12082 countingStream->rewind();
12083 uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR = OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR;
12084 stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t));
12085 stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012086 uint64_t cgen_var_828 = (uint64_t)local_physicalDevice;
12087 stream->putBe64(cgen_var_828);
12088 // WARNING PTR CHECK
12089 uint64_t cgen_var_829 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount;
12090 stream->putBe64(cgen_var_829);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012091 if (pQueueFamilyPropertyCount)
12092 {
12093 stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
12094 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012095 // WARNING PTR CHECK
12096 uint64_t cgen_var_830 = (uint64_t)(uintptr_t)pQueueFamilyProperties;
12097 stream->putBe64(cgen_var_830);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012098 if (pQueueFamilyProperties)
12099 {
12100 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
12101 {
12102 marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
12103 }
12104 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012105 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012106 uint32_t* check_pQueueFamilyPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012107 check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012108 if (pQueueFamilyPropertyCount)
12109 {
12110 if (!(check_pQueueFamilyPropertyCount))
12111 {
12112 fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n");
12113 }
12114 stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
12115 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012116 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012117 VkQueueFamilyProperties2* check_pQueueFamilyProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012118 check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012119 if (pQueueFamilyProperties)
12120 {
12121 if (!(check_pQueueFamilyProperties))
12122 {
12123 fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n");
12124 }
12125 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
12126 {
12127 unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
12128 }
12129 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012130 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012131}
12132
12133void VkEncoder::vkGetPhysicalDeviceMemoryProperties2KHR(
12134 VkPhysicalDevice physicalDevice,
12135 VkPhysicalDeviceMemoryProperties2* pMemoryProperties)
12136{
12137 auto stream = mImpl->stream();
12138 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012139 auto resources = mImpl->resources();
12140 auto pool = mImpl->pool();
12141 VkPhysicalDevice local_physicalDevice;
12142 local_physicalDevice = physicalDevice;
12143 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012144 countingStream->rewind();
12145 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012146 uint64_t cgen_var_833 = (uint64_t)local_physicalDevice;
12147 countingStream->putBe64(cgen_var_833);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012148 marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
12149 }
12150 uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12151 countingStream->rewind();
12152 uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2KHR = OP_vkGetPhysicalDeviceMemoryProperties2KHR;
12153 stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t));
12154 stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012155 uint64_t cgen_var_834 = (uint64_t)local_physicalDevice;
12156 stream->putBe64(cgen_var_834);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012157 marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
12158 unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012159 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012160}
12161
12162void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
12163 VkPhysicalDevice physicalDevice,
12164 const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
12165 uint32_t* pPropertyCount,
12166 VkSparseImageFormatProperties2* pProperties)
12167{
12168 auto stream = mImpl->stream();
12169 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012170 auto resources = mImpl->resources();
12171 auto pool = mImpl->pool();
12172 VkPhysicalDevice local_physicalDevice;
12173 local_physicalDevice = physicalDevice;
12174 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
12175 VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo;
12176 local_pFormatInfo = nullptr;
12177 if (pFormatInfo)
12178 {
12179 local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2));
12180 deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
12181 }
12182 if (local_pFormatInfo)
12183 {
12184 handlemap_VkPhysicalDeviceSparseImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
12185 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012186 countingStream->rewind();
12187 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012188 uint64_t cgen_var_835 = (uint64_t)local_physicalDevice;
12189 countingStream->putBe64(cgen_var_835);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012190 marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012191 // WARNING PTR CHECK
12192 uint64_t cgen_var_836 = (uint64_t)(uintptr_t)pPropertyCount;
12193 countingStream->putBe64(cgen_var_836);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012194 if (pPropertyCount)
12195 {
12196 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
12197 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012198 // WARNING PTR CHECK
12199 uint64_t cgen_var_837 = (uint64_t)(uintptr_t)pProperties;
12200 countingStream->putBe64(cgen_var_837);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012201 if (pProperties)
12202 {
12203 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12204 {
12205 marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i));
12206 }
12207 }
12208 }
12209 uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12210 countingStream->rewind();
12211 uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR;
12212 stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t));
12213 stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012214 uint64_t cgen_var_838 = (uint64_t)local_physicalDevice;
12215 stream->putBe64(cgen_var_838);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012216 marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012217 // WARNING PTR CHECK
12218 uint64_t cgen_var_839 = (uint64_t)(uintptr_t)pPropertyCount;
12219 stream->putBe64(cgen_var_839);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012220 if (pPropertyCount)
12221 {
12222 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
12223 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012224 // WARNING PTR CHECK
12225 uint64_t cgen_var_840 = (uint64_t)(uintptr_t)pProperties;
12226 stream->putBe64(cgen_var_840);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012227 if (pProperties)
12228 {
12229 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12230 {
12231 marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i));
12232 }
12233 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012234 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012235 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012236 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012237 if (pPropertyCount)
12238 {
12239 if (!(check_pPropertyCount))
12240 {
12241 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
12242 }
12243 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
12244 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012245 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012246 VkSparseImageFormatProperties2* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012247 check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012248 if (pProperties)
12249 {
12250 if (!(check_pProperties))
12251 {
12252 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
12253 }
12254 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12255 {
12256 unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i));
12257 }
12258 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012259 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012260}
12261
12262#endif
12263#ifdef VK_KHR_device_group
12264void VkEncoder::vkGetDeviceGroupPeerMemoryFeaturesKHR(
12265 VkDevice device,
12266 uint32_t heapIndex,
12267 uint32_t localDeviceIndex,
12268 uint32_t remoteDeviceIndex,
12269 VkPeerMemoryFeatureFlags* pPeerMemoryFeatures)
12270{
12271 auto stream = mImpl->stream();
12272 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012273 auto resources = mImpl->resources();
12274 auto pool = mImpl->pool();
12275 VkDevice local_device;
12276 local_device = device;
12277 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12278 uint32_t local_heapIndex;
12279 local_heapIndex = heapIndex;
12280 uint32_t local_localDeviceIndex;
12281 local_localDeviceIndex = localDeviceIndex;
12282 uint32_t local_remoteDeviceIndex;
12283 local_remoteDeviceIndex = remoteDeviceIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012284 countingStream->rewind();
12285 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012286 uint64_t cgen_var_843 = (uint64_t)local_device;
12287 countingStream->putBe64(cgen_var_843);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012288 countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
12289 countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
12290 countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012291 countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
12292 }
12293 uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12294 countingStream->rewind();
12295 uint32_t opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR = OP_vkGetDeviceGroupPeerMemoryFeaturesKHR;
12296 stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t));
12297 stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012298 uint64_t cgen_var_844 = (uint64_t)local_device;
12299 stream->putBe64(cgen_var_844);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012300 stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
12301 stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
12302 stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012303 stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
12304 stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012305 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012306}
12307
12308void VkEncoder::vkCmdSetDeviceMaskKHR(
12309 VkCommandBuffer commandBuffer,
12310 uint32_t deviceMask)
12311{
12312 auto stream = mImpl->stream();
12313 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012314 auto resources = mImpl->resources();
12315 auto pool = mImpl->pool();
12316 VkCommandBuffer local_commandBuffer;
12317 local_commandBuffer = commandBuffer;
12318 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
12319 uint32_t local_deviceMask;
12320 local_deviceMask = deviceMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012321 countingStream->rewind();
12322 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012323 uint64_t cgen_var_845 = (uint64_t)local_commandBuffer;
12324 countingStream->putBe64(cgen_var_845);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012325 countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012326 }
12327 uint32_t packetSize_vkCmdSetDeviceMaskKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12328 countingStream->rewind();
12329 uint32_t opcode_vkCmdSetDeviceMaskKHR = OP_vkCmdSetDeviceMaskKHR;
12330 stream->write(&opcode_vkCmdSetDeviceMaskKHR, sizeof(uint32_t));
12331 stream->write(&packetSize_vkCmdSetDeviceMaskKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012332 uint64_t cgen_var_846 = (uint64_t)local_commandBuffer;
12333 stream->putBe64(cgen_var_846);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012334 stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
12335 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012336}
12337
12338void VkEncoder::vkCmdDispatchBaseKHR(
12339 VkCommandBuffer commandBuffer,
12340 uint32_t baseGroupX,
12341 uint32_t baseGroupY,
12342 uint32_t baseGroupZ,
12343 uint32_t groupCountX,
12344 uint32_t groupCountY,
12345 uint32_t groupCountZ)
12346{
12347 auto stream = mImpl->stream();
12348 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012349 auto resources = mImpl->resources();
12350 auto pool = mImpl->pool();
12351 VkCommandBuffer local_commandBuffer;
12352 local_commandBuffer = commandBuffer;
12353 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
12354 uint32_t local_baseGroupX;
12355 local_baseGroupX = baseGroupX;
12356 uint32_t local_baseGroupY;
12357 local_baseGroupY = baseGroupY;
12358 uint32_t local_baseGroupZ;
12359 local_baseGroupZ = baseGroupZ;
12360 uint32_t local_groupCountX;
12361 local_groupCountX = groupCountX;
12362 uint32_t local_groupCountY;
12363 local_groupCountY = groupCountY;
12364 uint32_t local_groupCountZ;
12365 local_groupCountZ = groupCountZ;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012366 countingStream->rewind();
12367 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012368 uint64_t cgen_var_847 = (uint64_t)local_commandBuffer;
12369 countingStream->putBe64(cgen_var_847);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012370 countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
12371 countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
12372 countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
12373 countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
12374 countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
12375 countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012376 }
12377 uint32_t packetSize_vkCmdDispatchBaseKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12378 countingStream->rewind();
12379 uint32_t opcode_vkCmdDispatchBaseKHR = OP_vkCmdDispatchBaseKHR;
12380 stream->write(&opcode_vkCmdDispatchBaseKHR, sizeof(uint32_t));
12381 stream->write(&packetSize_vkCmdDispatchBaseKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012382 uint64_t cgen_var_848 = (uint64_t)local_commandBuffer;
12383 stream->putBe64(cgen_var_848);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012384 stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
12385 stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
12386 stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
12387 stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
12388 stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
12389 stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
12390 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012391}
12392
12393#endif
12394#ifdef VK_KHR_shader_draw_parameters
12395#endif
12396#ifdef VK_KHR_maintenance1
12397void VkEncoder::vkTrimCommandPoolKHR(
12398 VkDevice device,
12399 VkCommandPool commandPool,
12400 VkCommandPoolTrimFlags flags)
12401{
12402 auto stream = mImpl->stream();
12403 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012404 auto resources = mImpl->resources();
12405 auto pool = mImpl->pool();
12406 VkDevice local_device;
12407 local_device = device;
12408 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12409 VkCommandPool local_commandPool;
12410 local_commandPool = commandPool;
12411 resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool);
12412 VkCommandPoolTrimFlags local_flags;
12413 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012414 countingStream->rewind();
12415 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012416 uint64_t cgen_var_849 = (uint64_t)local_device;
12417 countingStream->putBe64(cgen_var_849);
12418 uint64_t cgen_var_850 = (uint64_t)local_commandPool;
12419 countingStream->putBe64(cgen_var_850);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012420 countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012421 }
12422 uint32_t packetSize_vkTrimCommandPoolKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12423 countingStream->rewind();
12424 uint32_t opcode_vkTrimCommandPoolKHR = OP_vkTrimCommandPoolKHR;
12425 stream->write(&opcode_vkTrimCommandPoolKHR, sizeof(uint32_t));
12426 stream->write(&packetSize_vkTrimCommandPoolKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012427 uint64_t cgen_var_851 = (uint64_t)local_device;
12428 stream->putBe64(cgen_var_851);
12429 uint64_t cgen_var_852 = (uint64_t)local_commandPool;
12430 stream->putBe64(cgen_var_852);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012431 stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
12432 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012433}
12434
12435#endif
12436#ifdef VK_KHR_device_group_creation
12437VkResult VkEncoder::vkEnumeratePhysicalDeviceGroupsKHR(
12438 VkInstance instance,
12439 uint32_t* pPhysicalDeviceGroupCount,
12440 VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties)
12441{
12442 auto stream = mImpl->stream();
12443 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012444 auto resources = mImpl->resources();
12445 auto pool = mImpl->pool();
12446 VkInstance local_instance;
12447 local_instance = instance;
12448 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012449 countingStream->rewind();
12450 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012451 uint64_t cgen_var_853 = (uint64_t)local_instance;
12452 countingStream->putBe64(cgen_var_853);
12453 // WARNING PTR CHECK
12454 uint64_t cgen_var_854 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
12455 countingStream->putBe64(cgen_var_854);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012456 if (pPhysicalDeviceGroupCount)
12457 {
12458 countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
12459 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012460 // WARNING PTR CHECK
12461 uint64_t cgen_var_855 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
12462 countingStream->putBe64(cgen_var_855);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012463 if (pPhysicalDeviceGroupProperties)
12464 {
12465 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
12466 {
12467 marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
12468 }
12469 }
12470 }
12471 uint32_t packetSize_vkEnumeratePhysicalDeviceGroupsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12472 countingStream->rewind();
12473 uint32_t opcode_vkEnumeratePhysicalDeviceGroupsKHR = OP_vkEnumeratePhysicalDeviceGroupsKHR;
12474 stream->write(&opcode_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t));
12475 stream->write(&packetSize_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012476 uint64_t cgen_var_856 = (uint64_t)local_instance;
12477 stream->putBe64(cgen_var_856);
12478 // WARNING PTR CHECK
12479 uint64_t cgen_var_857 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount;
12480 stream->putBe64(cgen_var_857);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012481 if (pPhysicalDeviceGroupCount)
12482 {
12483 stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
12484 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012485 // WARNING PTR CHECK
12486 uint64_t cgen_var_858 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties;
12487 stream->putBe64(cgen_var_858);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012488 if (pPhysicalDeviceGroupProperties)
12489 {
12490 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
12491 {
12492 marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
12493 }
12494 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012495 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012496 uint32_t* check_pPhysicalDeviceGroupCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012497 check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012498 if (pPhysicalDeviceGroupCount)
12499 {
12500 if (!(check_pPhysicalDeviceGroupCount))
12501 {
12502 fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n");
12503 }
12504 stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
12505 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012506 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012507 VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012508 check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012509 if (pPhysicalDeviceGroupProperties)
12510 {
12511 if (!(check_pPhysicalDeviceGroupProperties))
12512 {
12513 fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n");
12514 }
12515 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
12516 {
12517 unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
12518 }
12519 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012520 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012521 VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0;
12522 stream->read(&vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return, sizeof(VkResult));
12523 return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return;
12524}
12525
12526#endif
12527#ifdef VK_KHR_external_memory_capabilities
12528void VkEncoder::vkGetPhysicalDeviceExternalBufferPropertiesKHR(
12529 VkPhysicalDevice physicalDevice,
12530 const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
12531 VkExternalBufferProperties* pExternalBufferProperties)
12532{
12533 auto stream = mImpl->stream();
12534 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012535 auto resources = mImpl->resources();
12536 auto pool = mImpl->pool();
12537 VkPhysicalDevice local_physicalDevice;
12538 local_physicalDevice = physicalDevice;
12539 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
12540 VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo;
12541 local_pExternalBufferInfo = nullptr;
12542 if (pExternalBufferInfo)
12543 {
12544 local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo));
12545 deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
12546 }
12547 if (local_pExternalBufferInfo)
12548 {
12549 handlemap_VkPhysicalDeviceExternalBufferInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
12550 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012551 countingStream->rewind();
12552 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012553 uint64_t cgen_var_861 = (uint64_t)local_physicalDevice;
12554 countingStream->putBe64(cgen_var_861);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012555 marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012556 marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties));
12557 }
12558 uint32_t packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12559 countingStream->rewind();
12560 uint32_t opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR = OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR;
12561 stream->write(&opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t));
12562 stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012563 uint64_t cgen_var_862 = (uint64_t)local_physicalDevice;
12564 stream->putBe64(cgen_var_862);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012565 marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012566 marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
12567 unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012568 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012569}
12570
12571#endif
12572#ifdef VK_KHR_external_memory
12573#endif
12574#ifdef VK_KHR_external_memory_win32
12575VkResult VkEncoder::vkGetMemoryWin32HandleKHR(
12576 VkDevice device,
12577 const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
12578 HANDLE* pHandle)
12579{
12580 auto stream = mImpl->stream();
12581 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012582 auto resources = mImpl->resources();
12583 auto pool = mImpl->pool();
12584 VkDevice local_device;
12585 local_device = device;
12586 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12587 VkMemoryGetWin32HandleInfoKHR* local_pGetWin32HandleInfo;
12588 local_pGetWin32HandleInfo = nullptr;
12589 if (pGetWin32HandleInfo)
12590 {
12591 local_pGetWin32HandleInfo = (VkMemoryGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkMemoryGetWin32HandleInfoKHR));
12592 deepcopy_VkMemoryGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
12593 }
12594 if (local_pGetWin32HandleInfo)
12595 {
12596 handlemap_VkMemoryGetWin32HandleInfoKHR(resources->unwrapMapping(), (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
12597 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012598 countingStream->rewind();
12599 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012600 uint64_t cgen_var_863 = (uint64_t)local_device;
12601 countingStream->putBe64(cgen_var_863);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012602 marshal_VkMemoryGetWin32HandleInfoKHR(countingStream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012603 countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
12604 }
12605 uint32_t packetSize_vkGetMemoryWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12606 countingStream->rewind();
12607 uint32_t opcode_vkGetMemoryWin32HandleKHR = OP_vkGetMemoryWin32HandleKHR;
12608 stream->write(&opcode_vkGetMemoryWin32HandleKHR, sizeof(uint32_t));
12609 stream->write(&packetSize_vkGetMemoryWin32HandleKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012610 uint64_t cgen_var_864 = (uint64_t)local_device;
12611 stream->putBe64(cgen_var_864);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012612 marshal_VkMemoryGetWin32HandleInfoKHR(stream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012613 stream->write((HANDLE*)pHandle, sizeof(HANDLE));
12614 stream->read((HANDLE*)pHandle, sizeof(HANDLE));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012615 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012616 VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0;
12617 stream->read(&vkGetMemoryWin32HandleKHR_VkResult_return, sizeof(VkResult));
12618 return vkGetMemoryWin32HandleKHR_VkResult_return;
12619}
12620
12621VkResult VkEncoder::vkGetMemoryWin32HandlePropertiesKHR(
12622 VkDevice device,
12623 VkExternalMemoryHandleTypeFlagBits handleType,
12624 HANDLE handle,
12625 VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties)
12626{
12627 auto stream = mImpl->stream();
12628 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012629 auto resources = mImpl->resources();
12630 auto pool = mImpl->pool();
12631 VkDevice local_device;
12632 local_device = device;
12633 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12634 VkExternalMemoryHandleTypeFlagBits local_handleType;
12635 local_handleType = handleType;
12636 HANDLE local_handle;
12637 local_handle = handle;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012638 countingStream->rewind();
12639 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012640 uint64_t cgen_var_865 = (uint64_t)local_device;
12641 countingStream->putBe64(cgen_var_865);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012642 countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
12643 countingStream->write((HANDLE*)&local_handle, sizeof(HANDLE));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012644 marshal_VkMemoryWin32HandlePropertiesKHR(countingStream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties));
12645 }
12646 uint32_t packetSize_vkGetMemoryWin32HandlePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12647 countingStream->rewind();
12648 uint32_t opcode_vkGetMemoryWin32HandlePropertiesKHR = OP_vkGetMemoryWin32HandlePropertiesKHR;
12649 stream->write(&opcode_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t));
12650 stream->write(&packetSize_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012651 uint64_t cgen_var_866 = (uint64_t)local_device;
12652 stream->putBe64(cgen_var_866);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012653 stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
12654 stream->write((HANDLE*)&local_handle, sizeof(HANDLE));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012655 marshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties));
12656 unmarshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012657 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012658 VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0;
12659 stream->read(&vkGetMemoryWin32HandlePropertiesKHR_VkResult_return, sizeof(VkResult));
12660 return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return;
12661}
12662
12663#endif
12664#ifdef VK_KHR_external_memory_fd
12665VkResult VkEncoder::vkGetMemoryFdKHR(
12666 VkDevice device,
12667 const VkMemoryGetFdInfoKHR* pGetFdInfo,
12668 int* pFd)
12669{
12670 auto stream = mImpl->stream();
12671 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012672 auto resources = mImpl->resources();
12673 auto pool = mImpl->pool();
12674 VkDevice local_device;
12675 local_device = device;
12676 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12677 VkMemoryGetFdInfoKHR* local_pGetFdInfo;
12678 local_pGetFdInfo = nullptr;
12679 if (pGetFdInfo)
12680 {
12681 local_pGetFdInfo = (VkMemoryGetFdInfoKHR*)pool->alloc(sizeof(const VkMemoryGetFdInfoKHR));
12682 deepcopy_VkMemoryGetFdInfoKHR(pool, pGetFdInfo, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
12683 }
12684 if (local_pGetFdInfo)
12685 {
12686 handlemap_VkMemoryGetFdInfoKHR(resources->unwrapMapping(), (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
12687 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012688 countingStream->rewind();
12689 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012690 uint64_t cgen_var_867 = (uint64_t)local_device;
12691 countingStream->putBe64(cgen_var_867);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012692 marshal_VkMemoryGetFdInfoKHR(countingStream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012693 countingStream->write((int*)pFd, sizeof(int));
12694 }
12695 uint32_t packetSize_vkGetMemoryFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12696 countingStream->rewind();
12697 uint32_t opcode_vkGetMemoryFdKHR = OP_vkGetMemoryFdKHR;
12698 stream->write(&opcode_vkGetMemoryFdKHR, sizeof(uint32_t));
12699 stream->write(&packetSize_vkGetMemoryFdKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012700 uint64_t cgen_var_868 = (uint64_t)local_device;
12701 stream->putBe64(cgen_var_868);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012702 marshal_VkMemoryGetFdInfoKHR(stream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012703 stream->write((int*)pFd, sizeof(int));
12704 stream->read((int*)pFd, sizeof(int));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012705 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012706 VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0;
12707 stream->read(&vkGetMemoryFdKHR_VkResult_return, sizeof(VkResult));
12708 return vkGetMemoryFdKHR_VkResult_return;
12709}
12710
12711VkResult VkEncoder::vkGetMemoryFdPropertiesKHR(
12712 VkDevice device,
12713 VkExternalMemoryHandleTypeFlagBits handleType,
12714 int fd,
12715 VkMemoryFdPropertiesKHR* pMemoryFdProperties)
12716{
12717 auto stream = mImpl->stream();
12718 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012719 auto resources = mImpl->resources();
12720 auto pool = mImpl->pool();
12721 VkDevice local_device;
12722 local_device = device;
12723 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12724 VkExternalMemoryHandleTypeFlagBits local_handleType;
12725 local_handleType = handleType;
12726 int local_fd;
12727 local_fd = fd;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012728 countingStream->rewind();
12729 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012730 uint64_t cgen_var_869 = (uint64_t)local_device;
12731 countingStream->putBe64(cgen_var_869);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012732 countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
12733 countingStream->write((int*)&local_fd, sizeof(int));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012734 marshal_VkMemoryFdPropertiesKHR(countingStream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties));
12735 }
12736 uint32_t packetSize_vkGetMemoryFdPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12737 countingStream->rewind();
12738 uint32_t opcode_vkGetMemoryFdPropertiesKHR = OP_vkGetMemoryFdPropertiesKHR;
12739 stream->write(&opcode_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t));
12740 stream->write(&packetSize_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012741 uint64_t cgen_var_870 = (uint64_t)local_device;
12742 stream->putBe64(cgen_var_870);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012743 stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
12744 stream->write((int*)&local_fd, sizeof(int));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012745 marshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties));
12746 unmarshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012747 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012748 VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0;
12749 stream->read(&vkGetMemoryFdPropertiesKHR_VkResult_return, sizeof(VkResult));
12750 return vkGetMemoryFdPropertiesKHR_VkResult_return;
12751}
12752
12753#endif
12754#ifdef VK_KHR_win32_keyed_mutex
12755#endif
12756#ifdef VK_KHR_external_semaphore_capabilities
12757void VkEncoder::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
12758 VkPhysicalDevice physicalDevice,
12759 const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
12760 VkExternalSemaphoreProperties* pExternalSemaphoreProperties)
12761{
12762 auto stream = mImpl->stream();
12763 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012764 auto resources = mImpl->resources();
12765 auto pool = mImpl->pool();
12766 VkPhysicalDevice local_physicalDevice;
12767 local_physicalDevice = physicalDevice;
12768 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
12769 VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo;
12770 local_pExternalSemaphoreInfo = nullptr;
12771 if (pExternalSemaphoreInfo)
12772 {
12773 local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo));
12774 deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
12775 }
12776 if (local_pExternalSemaphoreInfo)
12777 {
12778 handlemap_VkPhysicalDeviceExternalSemaphoreInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
12779 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012780 countingStream->rewind();
12781 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012782 uint64_t cgen_var_871 = (uint64_t)local_physicalDevice;
12783 countingStream->putBe64(cgen_var_871);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012784 marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012785 marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
12786 }
12787 uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12788 countingStream->rewind();
12789 uint32_t opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR;
12790 stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t));
12791 stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012792 uint64_t cgen_var_872 = (uint64_t)local_physicalDevice;
12793 stream->putBe64(cgen_var_872);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012794 marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012795 marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
12796 unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012797 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012798}
12799
12800#endif
12801#ifdef VK_KHR_external_semaphore
12802#endif
12803#ifdef VK_KHR_external_semaphore_win32
12804VkResult VkEncoder::vkImportSemaphoreWin32HandleKHR(
12805 VkDevice device,
12806 const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo)
12807{
12808 auto stream = mImpl->stream();
12809 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012810 auto resources = mImpl->resources();
12811 auto pool = mImpl->pool();
12812 VkDevice local_device;
12813 local_device = device;
12814 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12815 VkImportSemaphoreWin32HandleInfoKHR* local_pImportSemaphoreWin32HandleInfo;
12816 local_pImportSemaphoreWin32HandleInfo = nullptr;
12817 if (pImportSemaphoreWin32HandleInfo)
12818 {
12819 local_pImportSemaphoreWin32HandleInfo = (VkImportSemaphoreWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreWin32HandleInfoKHR));
12820 deepcopy_VkImportSemaphoreWin32HandleInfoKHR(pool, pImportSemaphoreWin32HandleInfo, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
12821 }
12822 if (local_pImportSemaphoreWin32HandleInfo)
12823 {
12824 handlemap_VkImportSemaphoreWin32HandleInfoKHR(resources->unwrapMapping(), (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
12825 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012826 countingStream->rewind();
12827 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012828 uint64_t cgen_var_873 = (uint64_t)local_device;
12829 countingStream->putBe64(cgen_var_873);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012830 marshal_VkImportSemaphoreWin32HandleInfoKHR(countingStream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012831 }
12832 uint32_t packetSize_vkImportSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12833 countingStream->rewind();
12834 uint32_t opcode_vkImportSemaphoreWin32HandleKHR = OP_vkImportSemaphoreWin32HandleKHR;
12835 stream->write(&opcode_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t));
12836 stream->write(&packetSize_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012837 uint64_t cgen_var_874 = (uint64_t)local_device;
12838 stream->putBe64(cgen_var_874);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012839 marshal_VkImportSemaphoreWin32HandleInfoKHR(stream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
12840 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012841 VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
12842 stream->read(&vkImportSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult));
12843 return vkImportSemaphoreWin32HandleKHR_VkResult_return;
12844}
12845
12846VkResult VkEncoder::vkGetSemaphoreWin32HandleKHR(
12847 VkDevice device,
12848 const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
12849 HANDLE* pHandle)
12850{
12851 auto stream = mImpl->stream();
12852 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012853 auto resources = mImpl->resources();
12854 auto pool = mImpl->pool();
12855 VkDevice local_device;
12856 local_device = device;
12857 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12858 VkSemaphoreGetWin32HandleInfoKHR* local_pGetWin32HandleInfo;
12859 local_pGetWin32HandleInfo = nullptr;
12860 if (pGetWin32HandleInfo)
12861 {
12862 local_pGetWin32HandleInfo = (VkSemaphoreGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetWin32HandleInfoKHR));
12863 deepcopy_VkSemaphoreGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
12864 }
12865 if (local_pGetWin32HandleInfo)
12866 {
12867 handlemap_VkSemaphoreGetWin32HandleInfoKHR(resources->unwrapMapping(), (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
12868 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012869 countingStream->rewind();
12870 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012871 uint64_t cgen_var_875 = (uint64_t)local_device;
12872 countingStream->putBe64(cgen_var_875);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012873 marshal_VkSemaphoreGetWin32HandleInfoKHR(countingStream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012874 countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
12875 }
12876 uint32_t packetSize_vkGetSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12877 countingStream->rewind();
12878 uint32_t opcode_vkGetSemaphoreWin32HandleKHR = OP_vkGetSemaphoreWin32HandleKHR;
12879 stream->write(&opcode_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t));
12880 stream->write(&packetSize_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012881 uint64_t cgen_var_876 = (uint64_t)local_device;
12882 stream->putBe64(cgen_var_876);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012883 marshal_VkSemaphoreGetWin32HandleInfoKHR(stream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012884 stream->write((HANDLE*)pHandle, sizeof(HANDLE));
12885 stream->read((HANDLE*)pHandle, sizeof(HANDLE));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012886 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012887 VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
12888 stream->read(&vkGetSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult));
12889 return vkGetSemaphoreWin32HandleKHR_VkResult_return;
12890}
12891
12892#endif
12893#ifdef VK_KHR_external_semaphore_fd
12894VkResult VkEncoder::vkImportSemaphoreFdKHR(
12895 VkDevice device,
12896 const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo)
12897{
12898 auto stream = mImpl->stream();
12899 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012900 auto resources = mImpl->resources();
12901 auto pool = mImpl->pool();
12902 VkDevice local_device;
12903 local_device = device;
12904 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12905 VkImportSemaphoreFdInfoKHR* local_pImportSemaphoreFdInfo;
12906 local_pImportSemaphoreFdInfo = nullptr;
12907 if (pImportSemaphoreFdInfo)
12908 {
12909 local_pImportSemaphoreFdInfo = (VkImportSemaphoreFdInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreFdInfoKHR));
12910 deepcopy_VkImportSemaphoreFdInfoKHR(pool, pImportSemaphoreFdInfo, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
12911 }
12912 if (local_pImportSemaphoreFdInfo)
12913 {
12914 handlemap_VkImportSemaphoreFdInfoKHR(resources->unwrapMapping(), (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
12915 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012916 countingStream->rewind();
12917 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012918 uint64_t cgen_var_877 = (uint64_t)local_device;
12919 countingStream->putBe64(cgen_var_877);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012920 marshal_VkImportSemaphoreFdInfoKHR(countingStream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012921 }
12922 uint32_t packetSize_vkImportSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12923 countingStream->rewind();
12924 uint32_t opcode_vkImportSemaphoreFdKHR = OP_vkImportSemaphoreFdKHR;
12925 stream->write(&opcode_vkImportSemaphoreFdKHR, sizeof(uint32_t));
12926 stream->write(&packetSize_vkImportSemaphoreFdKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012927 uint64_t cgen_var_878 = (uint64_t)local_device;
12928 stream->putBe64(cgen_var_878);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012929 marshal_VkImportSemaphoreFdInfoKHR(stream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
12930 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012931 VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0;
12932 stream->read(&vkImportSemaphoreFdKHR_VkResult_return, sizeof(VkResult));
12933 return vkImportSemaphoreFdKHR_VkResult_return;
12934}
12935
12936VkResult VkEncoder::vkGetSemaphoreFdKHR(
12937 VkDevice device,
12938 const VkSemaphoreGetFdInfoKHR* pGetFdInfo,
12939 int* pFd)
12940{
12941 auto stream = mImpl->stream();
12942 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012943 auto resources = mImpl->resources();
12944 auto pool = mImpl->pool();
12945 VkDevice local_device;
12946 local_device = device;
12947 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12948 VkSemaphoreGetFdInfoKHR* local_pGetFdInfo;
12949 local_pGetFdInfo = nullptr;
12950 if (pGetFdInfo)
12951 {
12952 local_pGetFdInfo = (VkSemaphoreGetFdInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetFdInfoKHR));
12953 deepcopy_VkSemaphoreGetFdInfoKHR(pool, pGetFdInfo, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
12954 }
12955 if (local_pGetFdInfo)
12956 {
12957 handlemap_VkSemaphoreGetFdInfoKHR(resources->unwrapMapping(), (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
12958 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012959 countingStream->rewind();
12960 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012961 uint64_t cgen_var_879 = (uint64_t)local_device;
12962 countingStream->putBe64(cgen_var_879);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012963 marshal_VkSemaphoreGetFdInfoKHR(countingStream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012964 countingStream->write((int*)pFd, sizeof(int));
12965 }
12966 uint32_t packetSize_vkGetSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12967 countingStream->rewind();
12968 uint32_t opcode_vkGetSemaphoreFdKHR = OP_vkGetSemaphoreFdKHR;
12969 stream->write(&opcode_vkGetSemaphoreFdKHR, sizeof(uint32_t));
12970 stream->write(&packetSize_vkGetSemaphoreFdKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080012971 uint64_t cgen_var_880 = (uint64_t)local_device;
12972 stream->putBe64(cgen_var_880);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012973 marshal_VkSemaphoreGetFdInfoKHR(stream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012974 stream->write((int*)pFd, sizeof(int));
12975 stream->read((int*)pFd, sizeof(int));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012976 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012977 VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0;
12978 stream->read(&vkGetSemaphoreFdKHR_VkResult_return, sizeof(VkResult));
12979 return vkGetSemaphoreFdKHR_VkResult_return;
12980}
12981
12982#endif
12983#ifdef VK_KHR_push_descriptor
12984void VkEncoder::vkCmdPushDescriptorSetKHR(
12985 VkCommandBuffer commandBuffer,
12986 VkPipelineBindPoint pipelineBindPoint,
12987 VkPipelineLayout layout,
12988 uint32_t set,
12989 uint32_t descriptorWriteCount,
12990 const VkWriteDescriptorSet* pDescriptorWrites)
12991{
12992 auto stream = mImpl->stream();
12993 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012994 auto resources = mImpl->resources();
12995 auto pool = mImpl->pool();
12996 VkCommandBuffer local_commandBuffer;
12997 local_commandBuffer = commandBuffer;
12998 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
12999 VkPipelineBindPoint local_pipelineBindPoint;
13000 local_pipelineBindPoint = pipelineBindPoint;
13001 VkPipelineLayout local_layout;
13002 local_layout = layout;
13003 resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout);
13004 uint32_t local_set;
13005 local_set = set;
13006 uint32_t local_descriptorWriteCount;
13007 local_descriptorWriteCount = descriptorWriteCount;
13008 VkWriteDescriptorSet* local_pDescriptorWrites;
13009 local_pDescriptorWrites = nullptr;
13010 if (pDescriptorWrites)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013011 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013012 local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013013 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
13014 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013015 deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
13016 }
13017 }
13018 if (local_pDescriptorWrites)
13019 {
13020 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
13021 {
13022 handlemap_VkWriteDescriptorSet(resources->unwrapMapping(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
13023 }
13024 }
13025 countingStream->rewind();
13026 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013027 uint64_t cgen_var_881 = (uint64_t)local_commandBuffer;
13028 countingStream->putBe64(cgen_var_881);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013029 countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013030 uint64_t cgen_var_882 = (uint64_t)local_layout;
13031 countingStream->putBe64(cgen_var_882);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013032 countingStream->write((uint32_t*)&local_set, sizeof(uint32_t));
13033 countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
13034 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
13035 {
13036 marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013037 }
13038 }
13039 uint32_t packetSize_vkCmdPushDescriptorSetKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13040 countingStream->rewind();
13041 uint32_t opcode_vkCmdPushDescriptorSetKHR = OP_vkCmdPushDescriptorSetKHR;
13042 stream->write(&opcode_vkCmdPushDescriptorSetKHR, sizeof(uint32_t));
13043 stream->write(&packetSize_vkCmdPushDescriptorSetKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013044 uint64_t cgen_var_883 = (uint64_t)local_commandBuffer;
13045 stream->putBe64(cgen_var_883);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013046 stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013047 uint64_t cgen_var_884 = (uint64_t)local_layout;
13048 stream->putBe64(cgen_var_884);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013049 stream->write((uint32_t*)&local_set, sizeof(uint32_t));
13050 stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013051 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
13052 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013053 marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013054 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013055 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013056}
13057
13058void VkEncoder::vkCmdPushDescriptorSetWithTemplateKHR(
13059 VkCommandBuffer commandBuffer,
13060 VkDescriptorUpdateTemplate descriptorUpdateTemplate,
13061 VkPipelineLayout layout,
13062 uint32_t set,
13063 const void* pData)
13064{
13065 auto stream = mImpl->stream();
13066 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013067 auto resources = mImpl->resources();
13068 auto pool = mImpl->pool();
13069 VkCommandBuffer local_commandBuffer;
13070 local_commandBuffer = commandBuffer;
13071 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
13072 VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
13073 local_descriptorUpdateTemplate = descriptorUpdateTemplate;
13074 resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate);
13075 VkPipelineLayout local_layout;
13076 local_layout = layout;
13077 resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout);
13078 uint32_t local_set;
13079 local_set = set;
13080 void* local_pData;
13081 local_pData = nullptr;
13082 if (pData)
13083 {
13084 local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t));
13085 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013086 countingStream->rewind();
13087 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013088 uint64_t cgen_var_885 = (uint64_t)local_commandBuffer;
13089 countingStream->putBe64(cgen_var_885);
13090 uint64_t cgen_var_886 = (uint64_t)local_descriptorUpdateTemplate;
13091 countingStream->putBe64(cgen_var_886);
13092 uint64_t cgen_var_887 = (uint64_t)local_layout;
13093 countingStream->putBe64(cgen_var_887);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013094 countingStream->write((uint32_t*)&local_set, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013095 // WARNING PTR CHECK
13096 uint64_t cgen_var_888 = (uint64_t)(uintptr_t)local_pData;
13097 countingStream->putBe64(cgen_var_888);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013098 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013099 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013100 countingStream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013101 }
13102 }
13103 uint32_t packetSize_vkCmdPushDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13104 countingStream->rewind();
13105 uint32_t opcode_vkCmdPushDescriptorSetWithTemplateKHR = OP_vkCmdPushDescriptorSetWithTemplateKHR;
13106 stream->write(&opcode_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t));
13107 stream->write(&packetSize_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013108 uint64_t cgen_var_889 = (uint64_t)local_commandBuffer;
13109 stream->putBe64(cgen_var_889);
13110 uint64_t cgen_var_890 = (uint64_t)local_descriptorUpdateTemplate;
13111 stream->putBe64(cgen_var_890);
13112 uint64_t cgen_var_891 = (uint64_t)local_layout;
13113 stream->putBe64(cgen_var_891);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013114 stream->write((uint32_t*)&local_set, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013115 // WARNING PTR CHECK
13116 uint64_t cgen_var_892 = (uint64_t)(uintptr_t)local_pData;
13117 stream->putBe64(cgen_var_892);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013118 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013119 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013120 stream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013121 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013122 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013123}
13124
13125#endif
13126#ifdef VK_KHR_16bit_storage
13127#endif
13128#ifdef VK_KHR_incremental_present
13129#endif
13130#ifdef VK_KHR_descriptor_update_template
13131VkResult VkEncoder::vkCreateDescriptorUpdateTemplateKHR(
13132 VkDevice device,
13133 const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
13134 const VkAllocationCallbacks* pAllocator,
13135 VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate)
13136{
13137 auto stream = mImpl->stream();
13138 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013139 auto resources = mImpl->resources();
13140 auto pool = mImpl->pool();
13141 VkDevice local_device;
13142 local_device = device;
13143 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13144 VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo;
13145 local_pCreateInfo = nullptr;
13146 if (pCreateInfo)
13147 {
13148 local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo));
13149 deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
13150 }
13151 if (local_pCreateInfo)
13152 {
13153 handlemap_VkDescriptorUpdateTemplateCreateInfo(resources->unwrapMapping(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
13154 }
13155 VkAllocationCallbacks* local_pAllocator;
13156 local_pAllocator = nullptr;
13157 if (pAllocator)
13158 {
13159 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
13160 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
13161 }
13162 if (local_pAllocator)
13163 {
13164 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
13165 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080013166 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013167 countingStream->rewind();
13168 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013169 uint64_t cgen_var_893 = (uint64_t)local_device;
13170 countingStream->putBe64(cgen_var_893);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013171 marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013172 // WARNING PTR CHECK
13173 uint64_t cgen_var_894 = (uint64_t)(uintptr_t)local_pAllocator;
13174 countingStream->putBe64(cgen_var_894);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013175 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013176 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013177 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013178 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013179 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013180 countingStream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
13181 }
13182 uint32_t packetSize_vkCreateDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13183 countingStream->rewind();
13184 uint32_t opcode_vkCreateDescriptorUpdateTemplateKHR = OP_vkCreateDescriptorUpdateTemplateKHR;
13185 stream->write(&opcode_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t));
13186 stream->write(&packetSize_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013187 uint64_t cgen_var_895 = (uint64_t)local_device;
13188 stream->putBe64(cgen_var_895);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013189 marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013190 // WARNING PTR CHECK
13191 uint64_t cgen_var_896 = (uint64_t)(uintptr_t)local_pAllocator;
13192 stream->putBe64(cgen_var_896);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013193 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013194 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013195 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013196 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013197 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013198 stream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013199 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013200 stream->read((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013201 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013202 VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0;
13203 stream->read(&vkCreateDescriptorUpdateTemplateKHR_VkResult_return, sizeof(VkResult));
13204 return vkCreateDescriptorUpdateTemplateKHR_VkResult_return;
13205}
13206
13207void VkEncoder::vkDestroyDescriptorUpdateTemplateKHR(
13208 VkDevice device,
13209 VkDescriptorUpdateTemplate descriptorUpdateTemplate,
13210 const VkAllocationCallbacks* pAllocator)
13211{
13212 auto stream = mImpl->stream();
13213 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013214 auto resources = mImpl->resources();
13215 auto pool = mImpl->pool();
13216 VkDevice local_device;
13217 local_device = device;
13218 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13219 VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
13220 local_descriptorUpdateTemplate = descriptorUpdateTemplate;
13221 resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate);
13222 VkAllocationCallbacks* local_pAllocator;
13223 local_pAllocator = nullptr;
13224 if (pAllocator)
13225 {
13226 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
13227 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
13228 }
13229 if (local_pAllocator)
13230 {
13231 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
13232 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080013233 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013234 countingStream->rewind();
13235 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013236 uint64_t cgen_var_897 = (uint64_t)local_device;
13237 countingStream->putBe64(cgen_var_897);
13238 uint64_t cgen_var_898 = (uint64_t)local_descriptorUpdateTemplate;
13239 countingStream->putBe64(cgen_var_898);
13240 // WARNING PTR CHECK
13241 uint64_t cgen_var_899 = (uint64_t)(uintptr_t)local_pAllocator;
13242 countingStream->putBe64(cgen_var_899);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013243 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013244 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013245 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013246 }
13247 }
13248 uint32_t packetSize_vkDestroyDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13249 countingStream->rewind();
13250 uint32_t opcode_vkDestroyDescriptorUpdateTemplateKHR = OP_vkDestroyDescriptorUpdateTemplateKHR;
13251 stream->write(&opcode_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t));
13252 stream->write(&packetSize_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013253 uint64_t cgen_var_900 = (uint64_t)local_device;
13254 stream->putBe64(cgen_var_900);
13255 uint64_t cgen_var_901 = (uint64_t)local_descriptorUpdateTemplate;
13256 stream->putBe64(cgen_var_901);
13257 // WARNING PTR CHECK
13258 uint64_t cgen_var_902 = (uint64_t)(uintptr_t)local_pAllocator;
13259 stream->putBe64(cgen_var_902);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013260 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013261 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013262 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013263 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013264 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013265}
13266
13267void VkEncoder::vkUpdateDescriptorSetWithTemplateKHR(
13268 VkDevice device,
13269 VkDescriptorSet descriptorSet,
13270 VkDescriptorUpdateTemplate descriptorUpdateTemplate,
13271 const void* pData)
13272{
13273 auto stream = mImpl->stream();
13274 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013275 auto resources = mImpl->resources();
13276 auto pool = mImpl->pool();
13277 VkDevice local_device;
13278 local_device = device;
13279 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13280 VkDescriptorSet local_descriptorSet;
13281 local_descriptorSet = descriptorSet;
13282 resources->unwrapMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)&local_descriptorSet);
13283 VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
13284 local_descriptorUpdateTemplate = descriptorUpdateTemplate;
13285 resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate);
13286 void* local_pData;
13287 local_pData = nullptr;
13288 if (pData)
13289 {
13290 local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t));
13291 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013292 countingStream->rewind();
13293 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013294 uint64_t cgen_var_903 = (uint64_t)local_device;
13295 countingStream->putBe64(cgen_var_903);
13296 uint64_t cgen_var_904 = (uint64_t)local_descriptorSet;
13297 countingStream->putBe64(cgen_var_904);
13298 uint64_t cgen_var_905 = (uint64_t)local_descriptorUpdateTemplate;
13299 countingStream->putBe64(cgen_var_905);
13300 // WARNING PTR CHECK
13301 uint64_t cgen_var_906 = (uint64_t)(uintptr_t)local_pData;
13302 countingStream->putBe64(cgen_var_906);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013303 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013304 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013305 countingStream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013306 }
13307 }
13308 uint32_t packetSize_vkUpdateDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13309 countingStream->rewind();
13310 uint32_t opcode_vkUpdateDescriptorSetWithTemplateKHR = OP_vkUpdateDescriptorSetWithTemplateKHR;
13311 stream->write(&opcode_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t));
13312 stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013313 uint64_t cgen_var_907 = (uint64_t)local_device;
13314 stream->putBe64(cgen_var_907);
13315 uint64_t cgen_var_908 = (uint64_t)local_descriptorSet;
13316 stream->putBe64(cgen_var_908);
13317 uint64_t cgen_var_909 = (uint64_t)local_descriptorUpdateTemplate;
13318 stream->putBe64(cgen_var_909);
13319 // WARNING PTR CHECK
13320 uint64_t cgen_var_910 = (uint64_t)(uintptr_t)local_pData;
13321 stream->putBe64(cgen_var_910);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013322 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013323 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013324 stream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013325 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013326 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013327}
13328
13329#endif
13330#ifdef VK_KHR_create_renderpass2
13331VkResult VkEncoder::vkCreateRenderPass2KHR(
13332 VkDevice device,
13333 const VkRenderPassCreateInfo2KHR* pCreateInfo,
13334 const VkAllocationCallbacks* pAllocator,
13335 VkRenderPass* pRenderPass)
13336{
13337 auto stream = mImpl->stream();
13338 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013339 auto resources = mImpl->resources();
13340 auto pool = mImpl->pool();
13341 VkDevice local_device;
13342 local_device = device;
13343 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13344 VkRenderPassCreateInfo2KHR* local_pCreateInfo;
13345 local_pCreateInfo = nullptr;
13346 if (pCreateInfo)
13347 {
13348 local_pCreateInfo = (VkRenderPassCreateInfo2KHR*)pool->alloc(sizeof(const VkRenderPassCreateInfo2KHR));
13349 deepcopy_VkRenderPassCreateInfo2KHR(pool, pCreateInfo, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo));
13350 }
13351 if (local_pCreateInfo)
13352 {
13353 handlemap_VkRenderPassCreateInfo2KHR(resources->unwrapMapping(), (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo));
13354 }
13355 VkAllocationCallbacks* local_pAllocator;
13356 local_pAllocator = nullptr;
13357 if (pAllocator)
13358 {
13359 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
13360 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
13361 }
13362 if (local_pAllocator)
13363 {
13364 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
13365 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080013366 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013367 countingStream->rewind();
13368 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013369 uint64_t cgen_var_911 = (uint64_t)local_device;
13370 countingStream->putBe64(cgen_var_911);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013371 marshal_VkRenderPassCreateInfo2KHR(countingStream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013372 // WARNING PTR CHECK
13373 uint64_t cgen_var_912 = (uint64_t)(uintptr_t)local_pAllocator;
13374 countingStream->putBe64(cgen_var_912);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013375 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013376 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013377 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013378 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013379 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013380 countingStream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
13381 }
13382 uint32_t packetSize_vkCreateRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13383 countingStream->rewind();
13384 uint32_t opcode_vkCreateRenderPass2KHR = OP_vkCreateRenderPass2KHR;
13385 stream->write(&opcode_vkCreateRenderPass2KHR, sizeof(uint32_t));
13386 stream->write(&packetSize_vkCreateRenderPass2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013387 uint64_t cgen_var_913 = (uint64_t)local_device;
13388 stream->putBe64(cgen_var_913);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013389 marshal_VkRenderPassCreateInfo2KHR(stream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013390 // WARNING PTR CHECK
13391 uint64_t cgen_var_914 = (uint64_t)(uintptr_t)local_pAllocator;
13392 stream->putBe64(cgen_var_914);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013393 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013394 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013395 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013396 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013397 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013398 stream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013399 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013400 stream->read((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013401 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013402 VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0;
13403 stream->read(&vkCreateRenderPass2KHR_VkResult_return, sizeof(VkResult));
13404 return vkCreateRenderPass2KHR_VkResult_return;
13405}
13406
13407void VkEncoder::vkCmdBeginRenderPass2KHR(
13408 VkCommandBuffer commandBuffer,
13409 const VkRenderPassBeginInfo* pRenderPassBegin,
13410 const VkSubpassBeginInfoKHR* pSubpassBeginInfo)
13411{
13412 auto stream = mImpl->stream();
13413 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013414 auto resources = mImpl->resources();
13415 auto pool = mImpl->pool();
13416 VkCommandBuffer local_commandBuffer;
13417 local_commandBuffer = commandBuffer;
13418 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
13419 VkRenderPassBeginInfo* local_pRenderPassBegin;
13420 local_pRenderPassBegin = nullptr;
13421 if (pRenderPassBegin)
13422 {
13423 local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo));
13424 deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
13425 }
13426 if (local_pRenderPassBegin)
13427 {
13428 handlemap_VkRenderPassBeginInfo(resources->unwrapMapping(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
13429 }
13430 VkSubpassBeginInfoKHR* local_pSubpassBeginInfo;
13431 local_pSubpassBeginInfo = nullptr;
13432 if (pSubpassBeginInfo)
13433 {
13434 local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR));
13435 deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
13436 }
13437 if (local_pSubpassBeginInfo)
13438 {
13439 handlemap_VkSubpassBeginInfoKHR(resources->unwrapMapping(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
13440 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013441 countingStream->rewind();
13442 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013443 uint64_t cgen_var_915 = (uint64_t)local_commandBuffer;
13444 countingStream->putBe64(cgen_var_915);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013445 marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
13446 marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013447 }
13448 uint32_t packetSize_vkCmdBeginRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13449 countingStream->rewind();
13450 uint32_t opcode_vkCmdBeginRenderPass2KHR = OP_vkCmdBeginRenderPass2KHR;
13451 stream->write(&opcode_vkCmdBeginRenderPass2KHR, sizeof(uint32_t));
13452 stream->write(&packetSize_vkCmdBeginRenderPass2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013453 uint64_t cgen_var_916 = (uint64_t)local_commandBuffer;
13454 stream->putBe64(cgen_var_916);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013455 marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
13456 marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
13457 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013458}
13459
13460void VkEncoder::vkCmdNextSubpass2KHR(
13461 VkCommandBuffer commandBuffer,
13462 const VkSubpassBeginInfoKHR* pSubpassBeginInfo,
13463 const VkSubpassEndInfoKHR* pSubpassEndInfo)
13464{
13465 auto stream = mImpl->stream();
13466 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013467 auto resources = mImpl->resources();
13468 auto pool = mImpl->pool();
13469 VkCommandBuffer local_commandBuffer;
13470 local_commandBuffer = commandBuffer;
13471 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
13472 VkSubpassBeginInfoKHR* local_pSubpassBeginInfo;
13473 local_pSubpassBeginInfo = nullptr;
13474 if (pSubpassBeginInfo)
13475 {
13476 local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR));
13477 deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
13478 }
13479 if (local_pSubpassBeginInfo)
13480 {
13481 handlemap_VkSubpassBeginInfoKHR(resources->unwrapMapping(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
13482 }
13483 VkSubpassEndInfoKHR* local_pSubpassEndInfo;
13484 local_pSubpassEndInfo = nullptr;
13485 if (pSubpassEndInfo)
13486 {
13487 local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR));
13488 deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
13489 }
13490 if (local_pSubpassEndInfo)
13491 {
13492 handlemap_VkSubpassEndInfoKHR(resources->unwrapMapping(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
13493 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013494 countingStream->rewind();
13495 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013496 uint64_t cgen_var_917 = (uint64_t)local_commandBuffer;
13497 countingStream->putBe64(cgen_var_917);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013498 marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
13499 marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013500 }
13501 uint32_t packetSize_vkCmdNextSubpass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13502 countingStream->rewind();
13503 uint32_t opcode_vkCmdNextSubpass2KHR = OP_vkCmdNextSubpass2KHR;
13504 stream->write(&opcode_vkCmdNextSubpass2KHR, sizeof(uint32_t));
13505 stream->write(&packetSize_vkCmdNextSubpass2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013506 uint64_t cgen_var_918 = (uint64_t)local_commandBuffer;
13507 stream->putBe64(cgen_var_918);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013508 marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
13509 marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
13510 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013511}
13512
13513void VkEncoder::vkCmdEndRenderPass2KHR(
13514 VkCommandBuffer commandBuffer,
13515 const VkSubpassEndInfoKHR* pSubpassEndInfo)
13516{
13517 auto stream = mImpl->stream();
13518 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013519 auto resources = mImpl->resources();
13520 auto pool = mImpl->pool();
13521 VkCommandBuffer local_commandBuffer;
13522 local_commandBuffer = commandBuffer;
13523 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
13524 VkSubpassEndInfoKHR* local_pSubpassEndInfo;
13525 local_pSubpassEndInfo = nullptr;
13526 if (pSubpassEndInfo)
13527 {
13528 local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR));
13529 deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
13530 }
13531 if (local_pSubpassEndInfo)
13532 {
13533 handlemap_VkSubpassEndInfoKHR(resources->unwrapMapping(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
13534 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013535 countingStream->rewind();
13536 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013537 uint64_t cgen_var_919 = (uint64_t)local_commandBuffer;
13538 countingStream->putBe64(cgen_var_919);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013539 marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013540 }
13541 uint32_t packetSize_vkCmdEndRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13542 countingStream->rewind();
13543 uint32_t opcode_vkCmdEndRenderPass2KHR = OP_vkCmdEndRenderPass2KHR;
13544 stream->write(&opcode_vkCmdEndRenderPass2KHR, sizeof(uint32_t));
13545 stream->write(&packetSize_vkCmdEndRenderPass2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013546 uint64_t cgen_var_920 = (uint64_t)local_commandBuffer;
13547 stream->putBe64(cgen_var_920);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013548 marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
13549 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013550}
13551
13552#endif
13553#ifdef VK_KHR_shared_presentable_image
13554VkResult VkEncoder::vkGetSwapchainStatusKHR(
13555 VkDevice device,
13556 VkSwapchainKHR swapchain)
13557{
13558 auto stream = mImpl->stream();
13559 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013560 auto resources = mImpl->resources();
13561 auto pool = mImpl->pool();
13562 VkDevice local_device;
13563 local_device = device;
13564 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13565 VkSwapchainKHR local_swapchain;
13566 local_swapchain = swapchain;
13567 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013568 countingStream->rewind();
13569 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013570 uint64_t cgen_var_921 = (uint64_t)local_device;
13571 countingStream->putBe64(cgen_var_921);
13572 uint64_t cgen_var_922 = (uint64_t)local_swapchain;
13573 countingStream->putBe64(cgen_var_922);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013574 }
13575 uint32_t packetSize_vkGetSwapchainStatusKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13576 countingStream->rewind();
13577 uint32_t opcode_vkGetSwapchainStatusKHR = OP_vkGetSwapchainStatusKHR;
13578 stream->write(&opcode_vkGetSwapchainStatusKHR, sizeof(uint32_t));
13579 stream->write(&packetSize_vkGetSwapchainStatusKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013580 uint64_t cgen_var_923 = (uint64_t)local_device;
13581 stream->putBe64(cgen_var_923);
13582 uint64_t cgen_var_924 = (uint64_t)local_swapchain;
13583 stream->putBe64(cgen_var_924);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013584 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013585 VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0;
13586 stream->read(&vkGetSwapchainStatusKHR_VkResult_return, sizeof(VkResult));
13587 return vkGetSwapchainStatusKHR_VkResult_return;
13588}
13589
13590#endif
13591#ifdef VK_KHR_external_fence_capabilities
13592void VkEncoder::vkGetPhysicalDeviceExternalFencePropertiesKHR(
13593 VkPhysicalDevice physicalDevice,
13594 const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
13595 VkExternalFenceProperties* pExternalFenceProperties)
13596{
13597 auto stream = mImpl->stream();
13598 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013599 auto resources = mImpl->resources();
13600 auto pool = mImpl->pool();
13601 VkPhysicalDevice local_physicalDevice;
13602 local_physicalDevice = physicalDevice;
13603 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
13604 VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo;
13605 local_pExternalFenceInfo = nullptr;
13606 if (pExternalFenceInfo)
13607 {
13608 local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo));
13609 deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
13610 }
13611 if (local_pExternalFenceInfo)
13612 {
13613 handlemap_VkPhysicalDeviceExternalFenceInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
13614 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013615 countingStream->rewind();
13616 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013617 uint64_t cgen_var_925 = (uint64_t)local_physicalDevice;
13618 countingStream->putBe64(cgen_var_925);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013619 marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013620 marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties));
13621 }
13622 uint32_t packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13623 countingStream->rewind();
13624 uint32_t opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR = OP_vkGetPhysicalDeviceExternalFencePropertiesKHR;
13625 stream->write(&opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t));
13626 stream->write(&packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013627 uint64_t cgen_var_926 = (uint64_t)local_physicalDevice;
13628 stream->putBe64(cgen_var_926);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013629 marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013630 marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
13631 unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013632 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013633}
13634
13635#endif
13636#ifdef VK_KHR_external_fence
13637#endif
13638#ifdef VK_KHR_external_fence_win32
13639VkResult VkEncoder::vkImportFenceWin32HandleKHR(
13640 VkDevice device,
13641 const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo)
13642{
13643 auto stream = mImpl->stream();
13644 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013645 auto resources = mImpl->resources();
13646 auto pool = mImpl->pool();
13647 VkDevice local_device;
13648 local_device = device;
13649 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13650 VkImportFenceWin32HandleInfoKHR* local_pImportFenceWin32HandleInfo;
13651 local_pImportFenceWin32HandleInfo = nullptr;
13652 if (pImportFenceWin32HandleInfo)
13653 {
13654 local_pImportFenceWin32HandleInfo = (VkImportFenceWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportFenceWin32HandleInfoKHR));
13655 deepcopy_VkImportFenceWin32HandleInfoKHR(pool, pImportFenceWin32HandleInfo, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
13656 }
13657 if (local_pImportFenceWin32HandleInfo)
13658 {
13659 handlemap_VkImportFenceWin32HandleInfoKHR(resources->unwrapMapping(), (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
13660 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013661 countingStream->rewind();
13662 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013663 uint64_t cgen_var_927 = (uint64_t)local_device;
13664 countingStream->putBe64(cgen_var_927);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013665 marshal_VkImportFenceWin32HandleInfoKHR(countingStream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013666 }
13667 uint32_t packetSize_vkImportFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13668 countingStream->rewind();
13669 uint32_t opcode_vkImportFenceWin32HandleKHR = OP_vkImportFenceWin32HandleKHR;
13670 stream->write(&opcode_vkImportFenceWin32HandleKHR, sizeof(uint32_t));
13671 stream->write(&packetSize_vkImportFenceWin32HandleKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013672 uint64_t cgen_var_928 = (uint64_t)local_device;
13673 stream->putBe64(cgen_var_928);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013674 marshal_VkImportFenceWin32HandleInfoKHR(stream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
13675 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013676 VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0;
13677 stream->read(&vkImportFenceWin32HandleKHR_VkResult_return, sizeof(VkResult));
13678 return vkImportFenceWin32HandleKHR_VkResult_return;
13679}
13680
13681VkResult VkEncoder::vkGetFenceWin32HandleKHR(
13682 VkDevice device,
13683 const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
13684 HANDLE* pHandle)
13685{
13686 auto stream = mImpl->stream();
13687 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013688 auto resources = mImpl->resources();
13689 auto pool = mImpl->pool();
13690 VkDevice local_device;
13691 local_device = device;
13692 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13693 VkFenceGetWin32HandleInfoKHR* local_pGetWin32HandleInfo;
13694 local_pGetWin32HandleInfo = nullptr;
13695 if (pGetWin32HandleInfo)
13696 {
13697 local_pGetWin32HandleInfo = (VkFenceGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkFenceGetWin32HandleInfoKHR));
13698 deepcopy_VkFenceGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
13699 }
13700 if (local_pGetWin32HandleInfo)
13701 {
13702 handlemap_VkFenceGetWin32HandleInfoKHR(resources->unwrapMapping(), (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
13703 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013704 countingStream->rewind();
13705 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013706 uint64_t cgen_var_929 = (uint64_t)local_device;
13707 countingStream->putBe64(cgen_var_929);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013708 marshal_VkFenceGetWin32HandleInfoKHR(countingStream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013709 countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
13710 }
13711 uint32_t packetSize_vkGetFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13712 countingStream->rewind();
13713 uint32_t opcode_vkGetFenceWin32HandleKHR = OP_vkGetFenceWin32HandleKHR;
13714 stream->write(&opcode_vkGetFenceWin32HandleKHR, sizeof(uint32_t));
13715 stream->write(&packetSize_vkGetFenceWin32HandleKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013716 uint64_t cgen_var_930 = (uint64_t)local_device;
13717 stream->putBe64(cgen_var_930);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013718 marshal_VkFenceGetWin32HandleInfoKHR(stream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013719 stream->write((HANDLE*)pHandle, sizeof(HANDLE));
13720 stream->read((HANDLE*)pHandle, sizeof(HANDLE));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013721 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013722 VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0;
13723 stream->read(&vkGetFenceWin32HandleKHR_VkResult_return, sizeof(VkResult));
13724 return vkGetFenceWin32HandleKHR_VkResult_return;
13725}
13726
13727#endif
13728#ifdef VK_KHR_external_fence_fd
13729VkResult VkEncoder::vkImportFenceFdKHR(
13730 VkDevice device,
13731 const VkImportFenceFdInfoKHR* pImportFenceFdInfo)
13732{
13733 auto stream = mImpl->stream();
13734 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013735 auto resources = mImpl->resources();
13736 auto pool = mImpl->pool();
13737 VkDevice local_device;
13738 local_device = device;
13739 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13740 VkImportFenceFdInfoKHR* local_pImportFenceFdInfo;
13741 local_pImportFenceFdInfo = nullptr;
13742 if (pImportFenceFdInfo)
13743 {
13744 local_pImportFenceFdInfo = (VkImportFenceFdInfoKHR*)pool->alloc(sizeof(const VkImportFenceFdInfoKHR));
13745 deepcopy_VkImportFenceFdInfoKHR(pool, pImportFenceFdInfo, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
13746 }
13747 if (local_pImportFenceFdInfo)
13748 {
13749 handlemap_VkImportFenceFdInfoKHR(resources->unwrapMapping(), (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
13750 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013751 countingStream->rewind();
13752 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013753 uint64_t cgen_var_931 = (uint64_t)local_device;
13754 countingStream->putBe64(cgen_var_931);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013755 marshal_VkImportFenceFdInfoKHR(countingStream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013756 }
13757 uint32_t packetSize_vkImportFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13758 countingStream->rewind();
13759 uint32_t opcode_vkImportFenceFdKHR = OP_vkImportFenceFdKHR;
13760 stream->write(&opcode_vkImportFenceFdKHR, sizeof(uint32_t));
13761 stream->write(&packetSize_vkImportFenceFdKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013762 uint64_t cgen_var_932 = (uint64_t)local_device;
13763 stream->putBe64(cgen_var_932);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013764 marshal_VkImportFenceFdInfoKHR(stream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
13765 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013766 VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0;
13767 stream->read(&vkImportFenceFdKHR_VkResult_return, sizeof(VkResult));
13768 return vkImportFenceFdKHR_VkResult_return;
13769}
13770
13771VkResult VkEncoder::vkGetFenceFdKHR(
13772 VkDevice device,
13773 const VkFenceGetFdInfoKHR* pGetFdInfo,
13774 int* pFd)
13775{
13776 auto stream = mImpl->stream();
13777 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013778 auto resources = mImpl->resources();
13779 auto pool = mImpl->pool();
13780 VkDevice local_device;
13781 local_device = device;
13782 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13783 VkFenceGetFdInfoKHR* local_pGetFdInfo;
13784 local_pGetFdInfo = nullptr;
13785 if (pGetFdInfo)
13786 {
13787 local_pGetFdInfo = (VkFenceGetFdInfoKHR*)pool->alloc(sizeof(const VkFenceGetFdInfoKHR));
13788 deepcopy_VkFenceGetFdInfoKHR(pool, pGetFdInfo, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
13789 }
13790 if (local_pGetFdInfo)
13791 {
13792 handlemap_VkFenceGetFdInfoKHR(resources->unwrapMapping(), (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
13793 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013794 countingStream->rewind();
13795 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013796 uint64_t cgen_var_933 = (uint64_t)local_device;
13797 countingStream->putBe64(cgen_var_933);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013798 marshal_VkFenceGetFdInfoKHR(countingStream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013799 countingStream->write((int*)pFd, sizeof(int));
13800 }
13801 uint32_t packetSize_vkGetFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13802 countingStream->rewind();
13803 uint32_t opcode_vkGetFenceFdKHR = OP_vkGetFenceFdKHR;
13804 stream->write(&opcode_vkGetFenceFdKHR, sizeof(uint32_t));
13805 stream->write(&packetSize_vkGetFenceFdKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013806 uint64_t cgen_var_934 = (uint64_t)local_device;
13807 stream->putBe64(cgen_var_934);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013808 marshal_VkFenceGetFdInfoKHR(stream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013809 stream->write((int*)pFd, sizeof(int));
13810 stream->read((int*)pFd, sizeof(int));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013811 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013812 VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0;
13813 stream->read(&vkGetFenceFdKHR_VkResult_return, sizeof(VkResult));
13814 return vkGetFenceFdKHR_VkResult_return;
13815}
13816
13817#endif
13818#ifdef VK_KHR_maintenance2
13819#endif
13820#ifdef VK_KHR_get_surface_capabilities2
13821VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2KHR(
13822 VkPhysicalDevice physicalDevice,
13823 const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
13824 VkSurfaceCapabilities2KHR* pSurfaceCapabilities)
13825{
13826 auto stream = mImpl->stream();
13827 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013828 auto resources = mImpl->resources();
13829 auto pool = mImpl->pool();
13830 VkPhysicalDevice local_physicalDevice;
13831 local_physicalDevice = physicalDevice;
13832 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
13833 VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo;
13834 local_pSurfaceInfo = nullptr;
13835 if (pSurfaceInfo)
13836 {
13837 local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR));
13838 deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
13839 }
13840 if (local_pSurfaceInfo)
13841 {
13842 handlemap_VkPhysicalDeviceSurfaceInfo2KHR(resources->unwrapMapping(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
13843 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013844 countingStream->rewind();
13845 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013846 uint64_t cgen_var_935 = (uint64_t)local_physicalDevice;
13847 countingStream->putBe64(cgen_var_935);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013848 marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013849 marshal_VkSurfaceCapabilities2KHR(countingStream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
13850 }
13851 uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13852 countingStream->rewind();
13853 uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR = OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR;
13854 stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t));
13855 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013856 uint64_t cgen_var_936 = (uint64_t)local_physicalDevice;
13857 stream->putBe64(cgen_var_936);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013858 marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013859 marshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
13860 unmarshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013861 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013862 VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0;
13863 stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return, sizeof(VkResult));
13864 return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return;
13865}
13866
13867VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormats2KHR(
13868 VkPhysicalDevice physicalDevice,
13869 const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
13870 uint32_t* pSurfaceFormatCount,
13871 VkSurfaceFormat2KHR* pSurfaceFormats)
13872{
13873 auto stream = mImpl->stream();
13874 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013875 auto resources = mImpl->resources();
13876 auto pool = mImpl->pool();
13877 VkPhysicalDevice local_physicalDevice;
13878 local_physicalDevice = physicalDevice;
13879 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
13880 VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo;
13881 local_pSurfaceInfo = nullptr;
13882 if (pSurfaceInfo)
13883 {
13884 local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR));
13885 deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
13886 }
13887 if (local_pSurfaceInfo)
13888 {
13889 handlemap_VkPhysicalDeviceSurfaceInfo2KHR(resources->unwrapMapping(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
13890 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013891 countingStream->rewind();
13892 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013893 uint64_t cgen_var_937 = (uint64_t)local_physicalDevice;
13894 countingStream->putBe64(cgen_var_937);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013895 marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013896 // WARNING PTR CHECK
13897 uint64_t cgen_var_938 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
13898 countingStream->putBe64(cgen_var_938);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013899 if (pSurfaceFormatCount)
13900 {
13901 countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
13902 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013903 // WARNING PTR CHECK
13904 uint64_t cgen_var_939 = (uint64_t)(uintptr_t)pSurfaceFormats;
13905 countingStream->putBe64(cgen_var_939);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013906 if (pSurfaceFormats)
13907 {
13908 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
13909 {
13910 marshal_VkSurfaceFormat2KHR(countingStream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i));
13911 }
13912 }
13913 }
13914 uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13915 countingStream->rewind();
13916 uint32_t opcode_vkGetPhysicalDeviceSurfaceFormats2KHR = OP_vkGetPhysicalDeviceSurfaceFormats2KHR;
13917 stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t));
13918 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013919 uint64_t cgen_var_940 = (uint64_t)local_physicalDevice;
13920 stream->putBe64(cgen_var_940);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013921 marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013922 // WARNING PTR CHECK
13923 uint64_t cgen_var_941 = (uint64_t)(uintptr_t)pSurfaceFormatCount;
13924 stream->putBe64(cgen_var_941);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013925 if (pSurfaceFormatCount)
13926 {
13927 stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
13928 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013929 // WARNING PTR CHECK
13930 uint64_t cgen_var_942 = (uint64_t)(uintptr_t)pSurfaceFormats;
13931 stream->putBe64(cgen_var_942);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013932 if (pSurfaceFormats)
13933 {
13934 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
13935 {
13936 marshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i));
13937 }
13938 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013939 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013940 uint32_t* check_pSurfaceFormatCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013941 check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013942 if (pSurfaceFormatCount)
13943 {
13944 if (!(check_pSurfaceFormatCount))
13945 {
13946 fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n");
13947 }
13948 stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
13949 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013950 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013951 VkSurfaceFormat2KHR* check_pSurfaceFormats;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013952 check_pSurfaceFormats = (VkSurfaceFormat2KHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013953 if (pSurfaceFormats)
13954 {
13955 if (!(check_pSurfaceFormats))
13956 {
13957 fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n");
13958 }
13959 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
13960 {
13961 unmarshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i));
13962 }
13963 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013964 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013965 VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0;
13966 stream->read(&vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return, sizeof(VkResult));
13967 return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return;
13968}
13969
13970#endif
13971#ifdef VK_KHR_variable_pointers
13972#endif
13973#ifdef VK_KHR_get_display_properties2
13974VkResult VkEncoder::vkGetPhysicalDeviceDisplayProperties2KHR(
13975 VkPhysicalDevice physicalDevice,
13976 uint32_t* pPropertyCount,
13977 VkDisplayProperties2KHR* pProperties)
13978{
13979 auto stream = mImpl->stream();
13980 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013981 auto resources = mImpl->resources();
13982 auto pool = mImpl->pool();
13983 VkPhysicalDevice local_physicalDevice;
13984 local_physicalDevice = physicalDevice;
13985 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013986 countingStream->rewind();
13987 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013988 uint64_t cgen_var_945 = (uint64_t)local_physicalDevice;
13989 countingStream->putBe64(cgen_var_945);
13990 // WARNING PTR CHECK
13991 uint64_t cgen_var_946 = (uint64_t)(uintptr_t)pPropertyCount;
13992 countingStream->putBe64(cgen_var_946);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013993 if (pPropertyCount)
13994 {
13995 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
13996 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080013997 // WARNING PTR CHECK
13998 uint64_t cgen_var_947 = (uint64_t)(uintptr_t)pProperties;
13999 countingStream->putBe64(cgen_var_947);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014000 if (pProperties)
14001 {
14002 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
14003 {
14004 marshal_VkDisplayProperties2KHR(countingStream, (VkDisplayProperties2KHR*)(pProperties + i));
14005 }
14006 }
14007 }
14008 uint32_t packetSize_vkGetPhysicalDeviceDisplayProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14009 countingStream->rewind();
14010 uint32_t opcode_vkGetPhysicalDeviceDisplayProperties2KHR = OP_vkGetPhysicalDeviceDisplayProperties2KHR;
14011 stream->write(&opcode_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t));
14012 stream->write(&packetSize_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014013 uint64_t cgen_var_948 = (uint64_t)local_physicalDevice;
14014 stream->putBe64(cgen_var_948);
14015 // WARNING PTR CHECK
14016 uint64_t cgen_var_949 = (uint64_t)(uintptr_t)pPropertyCount;
14017 stream->putBe64(cgen_var_949);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014018 if (pPropertyCount)
14019 {
14020 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
14021 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014022 // WARNING PTR CHECK
14023 uint64_t cgen_var_950 = (uint64_t)(uintptr_t)pProperties;
14024 stream->putBe64(cgen_var_950);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014025 if (pProperties)
14026 {
14027 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
14028 {
14029 marshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i));
14030 }
14031 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014032 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014033 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014034 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014035 if (pPropertyCount)
14036 {
14037 if (!(check_pPropertyCount))
14038 {
14039 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
14040 }
14041 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
14042 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014043 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014044 VkDisplayProperties2KHR* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014045 check_pProperties = (VkDisplayProperties2KHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014046 if (pProperties)
14047 {
14048 if (!(check_pProperties))
14049 {
14050 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
14051 }
14052 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
14053 {
14054 unmarshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i));
14055 }
14056 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014057 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014058 VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0;
14059 stream->read(&vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return, sizeof(VkResult));
14060 return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return;
14061}
14062
14063VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlaneProperties2KHR(
14064 VkPhysicalDevice physicalDevice,
14065 uint32_t* pPropertyCount,
14066 VkDisplayPlaneProperties2KHR* pProperties)
14067{
14068 auto stream = mImpl->stream();
14069 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014070 auto resources = mImpl->resources();
14071 auto pool = mImpl->pool();
14072 VkPhysicalDevice local_physicalDevice;
14073 local_physicalDevice = physicalDevice;
14074 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014075 countingStream->rewind();
14076 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014077 uint64_t cgen_var_953 = (uint64_t)local_physicalDevice;
14078 countingStream->putBe64(cgen_var_953);
14079 // WARNING PTR CHECK
14080 uint64_t cgen_var_954 = (uint64_t)(uintptr_t)pPropertyCount;
14081 countingStream->putBe64(cgen_var_954);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014082 if (pPropertyCount)
14083 {
14084 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
14085 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014086 // WARNING PTR CHECK
14087 uint64_t cgen_var_955 = (uint64_t)(uintptr_t)pProperties;
14088 countingStream->putBe64(cgen_var_955);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014089 if (pProperties)
14090 {
14091 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
14092 {
14093 marshal_VkDisplayPlaneProperties2KHR(countingStream, (VkDisplayPlaneProperties2KHR*)(pProperties + i));
14094 }
14095 }
14096 }
14097 uint32_t packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14098 countingStream->rewind();
14099 uint32_t opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR;
14100 stream->write(&opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t));
14101 stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014102 uint64_t cgen_var_956 = (uint64_t)local_physicalDevice;
14103 stream->putBe64(cgen_var_956);
14104 // WARNING PTR CHECK
14105 uint64_t cgen_var_957 = (uint64_t)(uintptr_t)pPropertyCount;
14106 stream->putBe64(cgen_var_957);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014107 if (pPropertyCount)
14108 {
14109 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
14110 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014111 // WARNING PTR CHECK
14112 uint64_t cgen_var_958 = (uint64_t)(uintptr_t)pProperties;
14113 stream->putBe64(cgen_var_958);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014114 if (pProperties)
14115 {
14116 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
14117 {
14118 marshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i));
14119 }
14120 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014121 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014122 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014123 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014124 if (pPropertyCount)
14125 {
14126 if (!(check_pPropertyCount))
14127 {
14128 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
14129 }
14130 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
14131 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014132 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014133 VkDisplayPlaneProperties2KHR* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014134 check_pProperties = (VkDisplayPlaneProperties2KHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014135 if (pProperties)
14136 {
14137 if (!(check_pProperties))
14138 {
14139 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
14140 }
14141 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
14142 {
14143 unmarshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i));
14144 }
14145 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014146 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014147 VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0;
14148 stream->read(&vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return, sizeof(VkResult));
14149 return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return;
14150}
14151
14152VkResult VkEncoder::vkGetDisplayModeProperties2KHR(
14153 VkPhysicalDevice physicalDevice,
14154 VkDisplayKHR display,
14155 uint32_t* pPropertyCount,
14156 VkDisplayModeProperties2KHR* pProperties)
14157{
14158 auto stream = mImpl->stream();
14159 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014160 auto resources = mImpl->resources();
14161 auto pool = mImpl->pool();
14162 VkPhysicalDevice local_physicalDevice;
14163 local_physicalDevice = physicalDevice;
14164 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
14165 VkDisplayKHR local_display;
14166 local_display = display;
14167 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014168 countingStream->rewind();
14169 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014170 uint64_t cgen_var_961 = (uint64_t)local_physicalDevice;
14171 countingStream->putBe64(cgen_var_961);
14172 uint64_t cgen_var_962 = (uint64_t)local_display;
14173 countingStream->putBe64(cgen_var_962);
14174 // WARNING PTR CHECK
14175 uint64_t cgen_var_963 = (uint64_t)(uintptr_t)pPropertyCount;
14176 countingStream->putBe64(cgen_var_963);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014177 if (pPropertyCount)
14178 {
14179 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
14180 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014181 // WARNING PTR CHECK
14182 uint64_t cgen_var_964 = (uint64_t)(uintptr_t)pProperties;
14183 countingStream->putBe64(cgen_var_964);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014184 if (pProperties)
14185 {
14186 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
14187 {
14188 marshal_VkDisplayModeProperties2KHR(countingStream, (VkDisplayModeProperties2KHR*)(pProperties + i));
14189 }
14190 }
14191 }
14192 uint32_t packetSize_vkGetDisplayModeProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14193 countingStream->rewind();
14194 uint32_t opcode_vkGetDisplayModeProperties2KHR = OP_vkGetDisplayModeProperties2KHR;
14195 stream->write(&opcode_vkGetDisplayModeProperties2KHR, sizeof(uint32_t));
14196 stream->write(&packetSize_vkGetDisplayModeProperties2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014197 uint64_t cgen_var_965 = (uint64_t)local_physicalDevice;
14198 stream->putBe64(cgen_var_965);
14199 uint64_t cgen_var_966 = (uint64_t)local_display;
14200 stream->putBe64(cgen_var_966);
14201 // WARNING PTR CHECK
14202 uint64_t cgen_var_967 = (uint64_t)(uintptr_t)pPropertyCount;
14203 stream->putBe64(cgen_var_967);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014204 if (pPropertyCount)
14205 {
14206 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
14207 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014208 // WARNING PTR CHECK
14209 uint64_t cgen_var_968 = (uint64_t)(uintptr_t)pProperties;
14210 stream->putBe64(cgen_var_968);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014211 if (pProperties)
14212 {
14213 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
14214 {
14215 marshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i));
14216 }
14217 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014218 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014219 uint32_t* check_pPropertyCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014220 check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014221 if (pPropertyCount)
14222 {
14223 if (!(check_pPropertyCount))
14224 {
14225 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
14226 }
14227 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
14228 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014229 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014230 VkDisplayModeProperties2KHR* check_pProperties;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014231 check_pProperties = (VkDisplayModeProperties2KHR*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014232 if (pProperties)
14233 {
14234 if (!(check_pProperties))
14235 {
14236 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
14237 }
14238 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
14239 {
14240 unmarshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i));
14241 }
14242 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014243 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014244 VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0;
14245 stream->read(&vkGetDisplayModeProperties2KHR_VkResult_return, sizeof(VkResult));
14246 return vkGetDisplayModeProperties2KHR_VkResult_return;
14247}
14248
14249VkResult VkEncoder::vkGetDisplayPlaneCapabilities2KHR(
14250 VkPhysicalDevice physicalDevice,
14251 const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo,
14252 VkDisplayPlaneCapabilities2KHR* pCapabilities)
14253{
14254 auto stream = mImpl->stream();
14255 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014256 auto resources = mImpl->resources();
14257 auto pool = mImpl->pool();
14258 VkPhysicalDevice local_physicalDevice;
14259 local_physicalDevice = physicalDevice;
14260 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
14261 VkDisplayPlaneInfo2KHR* local_pDisplayPlaneInfo;
14262 local_pDisplayPlaneInfo = nullptr;
14263 if (pDisplayPlaneInfo)
14264 {
14265 local_pDisplayPlaneInfo = (VkDisplayPlaneInfo2KHR*)pool->alloc(sizeof(const VkDisplayPlaneInfo2KHR));
14266 deepcopy_VkDisplayPlaneInfo2KHR(pool, pDisplayPlaneInfo, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
14267 }
14268 if (local_pDisplayPlaneInfo)
14269 {
14270 handlemap_VkDisplayPlaneInfo2KHR(resources->unwrapMapping(), (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
14271 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014272 countingStream->rewind();
14273 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014274 uint64_t cgen_var_971 = (uint64_t)local_physicalDevice;
14275 countingStream->putBe64(cgen_var_971);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014276 marshal_VkDisplayPlaneInfo2KHR(countingStream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014277 marshal_VkDisplayPlaneCapabilities2KHR(countingStream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
14278 }
14279 uint32_t packetSize_vkGetDisplayPlaneCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14280 countingStream->rewind();
14281 uint32_t opcode_vkGetDisplayPlaneCapabilities2KHR = OP_vkGetDisplayPlaneCapabilities2KHR;
14282 stream->write(&opcode_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t));
14283 stream->write(&packetSize_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014284 uint64_t cgen_var_972 = (uint64_t)local_physicalDevice;
14285 stream->putBe64(cgen_var_972);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014286 marshal_VkDisplayPlaneInfo2KHR(stream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014287 marshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
14288 unmarshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014289 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014290 VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0;
14291 stream->read(&vkGetDisplayPlaneCapabilities2KHR_VkResult_return, sizeof(VkResult));
14292 return vkGetDisplayPlaneCapabilities2KHR_VkResult_return;
14293}
14294
14295#endif
14296#ifdef VK_KHR_dedicated_allocation
14297#endif
14298#ifdef VK_KHR_storage_buffer_storage_class
14299#endif
14300#ifdef VK_KHR_relaxed_block_layout
14301#endif
14302#ifdef VK_KHR_get_memory_requirements2
14303void VkEncoder::vkGetImageMemoryRequirements2KHR(
14304 VkDevice device,
14305 const VkImageMemoryRequirementsInfo2* pInfo,
14306 VkMemoryRequirements2* pMemoryRequirements)
14307{
14308 auto stream = mImpl->stream();
14309 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014310 auto resources = mImpl->resources();
14311 auto pool = mImpl->pool();
14312 VkDevice local_device;
14313 local_device = device;
14314 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14315 VkImageMemoryRequirementsInfo2* local_pInfo;
14316 local_pInfo = nullptr;
14317 if (pInfo)
14318 {
14319 local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2));
14320 deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
14321 }
14322 if (local_pInfo)
14323 {
14324 handlemap_VkImageMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageMemoryRequirementsInfo2*)(local_pInfo));
14325 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014326 countingStream->rewind();
14327 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014328 uint64_t cgen_var_973 = (uint64_t)local_device;
14329 countingStream->putBe64(cgen_var_973);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014330 marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014331 marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
14332 }
14333 uint32_t packetSize_vkGetImageMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14334 countingStream->rewind();
14335 uint32_t opcode_vkGetImageMemoryRequirements2KHR = OP_vkGetImageMemoryRequirements2KHR;
14336 stream->write(&opcode_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t));
14337 stream->write(&packetSize_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014338 uint64_t cgen_var_974 = (uint64_t)local_device;
14339 stream->putBe64(cgen_var_974);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014340 marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014341 marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
14342 unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014343 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014344}
14345
14346void VkEncoder::vkGetBufferMemoryRequirements2KHR(
14347 VkDevice device,
14348 const VkBufferMemoryRequirementsInfo2* pInfo,
14349 VkMemoryRequirements2* pMemoryRequirements)
14350{
14351 auto stream = mImpl->stream();
14352 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014353 auto resources = mImpl->resources();
14354 auto pool = mImpl->pool();
14355 VkDevice local_device;
14356 local_device = device;
14357 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14358 VkBufferMemoryRequirementsInfo2* local_pInfo;
14359 local_pInfo = nullptr;
14360 if (pInfo)
14361 {
14362 local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2));
14363 deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
14364 }
14365 if (local_pInfo)
14366 {
14367 handlemap_VkBufferMemoryRequirementsInfo2(resources->unwrapMapping(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
14368 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014369 countingStream->rewind();
14370 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014371 uint64_t cgen_var_975 = (uint64_t)local_device;
14372 countingStream->putBe64(cgen_var_975);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014373 marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014374 marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
14375 }
14376 uint32_t packetSize_vkGetBufferMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14377 countingStream->rewind();
14378 uint32_t opcode_vkGetBufferMemoryRequirements2KHR = OP_vkGetBufferMemoryRequirements2KHR;
14379 stream->write(&opcode_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t));
14380 stream->write(&packetSize_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014381 uint64_t cgen_var_976 = (uint64_t)local_device;
14382 stream->putBe64(cgen_var_976);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014383 marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014384 marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
14385 unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014386 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014387}
14388
14389void VkEncoder::vkGetImageSparseMemoryRequirements2KHR(
14390 VkDevice device,
14391 const VkImageSparseMemoryRequirementsInfo2* pInfo,
14392 uint32_t* pSparseMemoryRequirementCount,
14393 VkSparseImageMemoryRequirements2* pSparseMemoryRequirements)
14394{
14395 auto stream = mImpl->stream();
14396 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014397 auto resources = mImpl->resources();
14398 auto pool = mImpl->pool();
14399 VkDevice local_device;
14400 local_device = device;
14401 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14402 VkImageSparseMemoryRequirementsInfo2* local_pInfo;
14403 local_pInfo = nullptr;
14404 if (pInfo)
14405 {
14406 local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2));
14407 deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
14408 }
14409 if (local_pInfo)
14410 {
14411 handlemap_VkImageSparseMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
14412 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014413 countingStream->rewind();
14414 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014415 uint64_t cgen_var_977 = (uint64_t)local_device;
14416 countingStream->putBe64(cgen_var_977);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014417 marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014418 // WARNING PTR CHECK
14419 uint64_t cgen_var_978 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
14420 countingStream->putBe64(cgen_var_978);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014421 if (pSparseMemoryRequirementCount)
14422 {
14423 countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
14424 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014425 // WARNING PTR CHECK
14426 uint64_t cgen_var_979 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
14427 countingStream->putBe64(cgen_var_979);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014428 if (pSparseMemoryRequirements)
14429 {
14430 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
14431 {
14432 marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
14433 }
14434 }
14435 }
14436 uint32_t packetSize_vkGetImageSparseMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14437 countingStream->rewind();
14438 uint32_t opcode_vkGetImageSparseMemoryRequirements2KHR = OP_vkGetImageSparseMemoryRequirements2KHR;
14439 stream->write(&opcode_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t));
14440 stream->write(&packetSize_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014441 uint64_t cgen_var_980 = (uint64_t)local_device;
14442 stream->putBe64(cgen_var_980);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014443 marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014444 // WARNING PTR CHECK
14445 uint64_t cgen_var_981 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount;
14446 stream->putBe64(cgen_var_981);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014447 if (pSparseMemoryRequirementCount)
14448 {
14449 stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
14450 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014451 // WARNING PTR CHECK
14452 uint64_t cgen_var_982 = (uint64_t)(uintptr_t)pSparseMemoryRequirements;
14453 stream->putBe64(cgen_var_982);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014454 if (pSparseMemoryRequirements)
14455 {
14456 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
14457 {
14458 marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
14459 }
14460 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014461 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014462 uint32_t* check_pSparseMemoryRequirementCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014463 check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014464 if (pSparseMemoryRequirementCount)
14465 {
14466 if (!(check_pSparseMemoryRequirementCount))
14467 {
14468 fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n");
14469 }
14470 stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
14471 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014472 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014473 VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014474 check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014475 if (pSparseMemoryRequirements)
14476 {
14477 if (!(check_pSparseMemoryRequirements))
14478 {
14479 fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n");
14480 }
14481 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
14482 {
14483 unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
14484 }
14485 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014486 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014487}
14488
14489#endif
14490#ifdef VK_KHR_image_format_list
14491#endif
14492#ifdef VK_KHR_sampler_ycbcr_conversion
14493VkResult VkEncoder::vkCreateSamplerYcbcrConversionKHR(
14494 VkDevice device,
14495 const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
14496 const VkAllocationCallbacks* pAllocator,
14497 VkSamplerYcbcrConversion* pYcbcrConversion)
14498{
14499 auto stream = mImpl->stream();
14500 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014501 auto resources = mImpl->resources();
14502 auto pool = mImpl->pool();
14503 VkDevice local_device;
14504 local_device = device;
14505 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14506 VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo;
14507 local_pCreateInfo = nullptr;
14508 if (pCreateInfo)
14509 {
14510 local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo));
14511 deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
14512 }
14513 if (local_pCreateInfo)
14514 {
14515 handlemap_VkSamplerYcbcrConversionCreateInfo(resources->unwrapMapping(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
14516 }
14517 VkAllocationCallbacks* local_pAllocator;
14518 local_pAllocator = nullptr;
14519 if (pAllocator)
14520 {
14521 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
14522 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
14523 }
14524 if (local_pAllocator)
14525 {
14526 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
14527 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080014528 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014529 countingStream->rewind();
14530 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014531 uint64_t cgen_var_985 = (uint64_t)local_device;
14532 countingStream->putBe64(cgen_var_985);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014533 marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014534 // WARNING PTR CHECK
14535 uint64_t cgen_var_986 = (uint64_t)(uintptr_t)local_pAllocator;
14536 countingStream->putBe64(cgen_var_986);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014537 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014538 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014539 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014540 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014541 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014542 countingStream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
14543 }
14544 uint32_t packetSize_vkCreateSamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14545 countingStream->rewind();
14546 uint32_t opcode_vkCreateSamplerYcbcrConversionKHR = OP_vkCreateSamplerYcbcrConversionKHR;
14547 stream->write(&opcode_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t));
14548 stream->write(&packetSize_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014549 uint64_t cgen_var_987 = (uint64_t)local_device;
14550 stream->putBe64(cgen_var_987);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014551 marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014552 // WARNING PTR CHECK
14553 uint64_t cgen_var_988 = (uint64_t)(uintptr_t)local_pAllocator;
14554 stream->putBe64(cgen_var_988);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014555 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014556 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014557 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014558 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014559 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014560 stream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014561 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014562 stream->read((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014563 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014564 VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0;
14565 stream->read(&vkCreateSamplerYcbcrConversionKHR_VkResult_return, sizeof(VkResult));
14566 return vkCreateSamplerYcbcrConversionKHR_VkResult_return;
14567}
14568
14569void VkEncoder::vkDestroySamplerYcbcrConversionKHR(
14570 VkDevice device,
14571 VkSamplerYcbcrConversion ycbcrConversion,
14572 const VkAllocationCallbacks* pAllocator)
14573{
14574 auto stream = mImpl->stream();
14575 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014576 auto resources = mImpl->resources();
14577 auto pool = mImpl->pool();
14578 VkDevice local_device;
14579 local_device = device;
14580 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14581 VkSamplerYcbcrConversion local_ycbcrConversion;
14582 local_ycbcrConversion = ycbcrConversion;
14583 resources->unwrapMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&local_ycbcrConversion);
14584 VkAllocationCallbacks* local_pAllocator;
14585 local_pAllocator = nullptr;
14586 if (pAllocator)
14587 {
14588 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
14589 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
14590 }
14591 if (local_pAllocator)
14592 {
14593 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
14594 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080014595 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014596 countingStream->rewind();
14597 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014598 uint64_t cgen_var_989 = (uint64_t)local_device;
14599 countingStream->putBe64(cgen_var_989);
14600 uint64_t cgen_var_990 = (uint64_t)local_ycbcrConversion;
14601 countingStream->putBe64(cgen_var_990);
14602 // WARNING PTR CHECK
14603 uint64_t cgen_var_991 = (uint64_t)(uintptr_t)local_pAllocator;
14604 countingStream->putBe64(cgen_var_991);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014605 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014606 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014607 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014608 }
14609 }
14610 uint32_t packetSize_vkDestroySamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14611 countingStream->rewind();
14612 uint32_t opcode_vkDestroySamplerYcbcrConversionKHR = OP_vkDestroySamplerYcbcrConversionKHR;
14613 stream->write(&opcode_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t));
14614 stream->write(&packetSize_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014615 uint64_t cgen_var_992 = (uint64_t)local_device;
14616 stream->putBe64(cgen_var_992);
14617 uint64_t cgen_var_993 = (uint64_t)local_ycbcrConversion;
14618 stream->putBe64(cgen_var_993);
14619 // WARNING PTR CHECK
14620 uint64_t cgen_var_994 = (uint64_t)(uintptr_t)local_pAllocator;
14621 stream->putBe64(cgen_var_994);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014622 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014623 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014624 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014625 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014626 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014627}
14628
14629#endif
14630#ifdef VK_KHR_bind_memory2
14631VkResult VkEncoder::vkBindBufferMemory2KHR(
14632 VkDevice device,
14633 uint32_t bindInfoCount,
14634 const VkBindBufferMemoryInfo* pBindInfos)
14635{
14636 auto stream = mImpl->stream();
14637 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014638 auto resources = mImpl->resources();
14639 auto pool = mImpl->pool();
14640 VkDevice local_device;
14641 local_device = device;
14642 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14643 uint32_t local_bindInfoCount;
14644 local_bindInfoCount = bindInfoCount;
14645 VkBindBufferMemoryInfo* local_pBindInfos;
14646 local_pBindInfos = nullptr;
14647 if (pBindInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014648 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014649 local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014650 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
14651 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014652 deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
14653 }
14654 }
14655 if (local_pBindInfos)
14656 {
14657 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
14658 {
14659 handlemap_VkBindBufferMemoryInfo(resources->unwrapMapping(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
14660 }
14661 }
14662 countingStream->rewind();
14663 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014664 uint64_t cgen_var_995 = (uint64_t)local_device;
14665 countingStream->putBe64(cgen_var_995);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014666 countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
14667 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
14668 {
14669 marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014670 }
14671 }
14672 uint32_t packetSize_vkBindBufferMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14673 countingStream->rewind();
14674 uint32_t opcode_vkBindBufferMemory2KHR = OP_vkBindBufferMemory2KHR;
14675 stream->write(&opcode_vkBindBufferMemory2KHR, sizeof(uint32_t));
14676 stream->write(&packetSize_vkBindBufferMemory2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014677 uint64_t cgen_var_996 = (uint64_t)local_device;
14678 stream->putBe64(cgen_var_996);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014679 stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014680 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
14681 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014682 marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014683 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014684 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014685 VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0;
14686 stream->read(&vkBindBufferMemory2KHR_VkResult_return, sizeof(VkResult));
14687 return vkBindBufferMemory2KHR_VkResult_return;
14688}
14689
14690VkResult VkEncoder::vkBindImageMemory2KHR(
14691 VkDevice device,
14692 uint32_t bindInfoCount,
14693 const VkBindImageMemoryInfo* pBindInfos)
14694{
14695 auto stream = mImpl->stream();
14696 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014697 auto resources = mImpl->resources();
14698 auto pool = mImpl->pool();
14699 VkDevice local_device;
14700 local_device = device;
14701 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14702 uint32_t local_bindInfoCount;
14703 local_bindInfoCount = bindInfoCount;
14704 VkBindImageMemoryInfo* local_pBindInfos;
14705 local_pBindInfos = nullptr;
14706 if (pBindInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014707 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014708 local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014709 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
14710 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014711 deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
14712 }
14713 }
14714 if (local_pBindInfos)
14715 {
14716 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
14717 {
14718 handlemap_VkBindImageMemoryInfo(resources->unwrapMapping(), (VkBindImageMemoryInfo*)(local_pBindInfos + i));
14719 }
14720 }
14721 countingStream->rewind();
14722 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014723 uint64_t cgen_var_997 = (uint64_t)local_device;
14724 countingStream->putBe64(cgen_var_997);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014725 countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
14726 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
14727 {
14728 marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014729 }
14730 }
14731 uint32_t packetSize_vkBindImageMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14732 countingStream->rewind();
14733 uint32_t opcode_vkBindImageMemory2KHR = OP_vkBindImageMemory2KHR;
14734 stream->write(&opcode_vkBindImageMemory2KHR, sizeof(uint32_t));
14735 stream->write(&packetSize_vkBindImageMemory2KHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014736 uint64_t cgen_var_998 = (uint64_t)local_device;
14737 stream->putBe64(cgen_var_998);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014738 stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014739 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
14740 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014741 marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014742 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014743 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014744 VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0;
14745 stream->read(&vkBindImageMemory2KHR_VkResult_return, sizeof(VkResult));
14746 return vkBindImageMemory2KHR_VkResult_return;
14747}
14748
14749#endif
14750#ifdef VK_KHR_maintenance3
14751void VkEncoder::vkGetDescriptorSetLayoutSupportKHR(
14752 VkDevice device,
14753 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
14754 VkDescriptorSetLayoutSupport* pSupport)
14755{
14756 auto stream = mImpl->stream();
14757 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014758 auto resources = mImpl->resources();
14759 auto pool = mImpl->pool();
14760 VkDevice local_device;
14761 local_device = device;
14762 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14763 VkDescriptorSetLayoutCreateInfo* local_pCreateInfo;
14764 local_pCreateInfo = nullptr;
14765 if (pCreateInfo)
14766 {
14767 local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo));
14768 deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
14769 }
14770 if (local_pCreateInfo)
14771 {
14772 handlemap_VkDescriptorSetLayoutCreateInfo(resources->unwrapMapping(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
14773 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014774 countingStream->rewind();
14775 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014776 uint64_t cgen_var_999 = (uint64_t)local_device;
14777 countingStream->putBe64(cgen_var_999);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014778 marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014779 marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport));
14780 }
14781 uint32_t packetSize_vkGetDescriptorSetLayoutSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14782 countingStream->rewind();
14783 uint32_t opcode_vkGetDescriptorSetLayoutSupportKHR = OP_vkGetDescriptorSetLayoutSupportKHR;
14784 stream->write(&opcode_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t));
14785 stream->write(&packetSize_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014786 uint64_t cgen_var_1000 = (uint64_t)local_device;
14787 stream->putBe64(cgen_var_1000);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014788 marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014789 marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
14790 unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014791 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014792}
14793
14794#endif
14795#ifdef VK_KHR_draw_indirect_count
14796void VkEncoder::vkCmdDrawIndirectCountKHR(
14797 VkCommandBuffer commandBuffer,
14798 VkBuffer buffer,
14799 VkDeviceSize offset,
14800 VkBuffer countBuffer,
14801 VkDeviceSize countBufferOffset,
14802 uint32_t maxDrawCount,
14803 uint32_t stride)
14804{
14805 auto stream = mImpl->stream();
14806 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014807 auto resources = mImpl->resources();
14808 auto pool = mImpl->pool();
14809 VkCommandBuffer local_commandBuffer;
14810 local_commandBuffer = commandBuffer;
14811 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
14812 VkBuffer local_buffer;
14813 local_buffer = buffer;
14814 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
14815 VkDeviceSize local_offset;
14816 local_offset = offset;
14817 VkBuffer local_countBuffer;
14818 local_countBuffer = countBuffer;
14819 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer);
14820 VkDeviceSize local_countBufferOffset;
14821 local_countBufferOffset = countBufferOffset;
14822 uint32_t local_maxDrawCount;
14823 local_maxDrawCount = maxDrawCount;
14824 uint32_t local_stride;
14825 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014826 countingStream->rewind();
14827 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014828 uint64_t cgen_var_1001 = (uint64_t)local_commandBuffer;
14829 countingStream->putBe64(cgen_var_1001);
14830 uint64_t cgen_var_1002 = (uint64_t)local_buffer;
14831 countingStream->putBe64(cgen_var_1002);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014832 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014833 uint64_t cgen_var_1003 = (uint64_t)local_countBuffer;
14834 countingStream->putBe64(cgen_var_1003);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014835 countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
14836 countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
14837 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014838 }
14839 uint32_t packetSize_vkCmdDrawIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14840 countingStream->rewind();
14841 uint32_t opcode_vkCmdDrawIndirectCountKHR = OP_vkCmdDrawIndirectCountKHR;
14842 stream->write(&opcode_vkCmdDrawIndirectCountKHR, sizeof(uint32_t));
14843 stream->write(&packetSize_vkCmdDrawIndirectCountKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014844 uint64_t cgen_var_1004 = (uint64_t)local_commandBuffer;
14845 stream->putBe64(cgen_var_1004);
14846 uint64_t cgen_var_1005 = (uint64_t)local_buffer;
14847 stream->putBe64(cgen_var_1005);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014848 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014849 uint64_t cgen_var_1006 = (uint64_t)local_countBuffer;
14850 stream->putBe64(cgen_var_1006);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014851 stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
14852 stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
14853 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
14854 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014855}
14856
14857void VkEncoder::vkCmdDrawIndexedIndirectCountKHR(
14858 VkCommandBuffer commandBuffer,
14859 VkBuffer buffer,
14860 VkDeviceSize offset,
14861 VkBuffer countBuffer,
14862 VkDeviceSize countBufferOffset,
14863 uint32_t maxDrawCount,
14864 uint32_t stride)
14865{
14866 auto stream = mImpl->stream();
14867 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014868 auto resources = mImpl->resources();
14869 auto pool = mImpl->pool();
14870 VkCommandBuffer local_commandBuffer;
14871 local_commandBuffer = commandBuffer;
14872 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
14873 VkBuffer local_buffer;
14874 local_buffer = buffer;
14875 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
14876 VkDeviceSize local_offset;
14877 local_offset = offset;
14878 VkBuffer local_countBuffer;
14879 local_countBuffer = countBuffer;
14880 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer);
14881 VkDeviceSize local_countBufferOffset;
14882 local_countBufferOffset = countBufferOffset;
14883 uint32_t local_maxDrawCount;
14884 local_maxDrawCount = maxDrawCount;
14885 uint32_t local_stride;
14886 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014887 countingStream->rewind();
14888 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014889 uint64_t cgen_var_1007 = (uint64_t)local_commandBuffer;
14890 countingStream->putBe64(cgen_var_1007);
14891 uint64_t cgen_var_1008 = (uint64_t)local_buffer;
14892 countingStream->putBe64(cgen_var_1008);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014893 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014894 uint64_t cgen_var_1009 = (uint64_t)local_countBuffer;
14895 countingStream->putBe64(cgen_var_1009);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014896 countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
14897 countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
14898 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014899 }
14900 uint32_t packetSize_vkCmdDrawIndexedIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14901 countingStream->rewind();
14902 uint32_t opcode_vkCmdDrawIndexedIndirectCountKHR = OP_vkCmdDrawIndexedIndirectCountKHR;
14903 stream->write(&opcode_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t));
14904 stream->write(&packetSize_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014905 uint64_t cgen_var_1010 = (uint64_t)local_commandBuffer;
14906 stream->putBe64(cgen_var_1010);
14907 uint64_t cgen_var_1011 = (uint64_t)local_buffer;
14908 stream->putBe64(cgen_var_1011);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014909 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014910 uint64_t cgen_var_1012 = (uint64_t)local_countBuffer;
14911 stream->putBe64(cgen_var_1012);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014912 stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
14913 stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
14914 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
14915 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014916}
14917
14918#endif
14919#ifdef VK_KHR_8bit_storage
14920#endif
14921#ifdef VK_EXT_debug_report
14922VkResult VkEncoder::vkCreateDebugReportCallbackEXT(
14923 VkInstance instance,
14924 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
14925 const VkAllocationCallbacks* pAllocator,
14926 VkDebugReportCallbackEXT* pCallback)
14927{
14928 auto stream = mImpl->stream();
14929 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014930 auto resources = mImpl->resources();
14931 auto pool = mImpl->pool();
14932 VkInstance local_instance;
14933 local_instance = instance;
14934 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
14935 VkDebugReportCallbackCreateInfoEXT* local_pCreateInfo;
14936 local_pCreateInfo = nullptr;
14937 if (pCreateInfo)
14938 {
14939 local_pCreateInfo = (VkDebugReportCallbackCreateInfoEXT*)pool->alloc(sizeof(const VkDebugReportCallbackCreateInfoEXT));
14940 deepcopy_VkDebugReportCallbackCreateInfoEXT(pool, pCreateInfo, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
14941 }
14942 if (local_pCreateInfo)
14943 {
14944 handlemap_VkDebugReportCallbackCreateInfoEXT(resources->unwrapMapping(), (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
14945 }
14946 VkAllocationCallbacks* local_pAllocator;
14947 local_pAllocator = nullptr;
14948 if (pAllocator)
14949 {
14950 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
14951 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
14952 }
14953 if (local_pAllocator)
14954 {
14955 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
14956 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080014957 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014958 countingStream->rewind();
14959 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014960 uint64_t cgen_var_1013 = (uint64_t)local_instance;
14961 countingStream->putBe64(cgen_var_1013);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014962 marshal_VkDebugReportCallbackCreateInfoEXT(countingStream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014963 // WARNING PTR CHECK
14964 uint64_t cgen_var_1014 = (uint64_t)(uintptr_t)local_pAllocator;
14965 countingStream->putBe64(cgen_var_1014);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014966 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014967 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014968 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014969 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014970 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014971 countingStream->write((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT));
14972 }
14973 uint32_t packetSize_vkCreateDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14974 countingStream->rewind();
14975 uint32_t opcode_vkCreateDebugReportCallbackEXT = OP_vkCreateDebugReportCallbackEXT;
14976 stream->write(&opcode_vkCreateDebugReportCallbackEXT, sizeof(uint32_t));
14977 stream->write(&packetSize_vkCreateDebugReportCallbackEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014978 uint64_t cgen_var_1015 = (uint64_t)local_instance;
14979 stream->putBe64(cgen_var_1015);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014980 marshal_VkDebugReportCallbackCreateInfoEXT(stream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014981 // WARNING PTR CHECK
14982 uint64_t cgen_var_1016 = (uint64_t)(uintptr_t)local_pAllocator;
14983 stream->putBe64(cgen_var_1016);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014984 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014985 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014986 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014987 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014988 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014989 stream->write((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080014990 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014991 stream->read((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014992 if (pCallback)
14993 {
14994 resources->createMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)pCallback, 1);
14995 }
14996 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014997 VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0;
14998 stream->read(&vkCreateDebugReportCallbackEXT_VkResult_return, sizeof(VkResult));
14999 return vkCreateDebugReportCallbackEXT_VkResult_return;
15000}
15001
15002void VkEncoder::vkDestroyDebugReportCallbackEXT(
15003 VkInstance instance,
15004 VkDebugReportCallbackEXT callback,
15005 const VkAllocationCallbacks* pAllocator)
15006{
15007 auto stream = mImpl->stream();
15008 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015009 auto resources = mImpl->resources();
15010 auto pool = mImpl->pool();
15011 VkInstance local_instance;
15012 local_instance = instance;
15013 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
Lingfeng Yang9d02e102018-11-10 01:51:46 -080015014 VkDebugReportCallbackEXT local_callback;
15015 local_callback = callback;
15016 resources->unwrapMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)&local_callback);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015017 VkAllocationCallbacks* local_pAllocator;
15018 local_pAllocator = nullptr;
15019 if (pAllocator)
15020 {
15021 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
15022 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
15023 }
15024 if (local_pAllocator)
15025 {
15026 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
15027 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080015028 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015029 countingStream->rewind();
15030 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015031 uint64_t cgen_var_1017 = (uint64_t)local_instance;
15032 countingStream->putBe64(cgen_var_1017);
15033 uint64_t cgen_var_1018 = (uint64_t)local_callback;
15034 countingStream->putBe64(cgen_var_1018);
15035 // WARNING PTR CHECK
15036 uint64_t cgen_var_1019 = (uint64_t)(uintptr_t)local_pAllocator;
15037 countingStream->putBe64(cgen_var_1019);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015038 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015039 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015040 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015041 }
15042 }
15043 uint32_t packetSize_vkDestroyDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15044 countingStream->rewind();
15045 uint32_t opcode_vkDestroyDebugReportCallbackEXT = OP_vkDestroyDebugReportCallbackEXT;
15046 stream->write(&opcode_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t));
15047 stream->write(&packetSize_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015048 uint64_t cgen_var_1020 = (uint64_t)local_instance;
15049 stream->putBe64(cgen_var_1020);
15050 uint64_t cgen_var_1021 = (uint64_t)local_callback;
15051 stream->putBe64(cgen_var_1021);
15052 // WARNING PTR CHECK
15053 uint64_t cgen_var_1022 = (uint64_t)(uintptr_t)local_pAllocator;
15054 stream->putBe64(cgen_var_1022);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015055 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015056 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015057 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015058 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015059 resources->destroyMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)&callback);
15060 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015061}
15062
15063void VkEncoder::vkDebugReportMessageEXT(
15064 VkInstance instance,
15065 VkDebugReportFlagsEXT flags,
15066 VkDebugReportObjectTypeEXT objectType,
15067 uint64_t object,
15068 size_t location,
15069 int32_t messageCode,
15070 const char* pLayerPrefix,
15071 const char* pMessage)
15072{
15073 auto stream = mImpl->stream();
15074 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015075 auto resources = mImpl->resources();
15076 auto pool = mImpl->pool();
15077 VkInstance local_instance;
15078 local_instance = instance;
15079 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
15080 VkDebugReportFlagsEXT local_flags;
15081 local_flags = flags;
15082 VkDebugReportObjectTypeEXT local_objectType;
15083 local_objectType = objectType;
15084 uint64_t local_object;
15085 local_object = object;
15086 size_t local_location;
15087 local_location = location;
15088 int32_t local_messageCode;
15089 local_messageCode = messageCode;
15090 char* local_pLayerPrefix;
15091 local_pLayerPrefix = nullptr;
15092 if (pLayerPrefix)
15093 {
15094 local_pLayerPrefix = pool->strDup(pLayerPrefix);
15095 }
15096 char* local_pMessage;
15097 local_pMessage = nullptr;
15098 if (pMessage)
15099 {
15100 local_pMessage = pool->strDup(pMessage);
15101 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015102 countingStream->rewind();
15103 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015104 uint64_t cgen_var_1023 = (uint64_t)local_instance;
15105 countingStream->putBe64(cgen_var_1023);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015106 countingStream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT));
15107 countingStream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT));
15108 countingStream->write((uint64_t*)&local_object, sizeof(uint64_t));
15109 countingStream->write((size_t*)&local_location, sizeof(size_t));
15110 countingStream->write((int32_t*)&local_messageCode, sizeof(int32_t));
15111 countingStream->putString(local_pLayerPrefix);
15112 countingStream->putString(local_pMessage);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015113 }
15114 uint32_t packetSize_vkDebugReportMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15115 countingStream->rewind();
15116 uint32_t opcode_vkDebugReportMessageEXT = OP_vkDebugReportMessageEXT;
15117 stream->write(&opcode_vkDebugReportMessageEXT, sizeof(uint32_t));
15118 stream->write(&packetSize_vkDebugReportMessageEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015119 uint64_t cgen_var_1024 = (uint64_t)local_instance;
15120 stream->putBe64(cgen_var_1024);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015121 stream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT));
15122 stream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT));
15123 stream->write((uint64_t*)&local_object, sizeof(uint64_t));
15124 stream->write((size_t*)&local_location, sizeof(size_t));
15125 stream->write((int32_t*)&local_messageCode, sizeof(int32_t));
15126 stream->putString(local_pLayerPrefix);
15127 stream->putString(local_pMessage);
15128 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015129}
15130
15131#endif
15132#ifdef VK_NV_glsl_shader
15133#endif
15134#ifdef VK_EXT_depth_range_unrestricted
15135#endif
15136#ifdef VK_IMG_filter_cubic
15137#endif
15138#ifdef VK_AMD_rasterization_order
15139#endif
15140#ifdef VK_AMD_shader_trinary_minmax
15141#endif
15142#ifdef VK_AMD_shader_explicit_vertex_parameter
15143#endif
15144#ifdef VK_EXT_debug_marker
15145VkResult VkEncoder::vkDebugMarkerSetObjectTagEXT(
15146 VkDevice device,
15147 const VkDebugMarkerObjectTagInfoEXT* pTagInfo)
15148{
15149 auto stream = mImpl->stream();
15150 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015151 auto resources = mImpl->resources();
15152 auto pool = mImpl->pool();
15153 VkDevice local_device;
15154 local_device = device;
15155 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15156 VkDebugMarkerObjectTagInfoEXT* local_pTagInfo;
15157 local_pTagInfo = nullptr;
15158 if (pTagInfo)
15159 {
15160 local_pTagInfo = (VkDebugMarkerObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectTagInfoEXT));
15161 deepcopy_VkDebugMarkerObjectTagInfoEXT(pool, pTagInfo, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
15162 }
15163 if (local_pTagInfo)
15164 {
15165 handlemap_VkDebugMarkerObjectTagInfoEXT(resources->unwrapMapping(), (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
15166 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015167 countingStream->rewind();
15168 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015169 uint64_t cgen_var_1025 = (uint64_t)local_device;
15170 countingStream->putBe64(cgen_var_1025);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015171 marshal_VkDebugMarkerObjectTagInfoEXT(countingStream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015172 }
15173 uint32_t packetSize_vkDebugMarkerSetObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15174 countingStream->rewind();
15175 uint32_t opcode_vkDebugMarkerSetObjectTagEXT = OP_vkDebugMarkerSetObjectTagEXT;
15176 stream->write(&opcode_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t));
15177 stream->write(&packetSize_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015178 uint64_t cgen_var_1026 = (uint64_t)local_device;
15179 stream->putBe64(cgen_var_1026);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015180 marshal_VkDebugMarkerObjectTagInfoEXT(stream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
15181 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015182 VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0;
15183 stream->read(&vkDebugMarkerSetObjectTagEXT_VkResult_return, sizeof(VkResult));
15184 return vkDebugMarkerSetObjectTagEXT_VkResult_return;
15185}
15186
15187VkResult VkEncoder::vkDebugMarkerSetObjectNameEXT(
15188 VkDevice device,
15189 const VkDebugMarkerObjectNameInfoEXT* pNameInfo)
15190{
15191 auto stream = mImpl->stream();
15192 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015193 auto resources = mImpl->resources();
15194 auto pool = mImpl->pool();
15195 VkDevice local_device;
15196 local_device = device;
15197 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15198 VkDebugMarkerObjectNameInfoEXT* local_pNameInfo;
15199 local_pNameInfo = nullptr;
15200 if (pNameInfo)
15201 {
15202 local_pNameInfo = (VkDebugMarkerObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectNameInfoEXT));
15203 deepcopy_VkDebugMarkerObjectNameInfoEXT(pool, pNameInfo, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
15204 }
15205 if (local_pNameInfo)
15206 {
15207 handlemap_VkDebugMarkerObjectNameInfoEXT(resources->unwrapMapping(), (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
15208 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015209 countingStream->rewind();
15210 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015211 uint64_t cgen_var_1027 = (uint64_t)local_device;
15212 countingStream->putBe64(cgen_var_1027);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015213 marshal_VkDebugMarkerObjectNameInfoEXT(countingStream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015214 }
15215 uint32_t packetSize_vkDebugMarkerSetObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15216 countingStream->rewind();
15217 uint32_t opcode_vkDebugMarkerSetObjectNameEXT = OP_vkDebugMarkerSetObjectNameEXT;
15218 stream->write(&opcode_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t));
15219 stream->write(&packetSize_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015220 uint64_t cgen_var_1028 = (uint64_t)local_device;
15221 stream->putBe64(cgen_var_1028);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015222 marshal_VkDebugMarkerObjectNameInfoEXT(stream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
15223 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015224 VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0;
15225 stream->read(&vkDebugMarkerSetObjectNameEXT_VkResult_return, sizeof(VkResult));
15226 return vkDebugMarkerSetObjectNameEXT_VkResult_return;
15227}
15228
15229void VkEncoder::vkCmdDebugMarkerBeginEXT(
15230 VkCommandBuffer commandBuffer,
15231 const VkDebugMarkerMarkerInfoEXT* pMarkerInfo)
15232{
15233 auto stream = mImpl->stream();
15234 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015235 auto resources = mImpl->resources();
15236 auto pool = mImpl->pool();
15237 VkCommandBuffer local_commandBuffer;
15238 local_commandBuffer = commandBuffer;
15239 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
15240 VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo;
15241 local_pMarkerInfo = nullptr;
15242 if (pMarkerInfo)
15243 {
15244 local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT));
15245 deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
15246 }
15247 if (local_pMarkerInfo)
15248 {
15249 handlemap_VkDebugMarkerMarkerInfoEXT(resources->unwrapMapping(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
15250 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015251 countingStream->rewind();
15252 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015253 uint64_t cgen_var_1029 = (uint64_t)local_commandBuffer;
15254 countingStream->putBe64(cgen_var_1029);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015255 marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015256 }
15257 uint32_t packetSize_vkCmdDebugMarkerBeginEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15258 countingStream->rewind();
15259 uint32_t opcode_vkCmdDebugMarkerBeginEXT = OP_vkCmdDebugMarkerBeginEXT;
15260 stream->write(&opcode_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t));
15261 stream->write(&packetSize_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015262 uint64_t cgen_var_1030 = (uint64_t)local_commandBuffer;
15263 stream->putBe64(cgen_var_1030);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015264 marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
15265 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015266}
15267
15268void VkEncoder::vkCmdDebugMarkerEndEXT(
15269 VkCommandBuffer commandBuffer)
15270{
15271 auto stream = mImpl->stream();
15272 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015273 auto resources = mImpl->resources();
15274 auto pool = mImpl->pool();
15275 VkCommandBuffer local_commandBuffer;
15276 local_commandBuffer = commandBuffer;
15277 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015278 countingStream->rewind();
15279 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015280 uint64_t cgen_var_1031 = (uint64_t)local_commandBuffer;
15281 countingStream->putBe64(cgen_var_1031);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015282 }
15283 uint32_t packetSize_vkCmdDebugMarkerEndEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15284 countingStream->rewind();
15285 uint32_t opcode_vkCmdDebugMarkerEndEXT = OP_vkCmdDebugMarkerEndEXT;
15286 stream->write(&opcode_vkCmdDebugMarkerEndEXT, sizeof(uint32_t));
15287 stream->write(&packetSize_vkCmdDebugMarkerEndEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015288 uint64_t cgen_var_1032 = (uint64_t)local_commandBuffer;
15289 stream->putBe64(cgen_var_1032);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015290 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015291}
15292
15293void VkEncoder::vkCmdDebugMarkerInsertEXT(
15294 VkCommandBuffer commandBuffer,
15295 const VkDebugMarkerMarkerInfoEXT* pMarkerInfo)
15296{
15297 auto stream = mImpl->stream();
15298 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015299 auto resources = mImpl->resources();
15300 auto pool = mImpl->pool();
15301 VkCommandBuffer local_commandBuffer;
15302 local_commandBuffer = commandBuffer;
15303 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
15304 VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo;
15305 local_pMarkerInfo = nullptr;
15306 if (pMarkerInfo)
15307 {
15308 local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT));
15309 deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
15310 }
15311 if (local_pMarkerInfo)
15312 {
15313 handlemap_VkDebugMarkerMarkerInfoEXT(resources->unwrapMapping(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
15314 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015315 countingStream->rewind();
15316 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015317 uint64_t cgen_var_1033 = (uint64_t)local_commandBuffer;
15318 countingStream->putBe64(cgen_var_1033);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015319 marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015320 }
15321 uint32_t packetSize_vkCmdDebugMarkerInsertEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15322 countingStream->rewind();
15323 uint32_t opcode_vkCmdDebugMarkerInsertEXT = OP_vkCmdDebugMarkerInsertEXT;
15324 stream->write(&opcode_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t));
15325 stream->write(&packetSize_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015326 uint64_t cgen_var_1034 = (uint64_t)local_commandBuffer;
15327 stream->putBe64(cgen_var_1034);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015328 marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
15329 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015330}
15331
15332#endif
15333#ifdef VK_AMD_gcn_shader
15334#endif
15335#ifdef VK_NV_dedicated_allocation
15336#endif
15337#ifdef VK_AMD_draw_indirect_count
15338void VkEncoder::vkCmdDrawIndirectCountAMD(
15339 VkCommandBuffer commandBuffer,
15340 VkBuffer buffer,
15341 VkDeviceSize offset,
15342 VkBuffer countBuffer,
15343 VkDeviceSize countBufferOffset,
15344 uint32_t maxDrawCount,
15345 uint32_t stride)
15346{
15347 auto stream = mImpl->stream();
15348 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015349 auto resources = mImpl->resources();
15350 auto pool = mImpl->pool();
15351 VkCommandBuffer local_commandBuffer;
15352 local_commandBuffer = commandBuffer;
15353 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
15354 VkBuffer local_buffer;
15355 local_buffer = buffer;
15356 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
15357 VkDeviceSize local_offset;
15358 local_offset = offset;
15359 VkBuffer local_countBuffer;
15360 local_countBuffer = countBuffer;
15361 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer);
15362 VkDeviceSize local_countBufferOffset;
15363 local_countBufferOffset = countBufferOffset;
15364 uint32_t local_maxDrawCount;
15365 local_maxDrawCount = maxDrawCount;
15366 uint32_t local_stride;
15367 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015368 countingStream->rewind();
15369 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015370 uint64_t cgen_var_1035 = (uint64_t)local_commandBuffer;
15371 countingStream->putBe64(cgen_var_1035);
15372 uint64_t cgen_var_1036 = (uint64_t)local_buffer;
15373 countingStream->putBe64(cgen_var_1036);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015374 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015375 uint64_t cgen_var_1037 = (uint64_t)local_countBuffer;
15376 countingStream->putBe64(cgen_var_1037);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015377 countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
15378 countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
15379 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015380 }
15381 uint32_t packetSize_vkCmdDrawIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15382 countingStream->rewind();
15383 uint32_t opcode_vkCmdDrawIndirectCountAMD = OP_vkCmdDrawIndirectCountAMD;
15384 stream->write(&opcode_vkCmdDrawIndirectCountAMD, sizeof(uint32_t));
15385 stream->write(&packetSize_vkCmdDrawIndirectCountAMD, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015386 uint64_t cgen_var_1038 = (uint64_t)local_commandBuffer;
15387 stream->putBe64(cgen_var_1038);
15388 uint64_t cgen_var_1039 = (uint64_t)local_buffer;
15389 stream->putBe64(cgen_var_1039);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015390 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015391 uint64_t cgen_var_1040 = (uint64_t)local_countBuffer;
15392 stream->putBe64(cgen_var_1040);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015393 stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
15394 stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
15395 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
15396 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015397}
15398
15399void VkEncoder::vkCmdDrawIndexedIndirectCountAMD(
15400 VkCommandBuffer commandBuffer,
15401 VkBuffer buffer,
15402 VkDeviceSize offset,
15403 VkBuffer countBuffer,
15404 VkDeviceSize countBufferOffset,
15405 uint32_t maxDrawCount,
15406 uint32_t stride)
15407{
15408 auto stream = mImpl->stream();
15409 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015410 auto resources = mImpl->resources();
15411 auto pool = mImpl->pool();
15412 VkCommandBuffer local_commandBuffer;
15413 local_commandBuffer = commandBuffer;
15414 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
15415 VkBuffer local_buffer;
15416 local_buffer = buffer;
15417 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
15418 VkDeviceSize local_offset;
15419 local_offset = offset;
15420 VkBuffer local_countBuffer;
15421 local_countBuffer = countBuffer;
15422 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer);
15423 VkDeviceSize local_countBufferOffset;
15424 local_countBufferOffset = countBufferOffset;
15425 uint32_t local_maxDrawCount;
15426 local_maxDrawCount = maxDrawCount;
15427 uint32_t local_stride;
15428 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015429 countingStream->rewind();
15430 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015431 uint64_t cgen_var_1041 = (uint64_t)local_commandBuffer;
15432 countingStream->putBe64(cgen_var_1041);
15433 uint64_t cgen_var_1042 = (uint64_t)local_buffer;
15434 countingStream->putBe64(cgen_var_1042);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015435 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015436 uint64_t cgen_var_1043 = (uint64_t)local_countBuffer;
15437 countingStream->putBe64(cgen_var_1043);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015438 countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
15439 countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
15440 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015441 }
15442 uint32_t packetSize_vkCmdDrawIndexedIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15443 countingStream->rewind();
15444 uint32_t opcode_vkCmdDrawIndexedIndirectCountAMD = OP_vkCmdDrawIndexedIndirectCountAMD;
15445 stream->write(&opcode_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t));
15446 stream->write(&packetSize_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015447 uint64_t cgen_var_1044 = (uint64_t)local_commandBuffer;
15448 stream->putBe64(cgen_var_1044);
15449 uint64_t cgen_var_1045 = (uint64_t)local_buffer;
15450 stream->putBe64(cgen_var_1045);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015451 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015452 uint64_t cgen_var_1046 = (uint64_t)local_countBuffer;
15453 stream->putBe64(cgen_var_1046);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015454 stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
15455 stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
15456 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
15457 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015458}
15459
15460#endif
15461#ifdef VK_AMD_negative_viewport_height
15462#endif
15463#ifdef VK_AMD_gpu_shader_half_float
15464#endif
15465#ifdef VK_AMD_shader_ballot
15466#endif
15467#ifdef VK_AMD_texture_gather_bias_lod
15468#endif
15469#ifdef VK_AMD_shader_info
15470VkResult VkEncoder::vkGetShaderInfoAMD(
15471 VkDevice device,
15472 VkPipeline pipeline,
15473 VkShaderStageFlagBits shaderStage,
15474 VkShaderInfoTypeAMD infoType,
15475 size_t* pInfoSize,
15476 void* pInfo)
15477{
15478 auto stream = mImpl->stream();
15479 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015480 auto resources = mImpl->resources();
15481 auto pool = mImpl->pool();
15482 VkDevice local_device;
15483 local_device = device;
15484 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15485 VkPipeline local_pipeline;
15486 local_pipeline = pipeline;
15487 resources->unwrapMapping()->mapHandles_VkPipeline((VkPipeline*)&local_pipeline);
15488 VkShaderStageFlagBits local_shaderStage;
15489 local_shaderStage = shaderStage;
15490 VkShaderInfoTypeAMD local_infoType;
15491 local_infoType = infoType;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015492 countingStream->rewind();
15493 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015494 uint64_t cgen_var_1047 = (uint64_t)local_device;
15495 countingStream->putBe64(cgen_var_1047);
15496 uint64_t cgen_var_1048 = (uint64_t)local_pipeline;
15497 countingStream->putBe64(cgen_var_1048);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015498 countingStream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits));
15499 countingStream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015500 // WARNING PTR CHECK
15501 uint64_t cgen_var_1049 = (uint64_t)(uintptr_t)pInfoSize;
15502 countingStream->putBe64(cgen_var_1049);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015503 if (pInfoSize)
15504 {
15505 countingStream->write((size_t*)pInfoSize, sizeof(size_t));
15506 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015507 // WARNING PTR CHECK
15508 uint64_t cgen_var_1050 = (uint64_t)(uintptr_t)pInfo;
15509 countingStream->putBe64(cgen_var_1050);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015510 if (pInfo)
15511 {
15512 countingStream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t));
15513 }
15514 }
15515 uint32_t packetSize_vkGetShaderInfoAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15516 countingStream->rewind();
15517 uint32_t opcode_vkGetShaderInfoAMD = OP_vkGetShaderInfoAMD;
15518 stream->write(&opcode_vkGetShaderInfoAMD, sizeof(uint32_t));
15519 stream->write(&packetSize_vkGetShaderInfoAMD, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015520 uint64_t cgen_var_1051 = (uint64_t)local_device;
15521 stream->putBe64(cgen_var_1051);
15522 uint64_t cgen_var_1052 = (uint64_t)local_pipeline;
15523 stream->putBe64(cgen_var_1052);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015524 stream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits));
15525 stream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015526 // WARNING PTR CHECK
15527 uint64_t cgen_var_1053 = (uint64_t)(uintptr_t)pInfoSize;
15528 stream->putBe64(cgen_var_1053);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015529 if (pInfoSize)
15530 {
15531 stream->write((size_t*)pInfoSize, sizeof(size_t));
15532 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015533 // WARNING PTR CHECK
15534 uint64_t cgen_var_1054 = (uint64_t)(uintptr_t)pInfo;
15535 stream->putBe64(cgen_var_1054);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015536 if (pInfo)
15537 {
15538 stream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t));
15539 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015540 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015541 size_t* check_pInfoSize;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015542 check_pInfoSize = (size_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015543 if (pInfoSize)
15544 {
15545 if (!(check_pInfoSize))
15546 {
15547 fprintf(stderr, "fatal: pInfoSize inconsistent between guest and host\n");
15548 }
15549 stream->read((size_t*)pInfoSize, sizeof(size_t));
15550 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015551 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015552 void* check_pInfo;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015553 check_pInfo = (void*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015554 if (pInfo)
15555 {
15556 if (!(check_pInfo))
15557 {
15558 fprintf(stderr, "fatal: pInfo inconsistent between guest and host\n");
15559 }
15560 stream->read((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t));
15561 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015562 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015563 VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0;
15564 stream->read(&vkGetShaderInfoAMD_VkResult_return, sizeof(VkResult));
15565 return vkGetShaderInfoAMD_VkResult_return;
15566}
15567
15568#endif
15569#ifdef VK_AMD_shader_image_load_store_lod
15570#endif
15571#ifdef VK_IMG_format_pvrtc
15572#endif
15573#ifdef VK_NV_external_memory_capabilities
15574VkResult VkEncoder::vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
15575 VkPhysicalDevice physicalDevice,
15576 VkFormat format,
15577 VkImageType type,
15578 VkImageTiling tiling,
15579 VkImageUsageFlags usage,
15580 VkImageCreateFlags flags,
15581 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
15582 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties)
15583{
15584 auto stream = mImpl->stream();
15585 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015586 auto resources = mImpl->resources();
15587 auto pool = mImpl->pool();
15588 VkPhysicalDevice local_physicalDevice;
15589 local_physicalDevice = physicalDevice;
15590 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
15591 VkFormat local_format;
15592 local_format = format;
15593 VkImageType local_type;
15594 local_type = type;
15595 VkImageTiling local_tiling;
15596 local_tiling = tiling;
15597 VkImageUsageFlags local_usage;
15598 local_usage = usage;
15599 VkImageCreateFlags local_flags;
15600 local_flags = flags;
15601 VkExternalMemoryHandleTypeFlagsNV local_externalHandleType;
15602 local_externalHandleType = externalHandleType;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015603 countingStream->rewind();
15604 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015605 uint64_t cgen_var_1057 = (uint64_t)local_physicalDevice;
15606 countingStream->putBe64(cgen_var_1057);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015607 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
15608 countingStream->write((VkImageType*)&local_type, sizeof(VkImageType));
15609 countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
15610 countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
15611 countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags));
15612 countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015613 marshal_VkExternalImageFormatPropertiesNV(countingStream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties));
15614 }
15615 uint32_t packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15616 countingStream->rewind();
15617 uint32_t opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV;
15618 stream->write(&opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t));
15619 stream->write(&packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015620 uint64_t cgen_var_1058 = (uint64_t)local_physicalDevice;
15621 stream->putBe64(cgen_var_1058);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015622 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
15623 stream->write((VkImageType*)&local_type, sizeof(VkImageType));
15624 stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
15625 stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
15626 stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags));
15627 stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015628 marshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties));
15629 unmarshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015630 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015631 VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0;
15632 stream->read(&vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return, sizeof(VkResult));
15633 return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return;
15634}
15635
15636#endif
15637#ifdef VK_NV_external_memory
15638#endif
15639#ifdef VK_NV_external_memory_win32
15640VkResult VkEncoder::vkGetMemoryWin32HandleNV(
15641 VkDevice device,
15642 VkDeviceMemory memory,
15643 VkExternalMemoryHandleTypeFlagsNV handleType,
15644 HANDLE* pHandle)
15645{
15646 auto stream = mImpl->stream();
15647 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015648 auto resources = mImpl->resources();
15649 auto pool = mImpl->pool();
15650 VkDevice local_device;
15651 local_device = device;
15652 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15653 VkDeviceMemory local_memory;
15654 local_memory = memory;
15655 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
15656 VkExternalMemoryHandleTypeFlagsNV local_handleType;
15657 local_handleType = handleType;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015658 countingStream->rewind();
15659 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015660 uint64_t cgen_var_1059 = (uint64_t)local_device;
15661 countingStream->putBe64(cgen_var_1059);
15662 uint64_t cgen_var_1060 = (uint64_t)local_memory;
15663 countingStream->putBe64(cgen_var_1060);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015664 countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015665 countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
15666 }
15667 uint32_t packetSize_vkGetMemoryWin32HandleNV = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15668 countingStream->rewind();
15669 uint32_t opcode_vkGetMemoryWin32HandleNV = OP_vkGetMemoryWin32HandleNV;
15670 stream->write(&opcode_vkGetMemoryWin32HandleNV, sizeof(uint32_t));
15671 stream->write(&packetSize_vkGetMemoryWin32HandleNV, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015672 uint64_t cgen_var_1061 = (uint64_t)local_device;
15673 stream->putBe64(cgen_var_1061);
15674 uint64_t cgen_var_1062 = (uint64_t)local_memory;
15675 stream->putBe64(cgen_var_1062);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015676 stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015677 stream->write((HANDLE*)pHandle, sizeof(HANDLE));
15678 stream->read((HANDLE*)pHandle, sizeof(HANDLE));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015679 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015680 VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0;
15681 stream->read(&vkGetMemoryWin32HandleNV_VkResult_return, sizeof(VkResult));
15682 return vkGetMemoryWin32HandleNV_VkResult_return;
15683}
15684
15685#endif
15686#ifdef VK_NV_win32_keyed_mutex
15687#endif
15688#ifdef VK_EXT_validation_flags
15689#endif
15690#ifdef VK_NN_vi_surface
15691VkResult VkEncoder::vkCreateViSurfaceNN(
15692 VkInstance instance,
15693 const VkViSurfaceCreateInfoNN* pCreateInfo,
15694 const VkAllocationCallbacks* pAllocator,
15695 VkSurfaceKHR* pSurface)
15696{
15697 auto stream = mImpl->stream();
15698 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015699 auto resources = mImpl->resources();
15700 auto pool = mImpl->pool();
15701 VkInstance local_instance;
15702 local_instance = instance;
15703 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
15704 VkViSurfaceCreateInfoNN* local_pCreateInfo;
15705 local_pCreateInfo = nullptr;
15706 if (pCreateInfo)
15707 {
15708 local_pCreateInfo = (VkViSurfaceCreateInfoNN*)pool->alloc(sizeof(const VkViSurfaceCreateInfoNN));
15709 deepcopy_VkViSurfaceCreateInfoNN(pool, pCreateInfo, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
15710 }
15711 if (local_pCreateInfo)
15712 {
15713 handlemap_VkViSurfaceCreateInfoNN(resources->unwrapMapping(), (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
15714 }
15715 VkAllocationCallbacks* local_pAllocator;
15716 local_pAllocator = nullptr;
15717 if (pAllocator)
15718 {
15719 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
15720 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
15721 }
15722 if (local_pAllocator)
15723 {
15724 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
15725 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080015726 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015727 countingStream->rewind();
15728 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015729 uint64_t cgen_var_1063 = (uint64_t)local_instance;
15730 countingStream->putBe64(cgen_var_1063);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015731 marshal_VkViSurfaceCreateInfoNN(countingStream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015732 // WARNING PTR CHECK
15733 uint64_t cgen_var_1064 = (uint64_t)(uintptr_t)local_pAllocator;
15734 countingStream->putBe64(cgen_var_1064);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015735 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015736 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015737 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015738 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015739 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015740 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
15741 }
15742 uint32_t packetSize_vkCreateViSurfaceNN = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15743 countingStream->rewind();
15744 uint32_t opcode_vkCreateViSurfaceNN = OP_vkCreateViSurfaceNN;
15745 stream->write(&opcode_vkCreateViSurfaceNN, sizeof(uint32_t));
15746 stream->write(&packetSize_vkCreateViSurfaceNN, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015747 uint64_t cgen_var_1065 = (uint64_t)local_instance;
15748 stream->putBe64(cgen_var_1065);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015749 marshal_VkViSurfaceCreateInfoNN(stream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015750 // WARNING PTR CHECK
15751 uint64_t cgen_var_1066 = (uint64_t)(uintptr_t)local_pAllocator;
15752 stream->putBe64(cgen_var_1066);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015753 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015754 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015755 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015756 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015757 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015758 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015759 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015760 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015761 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015762 VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0;
15763 stream->read(&vkCreateViSurfaceNN_VkResult_return, sizeof(VkResult));
15764 return vkCreateViSurfaceNN_VkResult_return;
15765}
15766
15767#endif
15768#ifdef VK_EXT_shader_subgroup_ballot
15769#endif
15770#ifdef VK_EXT_shader_subgroup_vote
15771#endif
15772#ifdef VK_EXT_conditional_rendering
15773void VkEncoder::vkCmdBeginConditionalRenderingEXT(
15774 VkCommandBuffer commandBuffer,
15775 const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin)
15776{
15777 auto stream = mImpl->stream();
15778 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015779 auto resources = mImpl->resources();
15780 auto pool = mImpl->pool();
15781 VkCommandBuffer local_commandBuffer;
15782 local_commandBuffer = commandBuffer;
15783 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
15784 VkConditionalRenderingBeginInfoEXT* local_pConditionalRenderingBegin;
15785 local_pConditionalRenderingBegin = nullptr;
15786 if (pConditionalRenderingBegin)
15787 {
15788 local_pConditionalRenderingBegin = (VkConditionalRenderingBeginInfoEXT*)pool->alloc(sizeof(const VkConditionalRenderingBeginInfoEXT));
15789 deepcopy_VkConditionalRenderingBeginInfoEXT(pool, pConditionalRenderingBegin, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
15790 }
15791 if (local_pConditionalRenderingBegin)
15792 {
15793 handlemap_VkConditionalRenderingBeginInfoEXT(resources->unwrapMapping(), (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
15794 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015795 countingStream->rewind();
15796 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015797 uint64_t cgen_var_1067 = (uint64_t)local_commandBuffer;
15798 countingStream->putBe64(cgen_var_1067);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015799 marshal_VkConditionalRenderingBeginInfoEXT(countingStream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015800 }
15801 uint32_t packetSize_vkCmdBeginConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15802 countingStream->rewind();
15803 uint32_t opcode_vkCmdBeginConditionalRenderingEXT = OP_vkCmdBeginConditionalRenderingEXT;
15804 stream->write(&opcode_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t));
15805 stream->write(&packetSize_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015806 uint64_t cgen_var_1068 = (uint64_t)local_commandBuffer;
15807 stream->putBe64(cgen_var_1068);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015808 marshal_VkConditionalRenderingBeginInfoEXT(stream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
15809 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015810}
15811
15812void VkEncoder::vkCmdEndConditionalRenderingEXT(
15813 VkCommandBuffer commandBuffer)
15814{
15815 auto stream = mImpl->stream();
15816 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015817 auto resources = mImpl->resources();
15818 auto pool = mImpl->pool();
15819 VkCommandBuffer local_commandBuffer;
15820 local_commandBuffer = commandBuffer;
15821 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015822 countingStream->rewind();
15823 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015824 uint64_t cgen_var_1069 = (uint64_t)local_commandBuffer;
15825 countingStream->putBe64(cgen_var_1069);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015826 }
15827 uint32_t packetSize_vkCmdEndConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15828 countingStream->rewind();
15829 uint32_t opcode_vkCmdEndConditionalRenderingEXT = OP_vkCmdEndConditionalRenderingEXT;
15830 stream->write(&opcode_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t));
15831 stream->write(&packetSize_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015832 uint64_t cgen_var_1070 = (uint64_t)local_commandBuffer;
15833 stream->putBe64(cgen_var_1070);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015834 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015835}
15836
15837#endif
15838#ifdef VK_NVX_device_generated_commands
15839void VkEncoder::vkCmdProcessCommandsNVX(
15840 VkCommandBuffer commandBuffer,
15841 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo)
15842{
15843 auto stream = mImpl->stream();
15844 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015845 auto resources = mImpl->resources();
15846 auto pool = mImpl->pool();
15847 VkCommandBuffer local_commandBuffer;
15848 local_commandBuffer = commandBuffer;
15849 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
15850 VkCmdProcessCommandsInfoNVX* local_pProcessCommandsInfo;
15851 local_pProcessCommandsInfo = nullptr;
15852 if (pProcessCommandsInfo)
15853 {
15854 local_pProcessCommandsInfo = (VkCmdProcessCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdProcessCommandsInfoNVX));
15855 deepcopy_VkCmdProcessCommandsInfoNVX(pool, pProcessCommandsInfo, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo));
15856 }
15857 if (local_pProcessCommandsInfo)
15858 {
15859 handlemap_VkCmdProcessCommandsInfoNVX(resources->unwrapMapping(), (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo));
15860 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015861 countingStream->rewind();
15862 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015863 uint64_t cgen_var_1071 = (uint64_t)local_commandBuffer;
15864 countingStream->putBe64(cgen_var_1071);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015865 marshal_VkCmdProcessCommandsInfoNVX(countingStream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015866 }
15867 uint32_t packetSize_vkCmdProcessCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15868 countingStream->rewind();
15869 uint32_t opcode_vkCmdProcessCommandsNVX = OP_vkCmdProcessCommandsNVX;
15870 stream->write(&opcode_vkCmdProcessCommandsNVX, sizeof(uint32_t));
15871 stream->write(&packetSize_vkCmdProcessCommandsNVX, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015872 uint64_t cgen_var_1072 = (uint64_t)local_commandBuffer;
15873 stream->putBe64(cgen_var_1072);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015874 marshal_VkCmdProcessCommandsInfoNVX(stream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo));
15875 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015876}
15877
15878void VkEncoder::vkCmdReserveSpaceForCommandsNVX(
15879 VkCommandBuffer commandBuffer,
15880 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo)
15881{
15882 auto stream = mImpl->stream();
15883 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015884 auto resources = mImpl->resources();
15885 auto pool = mImpl->pool();
15886 VkCommandBuffer local_commandBuffer;
15887 local_commandBuffer = commandBuffer;
15888 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
15889 VkCmdReserveSpaceForCommandsInfoNVX* local_pReserveSpaceInfo;
15890 local_pReserveSpaceInfo = nullptr;
15891 if (pReserveSpaceInfo)
15892 {
15893 local_pReserveSpaceInfo = (VkCmdReserveSpaceForCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdReserveSpaceForCommandsInfoNVX));
15894 deepcopy_VkCmdReserveSpaceForCommandsInfoNVX(pool, pReserveSpaceInfo, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo));
15895 }
15896 if (local_pReserveSpaceInfo)
15897 {
15898 handlemap_VkCmdReserveSpaceForCommandsInfoNVX(resources->unwrapMapping(), (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo));
15899 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015900 countingStream->rewind();
15901 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015902 uint64_t cgen_var_1073 = (uint64_t)local_commandBuffer;
15903 countingStream->putBe64(cgen_var_1073);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015904 marshal_VkCmdReserveSpaceForCommandsInfoNVX(countingStream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015905 }
15906 uint32_t packetSize_vkCmdReserveSpaceForCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15907 countingStream->rewind();
15908 uint32_t opcode_vkCmdReserveSpaceForCommandsNVX = OP_vkCmdReserveSpaceForCommandsNVX;
15909 stream->write(&opcode_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t));
15910 stream->write(&packetSize_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015911 uint64_t cgen_var_1074 = (uint64_t)local_commandBuffer;
15912 stream->putBe64(cgen_var_1074);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015913 marshal_VkCmdReserveSpaceForCommandsInfoNVX(stream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo));
15914 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015915}
15916
15917VkResult VkEncoder::vkCreateIndirectCommandsLayoutNVX(
15918 VkDevice device,
15919 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
15920 const VkAllocationCallbacks* pAllocator,
15921 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout)
15922{
15923 auto stream = mImpl->stream();
15924 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015925 auto resources = mImpl->resources();
15926 auto pool = mImpl->pool();
15927 VkDevice local_device;
15928 local_device = device;
15929 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15930 VkIndirectCommandsLayoutCreateInfoNVX* local_pCreateInfo;
15931 local_pCreateInfo = nullptr;
15932 if (pCreateInfo)
15933 {
15934 local_pCreateInfo = (VkIndirectCommandsLayoutCreateInfoNVX*)pool->alloc(sizeof(const VkIndirectCommandsLayoutCreateInfoNVX));
15935 deepcopy_VkIndirectCommandsLayoutCreateInfoNVX(pool, pCreateInfo, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo));
15936 }
15937 if (local_pCreateInfo)
15938 {
15939 handlemap_VkIndirectCommandsLayoutCreateInfoNVX(resources->unwrapMapping(), (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo));
15940 }
15941 VkAllocationCallbacks* local_pAllocator;
15942 local_pAllocator = nullptr;
15943 if (pAllocator)
15944 {
15945 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
15946 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
15947 }
15948 if (local_pAllocator)
15949 {
15950 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
15951 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080015952 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015953 countingStream->rewind();
15954 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015955 uint64_t cgen_var_1075 = (uint64_t)local_device;
15956 countingStream->putBe64(cgen_var_1075);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015957 marshal_VkIndirectCommandsLayoutCreateInfoNVX(countingStream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015958 // WARNING PTR CHECK
15959 uint64_t cgen_var_1076 = (uint64_t)(uintptr_t)local_pAllocator;
15960 countingStream->putBe64(cgen_var_1076);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015961 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015962 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015963 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015964 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015965 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015966 countingStream->write((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
15967 }
15968 uint32_t packetSize_vkCreateIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15969 countingStream->rewind();
15970 uint32_t opcode_vkCreateIndirectCommandsLayoutNVX = OP_vkCreateIndirectCommandsLayoutNVX;
15971 stream->write(&opcode_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t));
15972 stream->write(&packetSize_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015973 uint64_t cgen_var_1077 = (uint64_t)local_device;
15974 stream->putBe64(cgen_var_1077);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015975 marshal_VkIndirectCommandsLayoutCreateInfoNVX(stream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015976 // WARNING PTR CHECK
15977 uint64_t cgen_var_1078 = (uint64_t)(uintptr_t)local_pAllocator;
15978 stream->putBe64(cgen_var_1078);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015979 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015980 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015981 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015982 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015983 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015984 stream->write((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080015985 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015986 stream->read((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015987 if (pIndirectCommandsLayout)
15988 {
15989 resources->createMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, 1);
15990 }
15991 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015992 VkResult vkCreateIndirectCommandsLayoutNVX_VkResult_return = (VkResult)0;
15993 stream->read(&vkCreateIndirectCommandsLayoutNVX_VkResult_return, sizeof(VkResult));
15994 return vkCreateIndirectCommandsLayoutNVX_VkResult_return;
15995}
15996
15997void VkEncoder::vkDestroyIndirectCommandsLayoutNVX(
15998 VkDevice device,
15999 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
16000 const VkAllocationCallbacks* pAllocator)
16001{
16002 auto stream = mImpl->stream();
16003 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016004 auto resources = mImpl->resources();
16005 auto pool = mImpl->pool();
16006 VkDevice local_device;
16007 local_device = device;
16008 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -080016009 VkIndirectCommandsLayoutNVX local_indirectCommandsLayout;
16010 local_indirectCommandsLayout = indirectCommandsLayout;
16011 resources->unwrapMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)&local_indirectCommandsLayout);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016012 VkAllocationCallbacks* local_pAllocator;
16013 local_pAllocator = nullptr;
16014 if (pAllocator)
16015 {
16016 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
16017 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
16018 }
16019 if (local_pAllocator)
16020 {
16021 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
16022 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080016023 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016024 countingStream->rewind();
16025 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016026 uint64_t cgen_var_1079 = (uint64_t)local_device;
16027 countingStream->putBe64(cgen_var_1079);
16028 uint64_t cgen_var_1080 = (uint64_t)local_indirectCommandsLayout;
16029 countingStream->putBe64(cgen_var_1080);
16030 // WARNING PTR CHECK
16031 uint64_t cgen_var_1081 = (uint64_t)(uintptr_t)local_pAllocator;
16032 countingStream->putBe64(cgen_var_1081);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016033 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016034 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016035 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016036 }
16037 }
16038 uint32_t packetSize_vkDestroyIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16039 countingStream->rewind();
16040 uint32_t opcode_vkDestroyIndirectCommandsLayoutNVX = OP_vkDestroyIndirectCommandsLayoutNVX;
16041 stream->write(&opcode_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t));
16042 stream->write(&packetSize_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016043 uint64_t cgen_var_1082 = (uint64_t)local_device;
16044 stream->putBe64(cgen_var_1082);
16045 uint64_t cgen_var_1083 = (uint64_t)local_indirectCommandsLayout;
16046 stream->putBe64(cgen_var_1083);
16047 // WARNING PTR CHECK
16048 uint64_t cgen_var_1084 = (uint64_t)(uintptr_t)local_pAllocator;
16049 stream->putBe64(cgen_var_1084);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016050 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016051 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016052 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016053 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016054 resources->destroyMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)&indirectCommandsLayout);
16055 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016056}
16057
16058VkResult VkEncoder::vkCreateObjectTableNVX(
16059 VkDevice device,
16060 const VkObjectTableCreateInfoNVX* pCreateInfo,
16061 const VkAllocationCallbacks* pAllocator,
16062 VkObjectTableNVX* pObjectTable)
16063{
16064 auto stream = mImpl->stream();
16065 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016066 auto resources = mImpl->resources();
16067 auto pool = mImpl->pool();
16068 VkDevice local_device;
16069 local_device = device;
16070 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16071 VkObjectTableCreateInfoNVX* local_pCreateInfo;
16072 local_pCreateInfo = nullptr;
16073 if (pCreateInfo)
16074 {
16075 local_pCreateInfo = (VkObjectTableCreateInfoNVX*)pool->alloc(sizeof(const VkObjectTableCreateInfoNVX));
16076 deepcopy_VkObjectTableCreateInfoNVX(pool, pCreateInfo, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo));
16077 }
16078 if (local_pCreateInfo)
16079 {
16080 handlemap_VkObjectTableCreateInfoNVX(resources->unwrapMapping(), (VkObjectTableCreateInfoNVX*)(local_pCreateInfo));
16081 }
16082 VkAllocationCallbacks* local_pAllocator;
16083 local_pAllocator = nullptr;
16084 if (pAllocator)
16085 {
16086 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
16087 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
16088 }
16089 if (local_pAllocator)
16090 {
16091 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
16092 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080016093 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016094 countingStream->rewind();
16095 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016096 uint64_t cgen_var_1085 = (uint64_t)local_device;
16097 countingStream->putBe64(cgen_var_1085);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016098 marshal_VkObjectTableCreateInfoNVX(countingStream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016099 // WARNING PTR CHECK
16100 uint64_t cgen_var_1086 = (uint64_t)(uintptr_t)local_pAllocator;
16101 countingStream->putBe64(cgen_var_1086);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016102 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016103 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016104 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016105 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016106 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016107 countingStream->write((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX));
16108 }
16109 uint32_t packetSize_vkCreateObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16110 countingStream->rewind();
16111 uint32_t opcode_vkCreateObjectTableNVX = OP_vkCreateObjectTableNVX;
16112 stream->write(&opcode_vkCreateObjectTableNVX, sizeof(uint32_t));
16113 stream->write(&packetSize_vkCreateObjectTableNVX, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016114 uint64_t cgen_var_1087 = (uint64_t)local_device;
16115 stream->putBe64(cgen_var_1087);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016116 marshal_VkObjectTableCreateInfoNVX(stream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016117 // WARNING PTR CHECK
16118 uint64_t cgen_var_1088 = (uint64_t)(uintptr_t)local_pAllocator;
16119 stream->putBe64(cgen_var_1088);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016120 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016121 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016122 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016123 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016124 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016125 stream->write((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016126 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016127 stream->read((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016128 if (pObjectTable)
16129 {
16130 resources->createMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)pObjectTable, 1);
16131 }
16132 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016133 VkResult vkCreateObjectTableNVX_VkResult_return = (VkResult)0;
16134 stream->read(&vkCreateObjectTableNVX_VkResult_return, sizeof(VkResult));
16135 return vkCreateObjectTableNVX_VkResult_return;
16136}
16137
16138void VkEncoder::vkDestroyObjectTableNVX(
16139 VkDevice device,
16140 VkObjectTableNVX objectTable,
16141 const VkAllocationCallbacks* pAllocator)
16142{
16143 auto stream = mImpl->stream();
16144 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016145 auto resources = mImpl->resources();
16146 auto pool = mImpl->pool();
16147 VkDevice local_device;
16148 local_device = device;
16149 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -080016150 VkObjectTableNVX local_objectTable;
16151 local_objectTable = objectTable;
16152 resources->unwrapMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&local_objectTable);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016153 VkAllocationCallbacks* local_pAllocator;
16154 local_pAllocator = nullptr;
16155 if (pAllocator)
16156 {
16157 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
16158 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
16159 }
16160 if (local_pAllocator)
16161 {
16162 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
16163 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080016164 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016165 countingStream->rewind();
16166 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016167 uint64_t cgen_var_1089 = (uint64_t)local_device;
16168 countingStream->putBe64(cgen_var_1089);
16169 uint64_t cgen_var_1090 = (uint64_t)local_objectTable;
16170 countingStream->putBe64(cgen_var_1090);
16171 // WARNING PTR CHECK
16172 uint64_t cgen_var_1091 = (uint64_t)(uintptr_t)local_pAllocator;
16173 countingStream->putBe64(cgen_var_1091);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016174 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016175 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016176 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016177 }
16178 }
16179 uint32_t packetSize_vkDestroyObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16180 countingStream->rewind();
16181 uint32_t opcode_vkDestroyObjectTableNVX = OP_vkDestroyObjectTableNVX;
16182 stream->write(&opcode_vkDestroyObjectTableNVX, sizeof(uint32_t));
16183 stream->write(&packetSize_vkDestroyObjectTableNVX, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016184 uint64_t cgen_var_1092 = (uint64_t)local_device;
16185 stream->putBe64(cgen_var_1092);
16186 uint64_t cgen_var_1093 = (uint64_t)local_objectTable;
16187 stream->putBe64(cgen_var_1093);
16188 // WARNING PTR CHECK
16189 uint64_t cgen_var_1094 = (uint64_t)(uintptr_t)local_pAllocator;
16190 stream->putBe64(cgen_var_1094);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016191 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016192 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016193 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016194 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016195 resources->destroyMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&objectTable);
16196 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016197}
16198
16199VkResult VkEncoder::vkRegisterObjectsNVX(
16200 VkDevice device,
16201 VkObjectTableNVX objectTable,
16202 uint32_t objectCount,
16203 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
16204 const uint32_t* pObjectIndices)
16205{
16206 auto stream = mImpl->stream();
16207 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016208 auto resources = mImpl->resources();
16209 auto pool = mImpl->pool();
16210 VkDevice local_device;
16211 local_device = device;
16212 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16213 VkObjectTableNVX local_objectTable;
16214 local_objectTable = objectTable;
16215 resources->unwrapMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&local_objectTable);
16216 uint32_t local_objectCount;
16217 local_objectCount = objectCount;
16218 VkObjectTableEntryNVX** local_ppObjectTableEntries;
Lingfeng Yang36891c52018-11-09 14:18:35 -080016219 (void)ppObjectTableEntries;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016220 uint32_t* local_pObjectIndices;
16221 local_pObjectIndices = nullptr;
16222 if (pObjectIndices)
16223 {
16224 local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t));
16225 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016226 countingStream->rewind();
16227 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016228 uint64_t cgen_var_1095 = (uint64_t)local_device;
16229 countingStream->putBe64(cgen_var_1095);
16230 uint64_t cgen_var_1096 = (uint64_t)local_objectTable;
16231 countingStream->putBe64(cgen_var_1096);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016232 countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
Lingfeng Yang36891c52018-11-09 14:18:35 -080016233 (void)local_ppObjectTableEntries;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016234 countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016235 }
16236 uint32_t packetSize_vkRegisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16237 countingStream->rewind();
16238 uint32_t opcode_vkRegisterObjectsNVX = OP_vkRegisterObjectsNVX;
16239 stream->write(&opcode_vkRegisterObjectsNVX, sizeof(uint32_t));
16240 stream->write(&packetSize_vkRegisterObjectsNVX, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016241 uint64_t cgen_var_1097 = (uint64_t)local_device;
16242 stream->putBe64(cgen_var_1097);
16243 uint64_t cgen_var_1098 = (uint64_t)local_objectTable;
16244 stream->putBe64(cgen_var_1098);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016245 stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
Lingfeng Yang36891c52018-11-09 14:18:35 -080016246 (void)local_ppObjectTableEntries;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016247 stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
16248 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016249 VkResult vkRegisterObjectsNVX_VkResult_return = (VkResult)0;
16250 stream->read(&vkRegisterObjectsNVX_VkResult_return, sizeof(VkResult));
16251 return vkRegisterObjectsNVX_VkResult_return;
16252}
16253
16254VkResult VkEncoder::vkUnregisterObjectsNVX(
16255 VkDevice device,
16256 VkObjectTableNVX objectTable,
16257 uint32_t objectCount,
16258 const VkObjectEntryTypeNVX* pObjectEntryTypes,
16259 const uint32_t* pObjectIndices)
16260{
16261 auto stream = mImpl->stream();
16262 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016263 auto resources = mImpl->resources();
16264 auto pool = mImpl->pool();
16265 VkDevice local_device;
16266 local_device = device;
16267 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16268 VkObjectTableNVX local_objectTable;
16269 local_objectTable = objectTable;
16270 resources->unwrapMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&local_objectTable);
16271 uint32_t local_objectCount;
16272 local_objectCount = objectCount;
16273 VkObjectEntryTypeNVX* local_pObjectEntryTypes;
16274 local_pObjectEntryTypes = nullptr;
16275 if (pObjectEntryTypes)
16276 {
16277 local_pObjectEntryTypes = (VkObjectEntryTypeNVX*)pool->dupArray(pObjectEntryTypes, ((objectCount)) * sizeof(const VkObjectEntryTypeNVX));
16278 }
16279 uint32_t* local_pObjectIndices;
16280 local_pObjectIndices = nullptr;
16281 if (pObjectIndices)
16282 {
16283 local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t));
16284 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016285 countingStream->rewind();
16286 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016287 uint64_t cgen_var_1099 = (uint64_t)local_device;
16288 countingStream->putBe64(cgen_var_1099);
16289 uint64_t cgen_var_1100 = (uint64_t)local_objectTable;
16290 countingStream->putBe64(cgen_var_1100);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016291 countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
16292 countingStream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX));
16293 countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016294 }
16295 uint32_t packetSize_vkUnregisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16296 countingStream->rewind();
16297 uint32_t opcode_vkUnregisterObjectsNVX = OP_vkUnregisterObjectsNVX;
16298 stream->write(&opcode_vkUnregisterObjectsNVX, sizeof(uint32_t));
16299 stream->write(&packetSize_vkUnregisterObjectsNVX, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016300 uint64_t cgen_var_1101 = (uint64_t)local_device;
16301 stream->putBe64(cgen_var_1101);
16302 uint64_t cgen_var_1102 = (uint64_t)local_objectTable;
16303 stream->putBe64(cgen_var_1102);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016304 stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
16305 stream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX));
16306 stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
16307 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016308 VkResult vkUnregisterObjectsNVX_VkResult_return = (VkResult)0;
16309 stream->read(&vkUnregisterObjectsNVX_VkResult_return, sizeof(VkResult));
16310 return vkUnregisterObjectsNVX_VkResult_return;
16311}
16312
16313void VkEncoder::vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
16314 VkPhysicalDevice physicalDevice,
16315 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
16316 VkDeviceGeneratedCommandsLimitsNVX* pLimits)
16317{
16318 auto stream = mImpl->stream();
16319 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016320 auto resources = mImpl->resources();
16321 auto pool = mImpl->pool();
16322 VkPhysicalDevice local_physicalDevice;
16323 local_physicalDevice = physicalDevice;
16324 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016325 countingStream->rewind();
16326 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016327 uint64_t cgen_var_1103 = (uint64_t)local_physicalDevice;
16328 countingStream->putBe64(cgen_var_1103);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016329 marshal_VkDeviceGeneratedCommandsFeaturesNVX(countingStream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures));
16330 marshal_VkDeviceGeneratedCommandsLimitsNVX(countingStream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits));
16331 }
16332 uint32_t packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16333 countingStream->rewind();
16334 uint32_t opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = OP_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX;
16335 stream->write(&opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t));
16336 stream->write(&packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016337 uint64_t cgen_var_1104 = (uint64_t)local_physicalDevice;
16338 stream->putBe64(cgen_var_1104);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016339 marshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures));
16340 marshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits));
16341 unmarshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures));
16342 unmarshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016343 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016344}
16345
16346#endif
16347#ifdef VK_NV_clip_space_w_scaling
16348void VkEncoder::vkCmdSetViewportWScalingNV(
16349 VkCommandBuffer commandBuffer,
16350 uint32_t firstViewport,
16351 uint32_t viewportCount,
16352 const VkViewportWScalingNV* pViewportWScalings)
16353{
16354 auto stream = mImpl->stream();
16355 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016356 auto resources = mImpl->resources();
16357 auto pool = mImpl->pool();
16358 VkCommandBuffer local_commandBuffer;
16359 local_commandBuffer = commandBuffer;
16360 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
16361 uint32_t local_firstViewport;
16362 local_firstViewport = firstViewport;
16363 uint32_t local_viewportCount;
16364 local_viewportCount = viewportCount;
16365 VkViewportWScalingNV* local_pViewportWScalings;
16366 local_pViewportWScalings = nullptr;
16367 if (pViewportWScalings)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016368 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016369 local_pViewportWScalings = (VkViewportWScalingNV*)pool->alloc(((viewportCount)) * sizeof(const VkViewportWScalingNV));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016370 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
16371 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016372 deepcopy_VkViewportWScalingNV(pool, pViewportWScalings + i, (VkViewportWScalingNV*)(local_pViewportWScalings + i));
16373 }
16374 }
16375 if (local_pViewportWScalings)
16376 {
16377 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
16378 {
16379 handlemap_VkViewportWScalingNV(resources->unwrapMapping(), (VkViewportWScalingNV*)(local_pViewportWScalings + i));
16380 }
16381 }
16382 countingStream->rewind();
16383 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016384 uint64_t cgen_var_1105 = (uint64_t)local_commandBuffer;
16385 countingStream->putBe64(cgen_var_1105);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016386 countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
16387 countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
16388 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
16389 {
16390 marshal_VkViewportWScalingNV(countingStream, (VkViewportWScalingNV*)(local_pViewportWScalings + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016391 }
16392 }
16393 uint32_t packetSize_vkCmdSetViewportWScalingNV = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16394 countingStream->rewind();
16395 uint32_t opcode_vkCmdSetViewportWScalingNV = OP_vkCmdSetViewportWScalingNV;
16396 stream->write(&opcode_vkCmdSetViewportWScalingNV, sizeof(uint32_t));
16397 stream->write(&packetSize_vkCmdSetViewportWScalingNV, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016398 uint64_t cgen_var_1106 = (uint64_t)local_commandBuffer;
16399 stream->putBe64(cgen_var_1106);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016400 stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
16401 stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016402 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
16403 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016404 marshal_VkViewportWScalingNV(stream, (VkViewportWScalingNV*)(local_pViewportWScalings + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016405 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016406 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016407}
16408
16409#endif
16410#ifdef VK_EXT_direct_mode_display
16411VkResult VkEncoder::vkReleaseDisplayEXT(
16412 VkPhysicalDevice physicalDevice,
16413 VkDisplayKHR display)
16414{
16415 auto stream = mImpl->stream();
16416 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016417 auto resources = mImpl->resources();
16418 auto pool = mImpl->pool();
16419 VkPhysicalDevice local_physicalDevice;
16420 local_physicalDevice = physicalDevice;
16421 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
16422 VkDisplayKHR local_display;
16423 local_display = display;
16424 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016425 countingStream->rewind();
16426 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016427 uint64_t cgen_var_1107 = (uint64_t)local_physicalDevice;
16428 countingStream->putBe64(cgen_var_1107);
16429 uint64_t cgen_var_1108 = (uint64_t)local_display;
16430 countingStream->putBe64(cgen_var_1108);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016431 }
16432 uint32_t packetSize_vkReleaseDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16433 countingStream->rewind();
16434 uint32_t opcode_vkReleaseDisplayEXT = OP_vkReleaseDisplayEXT;
16435 stream->write(&opcode_vkReleaseDisplayEXT, sizeof(uint32_t));
16436 stream->write(&packetSize_vkReleaseDisplayEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016437 uint64_t cgen_var_1109 = (uint64_t)local_physicalDevice;
16438 stream->putBe64(cgen_var_1109);
16439 uint64_t cgen_var_1110 = (uint64_t)local_display;
16440 stream->putBe64(cgen_var_1110);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016441 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016442 VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0;
16443 stream->read(&vkReleaseDisplayEXT_VkResult_return, sizeof(VkResult));
16444 return vkReleaseDisplayEXT_VkResult_return;
16445}
16446
16447#endif
16448#ifdef VK_EXT_acquire_xlib_display
16449VkResult VkEncoder::vkAcquireXlibDisplayEXT(
16450 VkPhysicalDevice physicalDevice,
16451 Display* dpy,
16452 VkDisplayKHR display)
16453{
16454 auto stream = mImpl->stream();
16455 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016456 auto resources = mImpl->resources();
16457 auto pool = mImpl->pool();
16458 VkPhysicalDevice local_physicalDevice;
16459 local_physicalDevice = physicalDevice;
16460 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
16461 VkDisplayKHR local_display;
16462 local_display = display;
16463 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016464 countingStream->rewind();
16465 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016466 uint64_t cgen_var_1111 = (uint64_t)local_physicalDevice;
16467 countingStream->putBe64(cgen_var_1111);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016468 countingStream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016469 uint64_t cgen_var_1112 = (uint64_t)local_display;
16470 countingStream->putBe64(cgen_var_1112);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016471 }
16472 uint32_t packetSize_vkAcquireXlibDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16473 countingStream->rewind();
16474 uint32_t opcode_vkAcquireXlibDisplayEXT = OP_vkAcquireXlibDisplayEXT;
16475 stream->write(&opcode_vkAcquireXlibDisplayEXT, sizeof(uint32_t));
16476 stream->write(&packetSize_vkAcquireXlibDisplayEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016477 uint64_t cgen_var_1113 = (uint64_t)local_physicalDevice;
16478 stream->putBe64(cgen_var_1113);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016479 stream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016480 uint64_t cgen_var_1114 = (uint64_t)local_display;
16481 stream->putBe64(cgen_var_1114);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016482 stream->read((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016483 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016484 VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0;
16485 stream->read(&vkAcquireXlibDisplayEXT_VkResult_return, sizeof(VkResult));
16486 return vkAcquireXlibDisplayEXT_VkResult_return;
16487}
16488
16489VkResult VkEncoder::vkGetRandROutputDisplayEXT(
16490 VkPhysicalDevice physicalDevice,
16491 Display* dpy,
16492 RROutput rrOutput,
16493 VkDisplayKHR* pDisplay)
16494{
16495 auto stream = mImpl->stream();
16496 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016497 auto resources = mImpl->resources();
16498 auto pool = mImpl->pool();
16499 VkPhysicalDevice local_physicalDevice;
16500 local_physicalDevice = physicalDevice;
16501 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
16502 RROutput local_rrOutput;
16503 local_rrOutput = rrOutput;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016504 countingStream->rewind();
16505 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016506 uint64_t cgen_var_1115 = (uint64_t)local_physicalDevice;
16507 countingStream->putBe64(cgen_var_1115);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016508 countingStream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016509 countingStream->write((RROutput*)&local_rrOutput, sizeof(RROutput));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016510 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016511 countingStream->write((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR));
16512 }
16513 uint32_t packetSize_vkGetRandROutputDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16514 countingStream->rewind();
16515 uint32_t opcode_vkGetRandROutputDisplayEXT = OP_vkGetRandROutputDisplayEXT;
16516 stream->write(&opcode_vkGetRandROutputDisplayEXT, sizeof(uint32_t));
16517 stream->write(&packetSize_vkGetRandROutputDisplayEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016518 uint64_t cgen_var_1116 = (uint64_t)local_physicalDevice;
16519 stream->putBe64(cgen_var_1116);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016520 stream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016521 stream->write((RROutput*)&local_rrOutput, sizeof(RROutput));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016522 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016523 stream->write((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR));
16524 stream->read((Display*)dpy, sizeof(Display));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016525 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016526 stream->read((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016527 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016528 VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0;
16529 stream->read(&vkGetRandROutputDisplayEXT_VkResult_return, sizeof(VkResult));
16530 return vkGetRandROutputDisplayEXT_VkResult_return;
16531}
16532
16533#endif
16534#ifdef VK_EXT_display_surface_counter
16535VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2EXT(
16536 VkPhysicalDevice physicalDevice,
16537 VkSurfaceKHR surface,
16538 VkSurfaceCapabilities2EXT* pSurfaceCapabilities)
16539{
16540 auto stream = mImpl->stream();
16541 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016542 auto resources = mImpl->resources();
16543 auto pool = mImpl->pool();
16544 VkPhysicalDevice local_physicalDevice;
16545 local_physicalDevice = physicalDevice;
16546 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
16547 VkSurfaceKHR local_surface;
16548 local_surface = surface;
16549 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016550 countingStream->rewind();
16551 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016552 uint64_t cgen_var_1117 = (uint64_t)local_physicalDevice;
16553 countingStream->putBe64(cgen_var_1117);
16554 uint64_t cgen_var_1118 = (uint64_t)local_surface;
16555 countingStream->putBe64(cgen_var_1118);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016556 marshal_VkSurfaceCapabilities2EXT(countingStream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
16557 }
16558 uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16559 countingStream->rewind();
16560 uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT = OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT;
16561 stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t));
16562 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016563 uint64_t cgen_var_1119 = (uint64_t)local_physicalDevice;
16564 stream->putBe64(cgen_var_1119);
16565 uint64_t cgen_var_1120 = (uint64_t)local_surface;
16566 stream->putBe64(cgen_var_1120);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016567 marshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
16568 unmarshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016569 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016570 VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0;
16571 stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return, sizeof(VkResult));
16572 return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return;
16573}
16574
16575#endif
16576#ifdef VK_EXT_display_control
16577VkResult VkEncoder::vkDisplayPowerControlEXT(
16578 VkDevice device,
16579 VkDisplayKHR display,
16580 const VkDisplayPowerInfoEXT* pDisplayPowerInfo)
16581{
16582 auto stream = mImpl->stream();
16583 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016584 auto resources = mImpl->resources();
16585 auto pool = mImpl->pool();
16586 VkDevice local_device;
16587 local_device = device;
16588 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16589 VkDisplayKHR local_display;
16590 local_display = display;
16591 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
16592 VkDisplayPowerInfoEXT* local_pDisplayPowerInfo;
16593 local_pDisplayPowerInfo = nullptr;
16594 if (pDisplayPowerInfo)
16595 {
16596 local_pDisplayPowerInfo = (VkDisplayPowerInfoEXT*)pool->alloc(sizeof(const VkDisplayPowerInfoEXT));
16597 deepcopy_VkDisplayPowerInfoEXT(pool, pDisplayPowerInfo, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
16598 }
16599 if (local_pDisplayPowerInfo)
16600 {
16601 handlemap_VkDisplayPowerInfoEXT(resources->unwrapMapping(), (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
16602 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016603 countingStream->rewind();
16604 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016605 uint64_t cgen_var_1121 = (uint64_t)local_device;
16606 countingStream->putBe64(cgen_var_1121);
16607 uint64_t cgen_var_1122 = (uint64_t)local_display;
16608 countingStream->putBe64(cgen_var_1122);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016609 marshal_VkDisplayPowerInfoEXT(countingStream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016610 }
16611 uint32_t packetSize_vkDisplayPowerControlEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16612 countingStream->rewind();
16613 uint32_t opcode_vkDisplayPowerControlEXT = OP_vkDisplayPowerControlEXT;
16614 stream->write(&opcode_vkDisplayPowerControlEXT, sizeof(uint32_t));
16615 stream->write(&packetSize_vkDisplayPowerControlEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016616 uint64_t cgen_var_1123 = (uint64_t)local_device;
16617 stream->putBe64(cgen_var_1123);
16618 uint64_t cgen_var_1124 = (uint64_t)local_display;
16619 stream->putBe64(cgen_var_1124);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016620 marshal_VkDisplayPowerInfoEXT(stream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
16621 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016622 VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0;
16623 stream->read(&vkDisplayPowerControlEXT_VkResult_return, sizeof(VkResult));
16624 return vkDisplayPowerControlEXT_VkResult_return;
16625}
16626
16627VkResult VkEncoder::vkRegisterDeviceEventEXT(
16628 VkDevice device,
16629 const VkDeviceEventInfoEXT* pDeviceEventInfo,
16630 const VkAllocationCallbacks* pAllocator,
16631 VkFence* pFence)
16632{
16633 auto stream = mImpl->stream();
16634 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016635 auto resources = mImpl->resources();
16636 auto pool = mImpl->pool();
16637 VkDevice local_device;
16638 local_device = device;
16639 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16640 VkDeviceEventInfoEXT* local_pDeviceEventInfo;
16641 local_pDeviceEventInfo = nullptr;
16642 if (pDeviceEventInfo)
16643 {
16644 local_pDeviceEventInfo = (VkDeviceEventInfoEXT*)pool->alloc(sizeof(const VkDeviceEventInfoEXT));
16645 deepcopy_VkDeviceEventInfoEXT(pool, pDeviceEventInfo, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
16646 }
16647 if (local_pDeviceEventInfo)
16648 {
16649 handlemap_VkDeviceEventInfoEXT(resources->unwrapMapping(), (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
16650 }
16651 VkAllocationCallbacks* local_pAllocator;
16652 local_pAllocator = nullptr;
16653 if (pAllocator)
16654 {
16655 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
16656 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
16657 }
16658 if (local_pAllocator)
16659 {
16660 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
16661 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080016662 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016663 countingStream->rewind();
16664 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016665 uint64_t cgen_var_1125 = (uint64_t)local_device;
16666 countingStream->putBe64(cgen_var_1125);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016667 marshal_VkDeviceEventInfoEXT(countingStream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016668 // WARNING PTR CHECK
16669 uint64_t cgen_var_1126 = (uint64_t)(uintptr_t)local_pAllocator;
16670 countingStream->putBe64(cgen_var_1126);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016671 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016672 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016673 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016674 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016675 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016676 countingStream->write((VkFence*)pFence, sizeof(VkFence));
16677 }
16678 uint32_t packetSize_vkRegisterDeviceEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16679 countingStream->rewind();
16680 uint32_t opcode_vkRegisterDeviceEventEXT = OP_vkRegisterDeviceEventEXT;
16681 stream->write(&opcode_vkRegisterDeviceEventEXT, sizeof(uint32_t));
16682 stream->write(&packetSize_vkRegisterDeviceEventEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016683 uint64_t cgen_var_1127 = (uint64_t)local_device;
16684 stream->putBe64(cgen_var_1127);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016685 marshal_VkDeviceEventInfoEXT(stream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016686 // WARNING PTR CHECK
16687 uint64_t cgen_var_1128 = (uint64_t)(uintptr_t)local_pAllocator;
16688 stream->putBe64(cgen_var_1128);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016689 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016690 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016691 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016692 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016693 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016694 stream->write((VkFence*)pFence, sizeof(VkFence));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016695 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016696 stream->read((VkFence*)pFence, sizeof(VkFence));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016697 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016698 VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0;
16699 stream->read(&vkRegisterDeviceEventEXT_VkResult_return, sizeof(VkResult));
16700 return vkRegisterDeviceEventEXT_VkResult_return;
16701}
16702
16703VkResult VkEncoder::vkRegisterDisplayEventEXT(
16704 VkDevice device,
16705 VkDisplayKHR display,
16706 const VkDisplayEventInfoEXT* pDisplayEventInfo,
16707 const VkAllocationCallbacks* pAllocator,
16708 VkFence* pFence)
16709{
16710 auto stream = mImpl->stream();
16711 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016712 auto resources = mImpl->resources();
16713 auto pool = mImpl->pool();
16714 VkDevice local_device;
16715 local_device = device;
16716 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16717 VkDisplayKHR local_display;
16718 local_display = display;
16719 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
16720 VkDisplayEventInfoEXT* local_pDisplayEventInfo;
16721 local_pDisplayEventInfo = nullptr;
16722 if (pDisplayEventInfo)
16723 {
16724 local_pDisplayEventInfo = (VkDisplayEventInfoEXT*)pool->alloc(sizeof(const VkDisplayEventInfoEXT));
16725 deepcopy_VkDisplayEventInfoEXT(pool, pDisplayEventInfo, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
16726 }
16727 if (local_pDisplayEventInfo)
16728 {
16729 handlemap_VkDisplayEventInfoEXT(resources->unwrapMapping(), (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
16730 }
16731 VkAllocationCallbacks* local_pAllocator;
16732 local_pAllocator = nullptr;
16733 if (pAllocator)
16734 {
16735 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
16736 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
16737 }
16738 if (local_pAllocator)
16739 {
16740 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
16741 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080016742 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016743 countingStream->rewind();
16744 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016745 uint64_t cgen_var_1129 = (uint64_t)local_device;
16746 countingStream->putBe64(cgen_var_1129);
16747 uint64_t cgen_var_1130 = (uint64_t)local_display;
16748 countingStream->putBe64(cgen_var_1130);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016749 marshal_VkDisplayEventInfoEXT(countingStream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016750 // WARNING PTR CHECK
16751 uint64_t cgen_var_1131 = (uint64_t)(uintptr_t)local_pAllocator;
16752 countingStream->putBe64(cgen_var_1131);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016753 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016754 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016755 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016756 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016757 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016758 countingStream->write((VkFence*)pFence, sizeof(VkFence));
16759 }
16760 uint32_t packetSize_vkRegisterDisplayEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16761 countingStream->rewind();
16762 uint32_t opcode_vkRegisterDisplayEventEXT = OP_vkRegisterDisplayEventEXT;
16763 stream->write(&opcode_vkRegisterDisplayEventEXT, sizeof(uint32_t));
16764 stream->write(&packetSize_vkRegisterDisplayEventEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016765 uint64_t cgen_var_1132 = (uint64_t)local_device;
16766 stream->putBe64(cgen_var_1132);
16767 uint64_t cgen_var_1133 = (uint64_t)local_display;
16768 stream->putBe64(cgen_var_1133);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016769 marshal_VkDisplayEventInfoEXT(stream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016770 // WARNING PTR CHECK
16771 uint64_t cgen_var_1134 = (uint64_t)(uintptr_t)local_pAllocator;
16772 stream->putBe64(cgen_var_1134);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016773 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016774 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016775 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016776 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016777 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016778 stream->write((VkFence*)pFence, sizeof(VkFence));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016779 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016780 stream->read((VkFence*)pFence, sizeof(VkFence));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016781 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016782 VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0;
16783 stream->read(&vkRegisterDisplayEventEXT_VkResult_return, sizeof(VkResult));
16784 return vkRegisterDisplayEventEXT_VkResult_return;
16785}
16786
16787VkResult VkEncoder::vkGetSwapchainCounterEXT(
16788 VkDevice device,
16789 VkSwapchainKHR swapchain,
16790 VkSurfaceCounterFlagBitsEXT counter,
16791 uint64_t* pCounterValue)
16792{
16793 auto stream = mImpl->stream();
16794 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016795 auto resources = mImpl->resources();
16796 auto pool = mImpl->pool();
16797 VkDevice local_device;
16798 local_device = device;
16799 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16800 VkSwapchainKHR local_swapchain;
16801 local_swapchain = swapchain;
16802 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
16803 VkSurfaceCounterFlagBitsEXT local_counter;
16804 local_counter = counter;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016805 countingStream->rewind();
16806 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016807 uint64_t cgen_var_1135 = (uint64_t)local_device;
16808 countingStream->putBe64(cgen_var_1135);
16809 uint64_t cgen_var_1136 = (uint64_t)local_swapchain;
16810 countingStream->putBe64(cgen_var_1136);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016811 countingStream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016812 countingStream->write((uint64_t*)pCounterValue, sizeof(uint64_t));
16813 }
16814 uint32_t packetSize_vkGetSwapchainCounterEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16815 countingStream->rewind();
16816 uint32_t opcode_vkGetSwapchainCounterEXT = OP_vkGetSwapchainCounterEXT;
16817 stream->write(&opcode_vkGetSwapchainCounterEXT, sizeof(uint32_t));
16818 stream->write(&packetSize_vkGetSwapchainCounterEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016819 uint64_t cgen_var_1137 = (uint64_t)local_device;
16820 stream->putBe64(cgen_var_1137);
16821 uint64_t cgen_var_1138 = (uint64_t)local_swapchain;
16822 stream->putBe64(cgen_var_1138);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016823 stream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016824 stream->write((uint64_t*)pCounterValue, sizeof(uint64_t));
16825 stream->read((uint64_t*)pCounterValue, sizeof(uint64_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016826 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016827 VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0;
16828 stream->read(&vkGetSwapchainCounterEXT_VkResult_return, sizeof(VkResult));
16829 return vkGetSwapchainCounterEXT_VkResult_return;
16830}
16831
16832#endif
16833#ifdef VK_GOOGLE_display_timing
16834VkResult VkEncoder::vkGetRefreshCycleDurationGOOGLE(
16835 VkDevice device,
16836 VkSwapchainKHR swapchain,
16837 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties)
16838{
16839 auto stream = mImpl->stream();
16840 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016841 auto resources = mImpl->resources();
16842 auto pool = mImpl->pool();
16843 VkDevice local_device;
16844 local_device = device;
16845 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16846 VkSwapchainKHR local_swapchain;
16847 local_swapchain = swapchain;
16848 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016849 countingStream->rewind();
16850 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016851 uint64_t cgen_var_1139 = (uint64_t)local_device;
16852 countingStream->putBe64(cgen_var_1139);
16853 uint64_t cgen_var_1140 = (uint64_t)local_swapchain;
16854 countingStream->putBe64(cgen_var_1140);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016855 marshal_VkRefreshCycleDurationGOOGLE(countingStream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
16856 }
16857 uint32_t packetSize_vkGetRefreshCycleDurationGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16858 countingStream->rewind();
16859 uint32_t opcode_vkGetRefreshCycleDurationGOOGLE = OP_vkGetRefreshCycleDurationGOOGLE;
16860 stream->write(&opcode_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t));
16861 stream->write(&packetSize_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016862 uint64_t cgen_var_1141 = (uint64_t)local_device;
16863 stream->putBe64(cgen_var_1141);
16864 uint64_t cgen_var_1142 = (uint64_t)local_swapchain;
16865 stream->putBe64(cgen_var_1142);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016866 marshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
16867 unmarshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016868 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016869 VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0;
16870 stream->read(&vkGetRefreshCycleDurationGOOGLE_VkResult_return, sizeof(VkResult));
16871 return vkGetRefreshCycleDurationGOOGLE_VkResult_return;
16872}
16873
16874VkResult VkEncoder::vkGetPastPresentationTimingGOOGLE(
16875 VkDevice device,
16876 VkSwapchainKHR swapchain,
16877 uint32_t* pPresentationTimingCount,
16878 VkPastPresentationTimingGOOGLE* pPresentationTimings)
16879{
16880 auto stream = mImpl->stream();
16881 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016882 auto resources = mImpl->resources();
16883 auto pool = mImpl->pool();
16884 VkDevice local_device;
16885 local_device = device;
16886 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16887 VkSwapchainKHR local_swapchain;
16888 local_swapchain = swapchain;
16889 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016890 countingStream->rewind();
16891 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016892 uint64_t cgen_var_1143 = (uint64_t)local_device;
16893 countingStream->putBe64(cgen_var_1143);
16894 uint64_t cgen_var_1144 = (uint64_t)local_swapchain;
16895 countingStream->putBe64(cgen_var_1144);
16896 // WARNING PTR CHECK
16897 uint64_t cgen_var_1145 = (uint64_t)(uintptr_t)pPresentationTimingCount;
16898 countingStream->putBe64(cgen_var_1145);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016899 if (pPresentationTimingCount)
16900 {
16901 countingStream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t));
16902 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016903 // WARNING PTR CHECK
16904 uint64_t cgen_var_1146 = (uint64_t)(uintptr_t)pPresentationTimings;
16905 countingStream->putBe64(cgen_var_1146);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016906 if (pPresentationTimings)
16907 {
16908 for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i)
16909 {
16910 marshal_VkPastPresentationTimingGOOGLE(countingStream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i));
16911 }
16912 }
16913 }
16914 uint32_t packetSize_vkGetPastPresentationTimingGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16915 countingStream->rewind();
16916 uint32_t opcode_vkGetPastPresentationTimingGOOGLE = OP_vkGetPastPresentationTimingGOOGLE;
16917 stream->write(&opcode_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t));
16918 stream->write(&packetSize_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016919 uint64_t cgen_var_1147 = (uint64_t)local_device;
16920 stream->putBe64(cgen_var_1147);
16921 uint64_t cgen_var_1148 = (uint64_t)local_swapchain;
16922 stream->putBe64(cgen_var_1148);
16923 // WARNING PTR CHECK
16924 uint64_t cgen_var_1149 = (uint64_t)(uintptr_t)pPresentationTimingCount;
16925 stream->putBe64(cgen_var_1149);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016926 if (pPresentationTimingCount)
16927 {
16928 stream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t));
16929 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016930 // WARNING PTR CHECK
16931 uint64_t cgen_var_1150 = (uint64_t)(uintptr_t)pPresentationTimings;
16932 stream->putBe64(cgen_var_1150);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016933 if (pPresentationTimings)
16934 {
16935 for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i)
16936 {
16937 marshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i));
16938 }
16939 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016940 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016941 uint32_t* check_pPresentationTimingCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016942 check_pPresentationTimingCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016943 if (pPresentationTimingCount)
16944 {
16945 if (!(check_pPresentationTimingCount))
16946 {
16947 fprintf(stderr, "fatal: pPresentationTimingCount inconsistent between guest and host\n");
16948 }
16949 stream->read((uint32_t*)pPresentationTimingCount, sizeof(uint32_t));
16950 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016951 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016952 VkPastPresentationTimingGOOGLE* check_pPresentationTimings;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080016953 check_pPresentationTimings = (VkPastPresentationTimingGOOGLE*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016954 if (pPresentationTimings)
16955 {
16956 if (!(check_pPresentationTimings))
16957 {
16958 fprintf(stderr, "fatal: pPresentationTimings inconsistent between guest and host\n");
16959 }
16960 for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i)
16961 {
16962 unmarshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i));
16963 }
16964 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016965 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016966 VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0;
16967 stream->read(&vkGetPastPresentationTimingGOOGLE_VkResult_return, sizeof(VkResult));
16968 return vkGetPastPresentationTimingGOOGLE_VkResult_return;
16969}
16970
16971#endif
16972#ifdef VK_NV_sample_mask_override_coverage
16973#endif
16974#ifdef VK_NV_geometry_shader_passthrough
16975#endif
16976#ifdef VK_NV_viewport_array2
16977#endif
16978#ifdef VK_NVX_multiview_per_view_attributes
16979#endif
16980#ifdef VK_NV_viewport_swizzle
16981#endif
16982#ifdef VK_EXT_discard_rectangles
16983void VkEncoder::vkCmdSetDiscardRectangleEXT(
16984 VkCommandBuffer commandBuffer,
16985 uint32_t firstDiscardRectangle,
16986 uint32_t discardRectangleCount,
16987 const VkRect2D* pDiscardRectangles)
16988{
16989 auto stream = mImpl->stream();
16990 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016991 auto resources = mImpl->resources();
16992 auto pool = mImpl->pool();
16993 VkCommandBuffer local_commandBuffer;
16994 local_commandBuffer = commandBuffer;
16995 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
16996 uint32_t local_firstDiscardRectangle;
16997 local_firstDiscardRectangle = firstDiscardRectangle;
16998 uint32_t local_discardRectangleCount;
16999 local_discardRectangleCount = discardRectangleCount;
17000 VkRect2D* local_pDiscardRectangles;
17001 local_pDiscardRectangles = nullptr;
17002 if (pDiscardRectangles)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017003 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017004 local_pDiscardRectangles = (VkRect2D*)pool->alloc(((discardRectangleCount)) * sizeof(const VkRect2D));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017005 for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i)
17006 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017007 deepcopy_VkRect2D(pool, pDiscardRectangles + i, (VkRect2D*)(local_pDiscardRectangles + i));
17008 }
17009 }
17010 if (local_pDiscardRectangles)
17011 {
17012 for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i)
17013 {
17014 handlemap_VkRect2D(resources->unwrapMapping(), (VkRect2D*)(local_pDiscardRectangles + i));
17015 }
17016 }
17017 countingStream->rewind();
17018 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017019 uint64_t cgen_var_1153 = (uint64_t)local_commandBuffer;
17020 countingStream->putBe64(cgen_var_1153);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017021 countingStream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t));
17022 countingStream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t));
17023 for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i)
17024 {
17025 marshal_VkRect2D(countingStream, (VkRect2D*)(local_pDiscardRectangles + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017026 }
17027 }
17028 uint32_t packetSize_vkCmdSetDiscardRectangleEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17029 countingStream->rewind();
17030 uint32_t opcode_vkCmdSetDiscardRectangleEXT = OP_vkCmdSetDiscardRectangleEXT;
17031 stream->write(&opcode_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t));
17032 stream->write(&packetSize_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017033 uint64_t cgen_var_1154 = (uint64_t)local_commandBuffer;
17034 stream->putBe64(cgen_var_1154);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017035 stream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t));
17036 stream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017037 for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i)
17038 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017039 marshal_VkRect2D(stream, (VkRect2D*)(local_pDiscardRectangles + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017040 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017041 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017042}
17043
17044#endif
17045#ifdef VK_EXT_conservative_rasterization
17046#endif
17047#ifdef VK_EXT_swapchain_colorspace
17048#endif
17049#ifdef VK_EXT_hdr_metadata
17050void VkEncoder::vkSetHdrMetadataEXT(
17051 VkDevice device,
17052 uint32_t swapchainCount,
17053 const VkSwapchainKHR* pSwapchains,
17054 const VkHdrMetadataEXT* pMetadata)
17055{
17056 auto stream = mImpl->stream();
17057 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017058 auto resources = mImpl->resources();
17059 auto pool = mImpl->pool();
17060 VkDevice local_device;
17061 local_device = device;
17062 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
17063 uint32_t local_swapchainCount;
17064 local_swapchainCount = swapchainCount;
17065 VkSwapchainKHR* local_pSwapchains;
17066 local_pSwapchains = nullptr;
17067 if (pSwapchains)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017068 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017069 local_pSwapchains = (VkSwapchainKHR*)pool->dupArray(pSwapchains, ((swapchainCount)) * sizeof(const VkSwapchainKHR));
17070 }
17071 if (local_pSwapchains)
17072 {
17073 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount)));
17074 }
17075 VkHdrMetadataEXT* local_pMetadata;
17076 local_pMetadata = nullptr;
17077 if (pMetadata)
17078 {
17079 local_pMetadata = (VkHdrMetadataEXT*)pool->alloc(((swapchainCount)) * sizeof(const VkHdrMetadataEXT));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017080 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
17081 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017082 deepcopy_VkHdrMetadataEXT(pool, pMetadata + i, (VkHdrMetadataEXT*)(local_pMetadata + i));
17083 }
17084 }
17085 if (local_pMetadata)
17086 {
17087 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
17088 {
17089 handlemap_VkHdrMetadataEXT(resources->unwrapMapping(), (VkHdrMetadataEXT*)(local_pMetadata + i));
17090 }
17091 }
17092 countingStream->rewind();
17093 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017094 uint64_t cgen_var_1155 = (uint64_t)local_device;
17095 countingStream->putBe64(cgen_var_1155);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017096 countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017097 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017098 countingStream->write((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
17099 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
17100 {
17101 marshal_VkHdrMetadataEXT(countingStream, (VkHdrMetadataEXT*)(local_pMetadata + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017102 }
17103 }
17104 uint32_t packetSize_vkSetHdrMetadataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17105 countingStream->rewind();
17106 uint32_t opcode_vkSetHdrMetadataEXT = OP_vkSetHdrMetadataEXT;
17107 stream->write(&opcode_vkSetHdrMetadataEXT, sizeof(uint32_t));
17108 stream->write(&packetSize_vkSetHdrMetadataEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017109 uint64_t cgen_var_1156 = (uint64_t)local_device;
17110 stream->putBe64(cgen_var_1156);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017111 stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017112 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017113 stream->write((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017114 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
17115 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017116 marshal_VkHdrMetadataEXT(stream, (VkHdrMetadataEXT*)(local_pMetadata + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017117 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017118 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017119}
17120
17121#endif
17122#ifdef VK_MVK_ios_surface
17123VkResult VkEncoder::vkCreateIOSSurfaceMVK(
17124 VkInstance instance,
17125 const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
17126 const VkAllocationCallbacks* pAllocator,
17127 VkSurfaceKHR* pSurface)
17128{
17129 auto stream = mImpl->stream();
17130 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017131 auto resources = mImpl->resources();
17132 auto pool = mImpl->pool();
17133 VkInstance local_instance;
17134 local_instance = instance;
17135 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
17136 VkIOSSurfaceCreateInfoMVK* local_pCreateInfo;
17137 local_pCreateInfo = nullptr;
17138 if (pCreateInfo)
17139 {
17140 local_pCreateInfo = (VkIOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkIOSSurfaceCreateInfoMVK));
17141 deepcopy_VkIOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
17142 }
17143 if (local_pCreateInfo)
17144 {
17145 handlemap_VkIOSSurfaceCreateInfoMVK(resources->unwrapMapping(), (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
17146 }
17147 VkAllocationCallbacks* local_pAllocator;
17148 local_pAllocator = nullptr;
17149 if (pAllocator)
17150 {
17151 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
17152 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
17153 }
17154 if (local_pAllocator)
17155 {
17156 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
17157 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080017158 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017159 countingStream->rewind();
17160 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017161 uint64_t cgen_var_1157 = (uint64_t)local_instance;
17162 countingStream->putBe64(cgen_var_1157);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017163 marshal_VkIOSSurfaceCreateInfoMVK(countingStream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017164 // WARNING PTR CHECK
17165 uint64_t cgen_var_1158 = (uint64_t)(uintptr_t)local_pAllocator;
17166 countingStream->putBe64(cgen_var_1158);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017167 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017168 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017169 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017170 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017171 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017172 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
17173 }
17174 uint32_t packetSize_vkCreateIOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17175 countingStream->rewind();
17176 uint32_t opcode_vkCreateIOSSurfaceMVK = OP_vkCreateIOSSurfaceMVK;
17177 stream->write(&opcode_vkCreateIOSSurfaceMVK, sizeof(uint32_t));
17178 stream->write(&packetSize_vkCreateIOSSurfaceMVK, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017179 uint64_t cgen_var_1159 = (uint64_t)local_instance;
17180 stream->putBe64(cgen_var_1159);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017181 marshal_VkIOSSurfaceCreateInfoMVK(stream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017182 // WARNING PTR CHECK
17183 uint64_t cgen_var_1160 = (uint64_t)(uintptr_t)local_pAllocator;
17184 stream->putBe64(cgen_var_1160);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017185 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017186 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017187 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017188 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017189 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017190 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017191 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017192 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017193 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017194 VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0;
17195 stream->read(&vkCreateIOSSurfaceMVK_VkResult_return, sizeof(VkResult));
17196 return vkCreateIOSSurfaceMVK_VkResult_return;
17197}
17198
17199#endif
17200#ifdef VK_MVK_macos_surface
17201VkResult VkEncoder::vkCreateMacOSSurfaceMVK(
17202 VkInstance instance,
17203 const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
17204 const VkAllocationCallbacks* pAllocator,
17205 VkSurfaceKHR* pSurface)
17206{
17207 auto stream = mImpl->stream();
17208 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017209 auto resources = mImpl->resources();
17210 auto pool = mImpl->pool();
17211 VkInstance local_instance;
17212 local_instance = instance;
17213 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
17214 VkMacOSSurfaceCreateInfoMVK* local_pCreateInfo;
17215 local_pCreateInfo = nullptr;
17216 if (pCreateInfo)
17217 {
17218 local_pCreateInfo = (VkMacOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkMacOSSurfaceCreateInfoMVK));
17219 deepcopy_VkMacOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
17220 }
17221 if (local_pCreateInfo)
17222 {
17223 handlemap_VkMacOSSurfaceCreateInfoMVK(resources->unwrapMapping(), (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
17224 }
17225 VkAllocationCallbacks* local_pAllocator;
17226 local_pAllocator = nullptr;
17227 if (pAllocator)
17228 {
17229 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
17230 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
17231 }
17232 if (local_pAllocator)
17233 {
17234 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
17235 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080017236 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017237 countingStream->rewind();
17238 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017239 uint64_t cgen_var_1161 = (uint64_t)local_instance;
17240 countingStream->putBe64(cgen_var_1161);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017241 marshal_VkMacOSSurfaceCreateInfoMVK(countingStream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017242 // WARNING PTR CHECK
17243 uint64_t cgen_var_1162 = (uint64_t)(uintptr_t)local_pAllocator;
17244 countingStream->putBe64(cgen_var_1162);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017245 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017246 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017247 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017248 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017249 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017250 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
17251 }
17252 uint32_t packetSize_vkCreateMacOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17253 countingStream->rewind();
17254 uint32_t opcode_vkCreateMacOSSurfaceMVK = OP_vkCreateMacOSSurfaceMVK;
17255 stream->write(&opcode_vkCreateMacOSSurfaceMVK, sizeof(uint32_t));
17256 stream->write(&packetSize_vkCreateMacOSSurfaceMVK, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017257 uint64_t cgen_var_1163 = (uint64_t)local_instance;
17258 stream->putBe64(cgen_var_1163);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017259 marshal_VkMacOSSurfaceCreateInfoMVK(stream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017260 // WARNING PTR CHECK
17261 uint64_t cgen_var_1164 = (uint64_t)(uintptr_t)local_pAllocator;
17262 stream->putBe64(cgen_var_1164);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017263 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017264 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017265 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017266 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017267 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017268 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017269 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017270 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017271 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017272 VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0;
17273 stream->read(&vkCreateMacOSSurfaceMVK_VkResult_return, sizeof(VkResult));
17274 return vkCreateMacOSSurfaceMVK_VkResult_return;
17275}
17276
17277#endif
17278#ifdef VK_EXT_external_memory_dma_buf
17279#endif
17280#ifdef VK_EXT_queue_family_foreign
17281#endif
17282#ifdef VK_EXT_debug_utils
17283VkResult VkEncoder::vkSetDebugUtilsObjectNameEXT(
17284 VkDevice device,
17285 const VkDebugUtilsObjectNameInfoEXT* pNameInfo)
17286{
17287 auto stream = mImpl->stream();
17288 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017289 auto resources = mImpl->resources();
17290 auto pool = mImpl->pool();
17291 VkDevice local_device;
17292 local_device = device;
17293 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
17294 VkDebugUtilsObjectNameInfoEXT* local_pNameInfo;
17295 local_pNameInfo = nullptr;
17296 if (pNameInfo)
17297 {
17298 local_pNameInfo = (VkDebugUtilsObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectNameInfoEXT));
17299 deepcopy_VkDebugUtilsObjectNameInfoEXT(pool, pNameInfo, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
17300 }
17301 if (local_pNameInfo)
17302 {
17303 handlemap_VkDebugUtilsObjectNameInfoEXT(resources->unwrapMapping(), (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
17304 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017305 countingStream->rewind();
17306 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017307 uint64_t cgen_var_1165 = (uint64_t)local_device;
17308 countingStream->putBe64(cgen_var_1165);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017309 marshal_VkDebugUtilsObjectNameInfoEXT(countingStream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017310 }
17311 uint32_t packetSize_vkSetDebugUtilsObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17312 countingStream->rewind();
17313 uint32_t opcode_vkSetDebugUtilsObjectNameEXT = OP_vkSetDebugUtilsObjectNameEXT;
17314 stream->write(&opcode_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t));
17315 stream->write(&packetSize_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017316 uint64_t cgen_var_1166 = (uint64_t)local_device;
17317 stream->putBe64(cgen_var_1166);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017318 marshal_VkDebugUtilsObjectNameInfoEXT(stream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
17319 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017320 VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0;
17321 stream->read(&vkSetDebugUtilsObjectNameEXT_VkResult_return, sizeof(VkResult));
17322 return vkSetDebugUtilsObjectNameEXT_VkResult_return;
17323}
17324
17325VkResult VkEncoder::vkSetDebugUtilsObjectTagEXT(
17326 VkDevice device,
17327 const VkDebugUtilsObjectTagInfoEXT* pTagInfo)
17328{
17329 auto stream = mImpl->stream();
17330 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017331 auto resources = mImpl->resources();
17332 auto pool = mImpl->pool();
17333 VkDevice local_device;
17334 local_device = device;
17335 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
17336 VkDebugUtilsObjectTagInfoEXT* local_pTagInfo;
17337 local_pTagInfo = nullptr;
17338 if (pTagInfo)
17339 {
17340 local_pTagInfo = (VkDebugUtilsObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectTagInfoEXT));
17341 deepcopy_VkDebugUtilsObjectTagInfoEXT(pool, pTagInfo, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
17342 }
17343 if (local_pTagInfo)
17344 {
17345 handlemap_VkDebugUtilsObjectTagInfoEXT(resources->unwrapMapping(), (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
17346 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017347 countingStream->rewind();
17348 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017349 uint64_t cgen_var_1167 = (uint64_t)local_device;
17350 countingStream->putBe64(cgen_var_1167);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017351 marshal_VkDebugUtilsObjectTagInfoEXT(countingStream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017352 }
17353 uint32_t packetSize_vkSetDebugUtilsObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17354 countingStream->rewind();
17355 uint32_t opcode_vkSetDebugUtilsObjectTagEXT = OP_vkSetDebugUtilsObjectTagEXT;
17356 stream->write(&opcode_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t));
17357 stream->write(&packetSize_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017358 uint64_t cgen_var_1168 = (uint64_t)local_device;
17359 stream->putBe64(cgen_var_1168);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017360 marshal_VkDebugUtilsObjectTagInfoEXT(stream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
17361 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017362 VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0;
17363 stream->read(&vkSetDebugUtilsObjectTagEXT_VkResult_return, sizeof(VkResult));
17364 return vkSetDebugUtilsObjectTagEXT_VkResult_return;
17365}
17366
17367void VkEncoder::vkQueueBeginDebugUtilsLabelEXT(
17368 VkQueue queue,
17369 const VkDebugUtilsLabelEXT* pLabelInfo)
17370{
17371 auto stream = mImpl->stream();
17372 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017373 auto resources = mImpl->resources();
17374 auto pool = mImpl->pool();
17375 VkQueue local_queue;
17376 local_queue = queue;
17377 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
17378 VkDebugUtilsLabelEXT* local_pLabelInfo;
17379 local_pLabelInfo = nullptr;
17380 if (pLabelInfo)
17381 {
17382 local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
17383 deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17384 }
17385 if (local_pLabelInfo)
17386 {
17387 handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17388 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017389 countingStream->rewind();
17390 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017391 uint64_t cgen_var_1169 = (uint64_t)local_queue;
17392 countingStream->putBe64(cgen_var_1169);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017393 marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017394 }
17395 uint32_t packetSize_vkQueueBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17396 countingStream->rewind();
17397 uint32_t opcode_vkQueueBeginDebugUtilsLabelEXT = OP_vkQueueBeginDebugUtilsLabelEXT;
17398 stream->write(&opcode_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t));
17399 stream->write(&packetSize_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017400 uint64_t cgen_var_1170 = (uint64_t)local_queue;
17401 stream->putBe64(cgen_var_1170);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017402 marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17403 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017404}
17405
17406void VkEncoder::vkQueueEndDebugUtilsLabelEXT(
17407 VkQueue queue)
17408{
17409 auto stream = mImpl->stream();
17410 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017411 auto resources = mImpl->resources();
17412 auto pool = mImpl->pool();
17413 VkQueue local_queue;
17414 local_queue = queue;
17415 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017416 countingStream->rewind();
17417 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017418 uint64_t cgen_var_1171 = (uint64_t)local_queue;
17419 countingStream->putBe64(cgen_var_1171);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017420 }
17421 uint32_t packetSize_vkQueueEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17422 countingStream->rewind();
17423 uint32_t opcode_vkQueueEndDebugUtilsLabelEXT = OP_vkQueueEndDebugUtilsLabelEXT;
17424 stream->write(&opcode_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t));
17425 stream->write(&packetSize_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017426 uint64_t cgen_var_1172 = (uint64_t)local_queue;
17427 stream->putBe64(cgen_var_1172);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017428 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017429}
17430
17431void VkEncoder::vkQueueInsertDebugUtilsLabelEXT(
17432 VkQueue queue,
17433 const VkDebugUtilsLabelEXT* pLabelInfo)
17434{
17435 auto stream = mImpl->stream();
17436 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017437 auto resources = mImpl->resources();
17438 auto pool = mImpl->pool();
17439 VkQueue local_queue;
17440 local_queue = queue;
17441 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
17442 VkDebugUtilsLabelEXT* local_pLabelInfo;
17443 local_pLabelInfo = nullptr;
17444 if (pLabelInfo)
17445 {
17446 local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
17447 deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17448 }
17449 if (local_pLabelInfo)
17450 {
17451 handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17452 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017453 countingStream->rewind();
17454 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017455 uint64_t cgen_var_1173 = (uint64_t)local_queue;
17456 countingStream->putBe64(cgen_var_1173);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017457 marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017458 }
17459 uint32_t packetSize_vkQueueInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17460 countingStream->rewind();
17461 uint32_t opcode_vkQueueInsertDebugUtilsLabelEXT = OP_vkQueueInsertDebugUtilsLabelEXT;
17462 stream->write(&opcode_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t));
17463 stream->write(&packetSize_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017464 uint64_t cgen_var_1174 = (uint64_t)local_queue;
17465 stream->putBe64(cgen_var_1174);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017466 marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17467 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017468}
17469
17470void VkEncoder::vkCmdBeginDebugUtilsLabelEXT(
17471 VkCommandBuffer commandBuffer,
17472 const VkDebugUtilsLabelEXT* pLabelInfo)
17473{
17474 auto stream = mImpl->stream();
17475 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017476 auto resources = mImpl->resources();
17477 auto pool = mImpl->pool();
17478 VkCommandBuffer local_commandBuffer;
17479 local_commandBuffer = commandBuffer;
17480 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
17481 VkDebugUtilsLabelEXT* local_pLabelInfo;
17482 local_pLabelInfo = nullptr;
17483 if (pLabelInfo)
17484 {
17485 local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
17486 deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17487 }
17488 if (local_pLabelInfo)
17489 {
17490 handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17491 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017492 countingStream->rewind();
17493 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017494 uint64_t cgen_var_1175 = (uint64_t)local_commandBuffer;
17495 countingStream->putBe64(cgen_var_1175);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017496 marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017497 }
17498 uint32_t packetSize_vkCmdBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17499 countingStream->rewind();
17500 uint32_t opcode_vkCmdBeginDebugUtilsLabelEXT = OP_vkCmdBeginDebugUtilsLabelEXT;
17501 stream->write(&opcode_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t));
17502 stream->write(&packetSize_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017503 uint64_t cgen_var_1176 = (uint64_t)local_commandBuffer;
17504 stream->putBe64(cgen_var_1176);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017505 marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17506 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017507}
17508
17509void VkEncoder::vkCmdEndDebugUtilsLabelEXT(
17510 VkCommandBuffer commandBuffer)
17511{
17512 auto stream = mImpl->stream();
17513 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017514 auto resources = mImpl->resources();
17515 auto pool = mImpl->pool();
17516 VkCommandBuffer local_commandBuffer;
17517 local_commandBuffer = commandBuffer;
17518 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017519 countingStream->rewind();
17520 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017521 uint64_t cgen_var_1177 = (uint64_t)local_commandBuffer;
17522 countingStream->putBe64(cgen_var_1177);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017523 }
17524 uint32_t packetSize_vkCmdEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17525 countingStream->rewind();
17526 uint32_t opcode_vkCmdEndDebugUtilsLabelEXT = OP_vkCmdEndDebugUtilsLabelEXT;
17527 stream->write(&opcode_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t));
17528 stream->write(&packetSize_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017529 uint64_t cgen_var_1178 = (uint64_t)local_commandBuffer;
17530 stream->putBe64(cgen_var_1178);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017531 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017532}
17533
17534void VkEncoder::vkCmdInsertDebugUtilsLabelEXT(
17535 VkCommandBuffer commandBuffer,
17536 const VkDebugUtilsLabelEXT* pLabelInfo)
17537{
17538 auto stream = mImpl->stream();
17539 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017540 auto resources = mImpl->resources();
17541 auto pool = mImpl->pool();
17542 VkCommandBuffer local_commandBuffer;
17543 local_commandBuffer = commandBuffer;
17544 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
17545 VkDebugUtilsLabelEXT* local_pLabelInfo;
17546 local_pLabelInfo = nullptr;
17547 if (pLabelInfo)
17548 {
17549 local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
17550 deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17551 }
17552 if (local_pLabelInfo)
17553 {
17554 handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17555 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017556 countingStream->rewind();
17557 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017558 uint64_t cgen_var_1179 = (uint64_t)local_commandBuffer;
17559 countingStream->putBe64(cgen_var_1179);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017560 marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017561 }
17562 uint32_t packetSize_vkCmdInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17563 countingStream->rewind();
17564 uint32_t opcode_vkCmdInsertDebugUtilsLabelEXT = OP_vkCmdInsertDebugUtilsLabelEXT;
17565 stream->write(&opcode_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t));
17566 stream->write(&packetSize_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017567 uint64_t cgen_var_1180 = (uint64_t)local_commandBuffer;
17568 stream->putBe64(cgen_var_1180);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017569 marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
17570 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017571}
17572
17573VkResult VkEncoder::vkCreateDebugUtilsMessengerEXT(
17574 VkInstance instance,
17575 const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo,
17576 const VkAllocationCallbacks* pAllocator,
17577 VkDebugUtilsMessengerEXT* pMessenger)
17578{
17579 auto stream = mImpl->stream();
17580 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017581 auto resources = mImpl->resources();
17582 auto pool = mImpl->pool();
17583 VkInstance local_instance;
17584 local_instance = instance;
17585 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
17586 VkDebugUtilsMessengerCreateInfoEXT* local_pCreateInfo;
17587 local_pCreateInfo = nullptr;
17588 if (pCreateInfo)
17589 {
17590 local_pCreateInfo = (VkDebugUtilsMessengerCreateInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCreateInfoEXT));
17591 deepcopy_VkDebugUtilsMessengerCreateInfoEXT(pool, pCreateInfo, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
17592 }
17593 if (local_pCreateInfo)
17594 {
17595 handlemap_VkDebugUtilsMessengerCreateInfoEXT(resources->unwrapMapping(), (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
17596 }
17597 VkAllocationCallbacks* local_pAllocator;
17598 local_pAllocator = nullptr;
17599 if (pAllocator)
17600 {
17601 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
17602 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
17603 }
17604 if (local_pAllocator)
17605 {
17606 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
17607 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080017608 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017609 countingStream->rewind();
17610 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017611 uint64_t cgen_var_1181 = (uint64_t)local_instance;
17612 countingStream->putBe64(cgen_var_1181);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017613 marshal_VkDebugUtilsMessengerCreateInfoEXT(countingStream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017614 // WARNING PTR CHECK
17615 uint64_t cgen_var_1182 = (uint64_t)(uintptr_t)local_pAllocator;
17616 countingStream->putBe64(cgen_var_1182);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017617 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017618 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017619 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017620 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017621 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017622 countingStream->write((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT));
17623 }
17624 uint32_t packetSize_vkCreateDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17625 countingStream->rewind();
17626 uint32_t opcode_vkCreateDebugUtilsMessengerEXT = OP_vkCreateDebugUtilsMessengerEXT;
17627 stream->write(&opcode_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t));
17628 stream->write(&packetSize_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017629 uint64_t cgen_var_1183 = (uint64_t)local_instance;
17630 stream->putBe64(cgen_var_1183);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017631 marshal_VkDebugUtilsMessengerCreateInfoEXT(stream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017632 // WARNING PTR CHECK
17633 uint64_t cgen_var_1184 = (uint64_t)(uintptr_t)local_pAllocator;
17634 stream->putBe64(cgen_var_1184);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017635 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017636 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017637 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017638 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017639 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017640 stream->write((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017641 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017642 stream->read((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017643 if (pMessenger)
17644 {
17645 resources->createMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)pMessenger, 1);
17646 }
17647 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017648 VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0;
17649 stream->read(&vkCreateDebugUtilsMessengerEXT_VkResult_return, sizeof(VkResult));
17650 return vkCreateDebugUtilsMessengerEXT_VkResult_return;
17651}
17652
17653void VkEncoder::vkDestroyDebugUtilsMessengerEXT(
17654 VkInstance instance,
17655 VkDebugUtilsMessengerEXT messenger,
17656 const VkAllocationCallbacks* pAllocator)
17657{
17658 auto stream = mImpl->stream();
17659 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017660 auto resources = mImpl->resources();
17661 auto pool = mImpl->pool();
17662 VkInstance local_instance;
17663 local_instance = instance;
17664 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
Lingfeng Yang9d02e102018-11-10 01:51:46 -080017665 VkDebugUtilsMessengerEXT local_messenger;
17666 local_messenger = messenger;
17667 resources->unwrapMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)&local_messenger);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017668 VkAllocationCallbacks* local_pAllocator;
17669 local_pAllocator = nullptr;
17670 if (pAllocator)
17671 {
17672 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
17673 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
17674 }
17675 if (local_pAllocator)
17676 {
17677 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
17678 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080017679 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017680 countingStream->rewind();
17681 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017682 uint64_t cgen_var_1185 = (uint64_t)local_instance;
17683 countingStream->putBe64(cgen_var_1185);
17684 uint64_t cgen_var_1186 = (uint64_t)local_messenger;
17685 countingStream->putBe64(cgen_var_1186);
17686 // WARNING PTR CHECK
17687 uint64_t cgen_var_1187 = (uint64_t)(uintptr_t)local_pAllocator;
17688 countingStream->putBe64(cgen_var_1187);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017689 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017690 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017691 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017692 }
17693 }
17694 uint32_t packetSize_vkDestroyDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17695 countingStream->rewind();
17696 uint32_t opcode_vkDestroyDebugUtilsMessengerEXT = OP_vkDestroyDebugUtilsMessengerEXT;
17697 stream->write(&opcode_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t));
17698 stream->write(&packetSize_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017699 uint64_t cgen_var_1188 = (uint64_t)local_instance;
17700 stream->putBe64(cgen_var_1188);
17701 uint64_t cgen_var_1189 = (uint64_t)local_messenger;
17702 stream->putBe64(cgen_var_1189);
17703 // WARNING PTR CHECK
17704 uint64_t cgen_var_1190 = (uint64_t)(uintptr_t)local_pAllocator;
17705 stream->putBe64(cgen_var_1190);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017706 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017707 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017708 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017709 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017710 resources->destroyMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)&messenger);
17711 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017712}
17713
17714void VkEncoder::vkSubmitDebugUtilsMessageEXT(
17715 VkInstance instance,
17716 VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
17717 VkDebugUtilsMessageTypeFlagsEXT messageTypes,
17718 const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData)
17719{
17720 auto stream = mImpl->stream();
17721 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017722 auto resources = mImpl->resources();
17723 auto pool = mImpl->pool();
17724 VkInstance local_instance;
17725 local_instance = instance;
17726 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
17727 VkDebugUtilsMessageSeverityFlagBitsEXT local_messageSeverity;
17728 local_messageSeverity = messageSeverity;
17729 VkDebugUtilsMessageTypeFlagsEXT local_messageTypes;
17730 local_messageTypes = messageTypes;
17731 VkDebugUtilsMessengerCallbackDataEXT* local_pCallbackData;
17732 local_pCallbackData = nullptr;
17733 if (pCallbackData)
17734 {
17735 local_pCallbackData = (VkDebugUtilsMessengerCallbackDataEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCallbackDataEXT));
17736 deepcopy_VkDebugUtilsMessengerCallbackDataEXT(pool, pCallbackData, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
17737 }
17738 if (local_pCallbackData)
17739 {
17740 handlemap_VkDebugUtilsMessengerCallbackDataEXT(resources->unwrapMapping(), (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
17741 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017742 countingStream->rewind();
17743 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017744 uint64_t cgen_var_1191 = (uint64_t)local_instance;
17745 countingStream->putBe64(cgen_var_1191);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017746 countingStream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT));
17747 countingStream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT));
17748 marshal_VkDebugUtilsMessengerCallbackDataEXT(countingStream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017749 }
17750 uint32_t packetSize_vkSubmitDebugUtilsMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17751 countingStream->rewind();
17752 uint32_t opcode_vkSubmitDebugUtilsMessageEXT = OP_vkSubmitDebugUtilsMessageEXT;
17753 stream->write(&opcode_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t));
17754 stream->write(&packetSize_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017755 uint64_t cgen_var_1192 = (uint64_t)local_instance;
17756 stream->putBe64(cgen_var_1192);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017757 stream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT));
17758 stream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT));
17759 marshal_VkDebugUtilsMessengerCallbackDataEXT(stream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
17760 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017761}
17762
17763#endif
17764#ifdef VK_ANDROID_external_memory_android_hardware_buffer
17765VkResult VkEncoder::vkGetAndroidHardwareBufferPropertiesANDROID(
17766 VkDevice device,
17767 const AHardwareBuffer* buffer,
17768 VkAndroidHardwareBufferPropertiesANDROID* pProperties)
17769{
17770 auto stream = mImpl->stream();
17771 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017772 auto resources = mImpl->resources();
17773 auto pool = mImpl->pool();
17774 VkDevice local_device;
17775 local_device = device;
17776 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
17777 AHardwareBuffer* local_buffer;
17778 local_buffer = nullptr;
17779 if (buffer)
17780 {
17781 local_buffer = (AHardwareBuffer*)pool->dupArray(buffer, sizeof(const AHardwareBuffer));
17782 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017783 countingStream->rewind();
17784 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017785 uint64_t cgen_var_1193 = (uint64_t)local_device;
17786 countingStream->putBe64(cgen_var_1193);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017787 countingStream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017788 marshal_VkAndroidHardwareBufferPropertiesANDROID(countingStream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
17789 }
17790 uint32_t packetSize_vkGetAndroidHardwareBufferPropertiesANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17791 countingStream->rewind();
17792 uint32_t opcode_vkGetAndroidHardwareBufferPropertiesANDROID = OP_vkGetAndroidHardwareBufferPropertiesANDROID;
17793 stream->write(&opcode_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t));
17794 stream->write(&packetSize_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017795 uint64_t cgen_var_1194 = (uint64_t)local_device;
17796 stream->putBe64(cgen_var_1194);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017797 stream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017798 marshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
17799 unmarshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017800 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017801 VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0;
17802 stream->read(&vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return, sizeof(VkResult));
17803 return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return;
17804}
17805
17806VkResult VkEncoder::vkGetMemoryAndroidHardwareBufferANDROID(
17807 VkDevice device,
17808 const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
17809 AHardwareBuffer** pBuffer)
17810{
17811 auto stream = mImpl->stream();
17812 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017813 auto resources = mImpl->resources();
17814 auto pool = mImpl->pool();
17815 VkDevice local_device;
17816 local_device = device;
17817 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
17818 VkMemoryGetAndroidHardwareBufferInfoANDROID* local_pInfo;
17819 local_pInfo = nullptr;
17820 if (pInfo)
17821 {
17822 local_pInfo = (VkMemoryGetAndroidHardwareBufferInfoANDROID*)pool->alloc(sizeof(const VkMemoryGetAndroidHardwareBufferInfoANDROID));
17823 deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(pool, pInfo, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
17824 }
17825 if (local_pInfo)
17826 {
17827 handlemap_VkMemoryGetAndroidHardwareBufferInfoANDROID(resources->unwrapMapping(), (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
17828 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017829 countingStream->rewind();
17830 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017831 uint64_t cgen_var_1195 = (uint64_t)local_device;
17832 countingStream->putBe64(cgen_var_1195);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017833 marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(countingStream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017834 countingStream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
17835 }
17836 uint32_t packetSize_vkGetMemoryAndroidHardwareBufferANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17837 countingStream->rewind();
17838 uint32_t opcode_vkGetMemoryAndroidHardwareBufferANDROID = OP_vkGetMemoryAndroidHardwareBufferANDROID;
17839 stream->write(&opcode_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t));
17840 stream->write(&packetSize_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017841 uint64_t cgen_var_1196 = (uint64_t)local_device;
17842 stream->putBe64(cgen_var_1196);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017843 marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(stream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017844 stream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
17845 stream->read((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017846 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017847 VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0;
17848 stream->read(&vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return, sizeof(VkResult));
17849 return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return;
17850}
17851
17852#endif
17853#ifdef VK_EXT_sampler_filter_minmax
17854#endif
17855#ifdef VK_AMD_gpu_shader_int16
17856#endif
17857#ifdef VK_AMD_mixed_attachment_samples
17858#endif
17859#ifdef VK_AMD_shader_fragment_mask
17860#endif
17861#ifdef VK_EXT_shader_stencil_export
17862#endif
17863#ifdef VK_EXT_sample_locations
17864void VkEncoder::vkCmdSetSampleLocationsEXT(
17865 VkCommandBuffer commandBuffer,
17866 const VkSampleLocationsInfoEXT* pSampleLocationsInfo)
17867{
17868 auto stream = mImpl->stream();
17869 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017870 auto resources = mImpl->resources();
17871 auto pool = mImpl->pool();
17872 VkCommandBuffer local_commandBuffer;
17873 local_commandBuffer = commandBuffer;
17874 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
17875 VkSampleLocationsInfoEXT* local_pSampleLocationsInfo;
17876 local_pSampleLocationsInfo = nullptr;
17877 if (pSampleLocationsInfo)
17878 {
17879 local_pSampleLocationsInfo = (VkSampleLocationsInfoEXT*)pool->alloc(sizeof(const VkSampleLocationsInfoEXT));
17880 deepcopy_VkSampleLocationsInfoEXT(pool, pSampleLocationsInfo, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
17881 }
17882 if (local_pSampleLocationsInfo)
17883 {
17884 handlemap_VkSampleLocationsInfoEXT(resources->unwrapMapping(), (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
17885 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017886 countingStream->rewind();
17887 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017888 uint64_t cgen_var_1197 = (uint64_t)local_commandBuffer;
17889 countingStream->putBe64(cgen_var_1197);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017890 marshal_VkSampleLocationsInfoEXT(countingStream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017891 }
17892 uint32_t packetSize_vkCmdSetSampleLocationsEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17893 countingStream->rewind();
17894 uint32_t opcode_vkCmdSetSampleLocationsEXT = OP_vkCmdSetSampleLocationsEXT;
17895 stream->write(&opcode_vkCmdSetSampleLocationsEXT, sizeof(uint32_t));
17896 stream->write(&packetSize_vkCmdSetSampleLocationsEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017897 uint64_t cgen_var_1198 = (uint64_t)local_commandBuffer;
17898 stream->putBe64(cgen_var_1198);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017899 marshal_VkSampleLocationsInfoEXT(stream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
17900 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017901}
17902
17903void VkEncoder::vkGetPhysicalDeviceMultisamplePropertiesEXT(
17904 VkPhysicalDevice physicalDevice,
17905 VkSampleCountFlagBits samples,
17906 VkMultisamplePropertiesEXT* pMultisampleProperties)
17907{
17908 auto stream = mImpl->stream();
17909 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017910 auto resources = mImpl->resources();
17911 auto pool = mImpl->pool();
17912 VkPhysicalDevice local_physicalDevice;
17913 local_physicalDevice = physicalDevice;
17914 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
17915 VkSampleCountFlagBits local_samples;
17916 local_samples = samples;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017917 countingStream->rewind();
17918 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017919 uint64_t cgen_var_1199 = (uint64_t)local_physicalDevice;
17920 countingStream->putBe64(cgen_var_1199);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017921 countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017922 marshal_VkMultisamplePropertiesEXT(countingStream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
17923 }
17924 uint32_t packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
17925 countingStream->rewind();
17926 uint32_t opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT = OP_vkGetPhysicalDeviceMultisamplePropertiesEXT;
17927 stream->write(&opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t));
17928 stream->write(&packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017929 uint64_t cgen_var_1200 = (uint64_t)local_physicalDevice;
17930 stream->putBe64(cgen_var_1200);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017931 stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017932 marshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
17933 unmarshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017934 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017935}
17936
17937#endif
17938#ifdef VK_EXT_blend_operation_advanced
17939#endif
17940#ifdef VK_NV_fragment_coverage_to_color
17941#endif
17942#ifdef VK_NV_framebuffer_mixed_samples
17943#endif
17944#ifdef VK_NV_fill_rectangle
17945#endif
17946#ifdef VK_EXT_post_depth_coverage
17947#endif
17948#ifdef VK_EXT_validation_cache
17949VkResult VkEncoder::vkCreateValidationCacheEXT(
17950 VkDevice device,
17951 const VkValidationCacheCreateInfoEXT* pCreateInfo,
17952 const VkAllocationCallbacks* pAllocator,
17953 VkValidationCacheEXT* pValidationCache)
17954{
17955 auto stream = mImpl->stream();
17956 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017957 auto resources = mImpl->resources();
17958 auto pool = mImpl->pool();
17959 VkDevice local_device;
17960 local_device = device;
17961 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
17962 VkValidationCacheCreateInfoEXT* local_pCreateInfo;
17963 local_pCreateInfo = nullptr;
17964 if (pCreateInfo)
17965 {
17966 local_pCreateInfo = (VkValidationCacheCreateInfoEXT*)pool->alloc(sizeof(const VkValidationCacheCreateInfoEXT));
17967 deepcopy_VkValidationCacheCreateInfoEXT(pool, pCreateInfo, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
17968 }
17969 if (local_pCreateInfo)
17970 {
17971 handlemap_VkValidationCacheCreateInfoEXT(resources->unwrapMapping(), (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
17972 }
17973 VkAllocationCallbacks* local_pAllocator;
17974 local_pAllocator = nullptr;
17975 if (pAllocator)
17976 {
17977 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
17978 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
17979 }
17980 if (local_pAllocator)
17981 {
17982 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
17983 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080017984 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017985 countingStream->rewind();
17986 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017987 uint64_t cgen_var_1201 = (uint64_t)local_device;
17988 countingStream->putBe64(cgen_var_1201);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017989 marshal_VkValidationCacheCreateInfoEXT(countingStream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017990 // WARNING PTR CHECK
17991 uint64_t cgen_var_1202 = (uint64_t)(uintptr_t)local_pAllocator;
17992 countingStream->putBe64(cgen_var_1202);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017993 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017994 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080017995 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017996 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080017997 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070017998 countingStream->write((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT));
17999 }
18000 uint32_t packetSize_vkCreateValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
18001 countingStream->rewind();
18002 uint32_t opcode_vkCreateValidationCacheEXT = OP_vkCreateValidationCacheEXT;
18003 stream->write(&opcode_vkCreateValidationCacheEXT, sizeof(uint32_t));
18004 stream->write(&packetSize_vkCreateValidationCacheEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018005 uint64_t cgen_var_1203 = (uint64_t)local_device;
18006 stream->putBe64(cgen_var_1203);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018007 marshal_VkValidationCacheCreateInfoEXT(stream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018008 // WARNING PTR CHECK
18009 uint64_t cgen_var_1204 = (uint64_t)(uintptr_t)local_pAllocator;
18010 stream->putBe64(cgen_var_1204);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018011 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018012 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018013 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018014 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018015 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018016 stream->write((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018017 // WARNING HANDLE TYPE POINTER
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018018 stream->read((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018019 if (pValidationCache)
18020 {
18021 resources->createMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)pValidationCache, 1);
18022 }
18023 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018024 VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0;
18025 stream->read(&vkCreateValidationCacheEXT_VkResult_return, sizeof(VkResult));
18026 return vkCreateValidationCacheEXT_VkResult_return;
18027}
18028
18029void VkEncoder::vkDestroyValidationCacheEXT(
18030 VkDevice device,
18031 VkValidationCacheEXT validationCache,
18032 const VkAllocationCallbacks* pAllocator)
18033{
18034 auto stream = mImpl->stream();
18035 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018036 auto resources = mImpl->resources();
18037 auto pool = mImpl->pool();
18038 VkDevice local_device;
18039 local_device = device;
18040 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yang9d02e102018-11-10 01:51:46 -080018041 VkValidationCacheEXT local_validationCache;
18042 local_validationCache = validationCache;
18043 resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&local_validationCache);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018044 VkAllocationCallbacks* local_pAllocator;
18045 local_pAllocator = nullptr;
18046 if (pAllocator)
18047 {
18048 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
18049 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
18050 }
18051 if (local_pAllocator)
18052 {
18053 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
18054 }
Lingfeng Yang9d02e102018-11-10 01:51:46 -080018055 local_pAllocator = nullptr;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018056 countingStream->rewind();
18057 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018058 uint64_t cgen_var_1205 = (uint64_t)local_device;
18059 countingStream->putBe64(cgen_var_1205);
18060 uint64_t cgen_var_1206 = (uint64_t)local_validationCache;
18061 countingStream->putBe64(cgen_var_1206);
18062 // WARNING PTR CHECK
18063 uint64_t cgen_var_1207 = (uint64_t)(uintptr_t)local_pAllocator;
18064 countingStream->putBe64(cgen_var_1207);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018065 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018066 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018067 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018068 }
18069 }
18070 uint32_t packetSize_vkDestroyValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
18071 countingStream->rewind();
18072 uint32_t opcode_vkDestroyValidationCacheEXT = OP_vkDestroyValidationCacheEXT;
18073 stream->write(&opcode_vkDestroyValidationCacheEXT, sizeof(uint32_t));
18074 stream->write(&packetSize_vkDestroyValidationCacheEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018075 uint64_t cgen_var_1208 = (uint64_t)local_device;
18076 stream->putBe64(cgen_var_1208);
18077 uint64_t cgen_var_1209 = (uint64_t)local_validationCache;
18078 stream->putBe64(cgen_var_1209);
18079 // WARNING PTR CHECK
18080 uint64_t cgen_var_1210 = (uint64_t)(uintptr_t)local_pAllocator;
18081 stream->putBe64(cgen_var_1210);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018082 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018083 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018084 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018085 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018086 resources->destroyMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&validationCache);
18087 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018088}
18089
18090VkResult VkEncoder::vkMergeValidationCachesEXT(
18091 VkDevice device,
18092 VkValidationCacheEXT dstCache,
18093 uint32_t srcCacheCount,
18094 const VkValidationCacheEXT* pSrcCaches)
18095{
18096 auto stream = mImpl->stream();
18097 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018098 auto resources = mImpl->resources();
18099 auto pool = mImpl->pool();
18100 VkDevice local_device;
18101 local_device = device;
18102 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
18103 VkValidationCacheEXT local_dstCache;
18104 local_dstCache = dstCache;
18105 resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&local_dstCache);
18106 uint32_t local_srcCacheCount;
18107 local_srcCacheCount = srcCacheCount;
18108 VkValidationCacheEXT* local_pSrcCaches;
18109 local_pSrcCaches = nullptr;
18110 if (pSrcCaches)
18111 {
18112 local_pSrcCaches = (VkValidationCacheEXT*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkValidationCacheEXT));
18113 }
18114 if (local_pSrcCaches)
18115 {
18116 resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount)));
18117 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018118 countingStream->rewind();
18119 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018120 uint64_t cgen_var_1211 = (uint64_t)local_device;
18121 countingStream->putBe64(cgen_var_1211);
18122 uint64_t cgen_var_1212 = (uint64_t)local_dstCache;
18123 countingStream->putBe64(cgen_var_1212);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018124 countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018125 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018126 countingStream->write((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkValidationCacheEXT));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018127 }
18128 uint32_t packetSize_vkMergeValidationCachesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
18129 countingStream->rewind();
18130 uint32_t opcode_vkMergeValidationCachesEXT = OP_vkMergeValidationCachesEXT;
18131 stream->write(&opcode_vkMergeValidationCachesEXT, sizeof(uint32_t));
18132 stream->write(&packetSize_vkMergeValidationCachesEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018133 uint64_t cgen_var_1213 = (uint64_t)local_device;
18134 stream->putBe64(cgen_var_1213);
18135 uint64_t cgen_var_1214 = (uint64_t)local_dstCache;
18136 stream->putBe64(cgen_var_1214);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018137 stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018138 // WARNING HANDLE TYPE POINTER
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018139 stream->write((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkValidationCacheEXT));
18140 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018141 VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0;
18142 stream->read(&vkMergeValidationCachesEXT_VkResult_return, sizeof(VkResult));
18143 return vkMergeValidationCachesEXT_VkResult_return;
18144}
18145
18146VkResult VkEncoder::vkGetValidationCacheDataEXT(
18147 VkDevice device,
18148 VkValidationCacheEXT validationCache,
18149 size_t* pDataSize,
18150 void* pData)
18151{
18152 auto stream = mImpl->stream();
18153 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018154 auto resources = mImpl->resources();
18155 auto pool = mImpl->pool();
18156 VkDevice local_device;
18157 local_device = device;
18158 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
18159 VkValidationCacheEXT local_validationCache;
18160 local_validationCache = validationCache;
18161 resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&local_validationCache);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018162 countingStream->rewind();
18163 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018164 uint64_t cgen_var_1215 = (uint64_t)local_device;
18165 countingStream->putBe64(cgen_var_1215);
18166 uint64_t cgen_var_1216 = (uint64_t)local_validationCache;
18167 countingStream->putBe64(cgen_var_1216);
18168 // WARNING PTR CHECK
18169 uint64_t cgen_var_1217 = (uint64_t)(uintptr_t)pDataSize;
18170 countingStream->putBe64(cgen_var_1217);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018171 if (pDataSize)
18172 {
18173 countingStream->write((size_t*)pDataSize, sizeof(size_t));
18174 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018175 // WARNING PTR CHECK
18176 uint64_t cgen_var_1218 = (uint64_t)(uintptr_t)pData;
18177 countingStream->putBe64(cgen_var_1218);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018178 if (pData)
18179 {
18180 countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
18181 }
18182 }
18183 uint32_t packetSize_vkGetValidationCacheDataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
18184 countingStream->rewind();
18185 uint32_t opcode_vkGetValidationCacheDataEXT = OP_vkGetValidationCacheDataEXT;
18186 stream->write(&opcode_vkGetValidationCacheDataEXT, sizeof(uint32_t));
18187 stream->write(&packetSize_vkGetValidationCacheDataEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018188 uint64_t cgen_var_1219 = (uint64_t)local_device;
18189 stream->putBe64(cgen_var_1219);
18190 uint64_t cgen_var_1220 = (uint64_t)local_validationCache;
18191 stream->putBe64(cgen_var_1220);
18192 // WARNING PTR CHECK
18193 uint64_t cgen_var_1221 = (uint64_t)(uintptr_t)pDataSize;
18194 stream->putBe64(cgen_var_1221);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018195 if (pDataSize)
18196 {
18197 stream->write((size_t*)pDataSize, sizeof(size_t));
18198 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018199 // WARNING PTR CHECK
18200 uint64_t cgen_var_1222 = (uint64_t)(uintptr_t)pData;
18201 stream->putBe64(cgen_var_1222);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018202 if (pData)
18203 {
18204 stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
18205 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018206 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018207 size_t* check_pDataSize;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018208 check_pDataSize = (size_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018209 if (pDataSize)
18210 {
18211 if (!(check_pDataSize))
18212 {
18213 fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n");
18214 }
18215 stream->read((size_t*)pDataSize, sizeof(size_t));
18216 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018217 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018218 void* check_pData;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018219 check_pData = (void*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018220 if (pData)
18221 {
18222 if (!(check_pData))
18223 {
18224 fprintf(stderr, "fatal: pData inconsistent between guest and host\n");
18225 }
18226 stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
18227 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018228 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018229 VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0;
18230 stream->read(&vkGetValidationCacheDataEXT_VkResult_return, sizeof(VkResult));
18231 return vkGetValidationCacheDataEXT_VkResult_return;
18232}
18233
18234#endif
18235#ifdef VK_EXT_descriptor_indexing
18236#endif
18237#ifdef VK_EXT_shader_viewport_index_layer
18238#endif
18239#ifdef VK_EXT_global_priority
18240#endif
18241#ifdef VK_EXT_external_memory_host
18242VkResult VkEncoder::vkGetMemoryHostPointerPropertiesEXT(
18243 VkDevice device,
18244 VkExternalMemoryHandleTypeFlagBits handleType,
18245 const void* pHostPointer,
18246 VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties)
18247{
18248 auto stream = mImpl->stream();
18249 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018250 auto resources = mImpl->resources();
18251 auto pool = mImpl->pool();
18252 VkDevice local_device;
18253 local_device = device;
18254 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
18255 VkExternalMemoryHandleTypeFlagBits local_handleType;
18256 local_handleType = handleType;
18257 void* local_pHostPointer;
18258 local_pHostPointer = nullptr;
18259 if (pHostPointer)
18260 {
18261 local_pHostPointer = (void*)pool->dupArray(pHostPointer, sizeof(const uint8_t));
18262 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018263 countingStream->rewind();
18264 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018265 uint64_t cgen_var_1225 = (uint64_t)local_device;
18266 countingStream->putBe64(cgen_var_1225);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018267 countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018268 // WARNING PTR CHECK
18269 uint64_t cgen_var_1226 = (uint64_t)(uintptr_t)local_pHostPointer;
18270 countingStream->putBe64(cgen_var_1226);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018271 if (local_pHostPointer)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018272 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018273 countingStream->write((void*)local_pHostPointer, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018274 }
18275 marshal_VkMemoryHostPointerPropertiesEXT(countingStream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties));
18276 }
18277 uint32_t packetSize_vkGetMemoryHostPointerPropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
18278 countingStream->rewind();
18279 uint32_t opcode_vkGetMemoryHostPointerPropertiesEXT = OP_vkGetMemoryHostPointerPropertiesEXT;
18280 stream->write(&opcode_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t));
18281 stream->write(&packetSize_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018282 uint64_t cgen_var_1227 = (uint64_t)local_device;
18283 stream->putBe64(cgen_var_1227);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018284 stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018285 // WARNING PTR CHECK
18286 uint64_t cgen_var_1228 = (uint64_t)(uintptr_t)local_pHostPointer;
18287 stream->putBe64(cgen_var_1228);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018288 if (local_pHostPointer)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018289 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018290 stream->write((void*)local_pHostPointer, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018291 }
18292 marshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties));
18293 unmarshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018294 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018295 VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0;
18296 stream->read(&vkGetMemoryHostPointerPropertiesEXT_VkResult_return, sizeof(VkResult));
18297 return vkGetMemoryHostPointerPropertiesEXT_VkResult_return;
18298}
18299
18300#endif
18301#ifdef VK_AMD_buffer_marker
18302void VkEncoder::vkCmdWriteBufferMarkerAMD(
18303 VkCommandBuffer commandBuffer,
18304 VkPipelineStageFlagBits pipelineStage,
18305 VkBuffer dstBuffer,
18306 VkDeviceSize dstOffset,
18307 uint32_t marker)
18308{
18309 auto stream = mImpl->stream();
18310 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018311 auto resources = mImpl->resources();
18312 auto pool = mImpl->pool();
18313 VkCommandBuffer local_commandBuffer;
18314 local_commandBuffer = commandBuffer;
18315 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
18316 VkPipelineStageFlagBits local_pipelineStage;
18317 local_pipelineStage = pipelineStage;
18318 VkBuffer local_dstBuffer;
18319 local_dstBuffer = dstBuffer;
18320 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
18321 VkDeviceSize local_dstOffset;
18322 local_dstOffset = dstOffset;
18323 uint32_t local_marker;
18324 local_marker = marker;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018325 countingStream->rewind();
18326 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018327 uint64_t cgen_var_1229 = (uint64_t)local_commandBuffer;
18328 countingStream->putBe64(cgen_var_1229);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018329 countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018330 uint64_t cgen_var_1230 = (uint64_t)local_dstBuffer;
18331 countingStream->putBe64(cgen_var_1230);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018332 countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
18333 countingStream->write((uint32_t*)&local_marker, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018334 }
18335 uint32_t packetSize_vkCmdWriteBufferMarkerAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten();
18336 countingStream->rewind();
18337 uint32_t opcode_vkCmdWriteBufferMarkerAMD = OP_vkCmdWriteBufferMarkerAMD;
18338 stream->write(&opcode_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t));
18339 stream->write(&packetSize_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018340 uint64_t cgen_var_1231 = (uint64_t)local_commandBuffer;
18341 stream->putBe64(cgen_var_1231);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018342 stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018343 uint64_t cgen_var_1232 = (uint64_t)local_dstBuffer;
18344 stream->putBe64(cgen_var_1232);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018345 stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
18346 stream->write((uint32_t*)&local_marker, sizeof(uint32_t));
18347 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018348}
18349
18350#endif
18351#ifdef VK_AMD_shader_core_properties
18352#endif
18353#ifdef VK_EXT_vertex_attribute_divisor
18354#endif
18355#ifdef VK_NV_shader_subgroup_partitioned
18356#endif
18357#ifdef VK_NV_device_diagnostic_checkpoints
18358void VkEncoder::vkCmdSetCheckpointNV(
18359 VkCommandBuffer commandBuffer,
18360 const void* pCheckpointMarker)
18361{
18362 auto stream = mImpl->stream();
18363 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018364 auto resources = mImpl->resources();
18365 auto pool = mImpl->pool();
18366 VkCommandBuffer local_commandBuffer;
18367 local_commandBuffer = commandBuffer;
18368 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
18369 void* local_pCheckpointMarker;
18370 local_pCheckpointMarker = nullptr;
18371 if (pCheckpointMarker)
18372 {
18373 local_pCheckpointMarker = (void*)pool->dupArray(pCheckpointMarker, sizeof(const uint8_t));
18374 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018375 countingStream->rewind();
18376 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018377 uint64_t cgen_var_1233 = (uint64_t)local_commandBuffer;
18378 countingStream->putBe64(cgen_var_1233);
18379 // WARNING PTR CHECK
18380 uint64_t cgen_var_1234 = (uint64_t)(uintptr_t)local_pCheckpointMarker;
18381 countingStream->putBe64(cgen_var_1234);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018382 if (local_pCheckpointMarker)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018383 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018384 countingStream->write((void*)local_pCheckpointMarker, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018385 }
18386 }
18387 uint32_t packetSize_vkCmdSetCheckpointNV = 4 + 4 + (uint32_t)countingStream->bytesWritten();
18388 countingStream->rewind();
18389 uint32_t opcode_vkCmdSetCheckpointNV = OP_vkCmdSetCheckpointNV;
18390 stream->write(&opcode_vkCmdSetCheckpointNV, sizeof(uint32_t));
18391 stream->write(&packetSize_vkCmdSetCheckpointNV, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018392 uint64_t cgen_var_1235 = (uint64_t)local_commandBuffer;
18393 stream->putBe64(cgen_var_1235);
18394 // WARNING PTR CHECK
18395 uint64_t cgen_var_1236 = (uint64_t)(uintptr_t)local_pCheckpointMarker;
18396 stream->putBe64(cgen_var_1236);
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018397 if (local_pCheckpointMarker)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018398 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018399 stream->write((void*)local_pCheckpointMarker, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018400 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018401 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018402}
18403
18404void VkEncoder::vkGetQueueCheckpointDataNV(
18405 VkQueue queue,
18406 uint32_t* pCheckpointDataCount,
18407 VkCheckpointDataNV* pCheckpointData)
18408{
18409 auto stream = mImpl->stream();
18410 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018411 auto resources = mImpl->resources();
18412 auto pool = mImpl->pool();
18413 VkQueue local_queue;
18414 local_queue = queue;
18415 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018416 countingStream->rewind();
18417 {
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018418 uint64_t cgen_var_1237 = (uint64_t)local_queue;
18419 countingStream->putBe64(cgen_var_1237);
18420 // WARNING PTR CHECK
18421 uint64_t cgen_var_1238 = (uint64_t)(uintptr_t)pCheckpointDataCount;
18422 countingStream->putBe64(cgen_var_1238);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018423 if (pCheckpointDataCount)
18424 {
18425 countingStream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
18426 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018427 // WARNING PTR CHECK
18428 uint64_t cgen_var_1239 = (uint64_t)(uintptr_t)pCheckpointData;
18429 countingStream->putBe64(cgen_var_1239);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018430 if (pCheckpointData)
18431 {
18432 for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i)
18433 {
18434 marshal_VkCheckpointDataNV(countingStream, (VkCheckpointDataNV*)(pCheckpointData + i));
18435 }
18436 }
18437 }
18438 uint32_t packetSize_vkGetQueueCheckpointDataNV = 4 + 4 + (uint32_t)countingStream->bytesWritten();
18439 countingStream->rewind();
18440 uint32_t opcode_vkGetQueueCheckpointDataNV = OP_vkGetQueueCheckpointDataNV;
18441 stream->write(&opcode_vkGetQueueCheckpointDataNV, sizeof(uint32_t));
18442 stream->write(&packetSize_vkGetQueueCheckpointDataNV, sizeof(uint32_t));
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018443 uint64_t cgen_var_1240 = (uint64_t)local_queue;
18444 stream->putBe64(cgen_var_1240);
18445 // WARNING PTR CHECK
18446 uint64_t cgen_var_1241 = (uint64_t)(uintptr_t)pCheckpointDataCount;
18447 stream->putBe64(cgen_var_1241);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018448 if (pCheckpointDataCount)
18449 {
18450 stream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
18451 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018452 // WARNING PTR CHECK
18453 uint64_t cgen_var_1242 = (uint64_t)(uintptr_t)pCheckpointData;
18454 stream->putBe64(cgen_var_1242);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018455 if (pCheckpointData)
18456 {
18457 for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i)
18458 {
18459 marshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i));
18460 }
18461 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018462 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018463 uint32_t* check_pCheckpointDataCount;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018464 check_pCheckpointDataCount = (uint32_t*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018465 if (pCheckpointDataCount)
18466 {
18467 if (!(check_pCheckpointDataCount))
18468 {
18469 fprintf(stderr, "fatal: pCheckpointDataCount inconsistent between guest and host\n");
18470 }
18471 stream->read((uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
18472 }
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018473 // WARNING PTR CHECK
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018474 VkCheckpointDataNV* check_pCheckpointData;
Lingfeng Yang77dc2512018-11-17 12:48:37 -080018475 check_pCheckpointData = (VkCheckpointDataNV*)(uintptr_t)stream->getBe64();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018476 if (pCheckpointData)
18477 {
18478 if (!(check_pCheckpointData))
18479 {
18480 fprintf(stderr, "fatal: pCheckpointData inconsistent between guest and host\n");
18481 }
18482 for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i)
18483 {
18484 unmarshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i));
18485 }
18486 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080018487 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070018488}
18489
18490#endif
18491
18492