blob: eb21c25e60bbae7ef22b7f2ac6a9c02853005410 [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 Yang71b596b2018-11-07 18:03:25 -080029#include "ResourceTracker.h"
Lingfeng Yanga126a8a2018-11-01 18:21:40 -070030#include "VulkanStream.h"
31
Lingfeng Yang6f3b6c52018-11-05 14:22:37 -080032#include "android/base/AlignedBuf.h"
Lingfeng Yang71b596b2018-11-07 18:03:25 -080033#include "android/base/Pool.h"
Lingfeng Yang6f3b6c52018-11-05 14:22:37 -080034
Lingfeng Yange71c6422018-11-01 19:29:49 -070035#include "goldfish_vk_marshaling_guest.h"
Lingfeng Yang71b596b2018-11-07 18:03:25 -080036#include "goldfish_vk_deepcopy_guest.h"
37#include "goldfish_vk_handlemap_guest.h"
Lingfeng Yange71c6422018-11-01 19:29:49 -070038
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070039
40
41
42
43
Lingfeng Yang71b596b2018-11-07 18:03:25 -080044using namespace goldfish_vk;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070045
Lingfeng Yang6f3b6c52018-11-05 14:22:37 -080046using android::aligned_buf_alloc;
47using android::aligned_buf_free;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080048using android::base::Pool;
Lingfeng Yang6f3b6c52018-11-05 14:22:37 -080049
Lingfeng Yanga126a8a2018-11-01 18:21:40 -070050class VkEncoder::Impl {
51public:
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070052 Impl(IOStream* stream) : m_stream(stream) { }
53 VulkanCountingStream* countingStream() { return &m_countingStream; }
54 VulkanStream* stream() { return &m_stream; }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080055 Pool* pool() { return &m_pool; }
56 ResourceTracker* resources() { return ResourceTracker::get(); }
Lingfeng Yanga126a8a2018-11-01 18:21:40 -070057private:
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070058 VulkanCountingStream m_countingStream;
59 VulkanStream m_stream;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080060 Pool m_pool { 8, 4096, 64 };
Lingfeng Yanga126a8a2018-11-01 18:21:40 -070061};
62
63VkEncoder::VkEncoder(IOStream *stream) :
64 mImpl(new VkEncoder::Impl(stream)) { }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070065#ifdef VK_VERSION_1_0
66VkResult VkEncoder::vkCreateInstance(
67 const VkInstanceCreateInfo* pCreateInfo,
68 const VkAllocationCallbacks* pAllocator,
69 VkInstance* pInstance)
70{
71 auto stream = mImpl->stream();
72 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080073 auto resources = mImpl->resources();
74 auto pool = mImpl->pool();
75 VkInstanceCreateInfo* local_pCreateInfo;
76 local_pCreateInfo = nullptr;
77 if (pCreateInfo)
78 {
79 local_pCreateInfo = (VkInstanceCreateInfo*)pool->alloc(sizeof(const VkInstanceCreateInfo));
80 deepcopy_VkInstanceCreateInfo(pool, pCreateInfo, (VkInstanceCreateInfo*)(local_pCreateInfo));
81 }
82 if (local_pCreateInfo)
83 {
84 handlemap_VkInstanceCreateInfo(resources->unwrapMapping(), (VkInstanceCreateInfo*)(local_pCreateInfo));
85 }
86 VkAllocationCallbacks* local_pAllocator;
87 local_pAllocator = nullptr;
88 if (pAllocator)
89 {
90 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
91 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
92 }
93 if (local_pAllocator)
94 {
95 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
96 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070097 countingStream->rewind();
98 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080099 marshal_VkInstanceCreateInfo(countingStream, (VkInstanceCreateInfo*)(local_pCreateInfo));
100 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
101 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700102 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800103 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700104 }
105 countingStream->write((VkInstance*)pInstance, sizeof(VkInstance));
106 }
107 uint32_t packetSize_vkCreateInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten();
108 countingStream->rewind();
109 uint32_t opcode_vkCreateInstance = OP_vkCreateInstance;
110 stream->write(&opcode_vkCreateInstance, sizeof(uint32_t));
111 stream->write(&packetSize_vkCreateInstance, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800112 marshal_VkInstanceCreateInfo(stream, (VkInstanceCreateInfo*)(local_pCreateInfo));
113 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
114 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700115 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800116 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700117 }
118 stream->write((VkInstance*)pInstance, sizeof(VkInstance));
119 stream->read((VkInstance*)pInstance, sizeof(VkInstance));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800120 if (pInstance)
121 {
122 resources->createMapping()->mapHandles_VkInstance((VkInstance*)pInstance, 1);
123 }
124 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700125 VkResult vkCreateInstance_VkResult_return = (VkResult)0;
126 stream->read(&vkCreateInstance_VkResult_return, sizeof(VkResult));
127 return vkCreateInstance_VkResult_return;
128}
129
130void VkEncoder::vkDestroyInstance(
131 VkInstance instance,
132 const VkAllocationCallbacks* pAllocator)
133{
134 auto stream = mImpl->stream();
135 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800136 auto resources = mImpl->resources();
137 auto pool = mImpl->pool();
138 VkAllocationCallbacks* local_pAllocator;
139 local_pAllocator = nullptr;
140 if (pAllocator)
141 {
142 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
143 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
144 }
145 if (local_pAllocator)
146 {
147 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
148 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700149 countingStream->rewind();
150 {
151 countingStream->write((VkInstance*)&instance, sizeof(VkInstance));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800152 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
153 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700154 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800155 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700156 }
157 }
158 uint32_t packetSize_vkDestroyInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten();
159 countingStream->rewind();
160 uint32_t opcode_vkDestroyInstance = OP_vkDestroyInstance;
161 stream->write(&opcode_vkDestroyInstance, sizeof(uint32_t));
162 stream->write(&packetSize_vkDestroyInstance, sizeof(uint32_t));
163 stream->write((VkInstance*)&instance, sizeof(VkInstance));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800164 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
165 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700166 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800167 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700168 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800169 resources->destroyMapping()->mapHandles_VkInstance((VkInstance*)&instance);
170 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700171}
172
173VkResult VkEncoder::vkEnumeratePhysicalDevices(
174 VkInstance instance,
175 uint32_t* pPhysicalDeviceCount,
176 VkPhysicalDevice* pPhysicalDevices)
177{
178 auto stream = mImpl->stream();
179 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800180 auto resources = mImpl->resources();
181 auto pool = mImpl->pool();
182 VkInstance local_instance;
183 local_instance = instance;
184 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700185 countingStream->rewind();
186 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800187 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700188 countingStream->write((uint32_t**)&pPhysicalDeviceCount, sizeof(uint32_t*));
189 if (pPhysicalDeviceCount)
190 {
191 countingStream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t));
192 }
193 countingStream->write((VkPhysicalDevice**)&pPhysicalDevices, sizeof(VkPhysicalDevice*));
194 if (pPhysicalDevices)
195 {
196 countingStream->write((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice));
197 }
198 }
199 uint32_t packetSize_vkEnumeratePhysicalDevices = 4 + 4 + (uint32_t)countingStream->bytesWritten();
200 countingStream->rewind();
201 uint32_t opcode_vkEnumeratePhysicalDevices = OP_vkEnumeratePhysicalDevices;
202 stream->write(&opcode_vkEnumeratePhysicalDevices, sizeof(uint32_t));
203 stream->write(&packetSize_vkEnumeratePhysicalDevices, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800204 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700205 stream->write((uint32_t**)&pPhysicalDeviceCount, sizeof(uint32_t*));
206 if (pPhysicalDeviceCount)
207 {
208 stream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t));
209 }
210 stream->write((VkPhysicalDevice**)&pPhysicalDevices, sizeof(VkPhysicalDevice*));
211 if (pPhysicalDevices)
212 {
213 stream->write((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice));
214 }
215 uint32_t* check_pPhysicalDeviceCount;
216 stream->read((uint32_t**)&check_pPhysicalDeviceCount, sizeof(uint32_t*));
217 if (pPhysicalDeviceCount)
218 {
219 if (!(check_pPhysicalDeviceCount))
220 {
221 fprintf(stderr, "fatal: pPhysicalDeviceCount inconsistent between guest and host\n");
222 }
223 stream->read((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t));
224 }
225 VkPhysicalDevice* check_pPhysicalDevices;
226 stream->read((VkPhysicalDevice**)&check_pPhysicalDevices, sizeof(VkPhysicalDevice*));
227 if (pPhysicalDevices)
228 {
229 if (!(check_pPhysicalDevices))
230 {
231 fprintf(stderr, "fatal: pPhysicalDevices inconsistent between guest and host\n");
232 }
233 stream->read((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice));
234 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800235 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700236 VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0;
237 stream->read(&vkEnumeratePhysicalDevices_VkResult_return, sizeof(VkResult));
238 return vkEnumeratePhysicalDevices_VkResult_return;
239}
240
241void VkEncoder::vkGetPhysicalDeviceFeatures(
242 VkPhysicalDevice physicalDevice,
243 VkPhysicalDeviceFeatures* pFeatures)
244{
245 auto stream = mImpl->stream();
246 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800247 auto resources = mImpl->resources();
248 auto pool = mImpl->pool();
249 VkPhysicalDevice local_physicalDevice;
250 local_physicalDevice = physicalDevice;
251 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700252 countingStream->rewind();
253 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800254 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700255 marshal_VkPhysicalDeviceFeatures(countingStream, (VkPhysicalDeviceFeatures*)(pFeatures));
256 }
257 uint32_t packetSize_vkGetPhysicalDeviceFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten();
258 countingStream->rewind();
259 uint32_t opcode_vkGetPhysicalDeviceFeatures = OP_vkGetPhysicalDeviceFeatures;
260 stream->write(&opcode_vkGetPhysicalDeviceFeatures, sizeof(uint32_t));
261 stream->write(&packetSize_vkGetPhysicalDeviceFeatures, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800262 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700263 marshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures));
264 unmarshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800265 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700266}
267
268void VkEncoder::vkGetPhysicalDeviceFormatProperties(
269 VkPhysicalDevice physicalDevice,
270 VkFormat format,
271 VkFormatProperties* pFormatProperties)
272{
273 auto stream = mImpl->stream();
274 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800275 auto resources = mImpl->resources();
276 auto pool = mImpl->pool();
277 VkPhysicalDevice local_physicalDevice;
278 local_physicalDevice = physicalDevice;
279 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
280 VkFormat local_format;
281 local_format = format;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700282 countingStream->rewind();
283 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800284 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
285 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700286 marshal_VkFormatProperties(countingStream, (VkFormatProperties*)(pFormatProperties));
287 }
288 uint32_t packetSize_vkGetPhysicalDeviceFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
289 countingStream->rewind();
290 uint32_t opcode_vkGetPhysicalDeviceFormatProperties = OP_vkGetPhysicalDeviceFormatProperties;
291 stream->write(&opcode_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t));
292 stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800293 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
294 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700295 marshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties));
296 unmarshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800297 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700298}
299
300VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties(
301 VkPhysicalDevice physicalDevice,
302 VkFormat format,
303 VkImageType type,
304 VkImageTiling tiling,
305 VkImageUsageFlags usage,
306 VkImageCreateFlags flags,
307 VkImageFormatProperties* pImageFormatProperties)
308{
309 auto stream = mImpl->stream();
310 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800311 auto resources = mImpl->resources();
312 auto pool = mImpl->pool();
313 VkPhysicalDevice local_physicalDevice;
314 local_physicalDevice = physicalDevice;
315 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
316 VkFormat local_format;
317 local_format = format;
318 VkImageType local_type;
319 local_type = type;
320 VkImageTiling local_tiling;
321 local_tiling = tiling;
322 VkImageUsageFlags local_usage;
323 local_usage = usage;
324 VkImageCreateFlags local_flags;
325 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700326 countingStream->rewind();
327 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800328 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
329 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
330 countingStream->write((VkImageType*)&local_type, sizeof(VkImageType));
331 countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
332 countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
333 countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700334 marshal_VkImageFormatProperties(countingStream, (VkImageFormatProperties*)(pImageFormatProperties));
335 }
336 uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
337 countingStream->rewind();
338 uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties = OP_vkGetPhysicalDeviceImageFormatProperties;
339 stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t));
340 stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800341 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
342 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
343 stream->write((VkImageType*)&local_type, sizeof(VkImageType));
344 stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
345 stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
346 stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700347 marshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties));
348 unmarshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800349 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700350 VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0;
351 stream->read(&vkGetPhysicalDeviceImageFormatProperties_VkResult_return, sizeof(VkResult));
352 return vkGetPhysicalDeviceImageFormatProperties_VkResult_return;
353}
354
355void VkEncoder::vkGetPhysicalDeviceProperties(
356 VkPhysicalDevice physicalDevice,
357 VkPhysicalDeviceProperties* pProperties)
358{
359 auto stream = mImpl->stream();
360 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800361 auto resources = mImpl->resources();
362 auto pool = mImpl->pool();
363 VkPhysicalDevice local_physicalDevice;
364 local_physicalDevice = physicalDevice;
365 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700366 countingStream->rewind();
367 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800368 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700369 marshal_VkPhysicalDeviceProperties(countingStream, (VkPhysicalDeviceProperties*)(pProperties));
370 }
371 uint32_t packetSize_vkGetPhysicalDeviceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
372 countingStream->rewind();
373 uint32_t opcode_vkGetPhysicalDeviceProperties = OP_vkGetPhysicalDeviceProperties;
374 stream->write(&opcode_vkGetPhysicalDeviceProperties, sizeof(uint32_t));
375 stream->write(&packetSize_vkGetPhysicalDeviceProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800376 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700377 marshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties));
378 unmarshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800379 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700380}
381
382void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties(
383 VkPhysicalDevice physicalDevice,
384 uint32_t* pQueueFamilyPropertyCount,
385 VkQueueFamilyProperties* pQueueFamilyProperties)
386{
387 auto stream = mImpl->stream();
388 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800389 auto resources = mImpl->resources();
390 auto pool = mImpl->pool();
391 VkPhysicalDevice local_physicalDevice;
392 local_physicalDevice = physicalDevice;
393 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700394 countingStream->rewind();
395 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800396 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700397 countingStream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*));
398 if (pQueueFamilyPropertyCount)
399 {
400 countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
401 }
402 countingStream->write((VkQueueFamilyProperties**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties*));
403 if (pQueueFamilyProperties)
404 {
405 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
406 {
407 marshal_VkQueueFamilyProperties(countingStream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i));
408 }
409 }
410 }
411 uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
412 countingStream->rewind();
413 uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties = OP_vkGetPhysicalDeviceQueueFamilyProperties;
414 stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t));
415 stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800416 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700417 stream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*));
418 if (pQueueFamilyPropertyCount)
419 {
420 stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
421 }
422 stream->write((VkQueueFamilyProperties**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties*));
423 if (pQueueFamilyProperties)
424 {
425 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
426 {
427 marshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i));
428 }
429 }
430 uint32_t* check_pQueueFamilyPropertyCount;
431 stream->read((uint32_t**)&check_pQueueFamilyPropertyCount, sizeof(uint32_t*));
432 if (pQueueFamilyPropertyCount)
433 {
434 if (!(check_pQueueFamilyPropertyCount))
435 {
436 fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n");
437 }
438 stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
439 }
440 VkQueueFamilyProperties* check_pQueueFamilyProperties;
441 stream->read((VkQueueFamilyProperties**)&check_pQueueFamilyProperties, sizeof(VkQueueFamilyProperties*));
442 if (pQueueFamilyProperties)
443 {
444 if (!(check_pQueueFamilyProperties))
445 {
446 fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n");
447 }
448 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
449 {
450 unmarshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i));
451 }
452 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800453 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700454}
455
456void VkEncoder::vkGetPhysicalDeviceMemoryProperties(
457 VkPhysicalDevice physicalDevice,
458 VkPhysicalDeviceMemoryProperties* pMemoryProperties)
459{
460 auto stream = mImpl->stream();
461 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800462 auto resources = mImpl->resources();
463 auto pool = mImpl->pool();
464 VkPhysicalDevice local_physicalDevice;
465 local_physicalDevice = physicalDevice;
466 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700467 countingStream->rewind();
468 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800469 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700470 marshal_VkPhysicalDeviceMemoryProperties(countingStream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
471 }
472 uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
473 countingStream->rewind();
474 uint32_t opcode_vkGetPhysicalDeviceMemoryProperties = OP_vkGetPhysicalDeviceMemoryProperties;
475 stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t));
476 stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800477 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700478 marshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
479 unmarshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800480 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700481}
482
483PFN_vkVoidFunction VkEncoder::vkGetInstanceProcAddr(
484 VkInstance instance,
485 const char* pName)
486{
487 auto stream = mImpl->stream();
488 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800489 auto resources = mImpl->resources();
490 auto pool = mImpl->pool();
491 VkInstance local_instance;
492 local_instance = instance;
493 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
494 char* local_pName;
495 local_pName = nullptr;
496 if (pName)
497 {
498 local_pName = pool->strDup(pName);
499 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700500 countingStream->rewind();
501 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800502 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
503 countingStream->putString(local_pName);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700504 }
505 uint32_t packetSize_vkGetInstanceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten();
506 countingStream->rewind();
507 uint32_t opcode_vkGetInstanceProcAddr = OP_vkGetInstanceProcAddr;
508 stream->write(&opcode_vkGetInstanceProcAddr, sizeof(uint32_t));
509 stream->write(&packetSize_vkGetInstanceProcAddr, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800510 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
511 stream->putString(local_pName);
512 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700513 PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0;
514 stream->read(&vkGetInstanceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction));
515 return vkGetInstanceProcAddr_PFN_vkVoidFunction_return;
516}
517
518PFN_vkVoidFunction VkEncoder::vkGetDeviceProcAddr(
519 VkDevice device,
520 const char* pName)
521{
522 auto stream = mImpl->stream();
523 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800524 auto resources = mImpl->resources();
525 auto pool = mImpl->pool();
526 VkDevice local_device;
527 local_device = device;
528 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
529 char* local_pName;
530 local_pName = nullptr;
531 if (pName)
532 {
533 local_pName = pool->strDup(pName);
534 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700535 countingStream->rewind();
536 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800537 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
538 countingStream->putString(local_pName);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700539 }
540 uint32_t packetSize_vkGetDeviceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten();
541 countingStream->rewind();
542 uint32_t opcode_vkGetDeviceProcAddr = OP_vkGetDeviceProcAddr;
543 stream->write(&opcode_vkGetDeviceProcAddr, sizeof(uint32_t));
544 stream->write(&packetSize_vkGetDeviceProcAddr, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800545 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
546 stream->putString(local_pName);
547 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700548 PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0;
549 stream->read(&vkGetDeviceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction));
550 return vkGetDeviceProcAddr_PFN_vkVoidFunction_return;
551}
552
553VkResult VkEncoder::vkCreateDevice(
554 VkPhysicalDevice physicalDevice,
555 const VkDeviceCreateInfo* pCreateInfo,
556 const VkAllocationCallbacks* pAllocator,
557 VkDevice* pDevice)
558{
559 auto stream = mImpl->stream();
560 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800561 auto resources = mImpl->resources();
562 auto pool = mImpl->pool();
563 VkPhysicalDevice local_physicalDevice;
564 local_physicalDevice = physicalDevice;
565 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
566 VkDeviceCreateInfo* local_pCreateInfo;
567 local_pCreateInfo = nullptr;
568 if (pCreateInfo)
569 {
570 local_pCreateInfo = (VkDeviceCreateInfo*)pool->alloc(sizeof(const VkDeviceCreateInfo));
571 deepcopy_VkDeviceCreateInfo(pool, pCreateInfo, (VkDeviceCreateInfo*)(local_pCreateInfo));
572 }
573 if (local_pCreateInfo)
574 {
575 handlemap_VkDeviceCreateInfo(resources->unwrapMapping(), (VkDeviceCreateInfo*)(local_pCreateInfo));
576 }
577 VkAllocationCallbacks* local_pAllocator;
578 local_pAllocator = nullptr;
579 if (pAllocator)
580 {
581 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
582 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
583 }
584 if (local_pAllocator)
585 {
586 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
587 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700588 countingStream->rewind();
589 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800590 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
591 marshal_VkDeviceCreateInfo(countingStream, (VkDeviceCreateInfo*)(local_pCreateInfo));
592 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
593 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700594 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800595 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700596 }
597 countingStream->write((VkDevice*)pDevice, sizeof(VkDevice));
598 }
599 uint32_t packetSize_vkCreateDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten();
600 countingStream->rewind();
601 uint32_t opcode_vkCreateDevice = OP_vkCreateDevice;
602 stream->write(&opcode_vkCreateDevice, sizeof(uint32_t));
603 stream->write(&packetSize_vkCreateDevice, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800604 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
605 marshal_VkDeviceCreateInfo(stream, (VkDeviceCreateInfo*)(local_pCreateInfo));
606 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
607 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700608 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800609 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700610 }
611 stream->write((VkDevice*)pDevice, sizeof(VkDevice));
612 stream->read((VkDevice*)pDevice, sizeof(VkDevice));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800613 if (pDevice)
614 {
615 resources->createMapping()->mapHandles_VkDevice((VkDevice*)pDevice, 1);
616 }
617 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700618 VkResult vkCreateDevice_VkResult_return = (VkResult)0;
619 stream->read(&vkCreateDevice_VkResult_return, sizeof(VkResult));
620 return vkCreateDevice_VkResult_return;
621}
622
623void VkEncoder::vkDestroyDevice(
624 VkDevice device,
625 const VkAllocationCallbacks* pAllocator)
626{
627 auto stream = mImpl->stream();
628 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800629 auto resources = mImpl->resources();
630 auto pool = mImpl->pool();
631 VkAllocationCallbacks* local_pAllocator;
632 local_pAllocator = nullptr;
633 if (pAllocator)
634 {
635 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
636 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
637 }
638 if (local_pAllocator)
639 {
640 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
641 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700642 countingStream->rewind();
643 {
644 countingStream->write((VkDevice*)&device, sizeof(VkDevice));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800645 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
646 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700647 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800648 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700649 }
650 }
651 uint32_t packetSize_vkDestroyDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten();
652 countingStream->rewind();
653 uint32_t opcode_vkDestroyDevice = OP_vkDestroyDevice;
654 stream->write(&opcode_vkDestroyDevice, sizeof(uint32_t));
655 stream->write(&packetSize_vkDestroyDevice, sizeof(uint32_t));
656 stream->write((VkDevice*)&device, sizeof(VkDevice));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800657 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
658 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700659 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800660 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700661 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800662 resources->destroyMapping()->mapHandles_VkDevice((VkDevice*)&device);
663 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700664}
665
666VkResult VkEncoder::vkEnumerateInstanceExtensionProperties(
667 const char* pLayerName,
668 uint32_t* pPropertyCount,
669 VkExtensionProperties* pProperties)
670{
671 auto stream = mImpl->stream();
672 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800673 auto resources = mImpl->resources();
674 auto pool = mImpl->pool();
675 char* local_pLayerName;
676 local_pLayerName = nullptr;
677 if (pLayerName)
678 {
679 local_pLayerName = pool->strDup(pLayerName);
680 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700681 countingStream->rewind();
682 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800683 countingStream->putString(local_pLayerName);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700684 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
685 if (pPropertyCount)
686 {
687 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
688 }
689 countingStream->write((VkExtensionProperties**)&pProperties, sizeof(VkExtensionProperties*));
690 if (pProperties)
691 {
692 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
693 {
694 marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i));
695 }
696 }
697 }
698 uint32_t packetSize_vkEnumerateInstanceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
699 countingStream->rewind();
700 uint32_t opcode_vkEnumerateInstanceExtensionProperties = OP_vkEnumerateInstanceExtensionProperties;
701 stream->write(&opcode_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t));
702 stream->write(&packetSize_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800703 stream->putString(local_pLayerName);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700704 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
705 if (pPropertyCount)
706 {
707 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
708 }
709 stream->write((VkExtensionProperties**)&pProperties, sizeof(VkExtensionProperties*));
710 if (pProperties)
711 {
712 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
713 {
714 marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i));
715 }
716 }
717 uint32_t* check_pPropertyCount;
718 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
719 if (pPropertyCount)
720 {
721 if (!(check_pPropertyCount))
722 {
723 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
724 }
725 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
726 }
727 VkExtensionProperties* check_pProperties;
728 stream->read((VkExtensionProperties**)&check_pProperties, sizeof(VkExtensionProperties*));
729 if (pProperties)
730 {
731 if (!(check_pProperties))
732 {
733 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
734 }
735 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
736 {
737 unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i));
738 }
739 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800740 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700741 VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0;
742 stream->read(&vkEnumerateInstanceExtensionProperties_VkResult_return, sizeof(VkResult));
743 return vkEnumerateInstanceExtensionProperties_VkResult_return;
744}
745
746VkResult VkEncoder::vkEnumerateDeviceExtensionProperties(
747 VkPhysicalDevice physicalDevice,
748 const char* pLayerName,
749 uint32_t* pPropertyCount,
750 VkExtensionProperties* pProperties)
751{
752 auto stream = mImpl->stream();
753 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800754 auto resources = mImpl->resources();
755 auto pool = mImpl->pool();
756 VkPhysicalDevice local_physicalDevice;
757 local_physicalDevice = physicalDevice;
758 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
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->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
768 countingStream->putString(local_pLayerName);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700769 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
770 if (pPropertyCount)
771 {
772 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
773 }
774 countingStream->write((VkExtensionProperties**)&pProperties, sizeof(VkExtensionProperties*));
775 if (pProperties)
776 {
777 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
778 {
779 marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i));
780 }
781 }
782 }
783 uint32_t packetSize_vkEnumerateDeviceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
784 countingStream->rewind();
785 uint32_t opcode_vkEnumerateDeviceExtensionProperties = OP_vkEnumerateDeviceExtensionProperties;
786 stream->write(&opcode_vkEnumerateDeviceExtensionProperties, sizeof(uint32_t));
787 stream->write(&packetSize_vkEnumerateDeviceExtensionProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800788 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
789 stream->putString(local_pLayerName);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700790 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
791 if (pPropertyCount)
792 {
793 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
794 }
795 stream->write((VkExtensionProperties**)&pProperties, sizeof(VkExtensionProperties*));
796 if (pProperties)
797 {
798 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
799 {
800 marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i));
801 }
802 }
803 uint32_t* check_pPropertyCount;
804 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
805 if (pPropertyCount)
806 {
807 if (!(check_pPropertyCount))
808 {
809 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
810 }
811 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
812 }
813 VkExtensionProperties* check_pProperties;
814 stream->read((VkExtensionProperties**)&check_pProperties, sizeof(VkExtensionProperties*));
815 if (pProperties)
816 {
817 if (!(check_pProperties))
818 {
819 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
820 }
821 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
822 {
823 unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i));
824 }
825 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800826 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700827 VkResult vkEnumerateDeviceExtensionProperties_VkResult_return = (VkResult)0;
828 stream->read(&vkEnumerateDeviceExtensionProperties_VkResult_return, sizeof(VkResult));
829 return vkEnumerateDeviceExtensionProperties_VkResult_return;
830}
831
832VkResult VkEncoder::vkEnumerateInstanceLayerProperties(
833 uint32_t* pPropertyCount,
834 VkLayerProperties* pProperties)
835{
836 auto stream = mImpl->stream();
837 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800838 auto resources = mImpl->resources();
839 auto pool = mImpl->pool();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700840 countingStream->rewind();
841 {
842 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
843 if (pPropertyCount)
844 {
845 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
846 }
847 countingStream->write((VkLayerProperties**)&pProperties, sizeof(VkLayerProperties*));
848 if (pProperties)
849 {
850 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
851 {
852 marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i));
853 }
854 }
855 }
856 uint32_t packetSize_vkEnumerateInstanceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
857 countingStream->rewind();
858 uint32_t opcode_vkEnumerateInstanceLayerProperties = OP_vkEnumerateInstanceLayerProperties;
859 stream->write(&opcode_vkEnumerateInstanceLayerProperties, sizeof(uint32_t));
860 stream->write(&packetSize_vkEnumerateInstanceLayerProperties, sizeof(uint32_t));
861 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
862 if (pPropertyCount)
863 {
864 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
865 }
866 stream->write((VkLayerProperties**)&pProperties, sizeof(VkLayerProperties*));
867 if (pProperties)
868 {
869 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
870 {
871 marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i));
872 }
873 }
874 uint32_t* check_pPropertyCount;
875 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
876 if (pPropertyCount)
877 {
878 if (!(check_pPropertyCount))
879 {
880 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
881 }
882 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
883 }
884 VkLayerProperties* check_pProperties;
885 stream->read((VkLayerProperties**)&check_pProperties, sizeof(VkLayerProperties*));
886 if (pProperties)
887 {
888 if (!(check_pProperties))
889 {
890 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
891 }
892 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
893 {
894 unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i));
895 }
896 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800897 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700898 VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0;
899 stream->read(&vkEnumerateInstanceLayerProperties_VkResult_return, sizeof(VkResult));
900 return vkEnumerateInstanceLayerProperties_VkResult_return;
901}
902
903VkResult VkEncoder::vkEnumerateDeviceLayerProperties(
904 VkPhysicalDevice physicalDevice,
905 uint32_t* pPropertyCount,
906 VkLayerProperties* pProperties)
907{
908 auto stream = mImpl->stream();
909 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800910 auto resources = mImpl->resources();
911 auto pool = mImpl->pool();
912 VkPhysicalDevice local_physicalDevice;
913 local_physicalDevice = physicalDevice;
914 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700915 countingStream->rewind();
916 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800917 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700918 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
919 if (pPropertyCount)
920 {
921 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
922 }
923 countingStream->write((VkLayerProperties**)&pProperties, sizeof(VkLayerProperties*));
924 if (pProperties)
925 {
926 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
927 {
928 marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i));
929 }
930 }
931 }
932 uint32_t packetSize_vkEnumerateDeviceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
933 countingStream->rewind();
934 uint32_t opcode_vkEnumerateDeviceLayerProperties = OP_vkEnumerateDeviceLayerProperties;
935 stream->write(&opcode_vkEnumerateDeviceLayerProperties, sizeof(uint32_t));
936 stream->write(&packetSize_vkEnumerateDeviceLayerProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800937 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700938 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
939 if (pPropertyCount)
940 {
941 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
942 }
943 stream->write((VkLayerProperties**)&pProperties, sizeof(VkLayerProperties*));
944 if (pProperties)
945 {
946 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
947 {
948 marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i));
949 }
950 }
951 uint32_t* check_pPropertyCount;
952 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
953 if (pPropertyCount)
954 {
955 if (!(check_pPropertyCount))
956 {
957 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
958 }
959 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
960 }
961 VkLayerProperties* check_pProperties;
962 stream->read((VkLayerProperties**)&check_pProperties, sizeof(VkLayerProperties*));
963 if (pProperties)
964 {
965 if (!(check_pProperties))
966 {
967 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
968 }
969 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
970 {
971 unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i));
972 }
973 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800974 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700975 VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0;
976 stream->read(&vkEnumerateDeviceLayerProperties_VkResult_return, sizeof(VkResult));
977 return vkEnumerateDeviceLayerProperties_VkResult_return;
978}
979
980void VkEncoder::vkGetDeviceQueue(
981 VkDevice device,
982 uint32_t queueFamilyIndex,
983 uint32_t queueIndex,
984 VkQueue* pQueue)
985{
986 auto stream = mImpl->stream();
987 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800988 auto resources = mImpl->resources();
989 auto pool = mImpl->pool();
990 VkDevice local_device;
991 local_device = device;
992 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
993 uint32_t local_queueFamilyIndex;
994 local_queueFamilyIndex = queueFamilyIndex;
995 uint32_t local_queueIndex;
996 local_queueIndex = queueIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -0700997 countingStream->rewind();
998 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -0800999 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1000 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
1001 countingStream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001002 countingStream->write((VkQueue*)pQueue, sizeof(VkQueue));
1003 }
1004 uint32_t packetSize_vkGetDeviceQueue = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1005 countingStream->rewind();
1006 uint32_t opcode_vkGetDeviceQueue = OP_vkGetDeviceQueue;
1007 stream->write(&opcode_vkGetDeviceQueue, sizeof(uint32_t));
1008 stream->write(&packetSize_vkGetDeviceQueue, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001009 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1010 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
1011 stream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001012 stream->write((VkQueue*)pQueue, sizeof(VkQueue));
1013 stream->read((VkQueue*)pQueue, sizeof(VkQueue));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001014 if (pQueue)
1015 {
1016 resources->createMapping()->mapHandles_VkQueue((VkQueue*)pQueue, 1);
1017 }
1018 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001019}
1020
1021VkResult VkEncoder::vkQueueSubmit(
1022 VkQueue queue,
1023 uint32_t submitCount,
1024 const VkSubmitInfo* pSubmits,
1025 VkFence fence)
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 VkQueue local_queue;
1032 local_queue = queue;
1033 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
1034 uint32_t local_submitCount;
1035 local_submitCount = submitCount;
1036 VkSubmitInfo* local_pSubmits;
1037 local_pSubmits = nullptr;
1038 if (pSubmits)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001039 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001040 local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001041 for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i)
1042 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001043 deepcopy_VkSubmitInfo(pool, pSubmits + i, (VkSubmitInfo*)(local_pSubmits + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001044 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001045 }
1046 if (local_pSubmits)
1047 {
1048 for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i)
1049 {
1050 handlemap_VkSubmitInfo(resources->unwrapMapping(), (VkSubmitInfo*)(local_pSubmits + i));
1051 }
1052 }
1053 VkFence local_fence;
1054 local_fence = fence;
1055 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
1056 countingStream->rewind();
1057 {
1058 countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue));
1059 countingStream->write((uint32_t*)&local_submitCount, sizeof(uint32_t));
1060 for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i)
1061 {
1062 marshal_VkSubmitInfo(countingStream, (VkSubmitInfo*)(local_pSubmits + i));
1063 }
1064 countingStream->write((VkFence*)&local_fence, sizeof(VkFence));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001065 }
1066 uint32_t packetSize_vkQueueSubmit = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1067 countingStream->rewind();
1068 uint32_t opcode_vkQueueSubmit = OP_vkQueueSubmit;
1069 stream->write(&opcode_vkQueueSubmit, sizeof(uint32_t));
1070 stream->write(&packetSize_vkQueueSubmit, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001071 stream->write((VkQueue*)&local_queue, sizeof(VkQueue));
1072 stream->write((uint32_t*)&local_submitCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001073 for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i)
1074 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001075 marshal_VkSubmitInfo(stream, (VkSubmitInfo*)(local_pSubmits + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001076 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001077 stream->write((VkFence*)&local_fence, sizeof(VkFence));
1078 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001079 VkResult vkQueueSubmit_VkResult_return = (VkResult)0;
1080 stream->read(&vkQueueSubmit_VkResult_return, sizeof(VkResult));
1081 return vkQueueSubmit_VkResult_return;
1082}
1083
1084VkResult VkEncoder::vkQueueWaitIdle(
1085 VkQueue queue)
1086{
1087 auto stream = mImpl->stream();
1088 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001089 auto resources = mImpl->resources();
1090 auto pool = mImpl->pool();
1091 VkQueue local_queue;
1092 local_queue = queue;
1093 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001094 countingStream->rewind();
1095 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001096 countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001097 }
1098 uint32_t packetSize_vkQueueWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1099 countingStream->rewind();
1100 uint32_t opcode_vkQueueWaitIdle = OP_vkQueueWaitIdle;
1101 stream->write(&opcode_vkQueueWaitIdle, sizeof(uint32_t));
1102 stream->write(&packetSize_vkQueueWaitIdle, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001103 stream->write((VkQueue*)&local_queue, sizeof(VkQueue));
1104 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001105 VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0;
1106 stream->read(&vkQueueWaitIdle_VkResult_return, sizeof(VkResult));
1107 return vkQueueWaitIdle_VkResult_return;
1108}
1109
1110VkResult VkEncoder::vkDeviceWaitIdle(
1111 VkDevice device)
1112{
1113 auto stream = mImpl->stream();
1114 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001115 auto resources = mImpl->resources();
1116 auto pool = mImpl->pool();
1117 VkDevice local_device;
1118 local_device = device;
1119 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001120 countingStream->rewind();
1121 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001122 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001123 }
1124 uint32_t packetSize_vkDeviceWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1125 countingStream->rewind();
1126 uint32_t opcode_vkDeviceWaitIdle = OP_vkDeviceWaitIdle;
1127 stream->write(&opcode_vkDeviceWaitIdle, sizeof(uint32_t));
1128 stream->write(&packetSize_vkDeviceWaitIdle, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001129 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1130 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001131 VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0;
1132 stream->read(&vkDeviceWaitIdle_VkResult_return, sizeof(VkResult));
1133 return vkDeviceWaitIdle_VkResult_return;
1134}
1135
1136VkResult VkEncoder::vkAllocateMemory(
1137 VkDevice device,
1138 const VkMemoryAllocateInfo* pAllocateInfo,
1139 const VkAllocationCallbacks* pAllocator,
1140 VkDeviceMemory* pMemory)
1141{
1142 auto stream = mImpl->stream();
1143 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001144 auto resources = mImpl->resources();
1145 auto pool = mImpl->pool();
1146 VkDevice local_device;
1147 local_device = device;
1148 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1149 VkMemoryAllocateInfo* local_pAllocateInfo;
1150 local_pAllocateInfo = nullptr;
1151 if (pAllocateInfo)
1152 {
1153 local_pAllocateInfo = (VkMemoryAllocateInfo*)pool->alloc(sizeof(const VkMemoryAllocateInfo));
1154 deepcopy_VkMemoryAllocateInfo(pool, pAllocateInfo, (VkMemoryAllocateInfo*)(local_pAllocateInfo));
1155 }
1156 if (local_pAllocateInfo)
1157 {
1158 handlemap_VkMemoryAllocateInfo(resources->unwrapMapping(), (VkMemoryAllocateInfo*)(local_pAllocateInfo));
1159 }
1160 VkAllocationCallbacks* local_pAllocator;
1161 local_pAllocator = nullptr;
1162 if (pAllocator)
1163 {
1164 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
1165 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
1166 }
1167 if (local_pAllocator)
1168 {
1169 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
1170 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001171 countingStream->rewind();
1172 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001173 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1174 marshal_VkMemoryAllocateInfo(countingStream, (VkMemoryAllocateInfo*)(local_pAllocateInfo));
1175 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
1176 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001177 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001178 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001179 }
1180 countingStream->write((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory));
1181 }
1182 uint32_t packetSize_vkAllocateMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1183 countingStream->rewind();
1184 uint32_t opcode_vkAllocateMemory = OP_vkAllocateMemory;
1185 stream->write(&opcode_vkAllocateMemory, sizeof(uint32_t));
1186 stream->write(&packetSize_vkAllocateMemory, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001187 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1188 marshal_VkMemoryAllocateInfo(stream, (VkMemoryAllocateInfo*)(local_pAllocateInfo));
1189 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
1190 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001191 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001192 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001193 }
1194 stream->write((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory));
1195 stream->read((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001196 if (pMemory)
1197 {
1198 resources->createMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)pMemory, 1);
1199 }
1200 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001201 VkResult vkAllocateMemory_VkResult_return = (VkResult)0;
1202 stream->read(&vkAllocateMemory_VkResult_return, sizeof(VkResult));
1203 return vkAllocateMemory_VkResult_return;
1204}
1205
1206void VkEncoder::vkFreeMemory(
1207 VkDevice device,
1208 VkDeviceMemory memory,
1209 const VkAllocationCallbacks* pAllocator)
1210{
1211 auto stream = mImpl->stream();
1212 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001213 auto resources = mImpl->resources();
1214 auto pool = mImpl->pool();
1215 VkDevice local_device;
1216 local_device = device;
1217 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1218 VkAllocationCallbacks* local_pAllocator;
1219 local_pAllocator = nullptr;
1220 if (pAllocator)
1221 {
1222 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
1223 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
1224 }
1225 if (local_pAllocator)
1226 {
1227 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
1228 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001229 countingStream->rewind();
1230 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001231 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001232 countingStream->write((VkDeviceMemory*)&memory, sizeof(VkDeviceMemory));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001233 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
1234 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 }
1238 }
1239 uint32_t packetSize_vkFreeMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1240 countingStream->rewind();
1241 uint32_t opcode_vkFreeMemory = OP_vkFreeMemory;
1242 stream->write(&opcode_vkFreeMemory, sizeof(uint32_t));
1243 stream->write(&packetSize_vkFreeMemory, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001244 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001245 stream->write((VkDeviceMemory*)&memory, sizeof(VkDeviceMemory));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001246 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
1247 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001248 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001249 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001250 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001251 resources->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory);
1252 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001253}
1254
1255VkResult VkEncoder::vkMapMemory(
1256 VkDevice device,
1257 VkDeviceMemory memory,
1258 VkDeviceSize offset,
1259 VkDeviceSize size,
1260 VkMemoryMapFlags flags,
1261 void** ppData)
1262{
1263 auto stream = mImpl->stream();
1264 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001265 auto resources = mImpl->resources();
1266 auto pool = mImpl->pool();
1267 VkDevice local_device;
1268 local_device = device;
1269 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1270 VkDeviceMemory local_memory;
1271 local_memory = memory;
1272 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
1273 VkDeviceSize local_offset;
1274 local_offset = offset;
1275 VkDeviceSize local_size;
1276 local_size = size;
1277 VkMemoryMapFlags local_flags;
1278 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001279 countingStream->rewind();
1280 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001281 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1282 countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
1283 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
1284 countingStream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize));
1285 countingStream->write((VkMemoryMapFlags*)&local_flags, sizeof(VkMemoryMapFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001286 countingStream->write((void***)&ppData, sizeof(void**));
1287 if (ppData)
1288 {
1289 countingStream->write((void**)ppData, sizeof(void*));
1290 }
1291 }
1292 uint32_t packetSize_vkMapMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1293 countingStream->rewind();
1294 uint32_t opcode_vkMapMemory = OP_vkMapMemory;
1295 stream->write(&opcode_vkMapMemory, sizeof(uint32_t));
1296 stream->write(&packetSize_vkMapMemory, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001297 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1298 stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
1299 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
1300 stream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize));
1301 stream->write((VkMemoryMapFlags*)&local_flags, sizeof(VkMemoryMapFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001302 stream->write((void***)&ppData, sizeof(void**));
1303 if (ppData)
1304 {
1305 stream->write((void**)ppData, sizeof(void*));
1306 }
1307 void** check_ppData;
1308 stream->read((void***)&check_ppData, sizeof(void**));
1309 if (ppData)
1310 {
1311 if (!(check_ppData))
1312 {
1313 fprintf(stderr, "fatal: ppData inconsistent between guest and host\n");
1314 }
1315 stream->read((void**)ppData, sizeof(void*));
1316 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001317 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001318 VkResult vkMapMemory_VkResult_return = (VkResult)0;
1319 stream->read(&vkMapMemory_VkResult_return, sizeof(VkResult));
Lingfeng Yang4b78f7f2018-11-05 14:22:20 -08001320 if (((vkMapMemory_VkResult_return == VK_SUCCESS) && ppData && size > 0))
1321 {
1322 *ppData = aligned_buf_alloc(1024 /* pick large alignment */, size);;
1323 stream->read(*ppData, size);
1324 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001325 return vkMapMemory_VkResult_return;
1326}
1327
1328void VkEncoder::vkUnmapMemory(
1329 VkDevice device,
1330 VkDeviceMemory memory)
1331{
1332 auto stream = mImpl->stream();
1333 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001334 auto resources = mImpl->resources();
1335 auto pool = mImpl->pool();
1336 VkDevice local_device;
1337 local_device = device;
1338 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1339 VkDeviceMemory local_memory;
1340 local_memory = memory;
1341 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001342 countingStream->rewind();
1343 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001344 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1345 countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001346 }
1347 uint32_t packetSize_vkUnmapMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1348 countingStream->rewind();
1349 uint32_t opcode_vkUnmapMemory = OP_vkUnmapMemory;
1350 stream->write(&opcode_vkUnmapMemory, sizeof(uint32_t));
1351 stream->write(&packetSize_vkUnmapMemory, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001352 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1353 stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
1354 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001355}
1356
1357VkResult VkEncoder::vkFlushMappedMemoryRanges(
1358 VkDevice device,
1359 uint32_t memoryRangeCount,
1360 const VkMappedMemoryRange* pMemoryRanges)
1361{
1362 auto stream = mImpl->stream();
1363 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001364 auto resources = mImpl->resources();
1365 auto pool = mImpl->pool();
1366 VkDevice local_device;
1367 local_device = device;
1368 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1369 uint32_t local_memoryRangeCount;
1370 local_memoryRangeCount = memoryRangeCount;
1371 VkMappedMemoryRange* local_pMemoryRanges;
1372 local_pMemoryRanges = nullptr;
1373 if (pMemoryRanges)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001374 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001375 local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001376 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1377 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001378 deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
1379 }
1380 }
1381 if (local_pMemoryRanges)
1382 {
1383 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1384 {
1385 handlemap_VkMappedMemoryRange(resources->unwrapMapping(), (VkMappedMemoryRange*)(local_pMemoryRanges + i));
1386 }
1387 }
1388 countingStream->rewind();
1389 {
1390 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1391 countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
1392 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1393 {
1394 marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001395 }
1396 }
1397 uint32_t packetSize_vkFlushMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1398 countingStream->rewind();
1399 uint32_t opcode_vkFlushMappedMemoryRanges = OP_vkFlushMappedMemoryRanges;
1400 stream->write(&opcode_vkFlushMappedMemoryRanges, sizeof(uint32_t));
1401 stream->write(&packetSize_vkFlushMappedMemoryRanges, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001402 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1403 stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001404 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1405 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001406 marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001407 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001408 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001409 VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0;
1410 stream->read(&vkFlushMappedMemoryRanges_VkResult_return, sizeof(VkResult));
1411 return vkFlushMappedMemoryRanges_VkResult_return;
1412}
1413
1414VkResult VkEncoder::vkInvalidateMappedMemoryRanges(
1415 VkDevice device,
1416 uint32_t memoryRangeCount,
1417 const VkMappedMemoryRange* pMemoryRanges)
1418{
1419 auto stream = mImpl->stream();
1420 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001421 auto resources = mImpl->resources();
1422 auto pool = mImpl->pool();
1423 VkDevice local_device;
1424 local_device = device;
1425 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1426 uint32_t local_memoryRangeCount;
1427 local_memoryRangeCount = memoryRangeCount;
1428 VkMappedMemoryRange* local_pMemoryRanges;
1429 local_pMemoryRanges = nullptr;
1430 if (pMemoryRanges)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001431 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001432 local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001433 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1434 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001435 deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
1436 }
1437 }
1438 if (local_pMemoryRanges)
1439 {
1440 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1441 {
1442 handlemap_VkMappedMemoryRange(resources->unwrapMapping(), (VkMappedMemoryRange*)(local_pMemoryRanges + i));
1443 }
1444 }
1445 countingStream->rewind();
1446 {
1447 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1448 countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
1449 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1450 {
1451 marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001452 }
1453 }
1454 uint32_t packetSize_vkInvalidateMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1455 countingStream->rewind();
1456 uint32_t opcode_vkInvalidateMappedMemoryRanges = OP_vkInvalidateMappedMemoryRanges;
1457 stream->write(&opcode_vkInvalidateMappedMemoryRanges, sizeof(uint32_t));
1458 stream->write(&packetSize_vkInvalidateMappedMemoryRanges, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001459 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1460 stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001461 for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i)
1462 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001463 marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001464 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001465 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001466 VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0;
1467 stream->read(&vkInvalidateMappedMemoryRanges_VkResult_return, sizeof(VkResult));
1468 return vkInvalidateMappedMemoryRanges_VkResult_return;
1469}
1470
1471void VkEncoder::vkGetDeviceMemoryCommitment(
1472 VkDevice device,
1473 VkDeviceMemory memory,
1474 VkDeviceSize* pCommittedMemoryInBytes)
1475{
1476 auto stream = mImpl->stream();
1477 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001478 auto resources = mImpl->resources();
1479 auto pool = mImpl->pool();
1480 VkDevice local_device;
1481 local_device = device;
1482 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1483 VkDeviceMemory local_memory;
1484 local_memory = memory;
1485 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001486 countingStream->rewind();
1487 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001488 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1489 countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001490 countingStream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
1491 }
1492 uint32_t packetSize_vkGetDeviceMemoryCommitment = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1493 countingStream->rewind();
1494 uint32_t opcode_vkGetDeviceMemoryCommitment = OP_vkGetDeviceMemoryCommitment;
1495 stream->write(&opcode_vkGetDeviceMemoryCommitment, sizeof(uint32_t));
1496 stream->write(&packetSize_vkGetDeviceMemoryCommitment, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001497 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1498 stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001499 stream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
1500 stream->read((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001501 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001502}
1503
1504VkResult VkEncoder::vkBindBufferMemory(
1505 VkDevice device,
1506 VkBuffer buffer,
1507 VkDeviceMemory memory,
1508 VkDeviceSize memoryOffset)
1509{
1510 auto stream = mImpl->stream();
1511 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001512 auto resources = mImpl->resources();
1513 auto pool = mImpl->pool();
1514 VkDevice local_device;
1515 local_device = device;
1516 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1517 VkBuffer local_buffer;
1518 local_buffer = buffer;
1519 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
1520 VkDeviceMemory local_memory;
1521 local_memory = memory;
1522 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
1523 VkDeviceSize local_memoryOffset;
1524 local_memoryOffset = memoryOffset;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001525 countingStream->rewind();
1526 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001527 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1528 countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
1529 countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
1530 countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001531 }
1532 uint32_t packetSize_vkBindBufferMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1533 countingStream->rewind();
1534 uint32_t opcode_vkBindBufferMemory = OP_vkBindBufferMemory;
1535 stream->write(&opcode_vkBindBufferMemory, sizeof(uint32_t));
1536 stream->write(&packetSize_vkBindBufferMemory, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001537 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1538 stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
1539 stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
1540 stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
1541 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001542 VkResult vkBindBufferMemory_VkResult_return = (VkResult)0;
1543 stream->read(&vkBindBufferMemory_VkResult_return, sizeof(VkResult));
1544 return vkBindBufferMemory_VkResult_return;
1545}
1546
1547VkResult VkEncoder::vkBindImageMemory(
1548 VkDevice device,
1549 VkImage image,
1550 VkDeviceMemory memory,
1551 VkDeviceSize memoryOffset)
1552{
1553 auto stream = mImpl->stream();
1554 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001555 auto resources = mImpl->resources();
1556 auto pool = mImpl->pool();
1557 VkDevice local_device;
1558 local_device = device;
1559 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1560 VkImage local_image;
1561 local_image = image;
1562 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
1563 VkDeviceMemory local_memory;
1564 local_memory = memory;
1565 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
1566 VkDeviceSize local_memoryOffset;
1567 local_memoryOffset = memoryOffset;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001568 countingStream->rewind();
1569 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001570 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1571 countingStream->write((VkImage*)&local_image, sizeof(VkImage));
1572 countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
1573 countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001574 }
1575 uint32_t packetSize_vkBindImageMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1576 countingStream->rewind();
1577 uint32_t opcode_vkBindImageMemory = OP_vkBindImageMemory;
1578 stream->write(&opcode_vkBindImageMemory, sizeof(uint32_t));
1579 stream->write(&packetSize_vkBindImageMemory, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001580 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1581 stream->write((VkImage*)&local_image, sizeof(VkImage));
1582 stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
1583 stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize));
1584 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001585 VkResult vkBindImageMemory_VkResult_return = (VkResult)0;
1586 stream->read(&vkBindImageMemory_VkResult_return, sizeof(VkResult));
1587 return vkBindImageMemory_VkResult_return;
1588}
1589
1590void VkEncoder::vkGetBufferMemoryRequirements(
1591 VkDevice device,
1592 VkBuffer buffer,
1593 VkMemoryRequirements* pMemoryRequirements)
1594{
1595 auto stream = mImpl->stream();
1596 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001597 auto resources = mImpl->resources();
1598 auto pool = mImpl->pool();
1599 VkDevice local_device;
1600 local_device = device;
1601 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1602 VkBuffer local_buffer;
1603 local_buffer = buffer;
1604 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001605 countingStream->rewind();
1606 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001607 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1608 countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001609 marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements));
1610 }
1611 uint32_t packetSize_vkGetBufferMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1612 countingStream->rewind();
1613 uint32_t opcode_vkGetBufferMemoryRequirements = OP_vkGetBufferMemoryRequirements;
1614 stream->write(&opcode_vkGetBufferMemoryRequirements, sizeof(uint32_t));
1615 stream->write(&packetSize_vkGetBufferMemoryRequirements, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001616 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1617 stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001618 marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
1619 unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001620 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001621}
1622
1623void VkEncoder::vkGetImageMemoryRequirements(
1624 VkDevice device,
1625 VkImage image,
1626 VkMemoryRequirements* pMemoryRequirements)
1627{
1628 auto stream = mImpl->stream();
1629 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001630 auto resources = mImpl->resources();
1631 auto pool = mImpl->pool();
1632 VkDevice local_device;
1633 local_device = device;
1634 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1635 VkImage local_image;
1636 local_image = image;
1637 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001638 countingStream->rewind();
1639 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001640 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1641 countingStream->write((VkImage*)&local_image, sizeof(VkImage));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001642 marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements));
1643 }
1644 uint32_t packetSize_vkGetImageMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1645 countingStream->rewind();
1646 uint32_t opcode_vkGetImageMemoryRequirements = OP_vkGetImageMemoryRequirements;
1647 stream->write(&opcode_vkGetImageMemoryRequirements, sizeof(uint32_t));
1648 stream->write(&packetSize_vkGetImageMemoryRequirements, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001649 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1650 stream->write((VkImage*)&local_image, sizeof(VkImage));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001651 marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
1652 unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001653 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001654}
1655
1656void VkEncoder::vkGetImageSparseMemoryRequirements(
1657 VkDevice device,
1658 VkImage image,
1659 uint32_t* pSparseMemoryRequirementCount,
1660 VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
1661{
1662 auto stream = mImpl->stream();
1663 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001664 auto resources = mImpl->resources();
1665 auto pool = mImpl->pool();
1666 VkDevice local_device;
1667 local_device = device;
1668 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1669 VkImage local_image;
1670 local_image = image;
1671 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001672 countingStream->rewind();
1673 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001674 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1675 countingStream->write((VkImage*)&local_image, sizeof(VkImage));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001676 countingStream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*));
1677 if (pSparseMemoryRequirementCount)
1678 {
1679 countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
1680 }
1681 countingStream->write((VkSparseImageMemoryRequirements**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements*));
1682 if (pSparseMemoryRequirements)
1683 {
1684 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
1685 {
1686 marshal_VkSparseImageMemoryRequirements(countingStream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i));
1687 }
1688 }
1689 }
1690 uint32_t packetSize_vkGetImageSparseMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1691 countingStream->rewind();
1692 uint32_t opcode_vkGetImageSparseMemoryRequirements = OP_vkGetImageSparseMemoryRequirements;
1693 stream->write(&opcode_vkGetImageSparseMemoryRequirements, sizeof(uint32_t));
1694 stream->write(&packetSize_vkGetImageSparseMemoryRequirements, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001695 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1696 stream->write((VkImage*)&local_image, sizeof(VkImage));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001697 stream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*));
1698 if (pSparseMemoryRequirementCount)
1699 {
1700 stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
1701 }
1702 stream->write((VkSparseImageMemoryRequirements**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements*));
1703 if (pSparseMemoryRequirements)
1704 {
1705 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
1706 {
1707 marshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i));
1708 }
1709 }
1710 uint32_t* check_pSparseMemoryRequirementCount;
1711 stream->read((uint32_t**)&check_pSparseMemoryRequirementCount, sizeof(uint32_t*));
1712 if (pSparseMemoryRequirementCount)
1713 {
1714 if (!(check_pSparseMemoryRequirementCount))
1715 {
1716 fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n");
1717 }
1718 stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
1719 }
1720 VkSparseImageMemoryRequirements* check_pSparseMemoryRequirements;
1721 stream->read((VkSparseImageMemoryRequirements**)&check_pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements*));
1722 if (pSparseMemoryRequirements)
1723 {
1724 if (!(check_pSparseMemoryRequirements))
1725 {
1726 fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n");
1727 }
1728 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
1729 {
1730 unmarshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i));
1731 }
1732 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001733 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001734}
1735
1736void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties(
1737 VkPhysicalDevice physicalDevice,
1738 VkFormat format,
1739 VkImageType type,
1740 VkSampleCountFlagBits samples,
1741 VkImageUsageFlags usage,
1742 VkImageTiling tiling,
1743 uint32_t* pPropertyCount,
1744 VkSparseImageFormatProperties* pProperties)
1745{
1746 auto stream = mImpl->stream();
1747 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001748 auto resources = mImpl->resources();
1749 auto pool = mImpl->pool();
1750 VkPhysicalDevice local_physicalDevice;
1751 local_physicalDevice = physicalDevice;
1752 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
1753 VkFormat local_format;
1754 local_format = format;
1755 VkImageType local_type;
1756 local_type = type;
1757 VkSampleCountFlagBits local_samples;
1758 local_samples = samples;
1759 VkImageUsageFlags local_usage;
1760 local_usage = usage;
1761 VkImageTiling local_tiling;
1762 local_tiling = tiling;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001763 countingStream->rewind();
1764 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001765 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
1766 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
1767 countingStream->write((VkImageType*)&local_type, sizeof(VkImageType));
1768 countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
1769 countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
1770 countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001771 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
1772 if (pPropertyCount)
1773 {
1774 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
1775 }
1776 countingStream->write((VkSparseImageFormatProperties**)&pProperties, sizeof(VkSparseImageFormatProperties*));
1777 if (pProperties)
1778 {
1779 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
1780 {
1781 marshal_VkSparseImageFormatProperties(countingStream, (VkSparseImageFormatProperties*)(pProperties + i));
1782 }
1783 }
1784 }
1785 uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1786 countingStream->rewind();
1787 uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties = OP_vkGetPhysicalDeviceSparseImageFormatProperties;
1788 stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t));
1789 stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001790 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
1791 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
1792 stream->write((VkImageType*)&local_type, sizeof(VkImageType));
1793 stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
1794 stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
1795 stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001796 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
1797 if (pPropertyCount)
1798 {
1799 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
1800 }
1801 stream->write((VkSparseImageFormatProperties**)&pProperties, sizeof(VkSparseImageFormatProperties*));
1802 if (pProperties)
1803 {
1804 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
1805 {
1806 marshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i));
1807 }
1808 }
1809 uint32_t* check_pPropertyCount;
1810 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
1811 if (pPropertyCount)
1812 {
1813 if (!(check_pPropertyCount))
1814 {
1815 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
1816 }
1817 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
1818 }
1819 VkSparseImageFormatProperties* check_pProperties;
1820 stream->read((VkSparseImageFormatProperties**)&check_pProperties, sizeof(VkSparseImageFormatProperties*));
1821 if (pProperties)
1822 {
1823 if (!(check_pProperties))
1824 {
1825 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
1826 }
1827 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
1828 {
1829 unmarshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i));
1830 }
1831 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001832 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001833}
1834
1835VkResult VkEncoder::vkQueueBindSparse(
1836 VkQueue queue,
1837 uint32_t bindInfoCount,
1838 const VkBindSparseInfo* pBindInfo,
1839 VkFence fence)
1840{
1841 auto stream = mImpl->stream();
1842 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001843 auto resources = mImpl->resources();
1844 auto pool = mImpl->pool();
1845 VkQueue local_queue;
1846 local_queue = queue;
1847 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
1848 uint32_t local_bindInfoCount;
1849 local_bindInfoCount = bindInfoCount;
1850 VkBindSparseInfo* local_pBindInfo;
1851 local_pBindInfo = nullptr;
1852 if (pBindInfo)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001853 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001854 local_pBindInfo = (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001855 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
1856 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001857 deepcopy_VkBindSparseInfo(pool, pBindInfo + i, (VkBindSparseInfo*)(local_pBindInfo + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001858 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001859 }
1860 if (local_pBindInfo)
1861 {
1862 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
1863 {
1864 handlemap_VkBindSparseInfo(resources->unwrapMapping(), (VkBindSparseInfo*)(local_pBindInfo + i));
1865 }
1866 }
1867 VkFence local_fence;
1868 local_fence = fence;
1869 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
1870 countingStream->rewind();
1871 {
1872 countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue));
1873 countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
1874 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
1875 {
1876 marshal_VkBindSparseInfo(countingStream, (VkBindSparseInfo*)(local_pBindInfo + i));
1877 }
1878 countingStream->write((VkFence*)&local_fence, sizeof(VkFence));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001879 }
1880 uint32_t packetSize_vkQueueBindSparse = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1881 countingStream->rewind();
1882 uint32_t opcode_vkQueueBindSparse = OP_vkQueueBindSparse;
1883 stream->write(&opcode_vkQueueBindSparse, sizeof(uint32_t));
1884 stream->write(&packetSize_vkQueueBindSparse, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001885 stream->write((VkQueue*)&local_queue, sizeof(VkQueue));
1886 stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001887 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
1888 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001889 marshal_VkBindSparseInfo(stream, (VkBindSparseInfo*)(local_pBindInfo + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001890 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001891 stream->write((VkFence*)&local_fence, sizeof(VkFence));
1892 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001893 VkResult vkQueueBindSparse_VkResult_return = (VkResult)0;
1894 stream->read(&vkQueueBindSparse_VkResult_return, sizeof(VkResult));
1895 return vkQueueBindSparse_VkResult_return;
1896}
1897
1898VkResult VkEncoder::vkCreateFence(
1899 VkDevice device,
1900 const VkFenceCreateInfo* pCreateInfo,
1901 const VkAllocationCallbacks* pAllocator,
1902 VkFence* pFence)
1903{
1904 auto stream = mImpl->stream();
1905 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001906 auto resources = mImpl->resources();
1907 auto pool = mImpl->pool();
1908 VkDevice local_device;
1909 local_device = device;
1910 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1911 VkFenceCreateInfo* local_pCreateInfo;
1912 local_pCreateInfo = nullptr;
1913 if (pCreateInfo)
1914 {
1915 local_pCreateInfo = (VkFenceCreateInfo*)pool->alloc(sizeof(const VkFenceCreateInfo));
1916 deepcopy_VkFenceCreateInfo(pool, pCreateInfo, (VkFenceCreateInfo*)(local_pCreateInfo));
1917 }
1918 if (local_pCreateInfo)
1919 {
1920 handlemap_VkFenceCreateInfo(resources->unwrapMapping(), (VkFenceCreateInfo*)(local_pCreateInfo));
1921 }
1922 VkAllocationCallbacks* local_pAllocator;
1923 local_pAllocator = nullptr;
1924 if (pAllocator)
1925 {
1926 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
1927 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
1928 }
1929 if (local_pAllocator)
1930 {
1931 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
1932 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001933 countingStream->rewind();
1934 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001935 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
1936 marshal_VkFenceCreateInfo(countingStream, (VkFenceCreateInfo*)(local_pCreateInfo));
1937 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
1938 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001939 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001940 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001941 }
1942 countingStream->write((VkFence*)pFence, sizeof(VkFence));
1943 }
1944 uint32_t packetSize_vkCreateFence = 4 + 4 + (uint32_t)countingStream->bytesWritten();
1945 countingStream->rewind();
1946 uint32_t opcode_vkCreateFence = OP_vkCreateFence;
1947 stream->write(&opcode_vkCreateFence, sizeof(uint32_t));
1948 stream->write(&packetSize_vkCreateFence, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001949 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
1950 marshal_VkFenceCreateInfo(stream, (VkFenceCreateInfo*)(local_pCreateInfo));
1951 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
1952 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001953 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001954 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001955 }
1956 stream->write((VkFence*)pFence, sizeof(VkFence));
1957 stream->read((VkFence*)pFence, sizeof(VkFence));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001958 if (pFence)
1959 {
1960 resources->createMapping()->mapHandles_VkFence((VkFence*)pFence, 1);
1961 }
1962 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001963 VkResult vkCreateFence_VkResult_return = (VkResult)0;
1964 stream->read(&vkCreateFence_VkResult_return, sizeof(VkResult));
1965 return vkCreateFence_VkResult_return;
1966}
1967
1968void VkEncoder::vkDestroyFence(
1969 VkDevice device,
1970 VkFence fence,
1971 const VkAllocationCallbacks* pAllocator)
1972{
1973 auto stream = mImpl->stream();
1974 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001975 auto resources = mImpl->resources();
1976 auto pool = mImpl->pool();
1977 VkDevice local_device;
1978 local_device = device;
1979 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
1980 VkAllocationCallbacks* local_pAllocator;
1981 local_pAllocator = nullptr;
1982 if (pAllocator)
1983 {
1984 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
1985 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
1986 }
1987 if (local_pAllocator)
1988 {
1989 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
1990 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001991 countingStream->rewind();
1992 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001993 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001994 countingStream->write((VkFence*)&fence, sizeof(VkFence));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001995 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
1996 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001997 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08001998 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07001999 }
2000 }
2001 uint32_t packetSize_vkDestroyFence = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2002 countingStream->rewind();
2003 uint32_t opcode_vkDestroyFence = OP_vkDestroyFence;
2004 stream->write(&opcode_vkDestroyFence, sizeof(uint32_t));
2005 stream->write(&packetSize_vkDestroyFence, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002006 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002007 stream->write((VkFence*)&fence, sizeof(VkFence));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002008 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2009 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002010 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002011 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002012 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002013 resources->destroyMapping()->mapHandles_VkFence((VkFence*)&fence);
2014 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002015}
2016
2017VkResult VkEncoder::vkResetFences(
2018 VkDevice device,
2019 uint32_t fenceCount,
2020 const VkFence* pFences)
2021{
2022 auto stream = mImpl->stream();
2023 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002024 auto resources = mImpl->resources();
2025 auto pool = mImpl->pool();
2026 VkDevice local_device;
2027 local_device = device;
2028 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2029 uint32_t local_fenceCount;
2030 local_fenceCount = fenceCount;
2031 VkFence* local_pFences;
2032 local_pFences = nullptr;
2033 if (pFences)
2034 {
2035 local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence));
2036 }
2037 if (local_pFences)
2038 {
2039 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)local_pFences, ((fenceCount)));
2040 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002041 countingStream->rewind();
2042 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002043 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2044 countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
2045 countingStream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002046 }
2047 uint32_t packetSize_vkResetFences = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2048 countingStream->rewind();
2049 uint32_t opcode_vkResetFences = OP_vkResetFences;
2050 stream->write(&opcode_vkResetFences, sizeof(uint32_t));
2051 stream->write(&packetSize_vkResetFences, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002052 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2053 stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
2054 stream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
2055 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002056 VkResult vkResetFences_VkResult_return = (VkResult)0;
2057 stream->read(&vkResetFences_VkResult_return, sizeof(VkResult));
2058 return vkResetFences_VkResult_return;
2059}
2060
2061VkResult VkEncoder::vkGetFenceStatus(
2062 VkDevice device,
2063 VkFence fence)
2064{
2065 auto stream = mImpl->stream();
2066 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002067 auto resources = mImpl->resources();
2068 auto pool = mImpl->pool();
2069 VkDevice local_device;
2070 local_device = device;
2071 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2072 VkFence local_fence;
2073 local_fence = fence;
2074 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002075 countingStream->rewind();
2076 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002077 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2078 countingStream->write((VkFence*)&local_fence, sizeof(VkFence));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002079 }
2080 uint32_t packetSize_vkGetFenceStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2081 countingStream->rewind();
2082 uint32_t opcode_vkGetFenceStatus = OP_vkGetFenceStatus;
2083 stream->write(&opcode_vkGetFenceStatus, sizeof(uint32_t));
2084 stream->write(&packetSize_vkGetFenceStatus, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002085 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2086 stream->write((VkFence*)&local_fence, sizeof(VkFence));
2087 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002088 VkResult vkGetFenceStatus_VkResult_return = (VkResult)0;
2089 stream->read(&vkGetFenceStatus_VkResult_return, sizeof(VkResult));
2090 return vkGetFenceStatus_VkResult_return;
2091}
2092
2093VkResult VkEncoder::vkWaitForFences(
2094 VkDevice device,
2095 uint32_t fenceCount,
2096 const VkFence* pFences,
2097 VkBool32 waitAll,
2098 uint64_t timeout)
2099{
2100 auto stream = mImpl->stream();
2101 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002102 auto resources = mImpl->resources();
2103 auto pool = mImpl->pool();
2104 VkDevice local_device;
2105 local_device = device;
2106 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2107 uint32_t local_fenceCount;
2108 local_fenceCount = fenceCount;
2109 VkFence* local_pFences;
2110 local_pFences = nullptr;
2111 if (pFences)
2112 {
2113 local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence));
2114 }
2115 if (local_pFences)
2116 {
2117 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)local_pFences, ((fenceCount)));
2118 }
2119 VkBool32 local_waitAll;
2120 local_waitAll = waitAll;
2121 uint64_t local_timeout;
2122 local_timeout = timeout;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002123 countingStream->rewind();
2124 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002125 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2126 countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
2127 countingStream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
2128 countingStream->write((VkBool32*)&local_waitAll, sizeof(VkBool32));
2129 countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002130 }
2131 uint32_t packetSize_vkWaitForFences = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2132 countingStream->rewind();
2133 uint32_t opcode_vkWaitForFences = OP_vkWaitForFences;
2134 stream->write(&opcode_vkWaitForFences, sizeof(uint32_t));
2135 stream->write(&packetSize_vkWaitForFences, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002136 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2137 stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t));
2138 stream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence));
2139 stream->write((VkBool32*)&local_waitAll, sizeof(VkBool32));
2140 stream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
2141 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002142 VkResult vkWaitForFences_VkResult_return = (VkResult)0;
2143 stream->read(&vkWaitForFences_VkResult_return, sizeof(VkResult));
2144 return vkWaitForFences_VkResult_return;
2145}
2146
2147VkResult VkEncoder::vkCreateSemaphore(
2148 VkDevice device,
2149 const VkSemaphoreCreateInfo* pCreateInfo,
2150 const VkAllocationCallbacks* pAllocator,
2151 VkSemaphore* pSemaphore)
2152{
2153 auto stream = mImpl->stream();
2154 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002155 auto resources = mImpl->resources();
2156 auto pool = mImpl->pool();
2157 VkDevice local_device;
2158 local_device = device;
2159 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2160 VkSemaphoreCreateInfo* local_pCreateInfo;
2161 local_pCreateInfo = nullptr;
2162 if (pCreateInfo)
2163 {
2164 local_pCreateInfo = (VkSemaphoreCreateInfo*)pool->alloc(sizeof(const VkSemaphoreCreateInfo));
2165 deepcopy_VkSemaphoreCreateInfo(pool, pCreateInfo, (VkSemaphoreCreateInfo*)(local_pCreateInfo));
2166 }
2167 if (local_pCreateInfo)
2168 {
2169 handlemap_VkSemaphoreCreateInfo(resources->unwrapMapping(), (VkSemaphoreCreateInfo*)(local_pCreateInfo));
2170 }
2171 VkAllocationCallbacks* local_pAllocator;
2172 local_pAllocator = nullptr;
2173 if (pAllocator)
2174 {
2175 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2176 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2177 }
2178 if (local_pAllocator)
2179 {
2180 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2181 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002182 countingStream->rewind();
2183 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002184 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2185 marshal_VkSemaphoreCreateInfo(countingStream, (VkSemaphoreCreateInfo*)(local_pCreateInfo));
2186 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2187 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002188 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002189 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002190 }
2191 countingStream->write((VkSemaphore*)pSemaphore, sizeof(VkSemaphore));
2192 }
2193 uint32_t packetSize_vkCreateSemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2194 countingStream->rewind();
2195 uint32_t opcode_vkCreateSemaphore = OP_vkCreateSemaphore;
2196 stream->write(&opcode_vkCreateSemaphore, sizeof(uint32_t));
2197 stream->write(&packetSize_vkCreateSemaphore, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002198 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2199 marshal_VkSemaphoreCreateInfo(stream, (VkSemaphoreCreateInfo*)(local_pCreateInfo));
2200 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2201 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002202 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002203 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002204 }
2205 stream->write((VkSemaphore*)pSemaphore, sizeof(VkSemaphore));
2206 stream->read((VkSemaphore*)pSemaphore, sizeof(VkSemaphore));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002207 if (pSemaphore)
2208 {
2209 resources->createMapping()->mapHandles_VkSemaphore((VkSemaphore*)pSemaphore, 1);
2210 }
2211 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002212 VkResult vkCreateSemaphore_VkResult_return = (VkResult)0;
2213 stream->read(&vkCreateSemaphore_VkResult_return, sizeof(VkResult));
2214 return vkCreateSemaphore_VkResult_return;
2215}
2216
2217void VkEncoder::vkDestroySemaphore(
2218 VkDevice device,
2219 VkSemaphore semaphore,
2220 const VkAllocationCallbacks* pAllocator)
2221{
2222 auto stream = mImpl->stream();
2223 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002224 auto resources = mImpl->resources();
2225 auto pool = mImpl->pool();
2226 VkDevice local_device;
2227 local_device = device;
2228 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2229 VkAllocationCallbacks* local_pAllocator;
2230 local_pAllocator = nullptr;
2231 if (pAllocator)
2232 {
2233 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2234 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2235 }
2236 if (local_pAllocator)
2237 {
2238 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2239 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002240 countingStream->rewind();
2241 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002242 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002243 countingStream->write((VkSemaphore*)&semaphore, sizeof(VkSemaphore));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002244 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2245 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002246 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002247 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002248 }
2249 }
2250 uint32_t packetSize_vkDestroySemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2251 countingStream->rewind();
2252 uint32_t opcode_vkDestroySemaphore = OP_vkDestroySemaphore;
2253 stream->write(&opcode_vkDestroySemaphore, sizeof(uint32_t));
2254 stream->write(&packetSize_vkDestroySemaphore, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002255 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002256 stream->write((VkSemaphore*)&semaphore, sizeof(VkSemaphore));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002257 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2258 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002259 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002260 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002261 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002262 resources->destroyMapping()->mapHandles_VkSemaphore((VkSemaphore*)&semaphore);
2263 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002264}
2265
2266VkResult VkEncoder::vkCreateEvent(
2267 VkDevice device,
2268 const VkEventCreateInfo* pCreateInfo,
2269 const VkAllocationCallbacks* pAllocator,
2270 VkEvent* pEvent)
2271{
2272 auto stream = mImpl->stream();
2273 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002274 auto resources = mImpl->resources();
2275 auto pool = mImpl->pool();
2276 VkDevice local_device;
2277 local_device = device;
2278 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2279 VkEventCreateInfo* local_pCreateInfo;
2280 local_pCreateInfo = nullptr;
2281 if (pCreateInfo)
2282 {
2283 local_pCreateInfo = (VkEventCreateInfo*)pool->alloc(sizeof(const VkEventCreateInfo));
2284 deepcopy_VkEventCreateInfo(pool, pCreateInfo, (VkEventCreateInfo*)(local_pCreateInfo));
2285 }
2286 if (local_pCreateInfo)
2287 {
2288 handlemap_VkEventCreateInfo(resources->unwrapMapping(), (VkEventCreateInfo*)(local_pCreateInfo));
2289 }
2290 VkAllocationCallbacks* local_pAllocator;
2291 local_pAllocator = nullptr;
2292 if (pAllocator)
2293 {
2294 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2295 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2296 }
2297 if (local_pAllocator)
2298 {
2299 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2300 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002301 countingStream->rewind();
2302 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002303 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2304 marshal_VkEventCreateInfo(countingStream, (VkEventCreateInfo*)(local_pCreateInfo));
2305 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2306 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002307 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002308 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002309 }
2310 countingStream->write((VkEvent*)pEvent, sizeof(VkEvent));
2311 }
2312 uint32_t packetSize_vkCreateEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2313 countingStream->rewind();
2314 uint32_t opcode_vkCreateEvent = OP_vkCreateEvent;
2315 stream->write(&opcode_vkCreateEvent, sizeof(uint32_t));
2316 stream->write(&packetSize_vkCreateEvent, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002317 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2318 marshal_VkEventCreateInfo(stream, (VkEventCreateInfo*)(local_pCreateInfo));
2319 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2320 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002321 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002322 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002323 }
2324 stream->write((VkEvent*)pEvent, sizeof(VkEvent));
2325 stream->read((VkEvent*)pEvent, sizeof(VkEvent));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002326 if (pEvent)
2327 {
2328 resources->createMapping()->mapHandles_VkEvent((VkEvent*)pEvent, 1);
2329 }
2330 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002331 VkResult vkCreateEvent_VkResult_return = (VkResult)0;
2332 stream->read(&vkCreateEvent_VkResult_return, sizeof(VkResult));
2333 return vkCreateEvent_VkResult_return;
2334}
2335
2336void VkEncoder::vkDestroyEvent(
2337 VkDevice device,
2338 VkEvent event,
2339 const VkAllocationCallbacks* pAllocator)
2340{
2341 auto stream = mImpl->stream();
2342 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002343 auto resources = mImpl->resources();
2344 auto pool = mImpl->pool();
2345 VkDevice local_device;
2346 local_device = device;
2347 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2348 VkAllocationCallbacks* local_pAllocator;
2349 local_pAllocator = nullptr;
2350 if (pAllocator)
2351 {
2352 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2353 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2354 }
2355 if (local_pAllocator)
2356 {
2357 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2358 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002359 countingStream->rewind();
2360 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002361 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002362 countingStream->write((VkEvent*)&event, sizeof(VkEvent));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002363 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2364 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002365 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002366 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002367 }
2368 }
2369 uint32_t packetSize_vkDestroyEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2370 countingStream->rewind();
2371 uint32_t opcode_vkDestroyEvent = OP_vkDestroyEvent;
2372 stream->write(&opcode_vkDestroyEvent, sizeof(uint32_t));
2373 stream->write(&packetSize_vkDestroyEvent, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002374 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002375 stream->write((VkEvent*)&event, sizeof(VkEvent));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002376 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2377 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002378 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002379 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002380 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002381 resources->destroyMapping()->mapHandles_VkEvent((VkEvent*)&event);
2382 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002383}
2384
2385VkResult VkEncoder::vkGetEventStatus(
2386 VkDevice device,
2387 VkEvent event)
2388{
2389 auto stream = mImpl->stream();
2390 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002391 auto resources = mImpl->resources();
2392 auto pool = mImpl->pool();
2393 VkDevice local_device;
2394 local_device = device;
2395 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2396 VkEvent local_event;
2397 local_event = event;
2398 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002399 countingStream->rewind();
2400 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002401 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2402 countingStream->write((VkEvent*)&local_event, sizeof(VkEvent));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002403 }
2404 uint32_t packetSize_vkGetEventStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2405 countingStream->rewind();
2406 uint32_t opcode_vkGetEventStatus = OP_vkGetEventStatus;
2407 stream->write(&opcode_vkGetEventStatus, sizeof(uint32_t));
2408 stream->write(&packetSize_vkGetEventStatus, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002409 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2410 stream->write((VkEvent*)&local_event, sizeof(VkEvent));
2411 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002412 VkResult vkGetEventStatus_VkResult_return = (VkResult)0;
2413 stream->read(&vkGetEventStatus_VkResult_return, sizeof(VkResult));
2414 return vkGetEventStatus_VkResult_return;
2415}
2416
2417VkResult VkEncoder::vkSetEvent(
2418 VkDevice device,
2419 VkEvent event)
2420{
2421 auto stream = mImpl->stream();
2422 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002423 auto resources = mImpl->resources();
2424 auto pool = mImpl->pool();
2425 VkDevice local_device;
2426 local_device = device;
2427 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2428 VkEvent local_event;
2429 local_event = event;
2430 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002431 countingStream->rewind();
2432 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002433 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2434 countingStream->write((VkEvent*)&local_event, sizeof(VkEvent));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002435 }
2436 uint32_t packetSize_vkSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2437 countingStream->rewind();
2438 uint32_t opcode_vkSetEvent = OP_vkSetEvent;
2439 stream->write(&opcode_vkSetEvent, sizeof(uint32_t));
2440 stream->write(&packetSize_vkSetEvent, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002441 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2442 stream->write((VkEvent*)&local_event, sizeof(VkEvent));
2443 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002444 VkResult vkSetEvent_VkResult_return = (VkResult)0;
2445 stream->read(&vkSetEvent_VkResult_return, sizeof(VkResult));
2446 return vkSetEvent_VkResult_return;
2447}
2448
2449VkResult VkEncoder::vkResetEvent(
2450 VkDevice device,
2451 VkEvent event)
2452{
2453 auto stream = mImpl->stream();
2454 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002455 auto resources = mImpl->resources();
2456 auto pool = mImpl->pool();
2457 VkDevice local_device;
2458 local_device = device;
2459 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2460 VkEvent local_event;
2461 local_event = event;
2462 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002463 countingStream->rewind();
2464 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002465 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2466 countingStream->write((VkEvent*)&local_event, sizeof(VkEvent));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002467 }
2468 uint32_t packetSize_vkResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2469 countingStream->rewind();
2470 uint32_t opcode_vkResetEvent = OP_vkResetEvent;
2471 stream->write(&opcode_vkResetEvent, sizeof(uint32_t));
2472 stream->write(&packetSize_vkResetEvent, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002473 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2474 stream->write((VkEvent*)&local_event, sizeof(VkEvent));
2475 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002476 VkResult vkResetEvent_VkResult_return = (VkResult)0;
2477 stream->read(&vkResetEvent_VkResult_return, sizeof(VkResult));
2478 return vkResetEvent_VkResult_return;
2479}
2480
2481VkResult VkEncoder::vkCreateQueryPool(
2482 VkDevice device,
2483 const VkQueryPoolCreateInfo* pCreateInfo,
2484 const VkAllocationCallbacks* pAllocator,
2485 VkQueryPool* pQueryPool)
2486{
2487 auto stream = mImpl->stream();
2488 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002489 auto resources = mImpl->resources();
2490 auto pool = mImpl->pool();
2491 VkDevice local_device;
2492 local_device = device;
2493 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2494 VkQueryPoolCreateInfo* local_pCreateInfo;
2495 local_pCreateInfo = nullptr;
2496 if (pCreateInfo)
2497 {
2498 local_pCreateInfo = (VkQueryPoolCreateInfo*)pool->alloc(sizeof(const VkQueryPoolCreateInfo));
2499 deepcopy_VkQueryPoolCreateInfo(pool, pCreateInfo, (VkQueryPoolCreateInfo*)(local_pCreateInfo));
2500 }
2501 if (local_pCreateInfo)
2502 {
2503 handlemap_VkQueryPoolCreateInfo(resources->unwrapMapping(), (VkQueryPoolCreateInfo*)(local_pCreateInfo));
2504 }
2505 VkAllocationCallbacks* local_pAllocator;
2506 local_pAllocator = nullptr;
2507 if (pAllocator)
2508 {
2509 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2510 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2511 }
2512 if (local_pAllocator)
2513 {
2514 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2515 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002516 countingStream->rewind();
2517 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002518 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2519 marshal_VkQueryPoolCreateInfo(countingStream, (VkQueryPoolCreateInfo*)(local_pCreateInfo));
2520 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2521 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002522 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002523 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002524 }
2525 countingStream->write((VkQueryPool*)pQueryPool, sizeof(VkQueryPool));
2526 }
2527 uint32_t packetSize_vkCreateQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2528 countingStream->rewind();
2529 uint32_t opcode_vkCreateQueryPool = OP_vkCreateQueryPool;
2530 stream->write(&opcode_vkCreateQueryPool, sizeof(uint32_t));
2531 stream->write(&packetSize_vkCreateQueryPool, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002532 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2533 marshal_VkQueryPoolCreateInfo(stream, (VkQueryPoolCreateInfo*)(local_pCreateInfo));
2534 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2535 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002536 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002537 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002538 }
2539 stream->write((VkQueryPool*)pQueryPool, sizeof(VkQueryPool));
2540 stream->read((VkQueryPool*)pQueryPool, sizeof(VkQueryPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002541 if (pQueryPool)
2542 {
2543 resources->createMapping()->mapHandles_VkQueryPool((VkQueryPool*)pQueryPool, 1);
2544 }
2545 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002546 VkResult vkCreateQueryPool_VkResult_return = (VkResult)0;
2547 stream->read(&vkCreateQueryPool_VkResult_return, sizeof(VkResult));
2548 return vkCreateQueryPool_VkResult_return;
2549}
2550
2551void VkEncoder::vkDestroyQueryPool(
2552 VkDevice device,
2553 VkQueryPool queryPool,
2554 const VkAllocationCallbacks* pAllocator)
2555{
2556 auto stream = mImpl->stream();
2557 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002558 auto resources = mImpl->resources();
2559 auto pool = mImpl->pool();
2560 VkDevice local_device;
2561 local_device = device;
2562 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2563 VkAllocationCallbacks* local_pAllocator;
2564 local_pAllocator = nullptr;
2565 if (pAllocator)
2566 {
2567 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2568 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2569 }
2570 if (local_pAllocator)
2571 {
2572 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2573 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002574 countingStream->rewind();
2575 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002576 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002577 countingStream->write((VkQueryPool*)&queryPool, sizeof(VkQueryPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002578 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2579 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002580 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002581 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002582 }
2583 }
2584 uint32_t packetSize_vkDestroyQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2585 countingStream->rewind();
2586 uint32_t opcode_vkDestroyQueryPool = OP_vkDestroyQueryPool;
2587 stream->write(&opcode_vkDestroyQueryPool, sizeof(uint32_t));
2588 stream->write(&packetSize_vkDestroyQueryPool, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002589 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002590 stream->write((VkQueryPool*)&queryPool, sizeof(VkQueryPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002591 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2592 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002593 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002594 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002595 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002596 resources->destroyMapping()->mapHandles_VkQueryPool((VkQueryPool*)&queryPool);
2597 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002598}
2599
2600VkResult VkEncoder::vkGetQueryPoolResults(
2601 VkDevice device,
2602 VkQueryPool queryPool,
2603 uint32_t firstQuery,
2604 uint32_t queryCount,
2605 size_t dataSize,
2606 void* pData,
2607 VkDeviceSize stride,
2608 VkQueryResultFlags flags)
2609{
2610 auto stream = mImpl->stream();
2611 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002612 auto resources = mImpl->resources();
2613 auto pool = mImpl->pool();
2614 VkDevice local_device;
2615 local_device = device;
2616 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2617 VkQueryPool local_queryPool;
2618 local_queryPool = queryPool;
2619 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
2620 uint32_t local_firstQuery;
2621 local_firstQuery = firstQuery;
2622 uint32_t local_queryCount;
2623 local_queryCount = queryCount;
2624 size_t local_dataSize;
2625 local_dataSize = dataSize;
2626 VkDeviceSize local_stride;
2627 local_stride = stride;
2628 VkQueryResultFlags local_flags;
2629 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002630 countingStream->rewind();
2631 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002632 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2633 countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
2634 countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
2635 countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
2636 countingStream->write((size_t*)&local_dataSize, sizeof(size_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002637 countingStream->write((void*)pData, ((dataSize)) * sizeof(uint8_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002638 countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
2639 countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002640 }
2641 uint32_t packetSize_vkGetQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2642 countingStream->rewind();
2643 uint32_t opcode_vkGetQueryPoolResults = OP_vkGetQueryPoolResults;
2644 stream->write(&opcode_vkGetQueryPoolResults, sizeof(uint32_t));
2645 stream->write(&packetSize_vkGetQueryPoolResults, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002646 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2647 stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
2648 stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
2649 stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
2650 stream->write((size_t*)&local_dataSize, sizeof(size_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002651 stream->write((void*)pData, ((dataSize)) * sizeof(uint8_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002652 stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
2653 stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002654 stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002655 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002656 VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0;
2657 stream->read(&vkGetQueryPoolResults_VkResult_return, sizeof(VkResult));
2658 return vkGetQueryPoolResults_VkResult_return;
2659}
2660
2661VkResult VkEncoder::vkCreateBuffer(
2662 VkDevice device,
2663 const VkBufferCreateInfo* pCreateInfo,
2664 const VkAllocationCallbacks* pAllocator,
2665 VkBuffer* pBuffer)
2666{
2667 auto stream = mImpl->stream();
2668 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002669 auto resources = mImpl->resources();
2670 auto pool = mImpl->pool();
2671 VkDevice local_device;
2672 local_device = device;
2673 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2674 VkBufferCreateInfo* local_pCreateInfo;
2675 local_pCreateInfo = nullptr;
2676 if (pCreateInfo)
2677 {
2678 local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo));
2679 deepcopy_VkBufferCreateInfo(pool, pCreateInfo, (VkBufferCreateInfo*)(local_pCreateInfo));
2680 }
2681 if (local_pCreateInfo)
2682 {
2683 handlemap_VkBufferCreateInfo(resources->unwrapMapping(), (VkBufferCreateInfo*)(local_pCreateInfo));
2684 }
2685 VkAllocationCallbacks* local_pAllocator;
2686 local_pAllocator = nullptr;
2687 if (pAllocator)
2688 {
2689 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2690 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2691 }
2692 if (local_pAllocator)
2693 {
2694 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2695 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002696 countingStream->rewind();
2697 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002698 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2699 marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo));
2700 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2701 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002702 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002703 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002704 }
2705 countingStream->write((VkBuffer*)pBuffer, sizeof(VkBuffer));
2706 }
2707 uint32_t packetSize_vkCreateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2708 countingStream->rewind();
2709 uint32_t opcode_vkCreateBuffer = OP_vkCreateBuffer;
2710 stream->write(&opcode_vkCreateBuffer, sizeof(uint32_t));
2711 stream->write(&packetSize_vkCreateBuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002712 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2713 marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo));
2714 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2715 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002716 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002717 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002718 }
2719 stream->write((VkBuffer*)pBuffer, sizeof(VkBuffer));
2720 stream->read((VkBuffer*)pBuffer, sizeof(VkBuffer));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002721 if (pBuffer)
2722 {
2723 resources->createMapping()->mapHandles_VkBuffer((VkBuffer*)pBuffer, 1);
2724 }
2725 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002726 VkResult vkCreateBuffer_VkResult_return = (VkResult)0;
2727 stream->read(&vkCreateBuffer_VkResult_return, sizeof(VkResult));
2728 return vkCreateBuffer_VkResult_return;
2729}
2730
2731void VkEncoder::vkDestroyBuffer(
2732 VkDevice device,
2733 VkBuffer buffer,
2734 const VkAllocationCallbacks* pAllocator)
2735{
2736 auto stream = mImpl->stream();
2737 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002738 auto resources = mImpl->resources();
2739 auto pool = mImpl->pool();
2740 VkDevice local_device;
2741 local_device = device;
2742 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2743 VkAllocationCallbacks* local_pAllocator;
2744 local_pAllocator = nullptr;
2745 if (pAllocator)
2746 {
2747 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2748 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2749 }
2750 if (local_pAllocator)
2751 {
2752 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2753 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002754 countingStream->rewind();
2755 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002756 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002757 countingStream->write((VkBuffer*)&buffer, sizeof(VkBuffer));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002758 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2759 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002760 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002761 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002762 }
2763 }
2764 uint32_t packetSize_vkDestroyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2765 countingStream->rewind();
2766 uint32_t opcode_vkDestroyBuffer = OP_vkDestroyBuffer;
2767 stream->write(&opcode_vkDestroyBuffer, sizeof(uint32_t));
2768 stream->write(&packetSize_vkDestroyBuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002769 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002770 stream->write((VkBuffer*)&buffer, sizeof(VkBuffer));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002771 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2772 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002773 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002774 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002775 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002776 resources->destroyMapping()->mapHandles_VkBuffer((VkBuffer*)&buffer);
2777 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002778}
2779
2780VkResult VkEncoder::vkCreateBufferView(
2781 VkDevice device,
2782 const VkBufferViewCreateInfo* pCreateInfo,
2783 const VkAllocationCallbacks* pAllocator,
2784 VkBufferView* pView)
2785{
2786 auto stream = mImpl->stream();
2787 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002788 auto resources = mImpl->resources();
2789 auto pool = mImpl->pool();
2790 VkDevice local_device;
2791 local_device = device;
2792 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2793 VkBufferViewCreateInfo* local_pCreateInfo;
2794 local_pCreateInfo = nullptr;
2795 if (pCreateInfo)
2796 {
2797 local_pCreateInfo = (VkBufferViewCreateInfo*)pool->alloc(sizeof(const VkBufferViewCreateInfo));
2798 deepcopy_VkBufferViewCreateInfo(pool, pCreateInfo, (VkBufferViewCreateInfo*)(local_pCreateInfo));
2799 }
2800 if (local_pCreateInfo)
2801 {
2802 handlemap_VkBufferViewCreateInfo(resources->unwrapMapping(), (VkBufferViewCreateInfo*)(local_pCreateInfo));
2803 }
2804 VkAllocationCallbacks* local_pAllocator;
2805 local_pAllocator = nullptr;
2806 if (pAllocator)
2807 {
2808 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2809 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2810 }
2811 if (local_pAllocator)
2812 {
2813 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2814 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002815 countingStream->rewind();
2816 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002817 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2818 marshal_VkBufferViewCreateInfo(countingStream, (VkBufferViewCreateInfo*)(local_pCreateInfo));
2819 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2820 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002821 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002822 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002823 }
2824 countingStream->write((VkBufferView*)pView, sizeof(VkBufferView));
2825 }
2826 uint32_t packetSize_vkCreateBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2827 countingStream->rewind();
2828 uint32_t opcode_vkCreateBufferView = OP_vkCreateBufferView;
2829 stream->write(&opcode_vkCreateBufferView, sizeof(uint32_t));
2830 stream->write(&packetSize_vkCreateBufferView, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002831 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2832 marshal_VkBufferViewCreateInfo(stream, (VkBufferViewCreateInfo*)(local_pCreateInfo));
2833 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2834 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002835 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002836 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002837 }
2838 stream->write((VkBufferView*)pView, sizeof(VkBufferView));
2839 stream->read((VkBufferView*)pView, sizeof(VkBufferView));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002840 if (pView)
2841 {
2842 resources->createMapping()->mapHandles_VkBufferView((VkBufferView*)pView, 1);
2843 }
2844 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002845 VkResult vkCreateBufferView_VkResult_return = (VkResult)0;
2846 stream->read(&vkCreateBufferView_VkResult_return, sizeof(VkResult));
2847 return vkCreateBufferView_VkResult_return;
2848}
2849
2850void VkEncoder::vkDestroyBufferView(
2851 VkDevice device,
2852 VkBufferView bufferView,
2853 const VkAllocationCallbacks* pAllocator)
2854{
2855 auto stream = mImpl->stream();
2856 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002857 auto resources = mImpl->resources();
2858 auto pool = mImpl->pool();
2859 VkDevice local_device;
2860 local_device = device;
2861 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2862 VkAllocationCallbacks* local_pAllocator;
2863 local_pAllocator = nullptr;
2864 if (pAllocator)
2865 {
2866 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2867 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2868 }
2869 if (local_pAllocator)
2870 {
2871 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2872 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002873 countingStream->rewind();
2874 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002875 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002876 countingStream->write((VkBufferView*)&bufferView, sizeof(VkBufferView));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002877 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2878 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002879 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002880 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002881 }
2882 }
2883 uint32_t packetSize_vkDestroyBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2884 countingStream->rewind();
2885 uint32_t opcode_vkDestroyBufferView = OP_vkDestroyBufferView;
2886 stream->write(&opcode_vkDestroyBufferView, sizeof(uint32_t));
2887 stream->write(&packetSize_vkDestroyBufferView, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002888 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002889 stream->write((VkBufferView*)&bufferView, sizeof(VkBufferView));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002890 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2891 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002892 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002893 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002894 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002895 resources->destroyMapping()->mapHandles_VkBufferView((VkBufferView*)&bufferView);
2896 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002897}
2898
2899VkResult VkEncoder::vkCreateImage(
2900 VkDevice device,
2901 const VkImageCreateInfo* pCreateInfo,
2902 const VkAllocationCallbacks* pAllocator,
2903 VkImage* pImage)
2904{
2905 auto stream = mImpl->stream();
2906 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002907 auto resources = mImpl->resources();
2908 auto pool = mImpl->pool();
2909 VkDevice local_device;
2910 local_device = device;
2911 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2912 VkImageCreateInfo* local_pCreateInfo;
2913 local_pCreateInfo = nullptr;
2914 if (pCreateInfo)
2915 {
2916 local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo));
2917 deepcopy_VkImageCreateInfo(pool, pCreateInfo, (VkImageCreateInfo*)(local_pCreateInfo));
2918 }
2919 if (local_pCreateInfo)
2920 {
2921 handlemap_VkImageCreateInfo(resources->unwrapMapping(), (VkImageCreateInfo*)(local_pCreateInfo));
2922 }
2923 VkAllocationCallbacks* local_pAllocator;
2924 local_pAllocator = nullptr;
2925 if (pAllocator)
2926 {
2927 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2928 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2929 }
2930 if (local_pAllocator)
2931 {
2932 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2933 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002934 countingStream->rewind();
2935 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002936 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
2937 marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo));
2938 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2939 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002940 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002941 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002942 }
2943 countingStream->write((VkImage*)pImage, sizeof(VkImage));
2944 }
2945 uint32_t packetSize_vkCreateImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
2946 countingStream->rewind();
2947 uint32_t opcode_vkCreateImage = OP_vkCreateImage;
2948 stream->write(&opcode_vkCreateImage, sizeof(uint32_t));
2949 stream->write(&packetSize_vkCreateImage, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002950 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
2951 marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo));
2952 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2953 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002954 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002955 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002956 }
2957 stream->write((VkImage*)pImage, sizeof(VkImage));
2958 stream->read((VkImage*)pImage, sizeof(VkImage));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002959 if (pImage)
2960 {
2961 resources->createMapping()->mapHandles_VkImage((VkImage*)pImage, 1);
2962 }
2963 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002964 VkResult vkCreateImage_VkResult_return = (VkResult)0;
2965 stream->read(&vkCreateImage_VkResult_return, sizeof(VkResult));
2966 return vkCreateImage_VkResult_return;
2967}
2968
2969void VkEncoder::vkDestroyImage(
2970 VkDevice device,
2971 VkImage image,
2972 const VkAllocationCallbacks* pAllocator)
2973{
2974 auto stream = mImpl->stream();
2975 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002976 auto resources = mImpl->resources();
2977 auto pool = mImpl->pool();
2978 VkDevice local_device;
2979 local_device = device;
2980 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
2981 VkAllocationCallbacks* local_pAllocator;
2982 local_pAllocator = nullptr;
2983 if (pAllocator)
2984 {
2985 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
2986 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
2987 }
2988 if (local_pAllocator)
2989 {
2990 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
2991 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002992 countingStream->rewind();
2993 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002994 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07002995 countingStream->write((VkImage*)&image, sizeof(VkImage));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08002996 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
2997 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_vkDestroyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3003 countingStream->rewind();
3004 uint32_t opcode_vkDestroyImage = OP_vkDestroyImage;
3005 stream->write(&opcode_vkDestroyImage, sizeof(uint32_t));
3006 stream->write(&packetSize_vkDestroyImage, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003007 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003008 stream->write((VkImage*)&image, sizeof(VkImage));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003009 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3010 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003011 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003012 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003013 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003014 resources->destroyMapping()->mapHandles_VkImage((VkImage*)&image);
3015 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003016}
3017
3018void VkEncoder::vkGetImageSubresourceLayout(
3019 VkDevice device,
3020 VkImage image,
3021 const VkImageSubresource* pSubresource,
3022 VkSubresourceLayout* pLayout)
3023{
3024 auto stream = mImpl->stream();
3025 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003026 auto resources = mImpl->resources();
3027 auto pool = mImpl->pool();
3028 VkDevice local_device;
3029 local_device = device;
3030 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3031 VkImage local_image;
3032 local_image = image;
3033 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
3034 VkImageSubresource* local_pSubresource;
3035 local_pSubresource = nullptr;
3036 if (pSubresource)
3037 {
3038 local_pSubresource = (VkImageSubresource*)pool->alloc(sizeof(const VkImageSubresource));
3039 deepcopy_VkImageSubresource(pool, pSubresource, (VkImageSubresource*)(local_pSubresource));
3040 }
3041 if (local_pSubresource)
3042 {
3043 handlemap_VkImageSubresource(resources->unwrapMapping(), (VkImageSubresource*)(local_pSubresource));
3044 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003045 countingStream->rewind();
3046 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003047 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
3048 countingStream->write((VkImage*)&local_image, sizeof(VkImage));
3049 marshal_VkImageSubresource(countingStream, (VkImageSubresource*)(local_pSubresource));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003050 marshal_VkSubresourceLayout(countingStream, (VkSubresourceLayout*)(pLayout));
3051 }
3052 uint32_t packetSize_vkGetImageSubresourceLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3053 countingStream->rewind();
3054 uint32_t opcode_vkGetImageSubresourceLayout = OP_vkGetImageSubresourceLayout;
3055 stream->write(&opcode_vkGetImageSubresourceLayout, sizeof(uint32_t));
3056 stream->write(&packetSize_vkGetImageSubresourceLayout, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003057 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
3058 stream->write((VkImage*)&local_image, sizeof(VkImage));
3059 marshal_VkImageSubresource(stream, (VkImageSubresource*)(local_pSubresource));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003060 marshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout));
3061 unmarshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003062 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003063}
3064
3065VkResult VkEncoder::vkCreateImageView(
3066 VkDevice device,
3067 const VkImageViewCreateInfo* pCreateInfo,
3068 const VkAllocationCallbacks* pAllocator,
3069 VkImageView* pView)
3070{
3071 auto stream = mImpl->stream();
3072 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003073 auto resources = mImpl->resources();
3074 auto pool = mImpl->pool();
3075 VkDevice local_device;
3076 local_device = device;
3077 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3078 VkImageViewCreateInfo* local_pCreateInfo;
3079 local_pCreateInfo = nullptr;
3080 if (pCreateInfo)
3081 {
3082 local_pCreateInfo = (VkImageViewCreateInfo*)pool->alloc(sizeof(const VkImageViewCreateInfo));
3083 deepcopy_VkImageViewCreateInfo(pool, pCreateInfo, (VkImageViewCreateInfo*)(local_pCreateInfo));
3084 }
3085 if (local_pCreateInfo)
3086 {
3087 handlemap_VkImageViewCreateInfo(resources->unwrapMapping(), (VkImageViewCreateInfo*)(local_pCreateInfo));
3088 }
3089 VkAllocationCallbacks* local_pAllocator;
3090 local_pAllocator = nullptr;
3091 if (pAllocator)
3092 {
3093 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3094 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3095 }
3096 if (local_pAllocator)
3097 {
3098 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3099 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003100 countingStream->rewind();
3101 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003102 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
3103 marshal_VkImageViewCreateInfo(countingStream, (VkImageViewCreateInfo*)(local_pCreateInfo));
3104 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3105 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003106 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003107 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003108 }
3109 countingStream->write((VkImageView*)pView, sizeof(VkImageView));
3110 }
3111 uint32_t packetSize_vkCreateImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3112 countingStream->rewind();
3113 uint32_t opcode_vkCreateImageView = OP_vkCreateImageView;
3114 stream->write(&opcode_vkCreateImageView, sizeof(uint32_t));
3115 stream->write(&packetSize_vkCreateImageView, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003116 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
3117 marshal_VkImageViewCreateInfo(stream, (VkImageViewCreateInfo*)(local_pCreateInfo));
3118 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3119 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003120 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003121 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003122 }
3123 stream->write((VkImageView*)pView, sizeof(VkImageView));
3124 stream->read((VkImageView*)pView, sizeof(VkImageView));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003125 if (pView)
3126 {
3127 resources->createMapping()->mapHandles_VkImageView((VkImageView*)pView, 1);
3128 }
3129 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003130 VkResult vkCreateImageView_VkResult_return = (VkResult)0;
3131 stream->read(&vkCreateImageView_VkResult_return, sizeof(VkResult));
3132 return vkCreateImageView_VkResult_return;
3133}
3134
3135void VkEncoder::vkDestroyImageView(
3136 VkDevice device,
3137 VkImageView imageView,
3138 const VkAllocationCallbacks* pAllocator)
3139{
3140 auto stream = mImpl->stream();
3141 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003142 auto resources = mImpl->resources();
3143 auto pool = mImpl->pool();
3144 VkDevice local_device;
3145 local_device = device;
3146 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3147 VkAllocationCallbacks* local_pAllocator;
3148 local_pAllocator = nullptr;
3149 if (pAllocator)
3150 {
3151 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3152 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3153 }
3154 if (local_pAllocator)
3155 {
3156 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3157 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003158 countingStream->rewind();
3159 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003160 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003161 countingStream->write((VkImageView*)&imageView, sizeof(VkImageView));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003162 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3163 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003164 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003165 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003166 }
3167 }
3168 uint32_t packetSize_vkDestroyImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3169 countingStream->rewind();
3170 uint32_t opcode_vkDestroyImageView = OP_vkDestroyImageView;
3171 stream->write(&opcode_vkDestroyImageView, sizeof(uint32_t));
3172 stream->write(&packetSize_vkDestroyImageView, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003173 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003174 stream->write((VkImageView*)&imageView, sizeof(VkImageView));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003175 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3176 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003177 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003178 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003179 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003180 resources->destroyMapping()->mapHandles_VkImageView((VkImageView*)&imageView);
3181 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003182}
3183
3184VkResult VkEncoder::vkCreateShaderModule(
3185 VkDevice device,
3186 const VkShaderModuleCreateInfo* pCreateInfo,
3187 const VkAllocationCallbacks* pAllocator,
3188 VkShaderModule* pShaderModule)
3189{
3190 auto stream = mImpl->stream();
3191 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003192 auto resources = mImpl->resources();
3193 auto pool = mImpl->pool();
3194 VkDevice local_device;
3195 local_device = device;
3196 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3197 VkShaderModuleCreateInfo* local_pCreateInfo;
3198 local_pCreateInfo = nullptr;
3199 if (pCreateInfo)
3200 {
3201 local_pCreateInfo = (VkShaderModuleCreateInfo*)pool->alloc(sizeof(const VkShaderModuleCreateInfo));
3202 deepcopy_VkShaderModuleCreateInfo(pool, pCreateInfo, (VkShaderModuleCreateInfo*)(local_pCreateInfo));
3203 }
3204 if (local_pCreateInfo)
3205 {
3206 handlemap_VkShaderModuleCreateInfo(resources->unwrapMapping(), (VkShaderModuleCreateInfo*)(local_pCreateInfo));
3207 }
3208 VkAllocationCallbacks* local_pAllocator;
3209 local_pAllocator = nullptr;
3210 if (pAllocator)
3211 {
3212 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3213 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3214 }
3215 if (local_pAllocator)
3216 {
3217 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3218 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003219 countingStream->rewind();
3220 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003221 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
3222 marshal_VkShaderModuleCreateInfo(countingStream, (VkShaderModuleCreateInfo*)(local_pCreateInfo));
3223 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3224 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003225 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003226 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003227 }
3228 countingStream->write((VkShaderModule*)pShaderModule, sizeof(VkShaderModule));
3229 }
3230 uint32_t packetSize_vkCreateShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3231 countingStream->rewind();
3232 uint32_t opcode_vkCreateShaderModule = OP_vkCreateShaderModule;
3233 stream->write(&opcode_vkCreateShaderModule, sizeof(uint32_t));
3234 stream->write(&packetSize_vkCreateShaderModule, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003235 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
3236 marshal_VkShaderModuleCreateInfo(stream, (VkShaderModuleCreateInfo*)(local_pCreateInfo));
3237 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3238 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003239 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003240 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003241 }
3242 stream->write((VkShaderModule*)pShaderModule, sizeof(VkShaderModule));
3243 stream->read((VkShaderModule*)pShaderModule, sizeof(VkShaderModule));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003244 if (pShaderModule)
3245 {
3246 resources->createMapping()->mapHandles_VkShaderModule((VkShaderModule*)pShaderModule, 1);
3247 }
3248 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003249 VkResult vkCreateShaderModule_VkResult_return = (VkResult)0;
3250 stream->read(&vkCreateShaderModule_VkResult_return, sizeof(VkResult));
3251 return vkCreateShaderModule_VkResult_return;
3252}
3253
3254void VkEncoder::vkDestroyShaderModule(
3255 VkDevice device,
3256 VkShaderModule shaderModule,
3257 const VkAllocationCallbacks* pAllocator)
3258{
3259 auto stream = mImpl->stream();
3260 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003261 auto resources = mImpl->resources();
3262 auto pool = mImpl->pool();
3263 VkDevice local_device;
3264 local_device = device;
3265 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3266 VkAllocationCallbacks* local_pAllocator;
3267 local_pAllocator = nullptr;
3268 if (pAllocator)
3269 {
3270 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3271 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3272 }
3273 if (local_pAllocator)
3274 {
3275 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3276 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003277 countingStream->rewind();
3278 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003279 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003280 countingStream->write((VkShaderModule*)&shaderModule, sizeof(VkShaderModule));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003281 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3282 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003283 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003284 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003285 }
3286 }
3287 uint32_t packetSize_vkDestroyShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3288 countingStream->rewind();
3289 uint32_t opcode_vkDestroyShaderModule = OP_vkDestroyShaderModule;
3290 stream->write(&opcode_vkDestroyShaderModule, sizeof(uint32_t));
3291 stream->write(&packetSize_vkDestroyShaderModule, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003292 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003293 stream->write((VkShaderModule*)&shaderModule, sizeof(VkShaderModule));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003294 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3295 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003296 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003297 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003298 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003299 resources->destroyMapping()->mapHandles_VkShaderModule((VkShaderModule*)&shaderModule);
3300 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003301}
3302
3303VkResult VkEncoder::vkCreatePipelineCache(
3304 VkDevice device,
3305 const VkPipelineCacheCreateInfo* pCreateInfo,
3306 const VkAllocationCallbacks* pAllocator,
3307 VkPipelineCache* pPipelineCache)
3308{
3309 auto stream = mImpl->stream();
3310 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003311 auto resources = mImpl->resources();
3312 auto pool = mImpl->pool();
3313 VkDevice local_device;
3314 local_device = device;
3315 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3316 VkPipelineCacheCreateInfo* local_pCreateInfo;
3317 local_pCreateInfo = nullptr;
3318 if (pCreateInfo)
3319 {
3320 local_pCreateInfo = (VkPipelineCacheCreateInfo*)pool->alloc(sizeof(const VkPipelineCacheCreateInfo));
3321 deepcopy_VkPipelineCacheCreateInfo(pool, pCreateInfo, (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
3322 }
3323 if (local_pCreateInfo)
3324 {
3325 handlemap_VkPipelineCacheCreateInfo(resources->unwrapMapping(), (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
3326 }
3327 VkAllocationCallbacks* local_pAllocator;
3328 local_pAllocator = nullptr;
3329 if (pAllocator)
3330 {
3331 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3332 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3333 }
3334 if (local_pAllocator)
3335 {
3336 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3337 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003338 countingStream->rewind();
3339 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003340 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
3341 marshal_VkPipelineCacheCreateInfo(countingStream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
3342 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3343 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003344 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003345 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003346 }
3347 countingStream->write((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache));
3348 }
3349 uint32_t packetSize_vkCreatePipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3350 countingStream->rewind();
3351 uint32_t opcode_vkCreatePipelineCache = OP_vkCreatePipelineCache;
3352 stream->write(&opcode_vkCreatePipelineCache, sizeof(uint32_t));
3353 stream->write(&packetSize_vkCreatePipelineCache, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003354 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
3355 marshal_VkPipelineCacheCreateInfo(stream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo));
3356 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3357 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003358 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003359 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003360 }
3361 stream->write((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache));
3362 stream->read((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003363 if (pPipelineCache)
3364 {
3365 resources->createMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)pPipelineCache, 1);
3366 }
3367 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003368 VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0;
3369 stream->read(&vkCreatePipelineCache_VkResult_return, sizeof(VkResult));
3370 return vkCreatePipelineCache_VkResult_return;
3371}
3372
3373void VkEncoder::vkDestroyPipelineCache(
3374 VkDevice device,
3375 VkPipelineCache pipelineCache,
3376 const VkAllocationCallbacks* pAllocator)
3377{
3378 auto stream = mImpl->stream();
3379 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003380 auto resources = mImpl->resources();
3381 auto pool = mImpl->pool();
3382 VkDevice local_device;
3383 local_device = device;
3384 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3385 VkAllocationCallbacks* local_pAllocator;
3386 local_pAllocator = nullptr;
3387 if (pAllocator)
3388 {
3389 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3390 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3391 }
3392 if (local_pAllocator)
3393 {
3394 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3395 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003396 countingStream->rewind();
3397 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003398 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003399 countingStream->write((VkPipelineCache*)&pipelineCache, sizeof(VkPipelineCache));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003400 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3401 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003402 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003403 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003404 }
3405 }
3406 uint32_t packetSize_vkDestroyPipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3407 countingStream->rewind();
3408 uint32_t opcode_vkDestroyPipelineCache = OP_vkDestroyPipelineCache;
3409 stream->write(&opcode_vkDestroyPipelineCache, sizeof(uint32_t));
3410 stream->write(&packetSize_vkDestroyPipelineCache, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003411 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003412 stream->write((VkPipelineCache*)&pipelineCache, sizeof(VkPipelineCache));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003413 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3414 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003415 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003416 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003417 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003418 resources->destroyMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&pipelineCache);
3419 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003420}
3421
3422VkResult VkEncoder::vkGetPipelineCacheData(
3423 VkDevice device,
3424 VkPipelineCache pipelineCache,
3425 size_t* pDataSize,
3426 void* pData)
3427{
3428 auto stream = mImpl->stream();
3429 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003430 auto resources = mImpl->resources();
3431 auto pool = mImpl->pool();
3432 VkDevice local_device;
3433 local_device = device;
3434 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3435 VkPipelineCache local_pipelineCache;
3436 local_pipelineCache = pipelineCache;
3437 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003438 countingStream->rewind();
3439 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003440 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
3441 countingStream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003442 countingStream->write((size_t**)&pDataSize, sizeof(size_t*));
3443 if (pDataSize)
3444 {
3445 countingStream->write((size_t*)pDataSize, sizeof(size_t));
3446 }
3447 countingStream->write((void**)&pData, sizeof(void*));
3448 if (pData)
3449 {
3450 countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
3451 }
3452 }
3453 uint32_t packetSize_vkGetPipelineCacheData = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3454 countingStream->rewind();
3455 uint32_t opcode_vkGetPipelineCacheData = OP_vkGetPipelineCacheData;
3456 stream->write(&opcode_vkGetPipelineCacheData, sizeof(uint32_t));
3457 stream->write(&packetSize_vkGetPipelineCacheData, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003458 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
3459 stream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003460 stream->write((size_t**)&pDataSize, sizeof(size_t*));
3461 if (pDataSize)
3462 {
3463 stream->write((size_t*)pDataSize, sizeof(size_t));
3464 }
3465 stream->write((void**)&pData, sizeof(void*));
3466 if (pData)
3467 {
3468 stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
3469 }
3470 size_t* check_pDataSize;
3471 stream->read((size_t**)&check_pDataSize, sizeof(size_t*));
3472 if (pDataSize)
3473 {
3474 if (!(check_pDataSize))
3475 {
3476 fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n");
3477 }
3478 stream->read((size_t*)pDataSize, sizeof(size_t));
3479 }
3480 void* check_pData;
3481 stream->read((void**)&check_pData, sizeof(void*));
3482 if (pData)
3483 {
3484 if (!(check_pData))
3485 {
3486 fprintf(stderr, "fatal: pData inconsistent between guest and host\n");
3487 }
3488 stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
3489 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003490 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003491 VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0;
3492 stream->read(&vkGetPipelineCacheData_VkResult_return, sizeof(VkResult));
3493 return vkGetPipelineCacheData_VkResult_return;
3494}
3495
3496VkResult VkEncoder::vkMergePipelineCaches(
3497 VkDevice device,
3498 VkPipelineCache dstCache,
3499 uint32_t srcCacheCount,
3500 const VkPipelineCache* pSrcCaches)
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 VkPipelineCache local_dstCache;
3510 local_dstCache = dstCache;
3511 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_dstCache);
3512 uint32_t local_srcCacheCount;
3513 local_srcCacheCount = srcCacheCount;
3514 VkPipelineCache* local_pSrcCaches;
3515 local_pSrcCaches = nullptr;
3516 if (pSrcCaches)
3517 {
3518 local_pSrcCaches = (VkPipelineCache*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkPipelineCache));
3519 }
3520 if (local_pSrcCaches)
3521 {
3522 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount)));
3523 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003524 countingStream->rewind();
3525 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003526 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
3527 countingStream->write((VkPipelineCache*)&local_dstCache, sizeof(VkPipelineCache));
3528 countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
3529 countingStream->write((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkPipelineCache));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003530 }
3531 uint32_t packetSize_vkMergePipelineCaches = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3532 countingStream->rewind();
3533 uint32_t opcode_vkMergePipelineCaches = OP_vkMergePipelineCaches;
3534 stream->write(&opcode_vkMergePipelineCaches, sizeof(uint32_t));
3535 stream->write(&packetSize_vkMergePipelineCaches, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003536 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
3537 stream->write((VkPipelineCache*)&local_dstCache, sizeof(VkPipelineCache));
3538 stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
3539 stream->write((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkPipelineCache));
3540 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003541 VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0;
3542 stream->read(&vkMergePipelineCaches_VkResult_return, sizeof(VkResult));
3543 return vkMergePipelineCaches_VkResult_return;
3544}
3545
3546VkResult VkEncoder::vkCreateGraphicsPipelines(
3547 VkDevice device,
3548 VkPipelineCache pipelineCache,
3549 uint32_t createInfoCount,
3550 const VkGraphicsPipelineCreateInfo* pCreateInfos,
3551 const VkAllocationCallbacks* pAllocator,
3552 VkPipeline* pPipelines)
3553{
3554 auto stream = mImpl->stream();
3555 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003556 auto resources = mImpl->resources();
3557 auto pool = mImpl->pool();
3558 VkDevice local_device;
3559 local_device = device;
3560 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3561 VkPipelineCache local_pipelineCache;
3562 local_pipelineCache = pipelineCache;
3563 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache);
3564 uint32_t local_createInfoCount;
3565 local_createInfoCount = createInfoCount;
3566 VkGraphicsPipelineCreateInfo* local_pCreateInfos;
3567 local_pCreateInfos = nullptr;
3568 if (pCreateInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003569 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003570 local_pCreateInfos = (VkGraphicsPipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkGraphicsPipelineCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003571 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
3572 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003573 deepcopy_VkGraphicsPipelineCreateInfo(pool, pCreateInfos + i, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003574 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003575 }
3576 if (local_pCreateInfos)
3577 {
3578 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003579 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003580 handlemap_VkGraphicsPipelineCreateInfo(resources->unwrapMapping(), (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
3581 }
3582 }
3583 VkAllocationCallbacks* local_pAllocator;
3584 local_pAllocator = nullptr;
3585 if (pAllocator)
3586 {
3587 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3588 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3589 }
3590 if (local_pAllocator)
3591 {
3592 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3593 }
3594 countingStream->rewind();
3595 {
3596 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
3597 countingStream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache));
3598 countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
3599 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
3600 {
3601 marshal_VkGraphicsPipelineCreateInfo(countingStream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
3602 }
3603 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3604 if (local_pAllocator)
3605 {
3606 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003607 }
3608 countingStream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
3609 }
3610 uint32_t packetSize_vkCreateGraphicsPipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3611 countingStream->rewind();
3612 uint32_t opcode_vkCreateGraphicsPipelines = OP_vkCreateGraphicsPipelines;
3613 stream->write(&opcode_vkCreateGraphicsPipelines, sizeof(uint32_t));
3614 stream->write(&packetSize_vkCreateGraphicsPipelines, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003615 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
3616 stream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache));
3617 stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003618 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
3619 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003620 marshal_VkGraphicsPipelineCreateInfo(stream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003621 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003622 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3623 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003624 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003625 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003626 }
3627 stream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
3628 stream->read((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003629 if (pPipelines)
3630 {
3631 resources->createMapping()->mapHandles_VkPipeline((VkPipeline*)pPipelines, ((createInfoCount)));
3632 }
3633 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003634 VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0;
3635 stream->read(&vkCreateGraphicsPipelines_VkResult_return, sizeof(VkResult));
3636 return vkCreateGraphicsPipelines_VkResult_return;
3637}
3638
3639VkResult VkEncoder::vkCreateComputePipelines(
3640 VkDevice device,
3641 VkPipelineCache pipelineCache,
3642 uint32_t createInfoCount,
3643 const VkComputePipelineCreateInfo* pCreateInfos,
3644 const VkAllocationCallbacks* pAllocator,
3645 VkPipeline* pPipelines)
3646{
3647 auto stream = mImpl->stream();
3648 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003649 auto resources = mImpl->resources();
3650 auto pool = mImpl->pool();
3651 VkDevice local_device;
3652 local_device = device;
3653 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3654 VkPipelineCache local_pipelineCache;
3655 local_pipelineCache = pipelineCache;
3656 resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache);
3657 uint32_t local_createInfoCount;
3658 local_createInfoCount = createInfoCount;
3659 VkComputePipelineCreateInfo* local_pCreateInfos;
3660 local_pCreateInfos = nullptr;
3661 if (pCreateInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003662 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003663 local_pCreateInfos = (VkComputePipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkComputePipelineCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003664 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
3665 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003666 deepcopy_VkComputePipelineCreateInfo(pool, pCreateInfos + i, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003667 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003668 }
3669 if (local_pCreateInfos)
3670 {
3671 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003672 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003673 handlemap_VkComputePipelineCreateInfo(resources->unwrapMapping(), (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
3674 }
3675 }
3676 VkAllocationCallbacks* local_pAllocator;
3677 local_pAllocator = nullptr;
3678 if (pAllocator)
3679 {
3680 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3681 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3682 }
3683 if (local_pAllocator)
3684 {
3685 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3686 }
3687 countingStream->rewind();
3688 {
3689 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
3690 countingStream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache));
3691 countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
3692 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
3693 {
3694 marshal_VkComputePipelineCreateInfo(countingStream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
3695 }
3696 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3697 if (local_pAllocator)
3698 {
3699 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003700 }
3701 countingStream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
3702 }
3703 uint32_t packetSize_vkCreateComputePipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3704 countingStream->rewind();
3705 uint32_t opcode_vkCreateComputePipelines = OP_vkCreateComputePipelines;
3706 stream->write(&opcode_vkCreateComputePipelines, sizeof(uint32_t));
3707 stream->write(&packetSize_vkCreateComputePipelines, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003708 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
3709 stream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache));
3710 stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003711 for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i)
3712 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003713 marshal_VkComputePipelineCreateInfo(stream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003714 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003715 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3716 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003717 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003718 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003719 }
3720 stream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
3721 stream->read((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003722 if (pPipelines)
3723 {
3724 resources->createMapping()->mapHandles_VkPipeline((VkPipeline*)pPipelines, ((createInfoCount)));
3725 }
3726 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003727 VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0;
3728 stream->read(&vkCreateComputePipelines_VkResult_return, sizeof(VkResult));
3729 return vkCreateComputePipelines_VkResult_return;
3730}
3731
3732void VkEncoder::vkDestroyPipeline(
3733 VkDevice device,
3734 VkPipeline pipeline,
3735 const VkAllocationCallbacks* pAllocator)
3736{
3737 auto stream = mImpl->stream();
3738 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003739 auto resources = mImpl->resources();
3740 auto pool = mImpl->pool();
3741 VkDevice local_device;
3742 local_device = device;
3743 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3744 VkAllocationCallbacks* local_pAllocator;
3745 local_pAllocator = nullptr;
3746 if (pAllocator)
3747 {
3748 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3749 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3750 }
3751 if (local_pAllocator)
3752 {
3753 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3754 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003755 countingStream->rewind();
3756 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003757 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003758 countingStream->write((VkPipeline*)&pipeline, sizeof(VkPipeline));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003759 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3760 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003761 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003762 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003763 }
3764 }
3765 uint32_t packetSize_vkDestroyPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3766 countingStream->rewind();
3767 uint32_t opcode_vkDestroyPipeline = OP_vkDestroyPipeline;
3768 stream->write(&opcode_vkDestroyPipeline, sizeof(uint32_t));
3769 stream->write(&packetSize_vkDestroyPipeline, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003770 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003771 stream->write((VkPipeline*)&pipeline, sizeof(VkPipeline));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003772 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3773 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003774 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003775 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003776 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003777 resources->destroyMapping()->mapHandles_VkPipeline((VkPipeline*)&pipeline);
3778 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003779}
3780
3781VkResult VkEncoder::vkCreatePipelineLayout(
3782 VkDevice device,
3783 const VkPipelineLayoutCreateInfo* pCreateInfo,
3784 const VkAllocationCallbacks* pAllocator,
3785 VkPipelineLayout* pPipelineLayout)
3786{
3787 auto stream = mImpl->stream();
3788 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003789 auto resources = mImpl->resources();
3790 auto pool = mImpl->pool();
3791 VkDevice local_device;
3792 local_device = device;
3793 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3794 VkPipelineLayoutCreateInfo* local_pCreateInfo;
3795 local_pCreateInfo = nullptr;
3796 if (pCreateInfo)
3797 {
3798 local_pCreateInfo = (VkPipelineLayoutCreateInfo*)pool->alloc(sizeof(const VkPipelineLayoutCreateInfo));
3799 deepcopy_VkPipelineLayoutCreateInfo(pool, pCreateInfo, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
3800 }
3801 if (local_pCreateInfo)
3802 {
3803 handlemap_VkPipelineLayoutCreateInfo(resources->unwrapMapping(), (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
3804 }
3805 VkAllocationCallbacks* local_pAllocator;
3806 local_pAllocator = nullptr;
3807 if (pAllocator)
3808 {
3809 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3810 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3811 }
3812 if (local_pAllocator)
3813 {
3814 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3815 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003816 countingStream->rewind();
3817 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003818 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
3819 marshal_VkPipelineLayoutCreateInfo(countingStream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
3820 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3821 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003822 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003823 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003824 }
3825 countingStream->write((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout));
3826 }
3827 uint32_t packetSize_vkCreatePipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3828 countingStream->rewind();
3829 uint32_t opcode_vkCreatePipelineLayout = OP_vkCreatePipelineLayout;
3830 stream->write(&opcode_vkCreatePipelineLayout, sizeof(uint32_t));
3831 stream->write(&packetSize_vkCreatePipelineLayout, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003832 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
3833 marshal_VkPipelineLayoutCreateInfo(stream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo));
3834 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3835 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003836 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003837 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003838 }
3839 stream->write((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout));
3840 stream->read((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003841 if (pPipelineLayout)
3842 {
3843 resources->createMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)pPipelineLayout, 1);
3844 }
3845 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003846 VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0;
3847 stream->read(&vkCreatePipelineLayout_VkResult_return, sizeof(VkResult));
3848 return vkCreatePipelineLayout_VkResult_return;
3849}
3850
3851void VkEncoder::vkDestroyPipelineLayout(
3852 VkDevice device,
3853 VkPipelineLayout pipelineLayout,
3854 const VkAllocationCallbacks* pAllocator)
3855{
3856 auto stream = mImpl->stream();
3857 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003858 auto resources = mImpl->resources();
3859 auto pool = mImpl->pool();
3860 VkDevice local_device;
3861 local_device = device;
3862 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3863 VkAllocationCallbacks* local_pAllocator;
3864 local_pAllocator = nullptr;
3865 if (pAllocator)
3866 {
3867 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3868 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3869 }
3870 if (local_pAllocator)
3871 {
3872 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3873 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003874 countingStream->rewind();
3875 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003876 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003877 countingStream->write((VkPipelineLayout*)&pipelineLayout, sizeof(VkPipelineLayout));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003878 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3879 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003880 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003881 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003882 }
3883 }
3884 uint32_t packetSize_vkDestroyPipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3885 countingStream->rewind();
3886 uint32_t opcode_vkDestroyPipelineLayout = OP_vkDestroyPipelineLayout;
3887 stream->write(&opcode_vkDestroyPipelineLayout, sizeof(uint32_t));
3888 stream->write(&packetSize_vkDestroyPipelineLayout, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003889 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003890 stream->write((VkPipelineLayout*)&pipelineLayout, sizeof(VkPipelineLayout));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003891 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3892 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003893 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003894 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003895 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003896 resources->destroyMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&pipelineLayout);
3897 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003898}
3899
3900VkResult VkEncoder::vkCreateSampler(
3901 VkDevice device,
3902 const VkSamplerCreateInfo* pCreateInfo,
3903 const VkAllocationCallbacks* pAllocator,
3904 VkSampler* pSampler)
3905{
3906 auto stream = mImpl->stream();
3907 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003908 auto resources = mImpl->resources();
3909 auto pool = mImpl->pool();
3910 VkDevice local_device;
3911 local_device = device;
3912 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3913 VkSamplerCreateInfo* local_pCreateInfo;
3914 local_pCreateInfo = nullptr;
3915 if (pCreateInfo)
3916 {
3917 local_pCreateInfo = (VkSamplerCreateInfo*)pool->alloc(sizeof(const VkSamplerCreateInfo));
3918 deepcopy_VkSamplerCreateInfo(pool, pCreateInfo, (VkSamplerCreateInfo*)(local_pCreateInfo));
3919 }
3920 if (local_pCreateInfo)
3921 {
3922 handlemap_VkSamplerCreateInfo(resources->unwrapMapping(), (VkSamplerCreateInfo*)(local_pCreateInfo));
3923 }
3924 VkAllocationCallbacks* local_pAllocator;
3925 local_pAllocator = nullptr;
3926 if (pAllocator)
3927 {
3928 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3929 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3930 }
3931 if (local_pAllocator)
3932 {
3933 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3934 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003935 countingStream->rewind();
3936 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003937 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
3938 marshal_VkSamplerCreateInfo(countingStream, (VkSamplerCreateInfo*)(local_pCreateInfo));
3939 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3940 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003941 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003942 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003943 }
3944 countingStream->write((VkSampler*)pSampler, sizeof(VkSampler));
3945 }
3946 uint32_t packetSize_vkCreateSampler = 4 + 4 + (uint32_t)countingStream->bytesWritten();
3947 countingStream->rewind();
3948 uint32_t opcode_vkCreateSampler = OP_vkCreateSampler;
3949 stream->write(&opcode_vkCreateSampler, sizeof(uint32_t));
3950 stream->write(&packetSize_vkCreateSampler, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003951 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
3952 marshal_VkSamplerCreateInfo(stream, (VkSamplerCreateInfo*)(local_pCreateInfo));
3953 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3954 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003955 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003956 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003957 }
3958 stream->write((VkSampler*)pSampler, sizeof(VkSampler));
3959 stream->read((VkSampler*)pSampler, sizeof(VkSampler));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003960 if (pSampler)
3961 {
3962 resources->createMapping()->mapHandles_VkSampler((VkSampler*)pSampler, 1);
3963 }
3964 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003965 VkResult vkCreateSampler_VkResult_return = (VkResult)0;
3966 stream->read(&vkCreateSampler_VkResult_return, sizeof(VkResult));
3967 return vkCreateSampler_VkResult_return;
3968}
3969
3970void VkEncoder::vkDestroySampler(
3971 VkDevice device,
3972 VkSampler sampler,
3973 const VkAllocationCallbacks* pAllocator)
3974{
3975 auto stream = mImpl->stream();
3976 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003977 auto resources = mImpl->resources();
3978 auto pool = mImpl->pool();
3979 VkDevice local_device;
3980 local_device = device;
3981 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
3982 VkAllocationCallbacks* local_pAllocator;
3983 local_pAllocator = nullptr;
3984 if (pAllocator)
3985 {
3986 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
3987 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
3988 }
3989 if (local_pAllocator)
3990 {
3991 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
3992 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003993 countingStream->rewind();
3994 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003995 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003996 countingStream->write((VkSampler*)&sampler, sizeof(VkSampler));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08003997 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
3998 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07003999 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004000 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004001 }
4002 }
4003 uint32_t packetSize_vkDestroySampler = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4004 countingStream->rewind();
4005 uint32_t opcode_vkDestroySampler = OP_vkDestroySampler;
4006 stream->write(&opcode_vkDestroySampler, sizeof(uint32_t));
4007 stream->write(&packetSize_vkDestroySampler, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004008 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004009 stream->write((VkSampler*)&sampler, sizeof(VkSampler));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004010 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4011 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004012 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004013 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004014 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004015 resources->destroyMapping()->mapHandles_VkSampler((VkSampler*)&sampler);
4016 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004017}
4018
4019VkResult VkEncoder::vkCreateDescriptorSetLayout(
4020 VkDevice device,
4021 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
4022 const VkAllocationCallbacks* pAllocator,
4023 VkDescriptorSetLayout* pSetLayout)
4024{
4025 auto stream = mImpl->stream();
4026 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004027 auto resources = mImpl->resources();
4028 auto pool = mImpl->pool();
4029 VkDevice local_device;
4030 local_device = device;
4031 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4032 VkDescriptorSetLayoutCreateInfo* local_pCreateInfo;
4033 local_pCreateInfo = nullptr;
4034 if (pCreateInfo)
4035 {
4036 local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo));
4037 deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
4038 }
4039 if (local_pCreateInfo)
4040 {
4041 handlemap_VkDescriptorSetLayoutCreateInfo(resources->unwrapMapping(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
4042 }
4043 VkAllocationCallbacks* local_pAllocator;
4044 local_pAllocator = nullptr;
4045 if (pAllocator)
4046 {
4047 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4048 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4049 }
4050 if (local_pAllocator)
4051 {
4052 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4053 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004054 countingStream->rewind();
4055 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004056 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4057 marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
4058 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4059 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004060 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004061 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004062 }
4063 countingStream->write((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout));
4064 }
4065 uint32_t packetSize_vkCreateDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4066 countingStream->rewind();
4067 uint32_t opcode_vkCreateDescriptorSetLayout = OP_vkCreateDescriptorSetLayout;
4068 stream->write(&opcode_vkCreateDescriptorSetLayout, sizeof(uint32_t));
4069 stream->write(&packetSize_vkCreateDescriptorSetLayout, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004070 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4071 marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
4072 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4073 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004074 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004075 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004076 }
4077 stream->write((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout));
4078 stream->read((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004079 if (pSetLayout)
4080 {
4081 resources->createMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)pSetLayout, 1);
4082 }
4083 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004084 VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0;
4085 stream->read(&vkCreateDescriptorSetLayout_VkResult_return, sizeof(VkResult));
4086 return vkCreateDescriptorSetLayout_VkResult_return;
4087}
4088
4089void VkEncoder::vkDestroyDescriptorSetLayout(
4090 VkDevice device,
4091 VkDescriptorSetLayout descriptorSetLayout,
4092 const VkAllocationCallbacks* pAllocator)
4093{
4094 auto stream = mImpl->stream();
4095 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004096 auto resources = mImpl->resources();
4097 auto pool = mImpl->pool();
4098 VkDevice local_device;
4099 local_device = device;
4100 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4101 VkAllocationCallbacks* local_pAllocator;
4102 local_pAllocator = nullptr;
4103 if (pAllocator)
4104 {
4105 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4106 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4107 }
4108 if (local_pAllocator)
4109 {
4110 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4111 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004112 countingStream->rewind();
4113 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004114 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004115 countingStream->write((VkDescriptorSetLayout*)&descriptorSetLayout, sizeof(VkDescriptorSetLayout));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004116 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4117 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004118 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004119 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004120 }
4121 }
4122 uint32_t packetSize_vkDestroyDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4123 countingStream->rewind();
4124 uint32_t opcode_vkDestroyDescriptorSetLayout = OP_vkDestroyDescriptorSetLayout;
4125 stream->write(&opcode_vkDestroyDescriptorSetLayout, sizeof(uint32_t));
4126 stream->write(&packetSize_vkDestroyDescriptorSetLayout, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004127 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004128 stream->write((VkDescriptorSetLayout*)&descriptorSetLayout, sizeof(VkDescriptorSetLayout));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004129 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4130 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004131 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004132 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004133 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004134 resources->destroyMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)&descriptorSetLayout);
4135 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004136}
4137
4138VkResult VkEncoder::vkCreateDescriptorPool(
4139 VkDevice device,
4140 const VkDescriptorPoolCreateInfo* pCreateInfo,
4141 const VkAllocationCallbacks* pAllocator,
4142 VkDescriptorPool* pDescriptorPool)
4143{
4144 auto stream = mImpl->stream();
4145 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004146 auto resources = mImpl->resources();
4147 auto pool = mImpl->pool();
4148 VkDevice local_device;
4149 local_device = device;
4150 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4151 VkDescriptorPoolCreateInfo* local_pCreateInfo;
4152 local_pCreateInfo = nullptr;
4153 if (pCreateInfo)
4154 {
4155 local_pCreateInfo = (VkDescriptorPoolCreateInfo*)pool->alloc(sizeof(const VkDescriptorPoolCreateInfo));
4156 deepcopy_VkDescriptorPoolCreateInfo(pool, pCreateInfo, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
4157 }
4158 if (local_pCreateInfo)
4159 {
4160 handlemap_VkDescriptorPoolCreateInfo(resources->unwrapMapping(), (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
4161 }
4162 VkAllocationCallbacks* local_pAllocator;
4163 local_pAllocator = nullptr;
4164 if (pAllocator)
4165 {
4166 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4167 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4168 }
4169 if (local_pAllocator)
4170 {
4171 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4172 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004173 countingStream->rewind();
4174 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004175 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4176 marshal_VkDescriptorPoolCreateInfo(countingStream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
4177 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4178 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004179 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004180 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004181 }
4182 countingStream->write((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool));
4183 }
4184 uint32_t packetSize_vkCreateDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4185 countingStream->rewind();
4186 uint32_t opcode_vkCreateDescriptorPool = OP_vkCreateDescriptorPool;
4187 stream->write(&opcode_vkCreateDescriptorPool, sizeof(uint32_t));
4188 stream->write(&packetSize_vkCreateDescriptorPool, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004189 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4190 marshal_VkDescriptorPoolCreateInfo(stream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo));
4191 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4192 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004193 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004194 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004195 }
4196 stream->write((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool));
4197 stream->read((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004198 if (pDescriptorPool)
4199 {
4200 resources->createMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)pDescriptorPool, 1);
4201 }
4202 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004203 VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0;
4204 stream->read(&vkCreateDescriptorPool_VkResult_return, sizeof(VkResult));
4205 return vkCreateDescriptorPool_VkResult_return;
4206}
4207
4208void VkEncoder::vkDestroyDescriptorPool(
4209 VkDevice device,
4210 VkDescriptorPool descriptorPool,
4211 const VkAllocationCallbacks* pAllocator)
4212{
4213 auto stream = mImpl->stream();
4214 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004215 auto resources = mImpl->resources();
4216 auto pool = mImpl->pool();
4217 VkDevice local_device;
4218 local_device = device;
4219 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4220 VkAllocationCallbacks* local_pAllocator;
4221 local_pAllocator = nullptr;
4222 if (pAllocator)
4223 {
4224 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4225 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4226 }
4227 if (local_pAllocator)
4228 {
4229 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4230 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004231 countingStream->rewind();
4232 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004233 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004234 countingStream->write((VkDescriptorPool*)&descriptorPool, sizeof(VkDescriptorPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004235 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4236 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004237 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004238 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004239 }
4240 }
4241 uint32_t packetSize_vkDestroyDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4242 countingStream->rewind();
4243 uint32_t opcode_vkDestroyDescriptorPool = OP_vkDestroyDescriptorPool;
4244 stream->write(&opcode_vkDestroyDescriptorPool, sizeof(uint32_t));
4245 stream->write(&packetSize_vkDestroyDescriptorPool, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004246 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004247 stream->write((VkDescriptorPool*)&descriptorPool, sizeof(VkDescriptorPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004248 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4249 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004250 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004251 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004252 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004253 resources->destroyMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&descriptorPool);
4254 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004255}
4256
4257VkResult VkEncoder::vkResetDescriptorPool(
4258 VkDevice device,
4259 VkDescriptorPool descriptorPool,
4260 VkDescriptorPoolResetFlags flags)
4261{
4262 auto stream = mImpl->stream();
4263 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004264 auto resources = mImpl->resources();
4265 auto pool = mImpl->pool();
4266 VkDevice local_device;
4267 local_device = device;
4268 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4269 VkDescriptorPool local_descriptorPool;
4270 local_descriptorPool = descriptorPool;
4271 resources->unwrapMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&local_descriptorPool);
4272 VkDescriptorPoolResetFlags local_flags;
4273 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004274 countingStream->rewind();
4275 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004276 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4277 countingStream->write((VkDescriptorPool*)&local_descriptorPool, sizeof(VkDescriptorPool));
4278 countingStream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004279 }
4280 uint32_t packetSize_vkResetDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4281 countingStream->rewind();
4282 uint32_t opcode_vkResetDescriptorPool = OP_vkResetDescriptorPool;
4283 stream->write(&opcode_vkResetDescriptorPool, sizeof(uint32_t));
4284 stream->write(&packetSize_vkResetDescriptorPool, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004285 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4286 stream->write((VkDescriptorPool*)&local_descriptorPool, sizeof(VkDescriptorPool));
4287 stream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags));
4288 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004289 VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0;
4290 stream->read(&vkResetDescriptorPool_VkResult_return, sizeof(VkResult));
4291 return vkResetDescriptorPool_VkResult_return;
4292}
4293
4294VkResult VkEncoder::vkAllocateDescriptorSets(
4295 VkDevice device,
4296 const VkDescriptorSetAllocateInfo* pAllocateInfo,
4297 VkDescriptorSet* pDescriptorSets)
4298{
4299 auto stream = mImpl->stream();
4300 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004301 auto resources = mImpl->resources();
4302 auto pool = mImpl->pool();
4303 VkDevice local_device;
4304 local_device = device;
4305 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4306 VkDescriptorSetAllocateInfo* local_pAllocateInfo;
4307 local_pAllocateInfo = nullptr;
4308 if (pAllocateInfo)
4309 {
4310 local_pAllocateInfo = (VkDescriptorSetAllocateInfo*)pool->alloc(sizeof(const VkDescriptorSetAllocateInfo));
4311 deepcopy_VkDescriptorSetAllocateInfo(pool, pAllocateInfo, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
4312 }
4313 if (local_pAllocateInfo)
4314 {
4315 handlemap_VkDescriptorSetAllocateInfo(resources->unwrapMapping(), (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
4316 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004317 countingStream->rewind();
4318 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004319 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4320 marshal_VkDescriptorSetAllocateInfo(countingStream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004321 countingStream->write((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet));
4322 }
4323 uint32_t packetSize_vkAllocateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4324 countingStream->rewind();
4325 uint32_t opcode_vkAllocateDescriptorSets = OP_vkAllocateDescriptorSets;
4326 stream->write(&opcode_vkAllocateDescriptorSets, sizeof(uint32_t));
4327 stream->write(&packetSize_vkAllocateDescriptorSets, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004328 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4329 marshal_VkDescriptorSetAllocateInfo(stream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004330 stream->write((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet));
4331 stream->read((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004332 if (pDescriptorSets)
4333 {
4334 resources->createMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount);
4335 }
4336 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004337 VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0;
4338 stream->read(&vkAllocateDescriptorSets_VkResult_return, sizeof(VkResult));
4339 return vkAllocateDescriptorSets_VkResult_return;
4340}
4341
4342VkResult VkEncoder::vkFreeDescriptorSets(
4343 VkDevice device,
4344 VkDescriptorPool descriptorPool,
4345 uint32_t descriptorSetCount,
4346 const VkDescriptorSet* pDescriptorSets)
4347{
4348 auto stream = mImpl->stream();
4349 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004350 auto resources = mImpl->resources();
4351 auto pool = mImpl->pool();
4352 VkDevice local_device;
4353 local_device = device;
4354 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4355 VkDescriptorPool local_descriptorPool;
4356 local_descriptorPool = descriptorPool;
4357 resources->unwrapMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&local_descriptorPool);
4358 uint32_t local_descriptorSetCount;
4359 local_descriptorSetCount = descriptorSetCount;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004360 countingStream->rewind();
4361 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004362 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4363 countingStream->write((VkDescriptorPool*)&local_descriptorPool, sizeof(VkDescriptorPool));
4364 countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004365 countingStream->write((const VkDescriptorSet**)&pDescriptorSets, sizeof(const VkDescriptorSet*));
4366 if (pDescriptorSets)
4367 {
4368 countingStream->write((const VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet));
4369 }
4370 }
4371 uint32_t packetSize_vkFreeDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4372 countingStream->rewind();
4373 uint32_t opcode_vkFreeDescriptorSets = OP_vkFreeDescriptorSets;
4374 stream->write(&opcode_vkFreeDescriptorSets, sizeof(uint32_t));
4375 stream->write(&packetSize_vkFreeDescriptorSets, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004376 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4377 stream->write((VkDescriptorPool*)&local_descriptorPool, sizeof(VkDescriptorPool));
4378 stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004379 stream->write((const VkDescriptorSet**)&pDescriptorSets, sizeof(const VkDescriptorSet*));
4380 if (pDescriptorSets)
4381 {
4382 stream->write((const VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet));
4383 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004384 if (pDescriptorSets)
4385 {
4386 resources->destroyMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount)));
4387 }
4388 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004389 VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0;
4390 stream->read(&vkFreeDescriptorSets_VkResult_return, sizeof(VkResult));
4391 return vkFreeDescriptorSets_VkResult_return;
4392}
4393
4394void VkEncoder::vkUpdateDescriptorSets(
4395 VkDevice device,
4396 uint32_t descriptorWriteCount,
4397 const VkWriteDescriptorSet* pDescriptorWrites,
4398 uint32_t descriptorCopyCount,
4399 const VkCopyDescriptorSet* pDescriptorCopies)
4400{
4401 auto stream = mImpl->stream();
4402 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004403 auto resources = mImpl->resources();
4404 auto pool = mImpl->pool();
4405 VkDevice local_device;
4406 local_device = device;
4407 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4408 uint32_t local_descriptorWriteCount;
4409 local_descriptorWriteCount = descriptorWriteCount;
4410 VkWriteDescriptorSet* local_pDescriptorWrites;
4411 local_pDescriptorWrites = nullptr;
4412 if (pDescriptorWrites)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004413 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004414 local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004415 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
4416 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004417 deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004418 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004419 }
4420 if (local_pDescriptorWrites)
4421 {
4422 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
4423 {
4424 handlemap_VkWriteDescriptorSet(resources->unwrapMapping(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
4425 }
4426 }
4427 uint32_t local_descriptorCopyCount;
4428 local_descriptorCopyCount = descriptorCopyCount;
4429 VkCopyDescriptorSet* local_pDescriptorCopies;
4430 local_pDescriptorCopies = nullptr;
4431 if (pDescriptorCopies)
4432 {
4433 local_pDescriptorCopies = (VkCopyDescriptorSet*)pool->alloc(((descriptorCopyCount)) * sizeof(const VkCopyDescriptorSet));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004434 for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i)
4435 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004436 deepcopy_VkCopyDescriptorSet(pool, pDescriptorCopies + i, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i));
4437 }
4438 }
4439 if (local_pDescriptorCopies)
4440 {
4441 for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i)
4442 {
4443 handlemap_VkCopyDescriptorSet(resources->unwrapMapping(), (VkCopyDescriptorSet*)(local_pDescriptorCopies + i));
4444 }
4445 }
4446 countingStream->rewind();
4447 {
4448 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4449 countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
4450 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
4451 {
4452 marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
4453 }
4454 countingStream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t));
4455 for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i)
4456 {
4457 marshal_VkCopyDescriptorSet(countingStream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004458 }
4459 }
4460 uint32_t packetSize_vkUpdateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4461 countingStream->rewind();
4462 uint32_t opcode_vkUpdateDescriptorSets = OP_vkUpdateDescriptorSets;
4463 stream->write(&opcode_vkUpdateDescriptorSets, sizeof(uint32_t));
4464 stream->write(&packetSize_vkUpdateDescriptorSets, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004465 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4466 stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004467 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
4468 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004469 marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004470 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004471 stream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004472 for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i)
4473 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004474 marshal_VkCopyDescriptorSet(stream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004475 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004476 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004477}
4478
4479VkResult VkEncoder::vkCreateFramebuffer(
4480 VkDevice device,
4481 const VkFramebufferCreateInfo* pCreateInfo,
4482 const VkAllocationCallbacks* pAllocator,
4483 VkFramebuffer* pFramebuffer)
4484{
4485 auto stream = mImpl->stream();
4486 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004487 auto resources = mImpl->resources();
4488 auto pool = mImpl->pool();
4489 VkDevice local_device;
4490 local_device = device;
4491 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4492 VkFramebufferCreateInfo* local_pCreateInfo;
4493 local_pCreateInfo = nullptr;
4494 if (pCreateInfo)
4495 {
4496 local_pCreateInfo = (VkFramebufferCreateInfo*)pool->alloc(sizeof(const VkFramebufferCreateInfo));
4497 deepcopy_VkFramebufferCreateInfo(pool, pCreateInfo, (VkFramebufferCreateInfo*)(local_pCreateInfo));
4498 }
4499 if (local_pCreateInfo)
4500 {
4501 handlemap_VkFramebufferCreateInfo(resources->unwrapMapping(), (VkFramebufferCreateInfo*)(local_pCreateInfo));
4502 }
4503 VkAllocationCallbacks* local_pAllocator;
4504 local_pAllocator = nullptr;
4505 if (pAllocator)
4506 {
4507 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4508 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4509 }
4510 if (local_pAllocator)
4511 {
4512 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4513 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004514 countingStream->rewind();
4515 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004516 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4517 marshal_VkFramebufferCreateInfo(countingStream, (VkFramebufferCreateInfo*)(local_pCreateInfo));
4518 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4519 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 }
4523 countingStream->write((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer));
4524 }
4525 uint32_t packetSize_vkCreateFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4526 countingStream->rewind();
4527 uint32_t opcode_vkCreateFramebuffer = OP_vkCreateFramebuffer;
4528 stream->write(&opcode_vkCreateFramebuffer, sizeof(uint32_t));
4529 stream->write(&packetSize_vkCreateFramebuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004530 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4531 marshal_VkFramebufferCreateInfo(stream, (VkFramebufferCreateInfo*)(local_pCreateInfo));
4532 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4533 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004534 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004535 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004536 }
4537 stream->write((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer));
4538 stream->read((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004539 if (pFramebuffer)
4540 {
4541 resources->createMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)pFramebuffer, 1);
4542 }
4543 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004544 VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0;
4545 stream->read(&vkCreateFramebuffer_VkResult_return, sizeof(VkResult));
4546 return vkCreateFramebuffer_VkResult_return;
4547}
4548
4549void VkEncoder::vkDestroyFramebuffer(
4550 VkDevice device,
4551 VkFramebuffer framebuffer,
4552 const VkAllocationCallbacks* pAllocator)
4553{
4554 auto stream = mImpl->stream();
4555 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004556 auto resources = mImpl->resources();
4557 auto pool = mImpl->pool();
4558 VkDevice local_device;
4559 local_device = device;
4560 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4561 VkAllocationCallbacks* local_pAllocator;
4562 local_pAllocator = nullptr;
4563 if (pAllocator)
4564 {
4565 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4566 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4567 }
4568 if (local_pAllocator)
4569 {
4570 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4571 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004572 countingStream->rewind();
4573 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004574 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004575 countingStream->write((VkFramebuffer*)&framebuffer, sizeof(VkFramebuffer));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004576 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4577 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004578 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004579 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004580 }
4581 }
4582 uint32_t packetSize_vkDestroyFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4583 countingStream->rewind();
4584 uint32_t opcode_vkDestroyFramebuffer = OP_vkDestroyFramebuffer;
4585 stream->write(&opcode_vkDestroyFramebuffer, sizeof(uint32_t));
4586 stream->write(&packetSize_vkDestroyFramebuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004587 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004588 stream->write((VkFramebuffer*)&framebuffer, sizeof(VkFramebuffer));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004589 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4590 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004591 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004592 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004593 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004594 resources->destroyMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&framebuffer);
4595 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004596}
4597
4598VkResult VkEncoder::vkCreateRenderPass(
4599 VkDevice device,
4600 const VkRenderPassCreateInfo* pCreateInfo,
4601 const VkAllocationCallbacks* pAllocator,
4602 VkRenderPass* pRenderPass)
4603{
4604 auto stream = mImpl->stream();
4605 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004606 auto resources = mImpl->resources();
4607 auto pool = mImpl->pool();
4608 VkDevice local_device;
4609 local_device = device;
4610 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4611 VkRenderPassCreateInfo* local_pCreateInfo;
4612 local_pCreateInfo = nullptr;
4613 if (pCreateInfo)
4614 {
4615 local_pCreateInfo = (VkRenderPassCreateInfo*)pool->alloc(sizeof(const VkRenderPassCreateInfo));
4616 deepcopy_VkRenderPassCreateInfo(pool, pCreateInfo, (VkRenderPassCreateInfo*)(local_pCreateInfo));
4617 }
4618 if (local_pCreateInfo)
4619 {
4620 handlemap_VkRenderPassCreateInfo(resources->unwrapMapping(), (VkRenderPassCreateInfo*)(local_pCreateInfo));
4621 }
4622 VkAllocationCallbacks* local_pAllocator;
4623 local_pAllocator = nullptr;
4624 if (pAllocator)
4625 {
4626 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4627 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4628 }
4629 if (local_pAllocator)
4630 {
4631 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4632 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004633 countingStream->rewind();
4634 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004635 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4636 marshal_VkRenderPassCreateInfo(countingStream, (VkRenderPassCreateInfo*)(local_pCreateInfo));
4637 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4638 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004639 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004640 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004641 }
4642 countingStream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
4643 }
4644 uint32_t packetSize_vkCreateRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4645 countingStream->rewind();
4646 uint32_t opcode_vkCreateRenderPass = OP_vkCreateRenderPass;
4647 stream->write(&opcode_vkCreateRenderPass, sizeof(uint32_t));
4648 stream->write(&packetSize_vkCreateRenderPass, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004649 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4650 marshal_VkRenderPassCreateInfo(stream, (VkRenderPassCreateInfo*)(local_pCreateInfo));
4651 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4652 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004653 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004654 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004655 }
4656 stream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
4657 stream->read((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004658 if (pRenderPass)
4659 {
4660 resources->createMapping()->mapHandles_VkRenderPass((VkRenderPass*)pRenderPass, 1);
4661 }
4662 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004663 VkResult vkCreateRenderPass_VkResult_return = (VkResult)0;
4664 stream->read(&vkCreateRenderPass_VkResult_return, sizeof(VkResult));
4665 return vkCreateRenderPass_VkResult_return;
4666}
4667
4668void VkEncoder::vkDestroyRenderPass(
4669 VkDevice device,
4670 VkRenderPass renderPass,
4671 const VkAllocationCallbacks* pAllocator)
4672{
4673 auto stream = mImpl->stream();
4674 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004675 auto resources = mImpl->resources();
4676 auto pool = mImpl->pool();
4677 VkDevice local_device;
4678 local_device = device;
4679 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4680 VkAllocationCallbacks* local_pAllocator;
4681 local_pAllocator = nullptr;
4682 if (pAllocator)
4683 {
4684 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4685 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4686 }
4687 if (local_pAllocator)
4688 {
4689 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4690 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004691 countingStream->rewind();
4692 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004693 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004694 countingStream->write((VkRenderPass*)&renderPass, sizeof(VkRenderPass));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004695 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4696 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004697 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004698 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004699 }
4700 }
4701 uint32_t packetSize_vkDestroyRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4702 countingStream->rewind();
4703 uint32_t opcode_vkDestroyRenderPass = OP_vkDestroyRenderPass;
4704 stream->write(&opcode_vkDestroyRenderPass, sizeof(uint32_t));
4705 stream->write(&packetSize_vkDestroyRenderPass, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004706 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004707 stream->write((VkRenderPass*)&renderPass, sizeof(VkRenderPass));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004708 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4709 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004710 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004711 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004712 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004713 resources->destroyMapping()->mapHandles_VkRenderPass((VkRenderPass*)&renderPass);
4714 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004715}
4716
4717void VkEncoder::vkGetRenderAreaGranularity(
4718 VkDevice device,
4719 VkRenderPass renderPass,
4720 VkExtent2D* pGranularity)
4721{
4722 auto stream = mImpl->stream();
4723 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004724 auto resources = mImpl->resources();
4725 auto pool = mImpl->pool();
4726 VkDevice local_device;
4727 local_device = device;
4728 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4729 VkRenderPass local_renderPass;
4730 local_renderPass = renderPass;
4731 resources->unwrapMapping()->mapHandles_VkRenderPass((VkRenderPass*)&local_renderPass);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004732 countingStream->rewind();
4733 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004734 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4735 countingStream->write((VkRenderPass*)&local_renderPass, sizeof(VkRenderPass));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004736 marshal_VkExtent2D(countingStream, (VkExtent2D*)(pGranularity));
4737 }
4738 uint32_t packetSize_vkGetRenderAreaGranularity = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4739 countingStream->rewind();
4740 uint32_t opcode_vkGetRenderAreaGranularity = OP_vkGetRenderAreaGranularity;
4741 stream->write(&opcode_vkGetRenderAreaGranularity, sizeof(uint32_t));
4742 stream->write(&packetSize_vkGetRenderAreaGranularity, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004743 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4744 stream->write((VkRenderPass*)&local_renderPass, sizeof(VkRenderPass));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004745 marshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity));
4746 unmarshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004747 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004748}
4749
4750VkResult VkEncoder::vkCreateCommandPool(
4751 VkDevice device,
4752 const VkCommandPoolCreateInfo* pCreateInfo,
4753 const VkAllocationCallbacks* pAllocator,
4754 VkCommandPool* pCommandPool)
4755{
4756 auto stream = mImpl->stream();
4757 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004758 auto resources = mImpl->resources();
4759 auto pool = mImpl->pool();
4760 VkDevice local_device;
4761 local_device = device;
4762 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4763 VkCommandPoolCreateInfo* local_pCreateInfo;
4764 local_pCreateInfo = nullptr;
4765 if (pCreateInfo)
4766 {
4767 local_pCreateInfo = (VkCommandPoolCreateInfo*)pool->alloc(sizeof(const VkCommandPoolCreateInfo));
4768 deepcopy_VkCommandPoolCreateInfo(pool, pCreateInfo, (VkCommandPoolCreateInfo*)(local_pCreateInfo));
4769 }
4770 if (local_pCreateInfo)
4771 {
4772 handlemap_VkCommandPoolCreateInfo(resources->unwrapMapping(), (VkCommandPoolCreateInfo*)(local_pCreateInfo));
4773 }
4774 VkAllocationCallbacks* local_pAllocator;
4775 local_pAllocator = nullptr;
4776 if (pAllocator)
4777 {
4778 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4779 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4780 }
4781 if (local_pAllocator)
4782 {
4783 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4784 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004785 countingStream->rewind();
4786 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004787 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4788 marshal_VkCommandPoolCreateInfo(countingStream, (VkCommandPoolCreateInfo*)(local_pCreateInfo));
4789 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4790 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004791 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004792 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004793 }
4794 countingStream->write((VkCommandPool*)pCommandPool, sizeof(VkCommandPool));
4795 }
4796 uint32_t packetSize_vkCreateCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4797 countingStream->rewind();
4798 uint32_t opcode_vkCreateCommandPool = OP_vkCreateCommandPool;
4799 stream->write(&opcode_vkCreateCommandPool, sizeof(uint32_t));
4800 stream->write(&packetSize_vkCreateCommandPool, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004801 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4802 marshal_VkCommandPoolCreateInfo(stream, (VkCommandPoolCreateInfo*)(local_pCreateInfo));
4803 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4804 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004805 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004806 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004807 }
4808 stream->write((VkCommandPool*)pCommandPool, sizeof(VkCommandPool));
4809 stream->read((VkCommandPool*)pCommandPool, sizeof(VkCommandPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004810 if (pCommandPool)
4811 {
4812 resources->createMapping()->mapHandles_VkCommandPool((VkCommandPool*)pCommandPool, 1);
4813 }
4814 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004815 VkResult vkCreateCommandPool_VkResult_return = (VkResult)0;
4816 stream->read(&vkCreateCommandPool_VkResult_return, sizeof(VkResult));
4817 return vkCreateCommandPool_VkResult_return;
4818}
4819
4820void VkEncoder::vkDestroyCommandPool(
4821 VkDevice device,
4822 VkCommandPool commandPool,
4823 const VkAllocationCallbacks* pAllocator)
4824{
4825 auto stream = mImpl->stream();
4826 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004827 auto resources = mImpl->resources();
4828 auto pool = mImpl->pool();
4829 VkDevice local_device;
4830 local_device = device;
4831 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4832 VkAllocationCallbacks* local_pAllocator;
4833 local_pAllocator = nullptr;
4834 if (pAllocator)
4835 {
4836 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
4837 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
4838 }
4839 if (local_pAllocator)
4840 {
4841 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
4842 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004843 countingStream->rewind();
4844 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004845 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004846 countingStream->write((VkCommandPool*)&commandPool, sizeof(VkCommandPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004847 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4848 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004849 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004850 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004851 }
4852 }
4853 uint32_t packetSize_vkDestroyCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4854 countingStream->rewind();
4855 uint32_t opcode_vkDestroyCommandPool = OP_vkDestroyCommandPool;
4856 stream->write(&opcode_vkDestroyCommandPool, sizeof(uint32_t));
4857 stream->write(&packetSize_vkDestroyCommandPool, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004858 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004859 stream->write((VkCommandPool*)&commandPool, sizeof(VkCommandPool));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004860 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
4861 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004862 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004863 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004864 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004865 resources->destroyMapping()->mapHandles_VkCommandPool((VkCommandPool*)&commandPool);
4866 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004867}
4868
4869VkResult VkEncoder::vkResetCommandPool(
4870 VkDevice device,
4871 VkCommandPool commandPool,
4872 VkCommandPoolResetFlags flags)
4873{
4874 auto stream = mImpl->stream();
4875 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004876 auto resources = mImpl->resources();
4877 auto pool = mImpl->pool();
4878 VkDevice local_device;
4879 local_device = device;
4880 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4881 VkCommandPool local_commandPool;
4882 local_commandPool = commandPool;
4883 resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool);
4884 VkCommandPoolResetFlags local_flags;
4885 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004886 countingStream->rewind();
4887 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004888 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4889 countingStream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool));
4890 countingStream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004891 }
4892 uint32_t packetSize_vkResetCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4893 countingStream->rewind();
4894 uint32_t opcode_vkResetCommandPool = OP_vkResetCommandPool;
4895 stream->write(&opcode_vkResetCommandPool, sizeof(uint32_t));
4896 stream->write(&packetSize_vkResetCommandPool, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004897 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4898 stream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool));
4899 stream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags));
4900 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004901 VkResult vkResetCommandPool_VkResult_return = (VkResult)0;
4902 stream->read(&vkResetCommandPool_VkResult_return, sizeof(VkResult));
4903 return vkResetCommandPool_VkResult_return;
4904}
4905
4906VkResult VkEncoder::vkAllocateCommandBuffers(
4907 VkDevice device,
4908 const VkCommandBufferAllocateInfo* pAllocateInfo,
4909 VkCommandBuffer* pCommandBuffers)
4910{
4911 auto stream = mImpl->stream();
4912 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004913 auto resources = mImpl->resources();
4914 auto pool = mImpl->pool();
4915 VkDevice local_device;
4916 local_device = device;
4917 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4918 VkCommandBufferAllocateInfo* local_pAllocateInfo;
4919 local_pAllocateInfo = nullptr;
4920 if (pAllocateInfo)
4921 {
4922 local_pAllocateInfo = (VkCommandBufferAllocateInfo*)pool->alloc(sizeof(const VkCommandBufferAllocateInfo));
4923 deepcopy_VkCommandBufferAllocateInfo(pool, pAllocateInfo, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
4924 }
4925 if (local_pAllocateInfo)
4926 {
4927 handlemap_VkCommandBufferAllocateInfo(resources->unwrapMapping(), (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
4928 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004929 countingStream->rewind();
4930 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004931 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4932 marshal_VkCommandBufferAllocateInfo(countingStream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004933 countingStream->write((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer));
4934 }
4935 uint32_t packetSize_vkAllocateCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4936 countingStream->rewind();
4937 uint32_t opcode_vkAllocateCommandBuffers = OP_vkAllocateCommandBuffers;
4938 stream->write(&opcode_vkAllocateCommandBuffers, sizeof(uint32_t));
4939 stream->write(&packetSize_vkAllocateCommandBuffers, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004940 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4941 marshal_VkCommandBufferAllocateInfo(stream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004942 stream->write((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer));
4943 stream->read((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004944 if (pCommandBuffers)
4945 {
4946 resources->createMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount);
4947 }
4948 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004949 VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0;
4950 stream->read(&vkAllocateCommandBuffers_VkResult_return, sizeof(VkResult));
4951 return vkAllocateCommandBuffers_VkResult_return;
4952}
4953
4954void VkEncoder::vkFreeCommandBuffers(
4955 VkDevice device,
4956 VkCommandPool commandPool,
4957 uint32_t commandBufferCount,
4958 const VkCommandBuffer* pCommandBuffers)
4959{
4960 auto stream = mImpl->stream();
4961 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004962 auto resources = mImpl->resources();
4963 auto pool = mImpl->pool();
4964 VkDevice local_device;
4965 local_device = device;
4966 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
4967 VkCommandPool local_commandPool;
4968 local_commandPool = commandPool;
4969 resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool);
4970 uint32_t local_commandBufferCount;
4971 local_commandBufferCount = commandBufferCount;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004972 countingStream->rewind();
4973 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004974 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
4975 countingStream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool));
4976 countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004977 countingStream->write((const VkCommandBuffer**)&pCommandBuffers, sizeof(const VkCommandBuffer*));
4978 if (pCommandBuffers)
4979 {
4980 countingStream->write((const VkCommandBuffer*)pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer));
4981 }
4982 }
4983 uint32_t packetSize_vkFreeCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten();
4984 countingStream->rewind();
4985 uint32_t opcode_vkFreeCommandBuffers = OP_vkFreeCommandBuffers;
4986 stream->write(&opcode_vkFreeCommandBuffers, sizeof(uint32_t));
4987 stream->write(&packetSize_vkFreeCommandBuffers, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004988 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
4989 stream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool));
4990 stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07004991 stream->write((const VkCommandBuffer**)&pCommandBuffers, sizeof(const VkCommandBuffer*));
4992 if (pCommandBuffers)
4993 {
4994 stream->write((const VkCommandBuffer*)pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer));
4995 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08004996 if (pCommandBuffers)
4997 {
4998 resources->destroyMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, ((commandBufferCount)));
4999 }
5000 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005001}
5002
5003VkResult VkEncoder::vkBeginCommandBuffer(
5004 VkCommandBuffer commandBuffer,
5005 const VkCommandBufferBeginInfo* pBeginInfo)
5006{
5007 auto stream = mImpl->stream();
5008 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005009 auto resources = mImpl->resources();
5010 auto pool = mImpl->pool();
5011 VkCommandBuffer local_commandBuffer;
5012 local_commandBuffer = commandBuffer;
5013 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5014 VkCommandBufferBeginInfo* local_pBeginInfo;
5015 local_pBeginInfo = nullptr;
5016 if (pBeginInfo)
5017 {
5018 local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo));
5019 deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo));
5020 }
5021 if (local_pBeginInfo)
5022 {
5023 handlemap_VkCommandBufferBeginInfo(resources->unwrapMapping(), (VkCommandBufferBeginInfo*)(local_pBeginInfo));
5024 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005025 countingStream->rewind();
5026 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005027 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5028 marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005029 }
5030 uint32_t packetSize_vkBeginCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5031 countingStream->rewind();
5032 uint32_t opcode_vkBeginCommandBuffer = OP_vkBeginCommandBuffer;
5033 stream->write(&opcode_vkBeginCommandBuffer, sizeof(uint32_t));
5034 stream->write(&packetSize_vkBeginCommandBuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005035 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5036 marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo));
5037 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005038 VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0;
5039 stream->read(&vkBeginCommandBuffer_VkResult_return, sizeof(VkResult));
5040 return vkBeginCommandBuffer_VkResult_return;
5041}
5042
5043VkResult VkEncoder::vkEndCommandBuffer(
5044 VkCommandBuffer commandBuffer)
5045{
5046 auto stream = mImpl->stream();
5047 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005048 auto resources = mImpl->resources();
5049 auto pool = mImpl->pool();
5050 VkCommandBuffer local_commandBuffer;
5051 local_commandBuffer = commandBuffer;
5052 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005053 countingStream->rewind();
5054 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005055 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005056 }
5057 uint32_t packetSize_vkEndCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5058 countingStream->rewind();
5059 uint32_t opcode_vkEndCommandBuffer = OP_vkEndCommandBuffer;
5060 stream->write(&opcode_vkEndCommandBuffer, sizeof(uint32_t));
5061 stream->write(&packetSize_vkEndCommandBuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005062 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5063 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005064 VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0;
5065 stream->read(&vkEndCommandBuffer_VkResult_return, sizeof(VkResult));
5066 return vkEndCommandBuffer_VkResult_return;
5067}
5068
5069VkResult VkEncoder::vkResetCommandBuffer(
5070 VkCommandBuffer commandBuffer,
5071 VkCommandBufferResetFlags flags)
5072{
5073 auto stream = mImpl->stream();
5074 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005075 auto resources = mImpl->resources();
5076 auto pool = mImpl->pool();
5077 VkCommandBuffer local_commandBuffer;
5078 local_commandBuffer = commandBuffer;
5079 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5080 VkCommandBufferResetFlags local_flags;
5081 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005082 countingStream->rewind();
5083 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005084 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5085 countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005086 }
5087 uint32_t packetSize_vkResetCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5088 countingStream->rewind();
5089 uint32_t opcode_vkResetCommandBuffer = OP_vkResetCommandBuffer;
5090 stream->write(&opcode_vkResetCommandBuffer, sizeof(uint32_t));
5091 stream->write(&packetSize_vkResetCommandBuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005092 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5093 stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags));
5094 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005095 VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0;
5096 stream->read(&vkResetCommandBuffer_VkResult_return, sizeof(VkResult));
5097 return vkResetCommandBuffer_VkResult_return;
5098}
5099
5100void VkEncoder::vkCmdBindPipeline(
5101 VkCommandBuffer commandBuffer,
5102 VkPipelineBindPoint pipelineBindPoint,
5103 VkPipeline pipeline)
5104{
5105 auto stream = mImpl->stream();
5106 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005107 auto resources = mImpl->resources();
5108 auto pool = mImpl->pool();
5109 VkCommandBuffer local_commandBuffer;
5110 local_commandBuffer = commandBuffer;
5111 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5112 VkPipelineBindPoint local_pipelineBindPoint;
5113 local_pipelineBindPoint = pipelineBindPoint;
5114 VkPipeline local_pipeline;
5115 local_pipeline = pipeline;
5116 resources->unwrapMapping()->mapHandles_VkPipeline((VkPipeline*)&local_pipeline);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005117 countingStream->rewind();
5118 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005119 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5120 countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
5121 countingStream->write((VkPipeline*)&local_pipeline, sizeof(VkPipeline));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005122 }
5123 uint32_t packetSize_vkCmdBindPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5124 countingStream->rewind();
5125 uint32_t opcode_vkCmdBindPipeline = OP_vkCmdBindPipeline;
5126 stream->write(&opcode_vkCmdBindPipeline, sizeof(uint32_t));
5127 stream->write(&packetSize_vkCmdBindPipeline, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005128 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5129 stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
5130 stream->write((VkPipeline*)&local_pipeline, sizeof(VkPipeline));
5131 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005132}
5133
5134void VkEncoder::vkCmdSetViewport(
5135 VkCommandBuffer commandBuffer,
5136 uint32_t firstViewport,
5137 uint32_t viewportCount,
5138 const VkViewport* pViewports)
5139{
5140 auto stream = mImpl->stream();
5141 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005142 auto resources = mImpl->resources();
5143 auto pool = mImpl->pool();
5144 VkCommandBuffer local_commandBuffer;
5145 local_commandBuffer = commandBuffer;
5146 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5147 uint32_t local_firstViewport;
5148 local_firstViewport = firstViewport;
5149 uint32_t local_viewportCount;
5150 local_viewportCount = viewportCount;
5151 VkViewport* local_pViewports;
5152 local_pViewports = nullptr;
5153 if (pViewports)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005154 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005155 local_pViewports = (VkViewport*)pool->alloc(((viewportCount)) * sizeof(const VkViewport));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005156 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
5157 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005158 deepcopy_VkViewport(pool, pViewports + i, (VkViewport*)(local_pViewports + i));
5159 }
5160 }
5161 if (local_pViewports)
5162 {
5163 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
5164 {
5165 handlemap_VkViewport(resources->unwrapMapping(), (VkViewport*)(local_pViewports + i));
5166 }
5167 }
5168 countingStream->rewind();
5169 {
5170 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5171 countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
5172 countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
5173 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
5174 {
5175 marshal_VkViewport(countingStream, (VkViewport*)(local_pViewports + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005176 }
5177 }
5178 uint32_t packetSize_vkCmdSetViewport = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5179 countingStream->rewind();
5180 uint32_t opcode_vkCmdSetViewport = OP_vkCmdSetViewport;
5181 stream->write(&opcode_vkCmdSetViewport, sizeof(uint32_t));
5182 stream->write(&packetSize_vkCmdSetViewport, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005183 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5184 stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
5185 stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005186 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
5187 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005188 marshal_VkViewport(stream, (VkViewport*)(local_pViewports + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005189 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005190 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005191}
5192
5193void VkEncoder::vkCmdSetScissor(
5194 VkCommandBuffer commandBuffer,
5195 uint32_t firstScissor,
5196 uint32_t scissorCount,
5197 const VkRect2D* pScissors)
5198{
5199 auto stream = mImpl->stream();
5200 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005201 auto resources = mImpl->resources();
5202 auto pool = mImpl->pool();
5203 VkCommandBuffer local_commandBuffer;
5204 local_commandBuffer = commandBuffer;
5205 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5206 uint32_t local_firstScissor;
5207 local_firstScissor = firstScissor;
5208 uint32_t local_scissorCount;
5209 local_scissorCount = scissorCount;
5210 VkRect2D* local_pScissors;
5211 local_pScissors = nullptr;
5212 if (pScissors)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005213 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005214 local_pScissors = (VkRect2D*)pool->alloc(((scissorCount)) * sizeof(const VkRect2D));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005215 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i)
5216 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005217 deepcopy_VkRect2D(pool, pScissors + i, (VkRect2D*)(local_pScissors + i));
5218 }
5219 }
5220 if (local_pScissors)
5221 {
5222 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i)
5223 {
5224 handlemap_VkRect2D(resources->unwrapMapping(), (VkRect2D*)(local_pScissors + i));
5225 }
5226 }
5227 countingStream->rewind();
5228 {
5229 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5230 countingStream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t));
5231 countingStream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t));
5232 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i)
5233 {
5234 marshal_VkRect2D(countingStream, (VkRect2D*)(local_pScissors + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005235 }
5236 }
5237 uint32_t packetSize_vkCmdSetScissor = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5238 countingStream->rewind();
5239 uint32_t opcode_vkCmdSetScissor = OP_vkCmdSetScissor;
5240 stream->write(&opcode_vkCmdSetScissor, sizeof(uint32_t));
5241 stream->write(&packetSize_vkCmdSetScissor, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005242 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5243 stream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t));
5244 stream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005245 for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i)
5246 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005247 marshal_VkRect2D(stream, (VkRect2D*)(local_pScissors + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005248 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005249 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005250}
5251
5252void VkEncoder::vkCmdSetLineWidth(
5253 VkCommandBuffer commandBuffer,
5254 float lineWidth)
5255{
5256 auto stream = mImpl->stream();
5257 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005258 auto resources = mImpl->resources();
5259 auto pool = mImpl->pool();
5260 VkCommandBuffer local_commandBuffer;
5261 local_commandBuffer = commandBuffer;
5262 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5263 float local_lineWidth;
5264 local_lineWidth = lineWidth;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005265 countingStream->rewind();
5266 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005267 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5268 countingStream->write((float*)&local_lineWidth, sizeof(float));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005269 }
5270 uint32_t packetSize_vkCmdSetLineWidth = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5271 countingStream->rewind();
5272 uint32_t opcode_vkCmdSetLineWidth = OP_vkCmdSetLineWidth;
5273 stream->write(&opcode_vkCmdSetLineWidth, sizeof(uint32_t));
5274 stream->write(&packetSize_vkCmdSetLineWidth, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005275 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5276 stream->write((float*)&local_lineWidth, sizeof(float));
5277 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005278}
5279
5280void VkEncoder::vkCmdSetDepthBias(
5281 VkCommandBuffer commandBuffer,
5282 float depthBiasConstantFactor,
5283 float depthBiasClamp,
5284 float depthBiasSlopeFactor)
5285{
5286 auto stream = mImpl->stream();
5287 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005288 auto resources = mImpl->resources();
5289 auto pool = mImpl->pool();
5290 VkCommandBuffer local_commandBuffer;
5291 local_commandBuffer = commandBuffer;
5292 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5293 float local_depthBiasConstantFactor;
5294 local_depthBiasConstantFactor = depthBiasConstantFactor;
5295 float local_depthBiasClamp;
5296 local_depthBiasClamp = depthBiasClamp;
5297 float local_depthBiasSlopeFactor;
5298 local_depthBiasSlopeFactor = depthBiasSlopeFactor;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005299 countingStream->rewind();
5300 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005301 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5302 countingStream->write((float*)&local_depthBiasConstantFactor, sizeof(float));
5303 countingStream->write((float*)&local_depthBiasClamp, sizeof(float));
5304 countingStream->write((float*)&local_depthBiasSlopeFactor, sizeof(float));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005305 }
5306 uint32_t packetSize_vkCmdSetDepthBias = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5307 countingStream->rewind();
5308 uint32_t opcode_vkCmdSetDepthBias = OP_vkCmdSetDepthBias;
5309 stream->write(&opcode_vkCmdSetDepthBias, sizeof(uint32_t));
5310 stream->write(&packetSize_vkCmdSetDepthBias, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005311 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5312 stream->write((float*)&local_depthBiasConstantFactor, sizeof(float));
5313 stream->write((float*)&local_depthBiasClamp, sizeof(float));
5314 stream->write((float*)&local_depthBiasSlopeFactor, sizeof(float));
5315 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005316}
5317
5318void VkEncoder::vkCmdSetBlendConstants(
5319 VkCommandBuffer commandBuffer,
5320 const float blendConstants)
5321{
5322 auto stream = mImpl->stream();
5323 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005324 auto resources = mImpl->resources();
5325 auto pool = mImpl->pool();
5326 VkCommandBuffer local_commandBuffer;
5327 local_commandBuffer = commandBuffer;
5328 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5329 float local_blendConstants[4];
5330 memcpy(&local_blendConstants, &blendConstants, 4 * sizeof(const float));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005331 countingStream->rewind();
5332 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005333 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5334 countingStream->write((float*)&local_blendConstants, 4 * sizeof(float));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005335 }
5336 uint32_t packetSize_vkCmdSetBlendConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5337 countingStream->rewind();
5338 uint32_t opcode_vkCmdSetBlendConstants = OP_vkCmdSetBlendConstants;
5339 stream->write(&opcode_vkCmdSetBlendConstants, sizeof(uint32_t));
5340 stream->write(&packetSize_vkCmdSetBlendConstants, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005341 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5342 stream->write((float*)&local_blendConstants, 4 * sizeof(float));
5343 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005344}
5345
5346void VkEncoder::vkCmdSetDepthBounds(
5347 VkCommandBuffer commandBuffer,
5348 float minDepthBounds,
5349 float maxDepthBounds)
5350{
5351 auto stream = mImpl->stream();
5352 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005353 auto resources = mImpl->resources();
5354 auto pool = mImpl->pool();
5355 VkCommandBuffer local_commandBuffer;
5356 local_commandBuffer = commandBuffer;
5357 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5358 float local_minDepthBounds;
5359 local_minDepthBounds = minDepthBounds;
5360 float local_maxDepthBounds;
5361 local_maxDepthBounds = maxDepthBounds;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005362 countingStream->rewind();
5363 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005364 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5365 countingStream->write((float*)&local_minDepthBounds, sizeof(float));
5366 countingStream->write((float*)&local_maxDepthBounds, sizeof(float));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005367 }
5368 uint32_t packetSize_vkCmdSetDepthBounds = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5369 countingStream->rewind();
5370 uint32_t opcode_vkCmdSetDepthBounds = OP_vkCmdSetDepthBounds;
5371 stream->write(&opcode_vkCmdSetDepthBounds, sizeof(uint32_t));
5372 stream->write(&packetSize_vkCmdSetDepthBounds, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005373 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5374 stream->write((float*)&local_minDepthBounds, sizeof(float));
5375 stream->write((float*)&local_maxDepthBounds, sizeof(float));
5376 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005377}
5378
5379void VkEncoder::vkCmdSetStencilCompareMask(
5380 VkCommandBuffer commandBuffer,
5381 VkStencilFaceFlags faceMask,
5382 uint32_t compareMask)
5383{
5384 auto stream = mImpl->stream();
5385 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005386 auto resources = mImpl->resources();
5387 auto pool = mImpl->pool();
5388 VkCommandBuffer local_commandBuffer;
5389 local_commandBuffer = commandBuffer;
5390 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5391 VkStencilFaceFlags local_faceMask;
5392 local_faceMask = faceMask;
5393 uint32_t local_compareMask;
5394 local_compareMask = compareMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005395 countingStream->rewind();
5396 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005397 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5398 countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
5399 countingStream->write((uint32_t*)&local_compareMask, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005400 }
5401 uint32_t packetSize_vkCmdSetStencilCompareMask = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5402 countingStream->rewind();
5403 uint32_t opcode_vkCmdSetStencilCompareMask = OP_vkCmdSetStencilCompareMask;
5404 stream->write(&opcode_vkCmdSetStencilCompareMask, sizeof(uint32_t));
5405 stream->write(&packetSize_vkCmdSetStencilCompareMask, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005406 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5407 stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
5408 stream->write((uint32_t*)&local_compareMask, sizeof(uint32_t));
5409 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005410}
5411
5412void VkEncoder::vkCmdSetStencilWriteMask(
5413 VkCommandBuffer commandBuffer,
5414 VkStencilFaceFlags faceMask,
5415 uint32_t writeMask)
5416{
5417 auto stream = mImpl->stream();
5418 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005419 auto resources = mImpl->resources();
5420 auto pool = mImpl->pool();
5421 VkCommandBuffer local_commandBuffer;
5422 local_commandBuffer = commandBuffer;
5423 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5424 VkStencilFaceFlags local_faceMask;
5425 local_faceMask = faceMask;
5426 uint32_t local_writeMask;
5427 local_writeMask = writeMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005428 countingStream->rewind();
5429 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005430 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5431 countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
5432 countingStream->write((uint32_t*)&local_writeMask, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005433 }
5434 uint32_t packetSize_vkCmdSetStencilWriteMask = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5435 countingStream->rewind();
5436 uint32_t opcode_vkCmdSetStencilWriteMask = OP_vkCmdSetStencilWriteMask;
5437 stream->write(&opcode_vkCmdSetStencilWriteMask, sizeof(uint32_t));
5438 stream->write(&packetSize_vkCmdSetStencilWriteMask, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005439 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5440 stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
5441 stream->write((uint32_t*)&local_writeMask, sizeof(uint32_t));
5442 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005443}
5444
5445void VkEncoder::vkCmdSetStencilReference(
5446 VkCommandBuffer commandBuffer,
5447 VkStencilFaceFlags faceMask,
5448 uint32_t reference)
5449{
5450 auto stream = mImpl->stream();
5451 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005452 auto resources = mImpl->resources();
5453 auto pool = mImpl->pool();
5454 VkCommandBuffer local_commandBuffer;
5455 local_commandBuffer = commandBuffer;
5456 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5457 VkStencilFaceFlags local_faceMask;
5458 local_faceMask = faceMask;
5459 uint32_t local_reference;
5460 local_reference = reference;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005461 countingStream->rewind();
5462 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005463 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5464 countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
5465 countingStream->write((uint32_t*)&local_reference, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005466 }
5467 uint32_t packetSize_vkCmdSetStencilReference = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5468 countingStream->rewind();
5469 uint32_t opcode_vkCmdSetStencilReference = OP_vkCmdSetStencilReference;
5470 stream->write(&opcode_vkCmdSetStencilReference, sizeof(uint32_t));
5471 stream->write(&packetSize_vkCmdSetStencilReference, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005472 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5473 stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags));
5474 stream->write((uint32_t*)&local_reference, sizeof(uint32_t));
5475 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005476}
5477
5478void VkEncoder::vkCmdBindDescriptorSets(
5479 VkCommandBuffer commandBuffer,
5480 VkPipelineBindPoint pipelineBindPoint,
5481 VkPipelineLayout layout,
5482 uint32_t firstSet,
5483 uint32_t descriptorSetCount,
5484 const VkDescriptorSet* pDescriptorSets,
5485 uint32_t dynamicOffsetCount,
5486 const uint32_t* pDynamicOffsets)
5487{
5488 auto stream = mImpl->stream();
5489 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005490 auto resources = mImpl->resources();
5491 auto pool = mImpl->pool();
5492 VkCommandBuffer local_commandBuffer;
5493 local_commandBuffer = commandBuffer;
5494 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5495 VkPipelineBindPoint local_pipelineBindPoint;
5496 local_pipelineBindPoint = pipelineBindPoint;
5497 VkPipelineLayout local_layout;
5498 local_layout = layout;
5499 resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout);
5500 uint32_t local_firstSet;
5501 local_firstSet = firstSet;
5502 uint32_t local_descriptorSetCount;
5503 local_descriptorSetCount = descriptorSetCount;
5504 VkDescriptorSet* local_pDescriptorSets;
5505 local_pDescriptorSets = nullptr;
5506 if (pDescriptorSets)
5507 {
5508 local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet));
5509 }
5510 if (local_pDescriptorSets)
5511 {
5512 resources->unwrapMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)));
5513 }
5514 uint32_t local_dynamicOffsetCount;
5515 local_dynamicOffsetCount = dynamicOffsetCount;
5516 uint32_t* local_pDynamicOffsets;
5517 local_pDynamicOffsets = nullptr;
5518 if (pDynamicOffsets)
5519 {
5520 local_pDynamicOffsets = (uint32_t*)pool->dupArray(pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(const uint32_t));
5521 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005522 countingStream->rewind();
5523 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005524 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5525 countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
5526 countingStream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout));
5527 countingStream->write((uint32_t*)&local_firstSet, sizeof(uint32_t));
5528 countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
5529 countingStream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet));
5530 countingStream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t));
5531 countingStream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005532 }
5533 uint32_t packetSize_vkCmdBindDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5534 countingStream->rewind();
5535 uint32_t opcode_vkCmdBindDescriptorSets = OP_vkCmdBindDescriptorSets;
5536 stream->write(&opcode_vkCmdBindDescriptorSets, sizeof(uint32_t));
5537 stream->write(&packetSize_vkCmdBindDescriptorSets, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005538 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5539 stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
5540 stream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout));
5541 stream->write((uint32_t*)&local_firstSet, sizeof(uint32_t));
5542 stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t));
5543 stream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet));
5544 stream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t));
5545 stream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t));
5546 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005547}
5548
5549void VkEncoder::vkCmdBindIndexBuffer(
5550 VkCommandBuffer commandBuffer,
5551 VkBuffer buffer,
5552 VkDeviceSize offset,
5553 VkIndexType indexType)
5554{
5555 auto stream = mImpl->stream();
5556 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005557 auto resources = mImpl->resources();
5558 auto pool = mImpl->pool();
5559 VkCommandBuffer local_commandBuffer;
5560 local_commandBuffer = commandBuffer;
5561 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5562 VkBuffer local_buffer;
5563 local_buffer = buffer;
5564 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
5565 VkDeviceSize local_offset;
5566 local_offset = offset;
5567 VkIndexType local_indexType;
5568 local_indexType = indexType;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005569 countingStream->rewind();
5570 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005571 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5572 countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
5573 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
5574 countingStream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005575 }
5576 uint32_t packetSize_vkCmdBindIndexBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5577 countingStream->rewind();
5578 uint32_t opcode_vkCmdBindIndexBuffer = OP_vkCmdBindIndexBuffer;
5579 stream->write(&opcode_vkCmdBindIndexBuffer, sizeof(uint32_t));
5580 stream->write(&packetSize_vkCmdBindIndexBuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005581 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5582 stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
5583 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
5584 stream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType));
5585 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005586}
5587
5588void VkEncoder::vkCmdBindVertexBuffers(
5589 VkCommandBuffer commandBuffer,
5590 uint32_t firstBinding,
5591 uint32_t bindingCount,
5592 const VkBuffer* pBuffers,
5593 const VkDeviceSize* pOffsets)
5594{
5595 auto stream = mImpl->stream();
5596 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005597 auto resources = mImpl->resources();
5598 auto pool = mImpl->pool();
5599 VkCommandBuffer local_commandBuffer;
5600 local_commandBuffer = commandBuffer;
5601 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5602 uint32_t local_firstBinding;
5603 local_firstBinding = firstBinding;
5604 uint32_t local_bindingCount;
5605 local_bindingCount = bindingCount;
5606 VkBuffer* local_pBuffers;
5607 local_pBuffers = nullptr;
5608 if (pBuffers)
5609 {
5610 local_pBuffers = (VkBuffer*)pool->dupArray(pBuffers, ((bindingCount)) * sizeof(const VkBuffer));
5611 }
5612 if (local_pBuffers)
5613 {
5614 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)local_pBuffers, ((bindingCount)));
5615 }
5616 VkDeviceSize* local_pOffsets;
5617 local_pOffsets = nullptr;
5618 if (pOffsets)
5619 {
5620 local_pOffsets = (VkDeviceSize*)pool->dupArray(pOffsets, ((bindingCount)) * sizeof(const VkDeviceSize));
5621 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005622 countingStream->rewind();
5623 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005624 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5625 countingStream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t));
5626 countingStream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t));
5627 countingStream->write((VkBuffer*)local_pBuffers, ((bindingCount)) * sizeof(VkBuffer));
5628 countingStream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005629 }
5630 uint32_t packetSize_vkCmdBindVertexBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5631 countingStream->rewind();
5632 uint32_t opcode_vkCmdBindVertexBuffers = OP_vkCmdBindVertexBuffers;
5633 stream->write(&opcode_vkCmdBindVertexBuffers, sizeof(uint32_t));
5634 stream->write(&packetSize_vkCmdBindVertexBuffers, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005635 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5636 stream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t));
5637 stream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t));
5638 stream->write((VkBuffer*)local_pBuffers, ((bindingCount)) * sizeof(VkBuffer));
5639 stream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize));
5640 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005641}
5642
5643void VkEncoder::vkCmdDraw(
5644 VkCommandBuffer commandBuffer,
5645 uint32_t vertexCount,
5646 uint32_t instanceCount,
5647 uint32_t firstVertex,
5648 uint32_t firstInstance)
5649{
5650 auto stream = mImpl->stream();
5651 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005652 auto resources = mImpl->resources();
5653 auto pool = mImpl->pool();
5654 VkCommandBuffer local_commandBuffer;
5655 local_commandBuffer = commandBuffer;
5656 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5657 uint32_t local_vertexCount;
5658 local_vertexCount = vertexCount;
5659 uint32_t local_instanceCount;
5660 local_instanceCount = instanceCount;
5661 uint32_t local_firstVertex;
5662 local_firstVertex = firstVertex;
5663 uint32_t local_firstInstance;
5664 local_firstInstance = firstInstance;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005665 countingStream->rewind();
5666 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005667 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5668 countingStream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t));
5669 countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
5670 countingStream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t));
5671 countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005672 }
5673 uint32_t packetSize_vkCmdDraw = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5674 countingStream->rewind();
5675 uint32_t opcode_vkCmdDraw = OP_vkCmdDraw;
5676 stream->write(&opcode_vkCmdDraw, sizeof(uint32_t));
5677 stream->write(&packetSize_vkCmdDraw, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005678 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5679 stream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t));
5680 stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
5681 stream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t));
5682 stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t));
5683 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005684}
5685
5686void VkEncoder::vkCmdDrawIndexed(
5687 VkCommandBuffer commandBuffer,
5688 uint32_t indexCount,
5689 uint32_t instanceCount,
5690 uint32_t firstIndex,
5691 int32_t vertexOffset,
5692 uint32_t firstInstance)
5693{
5694 auto stream = mImpl->stream();
5695 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005696 auto resources = mImpl->resources();
5697 auto pool = mImpl->pool();
5698 VkCommandBuffer local_commandBuffer;
5699 local_commandBuffer = commandBuffer;
5700 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5701 uint32_t local_indexCount;
5702 local_indexCount = indexCount;
5703 uint32_t local_instanceCount;
5704 local_instanceCount = instanceCount;
5705 uint32_t local_firstIndex;
5706 local_firstIndex = firstIndex;
5707 int32_t local_vertexOffset;
5708 local_vertexOffset = vertexOffset;
5709 uint32_t local_firstInstance;
5710 local_firstInstance = firstInstance;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005711 countingStream->rewind();
5712 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005713 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5714 countingStream->write((uint32_t*)&local_indexCount, sizeof(uint32_t));
5715 countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
5716 countingStream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t));
5717 countingStream->write((int32_t*)&local_vertexOffset, sizeof(int32_t));
5718 countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005719 }
5720 uint32_t packetSize_vkCmdDrawIndexed = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5721 countingStream->rewind();
5722 uint32_t opcode_vkCmdDrawIndexed = OP_vkCmdDrawIndexed;
5723 stream->write(&opcode_vkCmdDrawIndexed, sizeof(uint32_t));
5724 stream->write(&packetSize_vkCmdDrawIndexed, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005725 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5726 stream->write((uint32_t*)&local_indexCount, sizeof(uint32_t));
5727 stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t));
5728 stream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t));
5729 stream->write((int32_t*)&local_vertexOffset, sizeof(int32_t));
5730 stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t));
5731 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005732}
5733
5734void VkEncoder::vkCmdDrawIndirect(
5735 VkCommandBuffer commandBuffer,
5736 VkBuffer buffer,
5737 VkDeviceSize offset,
5738 uint32_t drawCount,
5739 uint32_t stride)
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 VkBuffer local_buffer;
5749 local_buffer = buffer;
5750 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
5751 VkDeviceSize local_offset;
5752 local_offset = offset;
5753 uint32_t local_drawCount;
5754 local_drawCount = drawCount;
5755 uint32_t local_stride;
5756 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005757 countingStream->rewind();
5758 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005759 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5760 countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
5761 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
5762 countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
5763 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005764 }
5765 uint32_t packetSize_vkCmdDrawIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5766 countingStream->rewind();
5767 uint32_t opcode_vkCmdDrawIndirect = OP_vkCmdDrawIndirect;
5768 stream->write(&opcode_vkCmdDrawIndirect, sizeof(uint32_t));
5769 stream->write(&packetSize_vkCmdDrawIndirect, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005770 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5771 stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
5772 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
5773 stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
5774 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
5775 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005776}
5777
5778void VkEncoder::vkCmdDrawIndexedIndirect(
5779 VkCommandBuffer commandBuffer,
5780 VkBuffer buffer,
5781 VkDeviceSize offset,
5782 uint32_t drawCount,
5783 uint32_t stride)
5784{
5785 auto stream = mImpl->stream();
5786 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005787 auto resources = mImpl->resources();
5788 auto pool = mImpl->pool();
5789 VkCommandBuffer local_commandBuffer;
5790 local_commandBuffer = commandBuffer;
5791 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5792 VkBuffer local_buffer;
5793 local_buffer = buffer;
5794 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
5795 VkDeviceSize local_offset;
5796 local_offset = offset;
5797 uint32_t local_drawCount;
5798 local_drawCount = drawCount;
5799 uint32_t local_stride;
5800 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005801 countingStream->rewind();
5802 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005803 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5804 countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
5805 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
5806 countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
5807 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005808 }
5809 uint32_t packetSize_vkCmdDrawIndexedIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5810 countingStream->rewind();
5811 uint32_t opcode_vkCmdDrawIndexedIndirect = OP_vkCmdDrawIndexedIndirect;
5812 stream->write(&opcode_vkCmdDrawIndexedIndirect, sizeof(uint32_t));
5813 stream->write(&packetSize_vkCmdDrawIndexedIndirect, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005814 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5815 stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
5816 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
5817 stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t));
5818 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
5819 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005820}
5821
5822void VkEncoder::vkCmdDispatch(
5823 VkCommandBuffer commandBuffer,
5824 uint32_t groupCountX,
5825 uint32_t groupCountY,
5826 uint32_t groupCountZ)
5827{
5828 auto stream = mImpl->stream();
5829 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005830 auto resources = mImpl->resources();
5831 auto pool = mImpl->pool();
5832 VkCommandBuffer local_commandBuffer;
5833 local_commandBuffer = commandBuffer;
5834 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5835 uint32_t local_groupCountX;
5836 local_groupCountX = groupCountX;
5837 uint32_t local_groupCountY;
5838 local_groupCountY = groupCountY;
5839 uint32_t local_groupCountZ;
5840 local_groupCountZ = groupCountZ;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005841 countingStream->rewind();
5842 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005843 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5844 countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
5845 countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
5846 countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005847 }
5848 uint32_t packetSize_vkCmdDispatch = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5849 countingStream->rewind();
5850 uint32_t opcode_vkCmdDispatch = OP_vkCmdDispatch;
5851 stream->write(&opcode_vkCmdDispatch, sizeof(uint32_t));
5852 stream->write(&packetSize_vkCmdDispatch, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005853 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5854 stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
5855 stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
5856 stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
5857 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005858}
5859
5860void VkEncoder::vkCmdDispatchIndirect(
5861 VkCommandBuffer commandBuffer,
5862 VkBuffer buffer,
5863 VkDeviceSize offset)
5864{
5865 auto stream = mImpl->stream();
5866 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005867 auto resources = mImpl->resources();
5868 auto pool = mImpl->pool();
5869 VkCommandBuffer local_commandBuffer;
5870 local_commandBuffer = commandBuffer;
5871 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5872 VkBuffer local_buffer;
5873 local_buffer = buffer;
5874 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
5875 VkDeviceSize local_offset;
5876 local_offset = offset;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005877 countingStream->rewind();
5878 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005879 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5880 countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
5881 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005882 }
5883 uint32_t packetSize_vkCmdDispatchIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5884 countingStream->rewind();
5885 uint32_t opcode_vkCmdDispatchIndirect = OP_vkCmdDispatchIndirect;
5886 stream->write(&opcode_vkCmdDispatchIndirect, sizeof(uint32_t));
5887 stream->write(&packetSize_vkCmdDispatchIndirect, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005888 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5889 stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
5890 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
5891 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005892}
5893
5894void VkEncoder::vkCmdCopyBuffer(
5895 VkCommandBuffer commandBuffer,
5896 VkBuffer srcBuffer,
5897 VkBuffer dstBuffer,
5898 uint32_t regionCount,
5899 const VkBufferCopy* pRegions)
5900{
5901 auto stream = mImpl->stream();
5902 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005903 auto resources = mImpl->resources();
5904 auto pool = mImpl->pool();
5905 VkCommandBuffer local_commandBuffer;
5906 local_commandBuffer = commandBuffer;
5907 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5908 VkBuffer local_srcBuffer;
5909 local_srcBuffer = srcBuffer;
5910 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_srcBuffer);
5911 VkBuffer local_dstBuffer;
5912 local_dstBuffer = dstBuffer;
5913 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
5914 uint32_t local_regionCount;
5915 local_regionCount = regionCount;
5916 VkBufferCopy* local_pRegions;
5917 local_pRegions = nullptr;
5918 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005919 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005920 local_pRegions = (VkBufferCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferCopy));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005921 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
5922 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005923 deepcopy_VkBufferCopy(pool, pRegions + i, (VkBufferCopy*)(local_pRegions + i));
5924 }
5925 }
5926 if (local_pRegions)
5927 {
5928 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
5929 {
5930 handlemap_VkBufferCopy(resources->unwrapMapping(), (VkBufferCopy*)(local_pRegions + i));
5931 }
5932 }
5933 countingStream->rewind();
5934 {
5935 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5936 countingStream->write((VkBuffer*)&local_srcBuffer, sizeof(VkBuffer));
5937 countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
5938 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
5939 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
5940 {
5941 marshal_VkBufferCopy(countingStream, (VkBufferCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005942 }
5943 }
5944 uint32_t packetSize_vkCmdCopyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
5945 countingStream->rewind();
5946 uint32_t opcode_vkCmdCopyBuffer = OP_vkCmdCopyBuffer;
5947 stream->write(&opcode_vkCmdCopyBuffer, sizeof(uint32_t));
5948 stream->write(&packetSize_vkCmdCopyBuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005949 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
5950 stream->write((VkBuffer*)&local_srcBuffer, sizeof(VkBuffer));
5951 stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
5952 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005953 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
5954 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005955 marshal_VkBufferCopy(stream, (VkBufferCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005956 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005957 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005958}
5959
5960void VkEncoder::vkCmdCopyImage(
5961 VkCommandBuffer commandBuffer,
5962 VkImage srcImage,
5963 VkImageLayout srcImageLayout,
5964 VkImage dstImage,
5965 VkImageLayout dstImageLayout,
5966 uint32_t regionCount,
5967 const VkImageCopy* pRegions)
5968{
5969 auto stream = mImpl->stream();
5970 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005971 auto resources = mImpl->resources();
5972 auto pool = mImpl->pool();
5973 VkCommandBuffer local_commandBuffer;
5974 local_commandBuffer = commandBuffer;
5975 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
5976 VkImage local_srcImage;
5977 local_srcImage = srcImage;
5978 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage);
5979 VkImageLayout local_srcImageLayout;
5980 local_srcImageLayout = srcImageLayout;
5981 VkImage local_dstImage;
5982 local_dstImage = dstImage;
5983 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage);
5984 VkImageLayout local_dstImageLayout;
5985 local_dstImageLayout = dstImageLayout;
5986 uint32_t local_regionCount;
5987 local_regionCount = regionCount;
5988 VkImageCopy* local_pRegions;
5989 local_pRegions = nullptr;
5990 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005991 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005992 local_pRegions = (VkImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkImageCopy));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07005993 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
5994 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08005995 deepcopy_VkImageCopy(pool, pRegions + i, (VkImageCopy*)(local_pRegions + i));
5996 }
5997 }
5998 if (local_pRegions)
5999 {
6000 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6001 {
6002 handlemap_VkImageCopy(resources->unwrapMapping(), (VkImageCopy*)(local_pRegions + i));
6003 }
6004 }
6005 countingStream->rewind();
6006 {
6007 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6008 countingStream->write((VkImage*)&local_srcImage, sizeof(VkImage));
6009 countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
6010 countingStream->write((VkImage*)&local_dstImage, sizeof(VkImage));
6011 countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6012 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
6013 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6014 {
6015 marshal_VkImageCopy(countingStream, (VkImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006016 }
6017 }
6018 uint32_t packetSize_vkCmdCopyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6019 countingStream->rewind();
6020 uint32_t opcode_vkCmdCopyImage = OP_vkCmdCopyImage;
6021 stream->write(&opcode_vkCmdCopyImage, sizeof(uint32_t));
6022 stream->write(&packetSize_vkCmdCopyImage, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006023 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6024 stream->write((VkImage*)&local_srcImage, sizeof(VkImage));
6025 stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
6026 stream->write((VkImage*)&local_dstImage, sizeof(VkImage));
6027 stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6028 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006029 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6030 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006031 marshal_VkImageCopy(stream, (VkImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006032 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006033 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006034}
6035
6036void VkEncoder::vkCmdBlitImage(
6037 VkCommandBuffer commandBuffer,
6038 VkImage srcImage,
6039 VkImageLayout srcImageLayout,
6040 VkImage dstImage,
6041 VkImageLayout dstImageLayout,
6042 uint32_t regionCount,
6043 const VkImageBlit* pRegions,
6044 VkFilter filter)
6045{
6046 auto stream = mImpl->stream();
6047 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006048 auto resources = mImpl->resources();
6049 auto pool = mImpl->pool();
6050 VkCommandBuffer local_commandBuffer;
6051 local_commandBuffer = commandBuffer;
6052 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6053 VkImage local_srcImage;
6054 local_srcImage = srcImage;
6055 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage);
6056 VkImageLayout local_srcImageLayout;
6057 local_srcImageLayout = srcImageLayout;
6058 VkImage local_dstImage;
6059 local_dstImage = dstImage;
6060 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage);
6061 VkImageLayout local_dstImageLayout;
6062 local_dstImageLayout = dstImageLayout;
6063 uint32_t local_regionCount;
6064 local_regionCount = regionCount;
6065 VkImageBlit* local_pRegions;
6066 local_pRegions = nullptr;
6067 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006068 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006069 local_pRegions = (VkImageBlit*)pool->alloc(((regionCount)) * sizeof(const VkImageBlit));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006070 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6071 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006072 deepcopy_VkImageBlit(pool, pRegions + i, (VkImageBlit*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006073 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006074 }
6075 if (local_pRegions)
6076 {
6077 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6078 {
6079 handlemap_VkImageBlit(resources->unwrapMapping(), (VkImageBlit*)(local_pRegions + i));
6080 }
6081 }
6082 VkFilter local_filter;
6083 local_filter = filter;
6084 countingStream->rewind();
6085 {
6086 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6087 countingStream->write((VkImage*)&local_srcImage, sizeof(VkImage));
6088 countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
6089 countingStream->write((VkImage*)&local_dstImage, sizeof(VkImage));
6090 countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6091 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
6092 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6093 {
6094 marshal_VkImageBlit(countingStream, (VkImageBlit*)(local_pRegions + i));
6095 }
6096 countingStream->write((VkFilter*)&local_filter, sizeof(VkFilter));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006097 }
6098 uint32_t packetSize_vkCmdBlitImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6099 countingStream->rewind();
6100 uint32_t opcode_vkCmdBlitImage = OP_vkCmdBlitImage;
6101 stream->write(&opcode_vkCmdBlitImage, sizeof(uint32_t));
6102 stream->write(&packetSize_vkCmdBlitImage, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006103 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6104 stream->write((VkImage*)&local_srcImage, sizeof(VkImage));
6105 stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
6106 stream->write((VkImage*)&local_dstImage, sizeof(VkImage));
6107 stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6108 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006109 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6110 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006111 marshal_VkImageBlit(stream, (VkImageBlit*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006112 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006113 stream->write((VkFilter*)&local_filter, sizeof(VkFilter));
6114 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006115}
6116
6117void VkEncoder::vkCmdCopyBufferToImage(
6118 VkCommandBuffer commandBuffer,
6119 VkBuffer srcBuffer,
6120 VkImage dstImage,
6121 VkImageLayout dstImageLayout,
6122 uint32_t regionCount,
6123 const VkBufferImageCopy* pRegions)
6124{
6125 auto stream = mImpl->stream();
6126 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006127 auto resources = mImpl->resources();
6128 auto pool = mImpl->pool();
6129 VkCommandBuffer local_commandBuffer;
6130 local_commandBuffer = commandBuffer;
6131 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6132 VkBuffer local_srcBuffer;
6133 local_srcBuffer = srcBuffer;
6134 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_srcBuffer);
6135 VkImage local_dstImage;
6136 local_dstImage = dstImage;
6137 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage);
6138 VkImageLayout local_dstImageLayout;
6139 local_dstImageLayout = dstImageLayout;
6140 uint32_t local_regionCount;
6141 local_regionCount = regionCount;
6142 VkBufferImageCopy* local_pRegions;
6143 local_pRegions = nullptr;
6144 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006145 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006146 local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006147 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6148 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006149 deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i));
6150 }
6151 }
6152 if (local_pRegions)
6153 {
6154 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6155 {
6156 handlemap_VkBufferImageCopy(resources->unwrapMapping(), (VkBufferImageCopy*)(local_pRegions + i));
6157 }
6158 }
6159 countingStream->rewind();
6160 {
6161 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6162 countingStream->write((VkBuffer*)&local_srcBuffer, sizeof(VkBuffer));
6163 countingStream->write((VkImage*)&local_dstImage, sizeof(VkImage));
6164 countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6165 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
6166 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6167 {
6168 marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006169 }
6170 }
6171 uint32_t packetSize_vkCmdCopyBufferToImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6172 countingStream->rewind();
6173 uint32_t opcode_vkCmdCopyBufferToImage = OP_vkCmdCopyBufferToImage;
6174 stream->write(&opcode_vkCmdCopyBufferToImage, sizeof(uint32_t));
6175 stream->write(&packetSize_vkCmdCopyBufferToImage, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006176 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6177 stream->write((VkBuffer*)&local_srcBuffer, sizeof(VkBuffer));
6178 stream->write((VkImage*)&local_dstImage, sizeof(VkImage));
6179 stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6180 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006181 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6182 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006183 marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006184 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006185 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006186}
6187
6188void VkEncoder::vkCmdCopyImageToBuffer(
6189 VkCommandBuffer commandBuffer,
6190 VkImage srcImage,
6191 VkImageLayout srcImageLayout,
6192 VkBuffer dstBuffer,
6193 uint32_t regionCount,
6194 const VkBufferImageCopy* pRegions)
6195{
6196 auto stream = mImpl->stream();
6197 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006198 auto resources = mImpl->resources();
6199 auto pool = mImpl->pool();
6200 VkCommandBuffer local_commandBuffer;
6201 local_commandBuffer = commandBuffer;
6202 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6203 VkImage local_srcImage;
6204 local_srcImage = srcImage;
6205 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage);
6206 VkImageLayout local_srcImageLayout;
6207 local_srcImageLayout = srcImageLayout;
6208 VkBuffer local_dstBuffer;
6209 local_dstBuffer = dstBuffer;
6210 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
6211 uint32_t local_regionCount;
6212 local_regionCount = regionCount;
6213 VkBufferImageCopy* local_pRegions;
6214 local_pRegions = nullptr;
6215 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006216 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006217 local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006218 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6219 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006220 deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i));
6221 }
6222 }
6223 if (local_pRegions)
6224 {
6225 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6226 {
6227 handlemap_VkBufferImageCopy(resources->unwrapMapping(), (VkBufferImageCopy*)(local_pRegions + i));
6228 }
6229 }
6230 countingStream->rewind();
6231 {
6232 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6233 countingStream->write((VkImage*)&local_srcImage, sizeof(VkImage));
6234 countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
6235 countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
6236 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
6237 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6238 {
6239 marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006240 }
6241 }
6242 uint32_t packetSize_vkCmdCopyImageToBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6243 countingStream->rewind();
6244 uint32_t opcode_vkCmdCopyImageToBuffer = OP_vkCmdCopyImageToBuffer;
6245 stream->write(&opcode_vkCmdCopyImageToBuffer, sizeof(uint32_t));
6246 stream->write(&packetSize_vkCmdCopyImageToBuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006247 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6248 stream->write((VkImage*)&local_srcImage, sizeof(VkImage));
6249 stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
6250 stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
6251 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006252 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6253 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006254 marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006255 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006256 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006257}
6258
6259void VkEncoder::vkCmdUpdateBuffer(
6260 VkCommandBuffer commandBuffer,
6261 VkBuffer dstBuffer,
6262 VkDeviceSize dstOffset,
6263 VkDeviceSize dataSize,
6264 const void* pData)
6265{
6266 auto stream = mImpl->stream();
6267 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006268 auto resources = mImpl->resources();
6269 auto pool = mImpl->pool();
6270 VkCommandBuffer local_commandBuffer;
6271 local_commandBuffer = commandBuffer;
6272 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6273 VkBuffer local_dstBuffer;
6274 local_dstBuffer = dstBuffer;
6275 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
6276 VkDeviceSize local_dstOffset;
6277 local_dstOffset = dstOffset;
6278 VkDeviceSize local_dataSize;
6279 local_dataSize = dataSize;
6280 void* local_pData;
6281 local_pData = nullptr;
6282 if (pData)
6283 {
6284 local_pData = (void*)pool->dupArray(pData, ((dataSize)) * sizeof(const uint8_t));
6285 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006286 countingStream->rewind();
6287 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006288 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6289 countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
6290 countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
6291 countingStream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize));
6292 countingStream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006293 }
6294 uint32_t packetSize_vkCmdUpdateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6295 countingStream->rewind();
6296 uint32_t opcode_vkCmdUpdateBuffer = OP_vkCmdUpdateBuffer;
6297 stream->write(&opcode_vkCmdUpdateBuffer, sizeof(uint32_t));
6298 stream->write(&packetSize_vkCmdUpdateBuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006299 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6300 stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
6301 stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
6302 stream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize));
6303 stream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t));
6304 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006305}
6306
6307void VkEncoder::vkCmdFillBuffer(
6308 VkCommandBuffer commandBuffer,
6309 VkBuffer dstBuffer,
6310 VkDeviceSize dstOffset,
6311 VkDeviceSize size,
6312 uint32_t data)
6313{
6314 auto stream = mImpl->stream();
6315 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006316 auto resources = mImpl->resources();
6317 auto pool = mImpl->pool();
6318 VkCommandBuffer local_commandBuffer;
6319 local_commandBuffer = commandBuffer;
6320 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6321 VkBuffer local_dstBuffer;
6322 local_dstBuffer = dstBuffer;
6323 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
6324 VkDeviceSize local_dstOffset;
6325 local_dstOffset = dstOffset;
6326 VkDeviceSize local_size;
6327 local_size = size;
6328 uint32_t local_data;
6329 local_data = data;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006330 countingStream->rewind();
6331 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006332 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6333 countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
6334 countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
6335 countingStream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize));
6336 countingStream->write((uint32_t*)&local_data, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006337 }
6338 uint32_t packetSize_vkCmdFillBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6339 countingStream->rewind();
6340 uint32_t opcode_vkCmdFillBuffer = OP_vkCmdFillBuffer;
6341 stream->write(&opcode_vkCmdFillBuffer, sizeof(uint32_t));
6342 stream->write(&packetSize_vkCmdFillBuffer, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006343 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6344 stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
6345 stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
6346 stream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize));
6347 stream->write((uint32_t*)&local_data, sizeof(uint32_t));
6348 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006349}
6350
6351void VkEncoder::vkCmdClearColorImage(
6352 VkCommandBuffer commandBuffer,
6353 VkImage image,
6354 VkImageLayout imageLayout,
6355 const VkClearColorValue* pColor,
6356 uint32_t rangeCount,
6357 const VkImageSubresourceRange* pRanges)
6358{
6359 auto stream = mImpl->stream();
6360 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006361 auto resources = mImpl->resources();
6362 auto pool = mImpl->pool();
6363 VkCommandBuffer local_commandBuffer;
6364 local_commandBuffer = commandBuffer;
6365 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6366 VkImage local_image;
6367 local_image = image;
6368 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
6369 VkImageLayout local_imageLayout;
6370 local_imageLayout = imageLayout;
6371 VkClearColorValue* local_pColor;
6372 local_pColor = nullptr;
6373 if (pColor)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006374 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006375 local_pColor = (VkClearColorValue*)pool->alloc(sizeof(const VkClearColorValue));
6376 deepcopy_VkClearColorValue(pool, pColor, (VkClearColorValue*)(local_pColor));
6377 }
6378 if (local_pColor)
6379 {
6380 handlemap_VkClearColorValue(resources->unwrapMapping(), (VkClearColorValue*)(local_pColor));
6381 }
6382 uint32_t local_rangeCount;
6383 local_rangeCount = rangeCount;
6384 VkImageSubresourceRange* local_pRanges;
6385 local_pRanges = nullptr;
6386 if (pRanges)
6387 {
6388 local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006389 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
6390 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006391 deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i));
6392 }
6393 }
6394 if (local_pRanges)
6395 {
6396 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
6397 {
6398 handlemap_VkImageSubresourceRange(resources->unwrapMapping(), (VkImageSubresourceRange*)(local_pRanges + i));
6399 }
6400 }
6401 countingStream->rewind();
6402 {
6403 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6404 countingStream->write((VkImage*)&local_image, sizeof(VkImage));
6405 countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
6406 marshal_VkClearColorValue(countingStream, (VkClearColorValue*)(local_pColor));
6407 countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
6408 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
6409 {
6410 marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006411 }
6412 }
6413 uint32_t packetSize_vkCmdClearColorImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6414 countingStream->rewind();
6415 uint32_t opcode_vkCmdClearColorImage = OP_vkCmdClearColorImage;
6416 stream->write(&opcode_vkCmdClearColorImage, sizeof(uint32_t));
6417 stream->write(&packetSize_vkCmdClearColorImage, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006418 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6419 stream->write((VkImage*)&local_image, sizeof(VkImage));
6420 stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
6421 marshal_VkClearColorValue(stream, (VkClearColorValue*)(local_pColor));
6422 stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006423 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
6424 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006425 marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006426 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006427 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006428}
6429
6430void VkEncoder::vkCmdClearDepthStencilImage(
6431 VkCommandBuffer commandBuffer,
6432 VkImage image,
6433 VkImageLayout imageLayout,
6434 const VkClearDepthStencilValue* pDepthStencil,
6435 uint32_t rangeCount,
6436 const VkImageSubresourceRange* pRanges)
6437{
6438 auto stream = mImpl->stream();
6439 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006440 auto resources = mImpl->resources();
6441 auto pool = mImpl->pool();
6442 VkCommandBuffer local_commandBuffer;
6443 local_commandBuffer = commandBuffer;
6444 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6445 VkImage local_image;
6446 local_image = image;
6447 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image);
6448 VkImageLayout local_imageLayout;
6449 local_imageLayout = imageLayout;
6450 VkClearDepthStencilValue* local_pDepthStencil;
6451 local_pDepthStencil = nullptr;
6452 if (pDepthStencil)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006453 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006454 local_pDepthStencil = (VkClearDepthStencilValue*)pool->alloc(sizeof(const VkClearDepthStencilValue));
6455 deepcopy_VkClearDepthStencilValue(pool, pDepthStencil, (VkClearDepthStencilValue*)(local_pDepthStencil));
6456 }
6457 if (local_pDepthStencil)
6458 {
6459 handlemap_VkClearDepthStencilValue(resources->unwrapMapping(), (VkClearDepthStencilValue*)(local_pDepthStencil));
6460 }
6461 uint32_t local_rangeCount;
6462 local_rangeCount = rangeCount;
6463 VkImageSubresourceRange* local_pRanges;
6464 local_pRanges = nullptr;
6465 if (pRanges)
6466 {
6467 local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006468 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
6469 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006470 deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i));
6471 }
6472 }
6473 if (local_pRanges)
6474 {
6475 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
6476 {
6477 handlemap_VkImageSubresourceRange(resources->unwrapMapping(), (VkImageSubresourceRange*)(local_pRanges + i));
6478 }
6479 }
6480 countingStream->rewind();
6481 {
6482 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6483 countingStream->write((VkImage*)&local_image, sizeof(VkImage));
6484 countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
6485 marshal_VkClearDepthStencilValue(countingStream, (VkClearDepthStencilValue*)(local_pDepthStencil));
6486 countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
6487 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
6488 {
6489 marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006490 }
6491 }
6492 uint32_t packetSize_vkCmdClearDepthStencilImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6493 countingStream->rewind();
6494 uint32_t opcode_vkCmdClearDepthStencilImage = OP_vkCmdClearDepthStencilImage;
6495 stream->write(&opcode_vkCmdClearDepthStencilImage, sizeof(uint32_t));
6496 stream->write(&packetSize_vkCmdClearDepthStencilImage, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006497 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6498 stream->write((VkImage*)&local_image, sizeof(VkImage));
6499 stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout));
6500 marshal_VkClearDepthStencilValue(stream, (VkClearDepthStencilValue*)(local_pDepthStencil));
6501 stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006502 for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i)
6503 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006504 marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006505 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006506 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006507}
6508
6509void VkEncoder::vkCmdClearAttachments(
6510 VkCommandBuffer commandBuffer,
6511 uint32_t attachmentCount,
6512 const VkClearAttachment* pAttachments,
6513 uint32_t rectCount,
6514 const VkClearRect* pRects)
6515{
6516 auto stream = mImpl->stream();
6517 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006518 auto resources = mImpl->resources();
6519 auto pool = mImpl->pool();
6520 VkCommandBuffer local_commandBuffer;
6521 local_commandBuffer = commandBuffer;
6522 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6523 uint32_t local_attachmentCount;
6524 local_attachmentCount = attachmentCount;
6525 VkClearAttachment* local_pAttachments;
6526 local_pAttachments = nullptr;
6527 if (pAttachments)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006528 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006529 local_pAttachments = (VkClearAttachment*)pool->alloc(((attachmentCount)) * sizeof(const VkClearAttachment));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006530 for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i)
6531 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006532 deepcopy_VkClearAttachment(pool, pAttachments + i, (VkClearAttachment*)(local_pAttachments + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006533 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006534 }
6535 if (local_pAttachments)
6536 {
6537 for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i)
6538 {
6539 handlemap_VkClearAttachment(resources->unwrapMapping(), (VkClearAttachment*)(local_pAttachments + i));
6540 }
6541 }
6542 uint32_t local_rectCount;
6543 local_rectCount = rectCount;
6544 VkClearRect* local_pRects;
6545 local_pRects = nullptr;
6546 if (pRects)
6547 {
6548 local_pRects = (VkClearRect*)pool->alloc(((rectCount)) * sizeof(const VkClearRect));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006549 for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i)
6550 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006551 deepcopy_VkClearRect(pool, pRects + i, (VkClearRect*)(local_pRects + i));
6552 }
6553 }
6554 if (local_pRects)
6555 {
6556 for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i)
6557 {
6558 handlemap_VkClearRect(resources->unwrapMapping(), (VkClearRect*)(local_pRects + i));
6559 }
6560 }
6561 countingStream->rewind();
6562 {
6563 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6564 countingStream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t));
6565 for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i)
6566 {
6567 marshal_VkClearAttachment(countingStream, (VkClearAttachment*)(local_pAttachments + i));
6568 }
6569 countingStream->write((uint32_t*)&local_rectCount, sizeof(uint32_t));
6570 for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i)
6571 {
6572 marshal_VkClearRect(countingStream, (VkClearRect*)(local_pRects + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006573 }
6574 }
6575 uint32_t packetSize_vkCmdClearAttachments = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6576 countingStream->rewind();
6577 uint32_t opcode_vkCmdClearAttachments = OP_vkCmdClearAttachments;
6578 stream->write(&opcode_vkCmdClearAttachments, sizeof(uint32_t));
6579 stream->write(&packetSize_vkCmdClearAttachments, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006580 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6581 stream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006582 for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i)
6583 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006584 marshal_VkClearAttachment(stream, (VkClearAttachment*)(local_pAttachments + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006585 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006586 stream->write((uint32_t*)&local_rectCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006587 for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i)
6588 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006589 marshal_VkClearRect(stream, (VkClearRect*)(local_pRects + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006590 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006591 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006592}
6593
6594void VkEncoder::vkCmdResolveImage(
6595 VkCommandBuffer commandBuffer,
6596 VkImage srcImage,
6597 VkImageLayout srcImageLayout,
6598 VkImage dstImage,
6599 VkImageLayout dstImageLayout,
6600 uint32_t regionCount,
6601 const VkImageResolve* pRegions)
6602{
6603 auto stream = mImpl->stream();
6604 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006605 auto resources = mImpl->resources();
6606 auto pool = mImpl->pool();
6607 VkCommandBuffer local_commandBuffer;
6608 local_commandBuffer = commandBuffer;
6609 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6610 VkImage local_srcImage;
6611 local_srcImage = srcImage;
6612 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage);
6613 VkImageLayout local_srcImageLayout;
6614 local_srcImageLayout = srcImageLayout;
6615 VkImage local_dstImage;
6616 local_dstImage = dstImage;
6617 resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage);
6618 VkImageLayout local_dstImageLayout;
6619 local_dstImageLayout = dstImageLayout;
6620 uint32_t local_regionCount;
6621 local_regionCount = regionCount;
6622 VkImageResolve* local_pRegions;
6623 local_pRegions = nullptr;
6624 if (pRegions)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006625 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006626 local_pRegions = (VkImageResolve*)pool->alloc(((regionCount)) * sizeof(const VkImageResolve));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006627 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6628 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006629 deepcopy_VkImageResolve(pool, pRegions + i, (VkImageResolve*)(local_pRegions + i));
6630 }
6631 }
6632 if (local_pRegions)
6633 {
6634 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6635 {
6636 handlemap_VkImageResolve(resources->unwrapMapping(), (VkImageResolve*)(local_pRegions + i));
6637 }
6638 }
6639 countingStream->rewind();
6640 {
6641 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6642 countingStream->write((VkImage*)&local_srcImage, sizeof(VkImage));
6643 countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
6644 countingStream->write((VkImage*)&local_dstImage, sizeof(VkImage));
6645 countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6646 countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
6647 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6648 {
6649 marshal_VkImageResolve(countingStream, (VkImageResolve*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006650 }
6651 }
6652 uint32_t packetSize_vkCmdResolveImage = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6653 countingStream->rewind();
6654 uint32_t opcode_vkCmdResolveImage = OP_vkCmdResolveImage;
6655 stream->write(&opcode_vkCmdResolveImage, sizeof(uint32_t));
6656 stream->write(&packetSize_vkCmdResolveImage, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006657 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6658 stream->write((VkImage*)&local_srcImage, sizeof(VkImage));
6659 stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout));
6660 stream->write((VkImage*)&local_dstImage, sizeof(VkImage));
6661 stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout));
6662 stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006663 for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i)
6664 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006665 marshal_VkImageResolve(stream, (VkImageResolve*)(local_pRegions + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006666 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006667 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006668}
6669
6670void VkEncoder::vkCmdSetEvent(
6671 VkCommandBuffer commandBuffer,
6672 VkEvent event,
6673 VkPipelineStageFlags stageMask)
6674{
6675 auto stream = mImpl->stream();
6676 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006677 auto resources = mImpl->resources();
6678 auto pool = mImpl->pool();
6679 VkCommandBuffer local_commandBuffer;
6680 local_commandBuffer = commandBuffer;
6681 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6682 VkEvent local_event;
6683 local_event = event;
6684 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
6685 VkPipelineStageFlags local_stageMask;
6686 local_stageMask = stageMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006687 countingStream->rewind();
6688 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006689 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6690 countingStream->write((VkEvent*)&local_event, sizeof(VkEvent));
6691 countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006692 }
6693 uint32_t packetSize_vkCmdSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6694 countingStream->rewind();
6695 uint32_t opcode_vkCmdSetEvent = OP_vkCmdSetEvent;
6696 stream->write(&opcode_vkCmdSetEvent, sizeof(uint32_t));
6697 stream->write(&packetSize_vkCmdSetEvent, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006698 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6699 stream->write((VkEvent*)&local_event, sizeof(VkEvent));
6700 stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
6701 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006702}
6703
6704void VkEncoder::vkCmdResetEvent(
6705 VkCommandBuffer commandBuffer,
6706 VkEvent event,
6707 VkPipelineStageFlags stageMask)
6708{
6709 auto stream = mImpl->stream();
6710 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006711 auto resources = mImpl->resources();
6712 auto pool = mImpl->pool();
6713 VkCommandBuffer local_commandBuffer;
6714 local_commandBuffer = commandBuffer;
6715 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6716 VkEvent local_event;
6717 local_event = event;
6718 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event);
6719 VkPipelineStageFlags local_stageMask;
6720 local_stageMask = stageMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006721 countingStream->rewind();
6722 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006723 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6724 countingStream->write((VkEvent*)&local_event, sizeof(VkEvent));
6725 countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006726 }
6727 uint32_t packetSize_vkCmdResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6728 countingStream->rewind();
6729 uint32_t opcode_vkCmdResetEvent = OP_vkCmdResetEvent;
6730 stream->write(&opcode_vkCmdResetEvent, sizeof(uint32_t));
6731 stream->write(&packetSize_vkCmdResetEvent, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006732 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6733 stream->write((VkEvent*)&local_event, sizeof(VkEvent));
6734 stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags));
6735 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006736}
6737
6738void VkEncoder::vkCmdWaitEvents(
6739 VkCommandBuffer commandBuffer,
6740 uint32_t eventCount,
6741 const VkEvent* pEvents,
6742 VkPipelineStageFlags srcStageMask,
6743 VkPipelineStageFlags dstStageMask,
6744 uint32_t memoryBarrierCount,
6745 const VkMemoryBarrier* pMemoryBarriers,
6746 uint32_t bufferMemoryBarrierCount,
6747 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
6748 uint32_t imageMemoryBarrierCount,
6749 const VkImageMemoryBarrier* pImageMemoryBarriers)
6750{
6751 auto stream = mImpl->stream();
6752 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006753 auto resources = mImpl->resources();
6754 auto pool = mImpl->pool();
6755 VkCommandBuffer local_commandBuffer;
6756 local_commandBuffer = commandBuffer;
6757 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6758 uint32_t local_eventCount;
6759 local_eventCount = eventCount;
6760 VkEvent* local_pEvents;
6761 local_pEvents = nullptr;
6762 if (pEvents)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006763 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006764 local_pEvents = (VkEvent*)pool->dupArray(pEvents, ((eventCount)) * sizeof(const VkEvent));
6765 }
6766 if (local_pEvents)
6767 {
6768 resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)local_pEvents, ((eventCount)));
6769 }
6770 VkPipelineStageFlags local_srcStageMask;
6771 local_srcStageMask = srcStageMask;
6772 VkPipelineStageFlags local_dstStageMask;
6773 local_dstStageMask = dstStageMask;
6774 uint32_t local_memoryBarrierCount;
6775 local_memoryBarrierCount = memoryBarrierCount;
6776 VkMemoryBarrier* local_pMemoryBarriers;
6777 local_pMemoryBarriers = nullptr;
6778 if (pMemoryBarriers)
6779 {
6780 local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006781 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
6782 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006783 deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006784 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006785 }
6786 if (local_pMemoryBarriers)
6787 {
6788 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
6789 {
6790 handlemap_VkMemoryBarrier(resources->unwrapMapping(), (VkMemoryBarrier*)(local_pMemoryBarriers + i));
6791 }
6792 }
6793 uint32_t local_bufferMemoryBarrierCount;
6794 local_bufferMemoryBarrierCount = bufferMemoryBarrierCount;
6795 VkBufferMemoryBarrier* local_pBufferMemoryBarriers;
6796 local_pBufferMemoryBarriers = nullptr;
6797 if (pBufferMemoryBarriers)
6798 {
6799 local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006800 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
6801 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006802 deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006803 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006804 }
6805 if (local_pBufferMemoryBarriers)
6806 {
6807 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
6808 {
6809 handlemap_VkBufferMemoryBarrier(resources->unwrapMapping(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
6810 }
6811 }
6812 uint32_t local_imageMemoryBarrierCount;
6813 local_imageMemoryBarrierCount = imageMemoryBarrierCount;
6814 VkImageMemoryBarrier* local_pImageMemoryBarriers;
6815 local_pImageMemoryBarriers = nullptr;
6816 if (pImageMemoryBarriers)
6817 {
6818 local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006819 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
6820 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006821 deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
6822 }
6823 }
6824 if (local_pImageMemoryBarriers)
6825 {
6826 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
6827 {
6828 handlemap_VkImageMemoryBarrier(resources->unwrapMapping(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
6829 }
6830 }
6831 countingStream->rewind();
6832 {
6833 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6834 countingStream->write((uint32_t*)&local_eventCount, sizeof(uint32_t));
6835 countingStream->write((VkEvent*)local_pEvents, ((eventCount)) * sizeof(VkEvent));
6836 countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
6837 countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
6838 countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
6839 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
6840 {
6841 marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
6842 }
6843 countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t));
6844 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
6845 {
6846 marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
6847 }
6848 countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t));
6849 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
6850 {
6851 marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006852 }
6853 }
6854 uint32_t packetSize_vkCmdWaitEvents = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6855 countingStream->rewind();
6856 uint32_t opcode_vkCmdWaitEvents = OP_vkCmdWaitEvents;
6857 stream->write(&opcode_vkCmdWaitEvents, sizeof(uint32_t));
6858 stream->write(&packetSize_vkCmdWaitEvents, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006859 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6860 stream->write((uint32_t*)&local_eventCount, sizeof(uint32_t));
6861 stream->write((VkEvent*)local_pEvents, ((eventCount)) * sizeof(VkEvent));
6862 stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
6863 stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
6864 stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006865 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
6866 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006867 marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006868 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006869 stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006870 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
6871 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006872 marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006873 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006874 stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006875 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
6876 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006877 marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006878 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006879 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006880}
6881
6882void VkEncoder::vkCmdPipelineBarrier(
6883 VkCommandBuffer commandBuffer,
6884 VkPipelineStageFlags srcStageMask,
6885 VkPipelineStageFlags dstStageMask,
6886 VkDependencyFlags dependencyFlags,
6887 uint32_t memoryBarrierCount,
6888 const VkMemoryBarrier* pMemoryBarriers,
6889 uint32_t bufferMemoryBarrierCount,
6890 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
6891 uint32_t imageMemoryBarrierCount,
6892 const VkImageMemoryBarrier* pImageMemoryBarriers)
6893{
6894 auto stream = mImpl->stream();
6895 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006896 auto resources = mImpl->resources();
6897 auto pool = mImpl->pool();
6898 VkCommandBuffer local_commandBuffer;
6899 local_commandBuffer = commandBuffer;
6900 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
6901 VkPipelineStageFlags local_srcStageMask;
6902 local_srcStageMask = srcStageMask;
6903 VkPipelineStageFlags local_dstStageMask;
6904 local_dstStageMask = dstStageMask;
6905 VkDependencyFlags local_dependencyFlags;
6906 local_dependencyFlags = dependencyFlags;
6907 uint32_t local_memoryBarrierCount;
6908 local_memoryBarrierCount = memoryBarrierCount;
6909 VkMemoryBarrier* local_pMemoryBarriers;
6910 local_pMemoryBarriers = nullptr;
6911 if (pMemoryBarriers)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006912 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006913 local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006914 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
6915 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006916 deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006917 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006918 }
6919 if (local_pMemoryBarriers)
6920 {
6921 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
6922 {
6923 handlemap_VkMemoryBarrier(resources->unwrapMapping(), (VkMemoryBarrier*)(local_pMemoryBarriers + i));
6924 }
6925 }
6926 uint32_t local_bufferMemoryBarrierCount;
6927 local_bufferMemoryBarrierCount = bufferMemoryBarrierCount;
6928 VkBufferMemoryBarrier* local_pBufferMemoryBarriers;
6929 local_pBufferMemoryBarriers = nullptr;
6930 if (pBufferMemoryBarriers)
6931 {
6932 local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006933 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
6934 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006935 deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006936 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006937 }
6938 if (local_pBufferMemoryBarriers)
6939 {
6940 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
6941 {
6942 handlemap_VkBufferMemoryBarrier(resources->unwrapMapping(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
6943 }
6944 }
6945 uint32_t local_imageMemoryBarrierCount;
6946 local_imageMemoryBarrierCount = imageMemoryBarrierCount;
6947 VkImageMemoryBarrier* local_pImageMemoryBarriers;
6948 local_pImageMemoryBarriers = nullptr;
6949 if (pImageMemoryBarriers)
6950 {
6951 local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006952 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
6953 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006954 deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
6955 }
6956 }
6957 if (local_pImageMemoryBarriers)
6958 {
6959 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
6960 {
6961 handlemap_VkImageMemoryBarrier(resources->unwrapMapping(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
6962 }
6963 }
6964 countingStream->rewind();
6965 {
6966 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6967 countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
6968 countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
6969 countingStream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags));
6970 countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
6971 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
6972 {
6973 marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
6974 }
6975 countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t));
6976 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
6977 {
6978 marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
6979 }
6980 countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t));
6981 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
6982 {
6983 marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006984 }
6985 }
6986 uint32_t packetSize_vkCmdPipelineBarrier = 4 + 4 + (uint32_t)countingStream->bytesWritten();
6987 countingStream->rewind();
6988 uint32_t opcode_vkCmdPipelineBarrier = OP_vkCmdPipelineBarrier;
6989 stream->write(&opcode_vkCmdPipelineBarrier, sizeof(uint32_t));
6990 stream->write(&packetSize_vkCmdPipelineBarrier, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006991 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
6992 stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags));
6993 stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags));
6994 stream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags));
6995 stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006996 for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i)
6997 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08006998 marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07006999 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007000 stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007001 for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i)
7002 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007003 marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007004 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007005 stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007006 for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i)
7007 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007008 marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007009 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007010 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007011}
7012
7013void VkEncoder::vkCmdBeginQuery(
7014 VkCommandBuffer commandBuffer,
7015 VkQueryPool queryPool,
7016 uint32_t query,
7017 VkQueryControlFlags flags)
7018{
7019 auto stream = mImpl->stream();
7020 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007021 auto resources = mImpl->resources();
7022 auto pool = mImpl->pool();
7023 VkCommandBuffer local_commandBuffer;
7024 local_commandBuffer = commandBuffer;
7025 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7026 VkQueryPool local_queryPool;
7027 local_queryPool = queryPool;
7028 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
7029 uint32_t local_query;
7030 local_query = query;
7031 VkQueryControlFlags local_flags;
7032 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007033 countingStream->rewind();
7034 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007035 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7036 countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
7037 countingStream->write((uint32_t*)&local_query, sizeof(uint32_t));
7038 countingStream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007039 }
7040 uint32_t packetSize_vkCmdBeginQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7041 countingStream->rewind();
7042 uint32_t opcode_vkCmdBeginQuery = OP_vkCmdBeginQuery;
7043 stream->write(&opcode_vkCmdBeginQuery, sizeof(uint32_t));
7044 stream->write(&packetSize_vkCmdBeginQuery, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007045 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7046 stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
7047 stream->write((uint32_t*)&local_query, sizeof(uint32_t));
7048 stream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags));
7049 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007050}
7051
7052void VkEncoder::vkCmdEndQuery(
7053 VkCommandBuffer commandBuffer,
7054 VkQueryPool queryPool,
7055 uint32_t query)
7056{
7057 auto stream = mImpl->stream();
7058 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007059 auto resources = mImpl->resources();
7060 auto pool = mImpl->pool();
7061 VkCommandBuffer local_commandBuffer;
7062 local_commandBuffer = commandBuffer;
7063 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7064 VkQueryPool local_queryPool;
7065 local_queryPool = queryPool;
7066 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
7067 uint32_t local_query;
7068 local_query = query;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007069 countingStream->rewind();
7070 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007071 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7072 countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
7073 countingStream->write((uint32_t*)&local_query, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007074 }
7075 uint32_t packetSize_vkCmdEndQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7076 countingStream->rewind();
7077 uint32_t opcode_vkCmdEndQuery = OP_vkCmdEndQuery;
7078 stream->write(&opcode_vkCmdEndQuery, sizeof(uint32_t));
7079 stream->write(&packetSize_vkCmdEndQuery, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007080 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7081 stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
7082 stream->write((uint32_t*)&local_query, sizeof(uint32_t));
7083 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007084}
7085
7086void VkEncoder::vkCmdResetQueryPool(
7087 VkCommandBuffer commandBuffer,
7088 VkQueryPool queryPool,
7089 uint32_t firstQuery,
7090 uint32_t queryCount)
7091{
7092 auto stream = mImpl->stream();
7093 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007094 auto resources = mImpl->resources();
7095 auto pool = mImpl->pool();
7096 VkCommandBuffer local_commandBuffer;
7097 local_commandBuffer = commandBuffer;
7098 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7099 VkQueryPool local_queryPool;
7100 local_queryPool = queryPool;
7101 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
7102 uint32_t local_firstQuery;
7103 local_firstQuery = firstQuery;
7104 uint32_t local_queryCount;
7105 local_queryCount = queryCount;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007106 countingStream->rewind();
7107 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007108 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7109 countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
7110 countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
7111 countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007112 }
7113 uint32_t packetSize_vkCmdResetQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7114 countingStream->rewind();
7115 uint32_t opcode_vkCmdResetQueryPool = OP_vkCmdResetQueryPool;
7116 stream->write(&opcode_vkCmdResetQueryPool, sizeof(uint32_t));
7117 stream->write(&packetSize_vkCmdResetQueryPool, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007118 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7119 stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
7120 stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
7121 stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
7122 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007123}
7124
7125void VkEncoder::vkCmdWriteTimestamp(
7126 VkCommandBuffer commandBuffer,
7127 VkPipelineStageFlagBits pipelineStage,
7128 VkQueryPool queryPool,
7129 uint32_t query)
7130{
7131 auto stream = mImpl->stream();
7132 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007133 auto resources = mImpl->resources();
7134 auto pool = mImpl->pool();
7135 VkCommandBuffer local_commandBuffer;
7136 local_commandBuffer = commandBuffer;
7137 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7138 VkPipelineStageFlagBits local_pipelineStage;
7139 local_pipelineStage = pipelineStage;
7140 VkQueryPool local_queryPool;
7141 local_queryPool = queryPool;
7142 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
7143 uint32_t local_query;
7144 local_query = query;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007145 countingStream->rewind();
7146 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007147 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7148 countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
7149 countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
7150 countingStream->write((uint32_t*)&local_query, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007151 }
7152 uint32_t packetSize_vkCmdWriteTimestamp = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7153 countingStream->rewind();
7154 uint32_t opcode_vkCmdWriteTimestamp = OP_vkCmdWriteTimestamp;
7155 stream->write(&opcode_vkCmdWriteTimestamp, sizeof(uint32_t));
7156 stream->write(&packetSize_vkCmdWriteTimestamp, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007157 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7158 stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
7159 stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
7160 stream->write((uint32_t*)&local_query, sizeof(uint32_t));
7161 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007162}
7163
7164void VkEncoder::vkCmdCopyQueryPoolResults(
7165 VkCommandBuffer commandBuffer,
7166 VkQueryPool queryPool,
7167 uint32_t firstQuery,
7168 uint32_t queryCount,
7169 VkBuffer dstBuffer,
7170 VkDeviceSize dstOffset,
7171 VkDeviceSize stride,
7172 VkQueryResultFlags flags)
7173{
7174 auto stream = mImpl->stream();
7175 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007176 auto resources = mImpl->resources();
7177 auto pool = mImpl->pool();
7178 VkCommandBuffer local_commandBuffer;
7179 local_commandBuffer = commandBuffer;
7180 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7181 VkQueryPool local_queryPool;
7182 local_queryPool = queryPool;
7183 resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool);
7184 uint32_t local_firstQuery;
7185 local_firstQuery = firstQuery;
7186 uint32_t local_queryCount;
7187 local_queryCount = queryCount;
7188 VkBuffer local_dstBuffer;
7189 local_dstBuffer = dstBuffer;
7190 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
7191 VkDeviceSize local_dstOffset;
7192 local_dstOffset = dstOffset;
7193 VkDeviceSize local_stride;
7194 local_stride = stride;
7195 VkQueryResultFlags local_flags;
7196 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007197 countingStream->rewind();
7198 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007199 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7200 countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
7201 countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
7202 countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
7203 countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
7204 countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
7205 countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
7206 countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007207 }
7208 uint32_t packetSize_vkCmdCopyQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7209 countingStream->rewind();
7210 uint32_t opcode_vkCmdCopyQueryPoolResults = OP_vkCmdCopyQueryPoolResults;
7211 stream->write(&opcode_vkCmdCopyQueryPoolResults, sizeof(uint32_t));
7212 stream->write(&packetSize_vkCmdCopyQueryPoolResults, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007213 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7214 stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool));
7215 stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t));
7216 stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t));
7217 stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
7218 stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
7219 stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize));
7220 stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags));
7221 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007222}
7223
7224void VkEncoder::vkCmdPushConstants(
7225 VkCommandBuffer commandBuffer,
7226 VkPipelineLayout layout,
7227 VkShaderStageFlags stageFlags,
7228 uint32_t offset,
7229 uint32_t size,
7230 const void* pValues)
7231{
7232 auto stream = mImpl->stream();
7233 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007234 auto resources = mImpl->resources();
7235 auto pool = mImpl->pool();
7236 VkCommandBuffer local_commandBuffer;
7237 local_commandBuffer = commandBuffer;
7238 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7239 VkPipelineLayout local_layout;
7240 local_layout = layout;
7241 resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout);
7242 VkShaderStageFlags local_stageFlags;
7243 local_stageFlags = stageFlags;
7244 uint32_t local_offset;
7245 local_offset = offset;
7246 uint32_t local_size;
7247 local_size = size;
7248 void* local_pValues;
7249 local_pValues = nullptr;
7250 if (pValues)
7251 {
7252 local_pValues = (void*)pool->dupArray(pValues, ((size)) * sizeof(const uint8_t));
7253 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007254 countingStream->rewind();
7255 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007256 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7257 countingStream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout));
7258 countingStream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags));
7259 countingStream->write((uint32_t*)&local_offset, sizeof(uint32_t));
7260 countingStream->write((uint32_t*)&local_size, sizeof(uint32_t));
7261 countingStream->write((void*)local_pValues, ((size)) * sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007262 }
7263 uint32_t packetSize_vkCmdPushConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7264 countingStream->rewind();
7265 uint32_t opcode_vkCmdPushConstants = OP_vkCmdPushConstants;
7266 stream->write(&opcode_vkCmdPushConstants, sizeof(uint32_t));
7267 stream->write(&packetSize_vkCmdPushConstants, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007268 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7269 stream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout));
7270 stream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags));
7271 stream->write((uint32_t*)&local_offset, sizeof(uint32_t));
7272 stream->write((uint32_t*)&local_size, sizeof(uint32_t));
7273 stream->write((void*)local_pValues, ((size)) * sizeof(uint8_t));
7274 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007275}
7276
7277void VkEncoder::vkCmdBeginRenderPass(
7278 VkCommandBuffer commandBuffer,
7279 const VkRenderPassBeginInfo* pRenderPassBegin,
7280 VkSubpassContents contents)
7281{
7282 auto stream = mImpl->stream();
7283 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007284 auto resources = mImpl->resources();
7285 auto pool = mImpl->pool();
7286 VkCommandBuffer local_commandBuffer;
7287 local_commandBuffer = commandBuffer;
7288 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7289 VkRenderPassBeginInfo* local_pRenderPassBegin;
7290 local_pRenderPassBegin = nullptr;
7291 if (pRenderPassBegin)
7292 {
7293 local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo));
7294 deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
7295 }
7296 if (local_pRenderPassBegin)
7297 {
7298 handlemap_VkRenderPassBeginInfo(resources->unwrapMapping(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
7299 }
7300 VkSubpassContents local_contents;
7301 local_contents = contents;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007302 countingStream->rewind();
7303 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007304 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7305 marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
7306 countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007307 }
7308 uint32_t packetSize_vkCmdBeginRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7309 countingStream->rewind();
7310 uint32_t opcode_vkCmdBeginRenderPass = OP_vkCmdBeginRenderPass;
7311 stream->write(&opcode_vkCmdBeginRenderPass, sizeof(uint32_t));
7312 stream->write(&packetSize_vkCmdBeginRenderPass, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007313 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7314 marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
7315 stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
7316 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007317}
7318
7319void VkEncoder::vkCmdNextSubpass(
7320 VkCommandBuffer commandBuffer,
7321 VkSubpassContents contents)
7322{
7323 auto stream = mImpl->stream();
7324 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007325 auto resources = mImpl->resources();
7326 auto pool = mImpl->pool();
7327 VkCommandBuffer local_commandBuffer;
7328 local_commandBuffer = commandBuffer;
7329 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7330 VkSubpassContents local_contents;
7331 local_contents = contents;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007332 countingStream->rewind();
7333 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007334 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7335 countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007336 }
7337 uint32_t packetSize_vkCmdNextSubpass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7338 countingStream->rewind();
7339 uint32_t opcode_vkCmdNextSubpass = OP_vkCmdNextSubpass;
7340 stream->write(&opcode_vkCmdNextSubpass, sizeof(uint32_t));
7341 stream->write(&packetSize_vkCmdNextSubpass, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007342 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7343 stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents));
7344 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007345}
7346
7347void VkEncoder::vkCmdEndRenderPass(
7348 VkCommandBuffer commandBuffer)
7349{
7350 auto stream = mImpl->stream();
7351 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007352 auto resources = mImpl->resources();
7353 auto pool = mImpl->pool();
7354 VkCommandBuffer local_commandBuffer;
7355 local_commandBuffer = commandBuffer;
7356 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007357 countingStream->rewind();
7358 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007359 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007360 }
7361 uint32_t packetSize_vkCmdEndRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7362 countingStream->rewind();
7363 uint32_t opcode_vkCmdEndRenderPass = OP_vkCmdEndRenderPass;
7364 stream->write(&opcode_vkCmdEndRenderPass, sizeof(uint32_t));
7365 stream->write(&packetSize_vkCmdEndRenderPass, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007366 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7367 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007368}
7369
7370void VkEncoder::vkCmdExecuteCommands(
7371 VkCommandBuffer commandBuffer,
7372 uint32_t commandBufferCount,
7373 const VkCommandBuffer* pCommandBuffers)
7374{
7375 auto stream = mImpl->stream();
7376 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007377 auto resources = mImpl->resources();
7378 auto pool = mImpl->pool();
7379 VkCommandBuffer local_commandBuffer;
7380 local_commandBuffer = commandBuffer;
7381 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7382 uint32_t local_commandBufferCount;
7383 local_commandBufferCount = commandBufferCount;
7384 VkCommandBuffer* local_pCommandBuffers;
7385 local_pCommandBuffers = nullptr;
7386 if (pCommandBuffers)
7387 {
7388 local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer));
7389 }
7390 if (local_pCommandBuffers)
7391 {
7392 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)));
7393 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007394 countingStream->rewind();
7395 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007396 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7397 countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
7398 countingStream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007399 }
7400 uint32_t packetSize_vkCmdExecuteCommands = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7401 countingStream->rewind();
7402 uint32_t opcode_vkCmdExecuteCommands = OP_vkCmdExecuteCommands;
7403 stream->write(&opcode_vkCmdExecuteCommands, sizeof(uint32_t));
7404 stream->write(&packetSize_vkCmdExecuteCommands, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007405 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7406 stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t));
7407 stream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer));
7408 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007409}
7410
7411#endif
7412#ifdef VK_VERSION_1_1
7413VkResult VkEncoder::vkEnumerateInstanceVersion(
7414 uint32_t* pApiVersion)
7415{
7416 auto stream = mImpl->stream();
7417 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007418 auto resources = mImpl->resources();
7419 auto pool = mImpl->pool();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007420 countingStream->rewind();
7421 {
7422 countingStream->write((uint32_t*)pApiVersion, sizeof(uint32_t));
7423 }
7424 uint32_t packetSize_vkEnumerateInstanceVersion = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7425 countingStream->rewind();
7426 uint32_t opcode_vkEnumerateInstanceVersion = OP_vkEnumerateInstanceVersion;
7427 stream->write(&opcode_vkEnumerateInstanceVersion, sizeof(uint32_t));
7428 stream->write(&packetSize_vkEnumerateInstanceVersion, sizeof(uint32_t));
7429 stream->write((uint32_t*)pApiVersion, sizeof(uint32_t));
7430 stream->read((uint32_t*)pApiVersion, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007431 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007432 VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0;
7433 stream->read(&vkEnumerateInstanceVersion_VkResult_return, sizeof(VkResult));
7434 return vkEnumerateInstanceVersion_VkResult_return;
7435}
7436
7437VkResult VkEncoder::vkBindBufferMemory2(
7438 VkDevice device,
7439 uint32_t bindInfoCount,
7440 const VkBindBufferMemoryInfo* pBindInfos)
7441{
7442 auto stream = mImpl->stream();
7443 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007444 auto resources = mImpl->resources();
7445 auto pool = mImpl->pool();
7446 VkDevice local_device;
7447 local_device = device;
7448 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
7449 uint32_t local_bindInfoCount;
7450 local_bindInfoCount = bindInfoCount;
7451 VkBindBufferMemoryInfo* local_pBindInfos;
7452 local_pBindInfos = nullptr;
7453 if (pBindInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007454 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007455 local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007456 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
7457 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007458 deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
7459 }
7460 }
7461 if (local_pBindInfos)
7462 {
7463 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
7464 {
7465 handlemap_VkBindBufferMemoryInfo(resources->unwrapMapping(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
7466 }
7467 }
7468 countingStream->rewind();
7469 {
7470 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
7471 countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
7472 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
7473 {
7474 marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007475 }
7476 }
7477 uint32_t packetSize_vkBindBufferMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7478 countingStream->rewind();
7479 uint32_t opcode_vkBindBufferMemory2 = OP_vkBindBufferMemory2;
7480 stream->write(&opcode_vkBindBufferMemory2, sizeof(uint32_t));
7481 stream->write(&packetSize_vkBindBufferMemory2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007482 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
7483 stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007484 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
7485 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007486 marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007487 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007488 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007489 VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0;
7490 stream->read(&vkBindBufferMemory2_VkResult_return, sizeof(VkResult));
7491 return vkBindBufferMemory2_VkResult_return;
7492}
7493
7494VkResult VkEncoder::vkBindImageMemory2(
7495 VkDevice device,
7496 uint32_t bindInfoCount,
7497 const VkBindImageMemoryInfo* pBindInfos)
7498{
7499 auto stream = mImpl->stream();
7500 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007501 auto resources = mImpl->resources();
7502 auto pool = mImpl->pool();
7503 VkDevice local_device;
7504 local_device = device;
7505 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
7506 uint32_t local_bindInfoCount;
7507 local_bindInfoCount = bindInfoCount;
7508 VkBindImageMemoryInfo* local_pBindInfos;
7509 local_pBindInfos = nullptr;
7510 if (pBindInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007511 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007512 local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007513 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
7514 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007515 deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
7516 }
7517 }
7518 if (local_pBindInfos)
7519 {
7520 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
7521 {
7522 handlemap_VkBindImageMemoryInfo(resources->unwrapMapping(), (VkBindImageMemoryInfo*)(local_pBindInfos + i));
7523 }
7524 }
7525 countingStream->rewind();
7526 {
7527 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
7528 countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
7529 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
7530 {
7531 marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007532 }
7533 }
7534 uint32_t packetSize_vkBindImageMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7535 countingStream->rewind();
7536 uint32_t opcode_vkBindImageMemory2 = OP_vkBindImageMemory2;
7537 stream->write(&opcode_vkBindImageMemory2, sizeof(uint32_t));
7538 stream->write(&packetSize_vkBindImageMemory2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007539 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
7540 stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007541 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
7542 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007543 marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007544 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007545 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007546 VkResult vkBindImageMemory2_VkResult_return = (VkResult)0;
7547 stream->read(&vkBindImageMemory2_VkResult_return, sizeof(VkResult));
7548 return vkBindImageMemory2_VkResult_return;
7549}
7550
7551void VkEncoder::vkGetDeviceGroupPeerMemoryFeatures(
7552 VkDevice device,
7553 uint32_t heapIndex,
7554 uint32_t localDeviceIndex,
7555 uint32_t remoteDeviceIndex,
7556 VkPeerMemoryFeatureFlags* pPeerMemoryFeatures)
7557{
7558 auto stream = mImpl->stream();
7559 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007560 auto resources = mImpl->resources();
7561 auto pool = mImpl->pool();
7562 VkDevice local_device;
7563 local_device = device;
7564 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
7565 uint32_t local_heapIndex;
7566 local_heapIndex = heapIndex;
7567 uint32_t local_localDeviceIndex;
7568 local_localDeviceIndex = localDeviceIndex;
7569 uint32_t local_remoteDeviceIndex;
7570 local_remoteDeviceIndex = remoteDeviceIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007571 countingStream->rewind();
7572 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007573 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
7574 countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
7575 countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
7576 countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007577 countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
7578 }
7579 uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7580 countingStream->rewind();
7581 uint32_t opcode_vkGetDeviceGroupPeerMemoryFeatures = OP_vkGetDeviceGroupPeerMemoryFeatures;
7582 stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t));
7583 stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007584 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
7585 stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
7586 stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
7587 stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007588 stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
7589 stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007590 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007591}
7592
7593void VkEncoder::vkCmdSetDeviceMask(
7594 VkCommandBuffer commandBuffer,
7595 uint32_t deviceMask)
7596{
7597 auto stream = mImpl->stream();
7598 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007599 auto resources = mImpl->resources();
7600 auto pool = mImpl->pool();
7601 VkCommandBuffer local_commandBuffer;
7602 local_commandBuffer = commandBuffer;
7603 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7604 uint32_t local_deviceMask;
7605 local_deviceMask = deviceMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007606 countingStream->rewind();
7607 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007608 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7609 countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007610 }
7611 uint32_t packetSize_vkCmdSetDeviceMask = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7612 countingStream->rewind();
7613 uint32_t opcode_vkCmdSetDeviceMask = OP_vkCmdSetDeviceMask;
7614 stream->write(&opcode_vkCmdSetDeviceMask, sizeof(uint32_t));
7615 stream->write(&packetSize_vkCmdSetDeviceMask, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007616 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7617 stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
7618 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007619}
7620
7621void VkEncoder::vkCmdDispatchBase(
7622 VkCommandBuffer commandBuffer,
7623 uint32_t baseGroupX,
7624 uint32_t baseGroupY,
7625 uint32_t baseGroupZ,
7626 uint32_t groupCountX,
7627 uint32_t groupCountY,
7628 uint32_t groupCountZ)
7629{
7630 auto stream = mImpl->stream();
7631 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007632 auto resources = mImpl->resources();
7633 auto pool = mImpl->pool();
7634 VkCommandBuffer local_commandBuffer;
7635 local_commandBuffer = commandBuffer;
7636 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
7637 uint32_t local_baseGroupX;
7638 local_baseGroupX = baseGroupX;
7639 uint32_t local_baseGroupY;
7640 local_baseGroupY = baseGroupY;
7641 uint32_t local_baseGroupZ;
7642 local_baseGroupZ = baseGroupZ;
7643 uint32_t local_groupCountX;
7644 local_groupCountX = groupCountX;
7645 uint32_t local_groupCountY;
7646 local_groupCountY = groupCountY;
7647 uint32_t local_groupCountZ;
7648 local_groupCountZ = groupCountZ;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007649 countingStream->rewind();
7650 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007651 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7652 countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
7653 countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
7654 countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
7655 countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
7656 countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
7657 countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007658 }
7659 uint32_t packetSize_vkCmdDispatchBase = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7660 countingStream->rewind();
7661 uint32_t opcode_vkCmdDispatchBase = OP_vkCmdDispatchBase;
7662 stream->write(&opcode_vkCmdDispatchBase, sizeof(uint32_t));
7663 stream->write(&packetSize_vkCmdDispatchBase, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007664 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
7665 stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
7666 stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
7667 stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
7668 stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
7669 stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
7670 stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
7671 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007672}
7673
7674VkResult VkEncoder::vkEnumeratePhysicalDeviceGroups(
7675 VkInstance instance,
7676 uint32_t* pPhysicalDeviceGroupCount,
7677 VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties)
7678{
7679 auto stream = mImpl->stream();
7680 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007681 auto resources = mImpl->resources();
7682 auto pool = mImpl->pool();
7683 VkInstance local_instance;
7684 local_instance = instance;
7685 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007686 countingStream->rewind();
7687 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007688 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007689 countingStream->write((uint32_t**)&pPhysicalDeviceGroupCount, sizeof(uint32_t*));
7690 if (pPhysicalDeviceGroupCount)
7691 {
7692 countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
7693 }
7694 countingStream->write((VkPhysicalDeviceGroupProperties**)&pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*));
7695 if (pPhysicalDeviceGroupProperties)
7696 {
7697 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
7698 {
7699 marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
7700 }
7701 }
7702 }
7703 uint32_t packetSize_vkEnumeratePhysicalDeviceGroups = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7704 countingStream->rewind();
7705 uint32_t opcode_vkEnumeratePhysicalDeviceGroups = OP_vkEnumeratePhysicalDeviceGroups;
7706 stream->write(&opcode_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t));
7707 stream->write(&packetSize_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007708 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007709 stream->write((uint32_t**)&pPhysicalDeviceGroupCount, sizeof(uint32_t*));
7710 if (pPhysicalDeviceGroupCount)
7711 {
7712 stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
7713 }
7714 stream->write((VkPhysicalDeviceGroupProperties**)&pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*));
7715 if (pPhysicalDeviceGroupProperties)
7716 {
7717 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
7718 {
7719 marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
7720 }
7721 }
7722 uint32_t* check_pPhysicalDeviceGroupCount;
7723 stream->read((uint32_t**)&check_pPhysicalDeviceGroupCount, sizeof(uint32_t*));
7724 if (pPhysicalDeviceGroupCount)
7725 {
7726 if (!(check_pPhysicalDeviceGroupCount))
7727 {
7728 fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n");
7729 }
7730 stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
7731 }
7732 VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties;
7733 stream->read((VkPhysicalDeviceGroupProperties**)&check_pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*));
7734 if (pPhysicalDeviceGroupProperties)
7735 {
7736 if (!(check_pPhysicalDeviceGroupProperties))
7737 {
7738 fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n");
7739 }
7740 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
7741 {
7742 unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
7743 }
7744 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007745 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007746 VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0;
7747 stream->read(&vkEnumeratePhysicalDeviceGroups_VkResult_return, sizeof(VkResult));
7748 return vkEnumeratePhysicalDeviceGroups_VkResult_return;
7749}
7750
7751void VkEncoder::vkGetImageMemoryRequirements2(
7752 VkDevice device,
7753 const VkImageMemoryRequirementsInfo2* pInfo,
7754 VkMemoryRequirements2* pMemoryRequirements)
7755{
7756 auto stream = mImpl->stream();
7757 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007758 auto resources = mImpl->resources();
7759 auto pool = mImpl->pool();
7760 VkDevice local_device;
7761 local_device = device;
7762 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
7763 VkImageMemoryRequirementsInfo2* local_pInfo;
7764 local_pInfo = nullptr;
7765 if (pInfo)
7766 {
7767 local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2));
7768 deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
7769 }
7770 if (local_pInfo)
7771 {
7772 handlemap_VkImageMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageMemoryRequirementsInfo2*)(local_pInfo));
7773 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007774 countingStream->rewind();
7775 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007776 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
7777 marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007778 marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
7779 }
7780 uint32_t packetSize_vkGetImageMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7781 countingStream->rewind();
7782 uint32_t opcode_vkGetImageMemoryRequirements2 = OP_vkGetImageMemoryRequirements2;
7783 stream->write(&opcode_vkGetImageMemoryRequirements2, sizeof(uint32_t));
7784 stream->write(&packetSize_vkGetImageMemoryRequirements2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007785 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
7786 marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007787 marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
7788 unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007789 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007790}
7791
7792void VkEncoder::vkGetBufferMemoryRequirements2(
7793 VkDevice device,
7794 const VkBufferMemoryRequirementsInfo2* pInfo,
7795 VkMemoryRequirements2* pMemoryRequirements)
7796{
7797 auto stream = mImpl->stream();
7798 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007799 auto resources = mImpl->resources();
7800 auto pool = mImpl->pool();
7801 VkDevice local_device;
7802 local_device = device;
7803 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
7804 VkBufferMemoryRequirementsInfo2* local_pInfo;
7805 local_pInfo = nullptr;
7806 if (pInfo)
7807 {
7808 local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2));
7809 deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
7810 }
7811 if (local_pInfo)
7812 {
7813 handlemap_VkBufferMemoryRequirementsInfo2(resources->unwrapMapping(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
7814 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007815 countingStream->rewind();
7816 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007817 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
7818 marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007819 marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
7820 }
7821 uint32_t packetSize_vkGetBufferMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7822 countingStream->rewind();
7823 uint32_t opcode_vkGetBufferMemoryRequirements2 = OP_vkGetBufferMemoryRequirements2;
7824 stream->write(&opcode_vkGetBufferMemoryRequirements2, sizeof(uint32_t));
7825 stream->write(&packetSize_vkGetBufferMemoryRequirements2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007826 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
7827 marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007828 marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
7829 unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007830 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007831}
7832
7833void VkEncoder::vkGetImageSparseMemoryRequirements2(
7834 VkDevice device,
7835 const VkImageSparseMemoryRequirementsInfo2* pInfo,
7836 uint32_t* pSparseMemoryRequirementCount,
7837 VkSparseImageMemoryRequirements2* pSparseMemoryRequirements)
7838{
7839 auto stream = mImpl->stream();
7840 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007841 auto resources = mImpl->resources();
7842 auto pool = mImpl->pool();
7843 VkDevice local_device;
7844 local_device = device;
7845 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
7846 VkImageSparseMemoryRequirementsInfo2* local_pInfo;
7847 local_pInfo = nullptr;
7848 if (pInfo)
7849 {
7850 local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2));
7851 deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
7852 }
7853 if (local_pInfo)
7854 {
7855 handlemap_VkImageSparseMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
7856 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007857 countingStream->rewind();
7858 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007859 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
7860 marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007861 countingStream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*));
7862 if (pSparseMemoryRequirementCount)
7863 {
7864 countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
7865 }
7866 countingStream->write((VkSparseImageMemoryRequirements2**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*));
7867 if (pSparseMemoryRequirements)
7868 {
7869 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
7870 {
7871 marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
7872 }
7873 }
7874 }
7875 uint32_t packetSize_vkGetImageSparseMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7876 countingStream->rewind();
7877 uint32_t opcode_vkGetImageSparseMemoryRequirements2 = OP_vkGetImageSparseMemoryRequirements2;
7878 stream->write(&opcode_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t));
7879 stream->write(&packetSize_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007880 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
7881 marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007882 stream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*));
7883 if (pSparseMemoryRequirementCount)
7884 {
7885 stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
7886 }
7887 stream->write((VkSparseImageMemoryRequirements2**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*));
7888 if (pSparseMemoryRequirements)
7889 {
7890 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
7891 {
7892 marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
7893 }
7894 }
7895 uint32_t* check_pSparseMemoryRequirementCount;
7896 stream->read((uint32_t**)&check_pSparseMemoryRequirementCount, sizeof(uint32_t*));
7897 if (pSparseMemoryRequirementCount)
7898 {
7899 if (!(check_pSparseMemoryRequirementCount))
7900 {
7901 fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n");
7902 }
7903 stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
7904 }
7905 VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements;
7906 stream->read((VkSparseImageMemoryRequirements2**)&check_pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*));
7907 if (pSparseMemoryRequirements)
7908 {
7909 if (!(check_pSparseMemoryRequirements))
7910 {
7911 fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n");
7912 }
7913 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
7914 {
7915 unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
7916 }
7917 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007918 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007919}
7920
7921void VkEncoder::vkGetPhysicalDeviceFeatures2(
7922 VkPhysicalDevice physicalDevice,
7923 VkPhysicalDeviceFeatures2* pFeatures)
7924{
7925 auto stream = mImpl->stream();
7926 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007927 auto resources = mImpl->resources();
7928 auto pool = mImpl->pool();
7929 VkPhysicalDevice local_physicalDevice;
7930 local_physicalDevice = physicalDevice;
7931 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007932 countingStream->rewind();
7933 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007934 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007935 marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures));
7936 }
7937 uint32_t packetSize_vkGetPhysicalDeviceFeatures2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7938 countingStream->rewind();
7939 uint32_t opcode_vkGetPhysicalDeviceFeatures2 = OP_vkGetPhysicalDeviceFeatures2;
7940 stream->write(&opcode_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t));
7941 stream->write(&packetSize_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007942 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007943 marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
7944 unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007945 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007946}
7947
7948void VkEncoder::vkGetPhysicalDeviceProperties2(
7949 VkPhysicalDevice physicalDevice,
7950 VkPhysicalDeviceProperties2* pProperties)
7951{
7952 auto stream = mImpl->stream();
7953 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007954 auto resources = mImpl->resources();
7955 auto pool = mImpl->pool();
7956 VkPhysicalDevice local_physicalDevice;
7957 local_physicalDevice = physicalDevice;
7958 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007959 countingStream->rewind();
7960 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007961 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007962 marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties));
7963 }
7964 uint32_t packetSize_vkGetPhysicalDeviceProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7965 countingStream->rewind();
7966 uint32_t opcode_vkGetPhysicalDeviceProperties2 = OP_vkGetPhysicalDeviceProperties2;
7967 stream->write(&opcode_vkGetPhysicalDeviceProperties2, sizeof(uint32_t));
7968 stream->write(&packetSize_vkGetPhysicalDeviceProperties2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007969 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007970 marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties));
7971 unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007972 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007973}
7974
7975void VkEncoder::vkGetPhysicalDeviceFormatProperties2(
7976 VkPhysicalDevice physicalDevice,
7977 VkFormat format,
7978 VkFormatProperties2* pFormatProperties)
7979{
7980 auto stream = mImpl->stream();
7981 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007982 auto resources = mImpl->resources();
7983 auto pool = mImpl->pool();
7984 VkPhysicalDevice local_physicalDevice;
7985 local_physicalDevice = physicalDevice;
7986 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
7987 VkFormat local_format;
7988 local_format = format;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007989 countingStream->rewind();
7990 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08007991 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
7992 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07007993 marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties));
7994 }
7995 uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
7996 countingStream->rewind();
7997 uint32_t opcode_vkGetPhysicalDeviceFormatProperties2 = OP_vkGetPhysicalDeviceFormatProperties2;
7998 stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t));
7999 stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008000 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8001 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008002 marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
8003 unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008004 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008005}
8006
8007VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2(
8008 VkPhysicalDevice physicalDevice,
8009 const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
8010 VkImageFormatProperties2* pImageFormatProperties)
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 VkPhysicalDevice local_physicalDevice;
8017 local_physicalDevice = physicalDevice;
8018 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8019 VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo;
8020 local_pImageFormatInfo = nullptr;
8021 if (pImageFormatInfo)
8022 {
8023 local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2));
8024 deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
8025 }
8026 if (local_pImageFormatInfo)
8027 {
8028 handlemap_VkPhysicalDeviceImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
8029 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008030 countingStream->rewind();
8031 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008032 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8033 marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008034 marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties));
8035 }
8036 uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8037 countingStream->rewind();
8038 uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2 = OP_vkGetPhysicalDeviceImageFormatProperties2;
8039 stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t));
8040 stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008041 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8042 marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008043 marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
8044 unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008045 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008046 VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0;
8047 stream->read(&vkGetPhysicalDeviceImageFormatProperties2_VkResult_return, sizeof(VkResult));
8048 return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return;
8049}
8050
8051void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2(
8052 VkPhysicalDevice physicalDevice,
8053 uint32_t* pQueueFamilyPropertyCount,
8054 VkQueueFamilyProperties2* pQueueFamilyProperties)
8055{
8056 auto stream = mImpl->stream();
8057 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008058 auto resources = mImpl->resources();
8059 auto pool = mImpl->pool();
8060 VkPhysicalDevice local_physicalDevice;
8061 local_physicalDevice = physicalDevice;
8062 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008063 countingStream->rewind();
8064 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008065 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008066 countingStream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*));
8067 if (pQueueFamilyPropertyCount)
8068 {
8069 countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
8070 }
8071 countingStream->write((VkQueueFamilyProperties2**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*));
8072 if (pQueueFamilyProperties)
8073 {
8074 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
8075 {
8076 marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
8077 }
8078 }
8079 }
8080 uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8081 countingStream->rewind();
8082 uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2 = OP_vkGetPhysicalDeviceQueueFamilyProperties2;
8083 stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t));
8084 stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008085 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008086 stream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*));
8087 if (pQueueFamilyPropertyCount)
8088 {
8089 stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
8090 }
8091 stream->write((VkQueueFamilyProperties2**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*));
8092 if (pQueueFamilyProperties)
8093 {
8094 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
8095 {
8096 marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
8097 }
8098 }
8099 uint32_t* check_pQueueFamilyPropertyCount;
8100 stream->read((uint32_t**)&check_pQueueFamilyPropertyCount, sizeof(uint32_t*));
8101 if (pQueueFamilyPropertyCount)
8102 {
8103 if (!(check_pQueueFamilyPropertyCount))
8104 {
8105 fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n");
8106 }
8107 stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
8108 }
8109 VkQueueFamilyProperties2* check_pQueueFamilyProperties;
8110 stream->read((VkQueueFamilyProperties2**)&check_pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*));
8111 if (pQueueFamilyProperties)
8112 {
8113 if (!(check_pQueueFamilyProperties))
8114 {
8115 fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n");
8116 }
8117 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
8118 {
8119 unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
8120 }
8121 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008122 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008123}
8124
8125void VkEncoder::vkGetPhysicalDeviceMemoryProperties2(
8126 VkPhysicalDevice physicalDevice,
8127 VkPhysicalDeviceMemoryProperties2* pMemoryProperties)
8128{
8129 auto stream = mImpl->stream();
8130 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008131 auto resources = mImpl->resources();
8132 auto pool = mImpl->pool();
8133 VkPhysicalDevice local_physicalDevice;
8134 local_physicalDevice = physicalDevice;
8135 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008136 countingStream->rewind();
8137 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008138 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008139 marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
8140 }
8141 uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8142 countingStream->rewind();
8143 uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2 = OP_vkGetPhysicalDeviceMemoryProperties2;
8144 stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t));
8145 stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008146 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008147 marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
8148 unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008149 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008150}
8151
8152void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2(
8153 VkPhysicalDevice physicalDevice,
8154 const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
8155 uint32_t* pPropertyCount,
8156 VkSparseImageFormatProperties2* pProperties)
8157{
8158 auto stream = mImpl->stream();
8159 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008160 auto resources = mImpl->resources();
8161 auto pool = mImpl->pool();
8162 VkPhysicalDevice local_physicalDevice;
8163 local_physicalDevice = physicalDevice;
8164 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8165 VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo;
8166 local_pFormatInfo = nullptr;
8167 if (pFormatInfo)
8168 {
8169 local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2));
8170 deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
8171 }
8172 if (local_pFormatInfo)
8173 {
8174 handlemap_VkPhysicalDeviceSparseImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
8175 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008176 countingStream->rewind();
8177 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008178 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8179 marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008180 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
8181 if (pPropertyCount)
8182 {
8183 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
8184 }
8185 countingStream->write((VkSparseImageFormatProperties2**)&pProperties, sizeof(VkSparseImageFormatProperties2*));
8186 if (pProperties)
8187 {
8188 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
8189 {
8190 marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i));
8191 }
8192 }
8193 }
8194 uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8195 countingStream->rewind();
8196 uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2 = OP_vkGetPhysicalDeviceSparseImageFormatProperties2;
8197 stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t));
8198 stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008199 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8200 marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008201 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
8202 if (pPropertyCount)
8203 {
8204 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
8205 }
8206 stream->write((VkSparseImageFormatProperties2**)&pProperties, sizeof(VkSparseImageFormatProperties2*));
8207 if (pProperties)
8208 {
8209 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
8210 {
8211 marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i));
8212 }
8213 }
8214 uint32_t* check_pPropertyCount;
8215 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
8216 if (pPropertyCount)
8217 {
8218 if (!(check_pPropertyCount))
8219 {
8220 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
8221 }
8222 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
8223 }
8224 VkSparseImageFormatProperties2* check_pProperties;
8225 stream->read((VkSparseImageFormatProperties2**)&check_pProperties, sizeof(VkSparseImageFormatProperties2*));
8226 if (pProperties)
8227 {
8228 if (!(check_pProperties))
8229 {
8230 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
8231 }
8232 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
8233 {
8234 unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i));
8235 }
8236 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008237 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008238}
8239
8240void VkEncoder::vkTrimCommandPool(
8241 VkDevice device,
8242 VkCommandPool commandPool,
8243 VkCommandPoolTrimFlags flags)
8244{
8245 auto stream = mImpl->stream();
8246 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008247 auto resources = mImpl->resources();
8248 auto pool = mImpl->pool();
8249 VkDevice local_device;
8250 local_device = device;
8251 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8252 VkCommandPool local_commandPool;
8253 local_commandPool = commandPool;
8254 resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool);
8255 VkCommandPoolTrimFlags local_flags;
8256 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008257 countingStream->rewind();
8258 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008259 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
8260 countingStream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool));
8261 countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008262 }
8263 uint32_t packetSize_vkTrimCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8264 countingStream->rewind();
8265 uint32_t opcode_vkTrimCommandPool = OP_vkTrimCommandPool;
8266 stream->write(&opcode_vkTrimCommandPool, sizeof(uint32_t));
8267 stream->write(&packetSize_vkTrimCommandPool, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008268 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
8269 stream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool));
8270 stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
8271 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008272}
8273
8274void VkEncoder::vkGetDeviceQueue2(
8275 VkDevice device,
8276 const VkDeviceQueueInfo2* pQueueInfo,
8277 VkQueue* pQueue)
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 VkDeviceQueueInfo2* local_pQueueInfo;
8287 local_pQueueInfo = nullptr;
8288 if (pQueueInfo)
8289 {
8290 local_pQueueInfo = (VkDeviceQueueInfo2*)pool->alloc(sizeof(const VkDeviceQueueInfo2));
8291 deepcopy_VkDeviceQueueInfo2(pool, pQueueInfo, (VkDeviceQueueInfo2*)(local_pQueueInfo));
8292 }
8293 if (local_pQueueInfo)
8294 {
8295 handlemap_VkDeviceQueueInfo2(resources->unwrapMapping(), (VkDeviceQueueInfo2*)(local_pQueueInfo));
8296 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008297 countingStream->rewind();
8298 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008299 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
8300 marshal_VkDeviceQueueInfo2(countingStream, (VkDeviceQueueInfo2*)(local_pQueueInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008301 countingStream->write((VkQueue*)pQueue, sizeof(VkQueue));
8302 }
8303 uint32_t packetSize_vkGetDeviceQueue2 = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8304 countingStream->rewind();
8305 uint32_t opcode_vkGetDeviceQueue2 = OP_vkGetDeviceQueue2;
8306 stream->write(&opcode_vkGetDeviceQueue2, sizeof(uint32_t));
8307 stream->write(&packetSize_vkGetDeviceQueue2, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008308 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
8309 marshal_VkDeviceQueueInfo2(stream, (VkDeviceQueueInfo2*)(local_pQueueInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008310 stream->write((VkQueue*)pQueue, sizeof(VkQueue));
8311 stream->read((VkQueue*)pQueue, sizeof(VkQueue));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008312 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008313}
8314
8315VkResult VkEncoder::vkCreateSamplerYcbcrConversion(
8316 VkDevice device,
8317 const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
8318 const VkAllocationCallbacks* pAllocator,
8319 VkSamplerYcbcrConversion* pYcbcrConversion)
8320{
8321 auto stream = mImpl->stream();
8322 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008323 auto resources = mImpl->resources();
8324 auto pool = mImpl->pool();
8325 VkDevice local_device;
8326 local_device = device;
8327 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8328 VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo;
8329 local_pCreateInfo = nullptr;
8330 if (pCreateInfo)
8331 {
8332 local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo));
8333 deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
8334 }
8335 if (local_pCreateInfo)
8336 {
8337 handlemap_VkSamplerYcbcrConversionCreateInfo(resources->unwrapMapping(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
8338 }
8339 VkAllocationCallbacks* local_pAllocator;
8340 local_pAllocator = nullptr;
8341 if (pAllocator)
8342 {
8343 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
8344 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
8345 }
8346 if (local_pAllocator)
8347 {
8348 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
8349 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008350 countingStream->rewind();
8351 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008352 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
8353 marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
8354 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
8355 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008356 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008357 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008358 }
8359 countingStream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
8360 }
8361 uint32_t packetSize_vkCreateSamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8362 countingStream->rewind();
8363 uint32_t opcode_vkCreateSamplerYcbcrConversion = OP_vkCreateSamplerYcbcrConversion;
8364 stream->write(&opcode_vkCreateSamplerYcbcrConversion, sizeof(uint32_t));
8365 stream->write(&packetSize_vkCreateSamplerYcbcrConversion, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008366 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
8367 marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
8368 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
8369 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008370 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008371 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008372 }
8373 stream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
8374 stream->read((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008375 if (pYcbcrConversion)
8376 {
8377 resources->createMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)pYcbcrConversion, 1);
8378 }
8379 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008380 VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0;
8381 stream->read(&vkCreateSamplerYcbcrConversion_VkResult_return, sizeof(VkResult));
8382 return vkCreateSamplerYcbcrConversion_VkResult_return;
8383}
8384
8385void VkEncoder::vkDestroySamplerYcbcrConversion(
8386 VkDevice device,
8387 VkSamplerYcbcrConversion ycbcrConversion,
8388 const VkAllocationCallbacks* pAllocator)
8389{
8390 auto stream = mImpl->stream();
8391 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008392 auto resources = mImpl->resources();
8393 auto pool = mImpl->pool();
8394 VkDevice local_device;
8395 local_device = device;
8396 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8397 VkAllocationCallbacks* local_pAllocator;
8398 local_pAllocator = nullptr;
8399 if (pAllocator)
8400 {
8401 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
8402 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
8403 }
8404 if (local_pAllocator)
8405 {
8406 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
8407 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008408 countingStream->rewind();
8409 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008410 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008411 countingStream->write((VkSamplerYcbcrConversion*)&ycbcrConversion, sizeof(VkSamplerYcbcrConversion));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008412 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
8413 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008414 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008415 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008416 }
8417 }
8418 uint32_t packetSize_vkDestroySamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8419 countingStream->rewind();
8420 uint32_t opcode_vkDestroySamplerYcbcrConversion = OP_vkDestroySamplerYcbcrConversion;
8421 stream->write(&opcode_vkDestroySamplerYcbcrConversion, sizeof(uint32_t));
8422 stream->write(&packetSize_vkDestroySamplerYcbcrConversion, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008423 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008424 stream->write((VkSamplerYcbcrConversion*)&ycbcrConversion, sizeof(VkSamplerYcbcrConversion));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008425 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
8426 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008427 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008428 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008429 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008430 resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion);
8431 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008432}
8433
8434VkResult VkEncoder::vkCreateDescriptorUpdateTemplate(
8435 VkDevice device,
8436 const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
8437 const VkAllocationCallbacks* pAllocator,
8438 VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate)
8439{
8440 auto stream = mImpl->stream();
8441 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008442 auto resources = mImpl->resources();
8443 auto pool = mImpl->pool();
8444 VkDevice local_device;
8445 local_device = device;
8446 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8447 VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo;
8448 local_pCreateInfo = nullptr;
8449 if (pCreateInfo)
8450 {
8451 local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo));
8452 deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
8453 }
8454 if (local_pCreateInfo)
8455 {
8456 handlemap_VkDescriptorUpdateTemplateCreateInfo(resources->unwrapMapping(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
8457 }
8458 VkAllocationCallbacks* local_pAllocator;
8459 local_pAllocator = nullptr;
8460 if (pAllocator)
8461 {
8462 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
8463 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
8464 }
8465 if (local_pAllocator)
8466 {
8467 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
8468 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008469 countingStream->rewind();
8470 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008471 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
8472 marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
8473 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
8474 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008475 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008476 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008477 }
8478 countingStream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
8479 }
8480 uint32_t packetSize_vkCreateDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8481 countingStream->rewind();
8482 uint32_t opcode_vkCreateDescriptorUpdateTemplate = OP_vkCreateDescriptorUpdateTemplate;
8483 stream->write(&opcode_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t));
8484 stream->write(&packetSize_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008485 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
8486 marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
8487 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
8488 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008489 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008490 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008491 }
8492 stream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
8493 stream->read((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008494 if (pDescriptorUpdateTemplate)
8495 {
8496 resources->createMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1);
8497 }
8498 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008499 VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0;
8500 stream->read(&vkCreateDescriptorUpdateTemplate_VkResult_return, sizeof(VkResult));
8501 return vkCreateDescriptorUpdateTemplate_VkResult_return;
8502}
8503
8504void VkEncoder::vkDestroyDescriptorUpdateTemplate(
8505 VkDevice device,
8506 VkDescriptorUpdateTemplate descriptorUpdateTemplate,
8507 const VkAllocationCallbacks* pAllocator)
8508{
8509 auto stream = mImpl->stream();
8510 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008511 auto resources = mImpl->resources();
8512 auto pool = mImpl->pool();
8513 VkDevice local_device;
8514 local_device = device;
8515 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8516 VkAllocationCallbacks* local_pAllocator;
8517 local_pAllocator = nullptr;
8518 if (pAllocator)
8519 {
8520 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
8521 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
8522 }
8523 if (local_pAllocator)
8524 {
8525 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
8526 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008527 countingStream->rewind();
8528 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008529 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008530 countingStream->write((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008531 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
8532 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008533 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008534 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008535 }
8536 }
8537 uint32_t packetSize_vkDestroyDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8538 countingStream->rewind();
8539 uint32_t opcode_vkDestroyDescriptorUpdateTemplate = OP_vkDestroyDescriptorUpdateTemplate;
8540 stream->write(&opcode_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t));
8541 stream->write(&packetSize_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008542 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008543 stream->write((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008544 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
8545 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008546 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008547 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008548 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008549 resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate);
8550 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008551}
8552
8553void VkEncoder::vkUpdateDescriptorSetWithTemplate(
8554 VkDevice device,
8555 VkDescriptorSet descriptorSet,
8556 VkDescriptorUpdateTemplate descriptorUpdateTemplate,
8557 const void* pData)
8558{
8559 auto stream = mImpl->stream();
8560 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008561 auto resources = mImpl->resources();
8562 auto pool = mImpl->pool();
8563 VkDevice local_device;
8564 local_device = device;
8565 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8566 VkDescriptorSet local_descriptorSet;
8567 local_descriptorSet = descriptorSet;
8568 resources->unwrapMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)&local_descriptorSet);
8569 VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
8570 local_descriptorUpdateTemplate = descriptorUpdateTemplate;
8571 resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate);
8572 void* local_pData;
8573 local_pData = nullptr;
8574 if (pData)
8575 {
8576 local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t));
8577 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008578 countingStream->rewind();
8579 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008580 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
8581 countingStream->write((VkDescriptorSet*)&local_descriptorSet, sizeof(VkDescriptorSet));
8582 countingStream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
8583 countingStream->write((void**)&local_pData, sizeof(void*));
8584 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008585 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008586 countingStream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008587 }
8588 }
8589 uint32_t packetSize_vkUpdateDescriptorSetWithTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8590 countingStream->rewind();
8591 uint32_t opcode_vkUpdateDescriptorSetWithTemplate = OP_vkUpdateDescriptorSetWithTemplate;
8592 stream->write(&opcode_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t));
8593 stream->write(&packetSize_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008594 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
8595 stream->write((VkDescriptorSet*)&local_descriptorSet, sizeof(VkDescriptorSet));
8596 stream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
8597 stream->write((void**)&local_pData, sizeof(void*));
8598 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008599 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008600 stream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008601 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008602 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008603}
8604
8605void VkEncoder::vkGetPhysicalDeviceExternalBufferProperties(
8606 VkPhysicalDevice physicalDevice,
8607 const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
8608 VkExternalBufferProperties* pExternalBufferProperties)
8609{
8610 auto stream = mImpl->stream();
8611 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008612 auto resources = mImpl->resources();
8613 auto pool = mImpl->pool();
8614 VkPhysicalDevice local_physicalDevice;
8615 local_physicalDevice = physicalDevice;
8616 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8617 VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo;
8618 local_pExternalBufferInfo = nullptr;
8619 if (pExternalBufferInfo)
8620 {
8621 local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo));
8622 deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
8623 }
8624 if (local_pExternalBufferInfo)
8625 {
8626 handlemap_VkPhysicalDeviceExternalBufferInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
8627 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008628 countingStream->rewind();
8629 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008630 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8631 marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008632 marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties));
8633 }
8634 uint32_t packetSize_vkGetPhysicalDeviceExternalBufferProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8635 countingStream->rewind();
8636 uint32_t opcode_vkGetPhysicalDeviceExternalBufferProperties = OP_vkGetPhysicalDeviceExternalBufferProperties;
8637 stream->write(&opcode_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t));
8638 stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008639 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8640 marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008641 marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
8642 unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008643 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008644}
8645
8646void VkEncoder::vkGetPhysicalDeviceExternalFenceProperties(
8647 VkPhysicalDevice physicalDevice,
8648 const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
8649 VkExternalFenceProperties* pExternalFenceProperties)
8650{
8651 auto stream = mImpl->stream();
8652 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008653 auto resources = mImpl->resources();
8654 auto pool = mImpl->pool();
8655 VkPhysicalDevice local_physicalDevice;
8656 local_physicalDevice = physicalDevice;
8657 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8658 VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo;
8659 local_pExternalFenceInfo = nullptr;
8660 if (pExternalFenceInfo)
8661 {
8662 local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo));
8663 deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
8664 }
8665 if (local_pExternalFenceInfo)
8666 {
8667 handlemap_VkPhysicalDeviceExternalFenceInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
8668 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008669 countingStream->rewind();
8670 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008671 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8672 marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008673 marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties));
8674 }
8675 uint32_t packetSize_vkGetPhysicalDeviceExternalFenceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8676 countingStream->rewind();
8677 uint32_t opcode_vkGetPhysicalDeviceExternalFenceProperties = OP_vkGetPhysicalDeviceExternalFenceProperties;
8678 stream->write(&opcode_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t));
8679 stream->write(&packetSize_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008680 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8681 marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008682 marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
8683 unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008684 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008685}
8686
8687void VkEncoder::vkGetPhysicalDeviceExternalSemaphoreProperties(
8688 VkPhysicalDevice physicalDevice,
8689 const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
8690 VkExternalSemaphoreProperties* pExternalSemaphoreProperties)
8691{
8692 auto stream = mImpl->stream();
8693 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008694 auto resources = mImpl->resources();
8695 auto pool = mImpl->pool();
8696 VkPhysicalDevice local_physicalDevice;
8697 local_physicalDevice = physicalDevice;
8698 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8699 VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo;
8700 local_pExternalSemaphoreInfo = nullptr;
8701 if (pExternalSemaphoreInfo)
8702 {
8703 local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo));
8704 deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
8705 }
8706 if (local_pExternalSemaphoreInfo)
8707 {
8708 handlemap_VkPhysicalDeviceExternalSemaphoreInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
8709 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008710 countingStream->rewind();
8711 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008712 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8713 marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008714 marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
8715 }
8716 uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8717 countingStream->rewind();
8718 uint32_t opcode_vkGetPhysicalDeviceExternalSemaphoreProperties = OP_vkGetPhysicalDeviceExternalSemaphoreProperties;
8719 stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t));
8720 stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008721 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8722 marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008723 marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
8724 unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008725 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008726}
8727
8728void VkEncoder::vkGetDescriptorSetLayoutSupport(
8729 VkDevice device,
8730 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
8731 VkDescriptorSetLayoutSupport* pSupport)
8732{
8733 auto stream = mImpl->stream();
8734 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008735 auto resources = mImpl->resources();
8736 auto pool = mImpl->pool();
8737 VkDevice local_device;
8738 local_device = device;
8739 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
8740 VkDescriptorSetLayoutCreateInfo* local_pCreateInfo;
8741 local_pCreateInfo = nullptr;
8742 if (pCreateInfo)
8743 {
8744 local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo));
8745 deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
8746 }
8747 if (local_pCreateInfo)
8748 {
8749 handlemap_VkDescriptorSetLayoutCreateInfo(resources->unwrapMapping(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
8750 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008751 countingStream->rewind();
8752 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008753 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
8754 marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008755 marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport));
8756 }
8757 uint32_t packetSize_vkGetDescriptorSetLayoutSupport = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8758 countingStream->rewind();
8759 uint32_t opcode_vkGetDescriptorSetLayoutSupport = OP_vkGetDescriptorSetLayoutSupport;
8760 stream->write(&opcode_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t));
8761 stream->write(&packetSize_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008762 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
8763 marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008764 marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
8765 unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008766 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008767}
8768
8769#endif
8770#ifdef VK_KHR_surface
8771void VkEncoder::vkDestroySurfaceKHR(
8772 VkInstance instance,
8773 VkSurfaceKHR surface,
8774 const VkAllocationCallbacks* pAllocator)
8775{
8776 auto stream = mImpl->stream();
8777 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008778 auto resources = mImpl->resources();
8779 auto pool = mImpl->pool();
8780 VkInstance local_instance;
8781 local_instance = instance;
8782 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
8783 VkAllocationCallbacks* local_pAllocator;
8784 local_pAllocator = nullptr;
8785 if (pAllocator)
8786 {
8787 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
8788 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
8789 }
8790 if (local_pAllocator)
8791 {
8792 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
8793 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008794 countingStream->rewind();
8795 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008796 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008797 countingStream->write((VkSurfaceKHR*)&surface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008798 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
8799 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008800 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008801 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008802 }
8803 }
8804 uint32_t packetSize_vkDestroySurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8805 countingStream->rewind();
8806 uint32_t opcode_vkDestroySurfaceKHR = OP_vkDestroySurfaceKHR;
8807 stream->write(&opcode_vkDestroySurfaceKHR, sizeof(uint32_t));
8808 stream->write(&packetSize_vkDestroySurfaceKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008809 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008810 stream->write((VkSurfaceKHR*)&surface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008811 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
8812 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008813 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008814 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008815 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008816 resources->destroyMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&surface);
8817 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008818}
8819
8820VkResult VkEncoder::vkGetPhysicalDeviceSurfaceSupportKHR(
8821 VkPhysicalDevice physicalDevice,
8822 uint32_t queueFamilyIndex,
8823 VkSurfaceKHR surface,
8824 VkBool32* pSupported)
8825{
8826 auto stream = mImpl->stream();
8827 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008828 auto resources = mImpl->resources();
8829 auto pool = mImpl->pool();
8830 VkPhysicalDevice local_physicalDevice;
8831 local_physicalDevice = physicalDevice;
8832 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8833 uint32_t local_queueFamilyIndex;
8834 local_queueFamilyIndex = queueFamilyIndex;
8835 VkSurfaceKHR local_surface;
8836 local_surface = surface;
8837 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008838 countingStream->rewind();
8839 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008840 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8841 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
8842 countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008843 countingStream->write((VkBool32*)pSupported, sizeof(VkBool32));
8844 }
8845 uint32_t packetSize_vkGetPhysicalDeviceSurfaceSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8846 countingStream->rewind();
8847 uint32_t opcode_vkGetPhysicalDeviceSurfaceSupportKHR = OP_vkGetPhysicalDeviceSurfaceSupportKHR;
8848 stream->write(&opcode_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t));
8849 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008850 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8851 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
8852 stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008853 stream->write((VkBool32*)pSupported, sizeof(VkBool32));
8854 stream->read((VkBool32*)pSupported, sizeof(VkBool32));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008855 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008856 VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0;
8857 stream->read(&vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return, sizeof(VkResult));
8858 return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return;
8859}
8860
8861VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
8862 VkPhysicalDevice physicalDevice,
8863 VkSurfaceKHR surface,
8864 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities)
8865{
8866 auto stream = mImpl->stream();
8867 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008868 auto resources = mImpl->resources();
8869 auto pool = mImpl->pool();
8870 VkPhysicalDevice local_physicalDevice;
8871 local_physicalDevice = physicalDevice;
8872 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8873 VkSurfaceKHR local_surface;
8874 local_surface = surface;
8875 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008876 countingStream->rewind();
8877 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008878 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8879 countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008880 marshal_VkSurfaceCapabilitiesKHR(countingStream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
8881 }
8882 uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8883 countingStream->rewind();
8884 uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
8885 stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t));
8886 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008887 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8888 stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008889 marshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
8890 unmarshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008891 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008892 VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0;
8893 stream->read(&vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return, sizeof(VkResult));
8894 return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return;
8895}
8896
8897VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormatsKHR(
8898 VkPhysicalDevice physicalDevice,
8899 VkSurfaceKHR surface,
8900 uint32_t* pSurfaceFormatCount,
8901 VkSurfaceFormatKHR* pSurfaceFormats)
8902{
8903 auto stream = mImpl->stream();
8904 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008905 auto resources = mImpl->resources();
8906 auto pool = mImpl->pool();
8907 VkPhysicalDevice local_physicalDevice;
8908 local_physicalDevice = physicalDevice;
8909 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8910 VkSurfaceKHR local_surface;
8911 local_surface = surface;
8912 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008913 countingStream->rewind();
8914 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008915 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8916 countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008917 countingStream->write((uint32_t**)&pSurfaceFormatCount, sizeof(uint32_t*));
8918 if (pSurfaceFormatCount)
8919 {
8920 countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
8921 }
8922 countingStream->write((VkSurfaceFormatKHR**)&pSurfaceFormats, sizeof(VkSurfaceFormatKHR*));
8923 if (pSurfaceFormats)
8924 {
8925 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
8926 {
8927 marshal_VkSurfaceFormatKHR(countingStream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i));
8928 }
8929 }
8930 }
8931 uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
8932 countingStream->rewind();
8933 uint32_t opcode_vkGetPhysicalDeviceSurfaceFormatsKHR = OP_vkGetPhysicalDeviceSurfaceFormatsKHR;
8934 stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t));
8935 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008936 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8937 stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008938 stream->write((uint32_t**)&pSurfaceFormatCount, sizeof(uint32_t*));
8939 if (pSurfaceFormatCount)
8940 {
8941 stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
8942 }
8943 stream->write((VkSurfaceFormatKHR**)&pSurfaceFormats, sizeof(VkSurfaceFormatKHR*));
8944 if (pSurfaceFormats)
8945 {
8946 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
8947 {
8948 marshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i));
8949 }
8950 }
8951 uint32_t* check_pSurfaceFormatCount;
8952 stream->read((uint32_t**)&check_pSurfaceFormatCount, sizeof(uint32_t*));
8953 if (pSurfaceFormatCount)
8954 {
8955 if (!(check_pSurfaceFormatCount))
8956 {
8957 fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n");
8958 }
8959 stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
8960 }
8961 VkSurfaceFormatKHR* check_pSurfaceFormats;
8962 stream->read((VkSurfaceFormatKHR**)&check_pSurfaceFormats, sizeof(VkSurfaceFormatKHR*));
8963 if (pSurfaceFormats)
8964 {
8965 if (!(check_pSurfaceFormats))
8966 {
8967 fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n");
8968 }
8969 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
8970 {
8971 unmarshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i));
8972 }
8973 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008974 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008975 VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0;
8976 stream->read(&vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return, sizeof(VkResult));
8977 return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return;
8978}
8979
8980VkResult VkEncoder::vkGetPhysicalDeviceSurfacePresentModesKHR(
8981 VkPhysicalDevice physicalDevice,
8982 VkSurfaceKHR surface,
8983 uint32_t* pPresentModeCount,
8984 VkPresentModeKHR* pPresentModes)
8985{
8986 auto stream = mImpl->stream();
8987 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008988 auto resources = mImpl->resources();
8989 auto pool = mImpl->pool();
8990 VkPhysicalDevice local_physicalDevice;
8991 local_physicalDevice = physicalDevice;
8992 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
8993 VkSurfaceKHR local_surface;
8994 local_surface = surface;
8995 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07008996 countingStream->rewind();
8997 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08008998 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
8999 countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009000 countingStream->write((uint32_t**)&pPresentModeCount, sizeof(uint32_t*));
9001 if (pPresentModeCount)
9002 {
9003 countingStream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t));
9004 }
9005 countingStream->write((VkPresentModeKHR**)&pPresentModes, sizeof(VkPresentModeKHR*));
9006 if (pPresentModes)
9007 {
9008 countingStream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
9009 }
9010 }
9011 uint32_t packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9012 countingStream->rewind();
9013 uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModesKHR = OP_vkGetPhysicalDeviceSurfacePresentModesKHR;
9014 stream->write(&opcode_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t));
9015 stream->write(&packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009016 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9017 stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009018 stream->write((uint32_t**)&pPresentModeCount, sizeof(uint32_t*));
9019 if (pPresentModeCount)
9020 {
9021 stream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t));
9022 }
9023 stream->write((VkPresentModeKHR**)&pPresentModes, sizeof(VkPresentModeKHR*));
9024 if (pPresentModes)
9025 {
9026 stream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
9027 }
9028 uint32_t* check_pPresentModeCount;
9029 stream->read((uint32_t**)&check_pPresentModeCount, sizeof(uint32_t*));
9030 if (pPresentModeCount)
9031 {
9032 if (!(check_pPresentModeCount))
9033 {
9034 fprintf(stderr, "fatal: pPresentModeCount inconsistent between guest and host\n");
9035 }
9036 stream->read((uint32_t*)pPresentModeCount, sizeof(uint32_t));
9037 }
9038 VkPresentModeKHR* check_pPresentModes;
9039 stream->read((VkPresentModeKHR**)&check_pPresentModes, sizeof(VkPresentModeKHR*));
9040 if (pPresentModes)
9041 {
9042 if (!(check_pPresentModes))
9043 {
9044 fprintf(stderr, "fatal: pPresentModes inconsistent between guest and host\n");
9045 }
9046 stream->read((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR));
9047 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009048 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009049 VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0;
9050 stream->read(&vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return, sizeof(VkResult));
9051 return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return;
9052}
9053
9054#endif
9055#ifdef VK_KHR_swapchain
9056VkResult VkEncoder::vkCreateSwapchainKHR(
9057 VkDevice device,
9058 const VkSwapchainCreateInfoKHR* pCreateInfo,
9059 const VkAllocationCallbacks* pAllocator,
9060 VkSwapchainKHR* pSwapchain)
9061{
9062 auto stream = mImpl->stream();
9063 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009064 auto resources = mImpl->resources();
9065 auto pool = mImpl->pool();
9066 VkDevice local_device;
9067 local_device = device;
9068 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9069 VkSwapchainCreateInfoKHR* local_pCreateInfo;
9070 local_pCreateInfo = nullptr;
9071 if (pCreateInfo)
9072 {
9073 local_pCreateInfo = (VkSwapchainCreateInfoKHR*)pool->alloc(sizeof(const VkSwapchainCreateInfoKHR));
9074 deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfo, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
9075 }
9076 if (local_pCreateInfo)
9077 {
9078 handlemap_VkSwapchainCreateInfoKHR(resources->unwrapMapping(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
9079 }
9080 VkAllocationCallbacks* local_pAllocator;
9081 local_pAllocator = nullptr;
9082 if (pAllocator)
9083 {
9084 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
9085 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
9086 }
9087 if (local_pAllocator)
9088 {
9089 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
9090 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009091 countingStream->rewind();
9092 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009093 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
9094 marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
9095 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
9096 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009097 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009098 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009099 }
9100 countingStream->write((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR));
9101 }
9102 uint32_t packetSize_vkCreateSwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9103 countingStream->rewind();
9104 uint32_t opcode_vkCreateSwapchainKHR = OP_vkCreateSwapchainKHR;
9105 stream->write(&opcode_vkCreateSwapchainKHR, sizeof(uint32_t));
9106 stream->write(&packetSize_vkCreateSwapchainKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009107 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
9108 marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo));
9109 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
9110 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009111 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009112 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009113 }
9114 stream->write((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR));
9115 stream->read((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009116 if (pSwapchain)
9117 {
9118 resources->createMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)pSwapchain, 1);
9119 }
9120 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009121 VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0;
9122 stream->read(&vkCreateSwapchainKHR_VkResult_return, sizeof(VkResult));
9123 return vkCreateSwapchainKHR_VkResult_return;
9124}
9125
9126void VkEncoder::vkDestroySwapchainKHR(
9127 VkDevice device,
9128 VkSwapchainKHR swapchain,
9129 const VkAllocationCallbacks* pAllocator)
9130{
9131 auto stream = mImpl->stream();
9132 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009133 auto resources = mImpl->resources();
9134 auto pool = mImpl->pool();
9135 VkDevice local_device;
9136 local_device = device;
9137 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9138 VkAllocationCallbacks* local_pAllocator;
9139 local_pAllocator = nullptr;
9140 if (pAllocator)
9141 {
9142 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
9143 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
9144 }
9145 if (local_pAllocator)
9146 {
9147 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
9148 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009149 countingStream->rewind();
9150 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009151 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009152 countingStream->write((VkSwapchainKHR*)&swapchain, sizeof(VkSwapchainKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009153 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
9154 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009155 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009156 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009157 }
9158 }
9159 uint32_t packetSize_vkDestroySwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9160 countingStream->rewind();
9161 uint32_t opcode_vkDestroySwapchainKHR = OP_vkDestroySwapchainKHR;
9162 stream->write(&opcode_vkDestroySwapchainKHR, sizeof(uint32_t));
9163 stream->write(&packetSize_vkDestroySwapchainKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009164 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009165 stream->write((VkSwapchainKHR*)&swapchain, sizeof(VkSwapchainKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009166 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
9167 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009168 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009169 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009170 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009171 resources->destroyMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&swapchain);
9172 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009173}
9174
9175VkResult VkEncoder::vkGetSwapchainImagesKHR(
9176 VkDevice device,
9177 VkSwapchainKHR swapchain,
9178 uint32_t* pSwapchainImageCount,
9179 VkImage* pSwapchainImages)
9180{
9181 auto stream = mImpl->stream();
9182 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009183 auto resources = mImpl->resources();
9184 auto pool = mImpl->pool();
9185 VkDevice local_device;
9186 local_device = device;
9187 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9188 VkSwapchainKHR local_swapchain;
9189 local_swapchain = swapchain;
9190 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009191 countingStream->rewind();
9192 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009193 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
9194 countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009195 countingStream->write((uint32_t**)&pSwapchainImageCount, sizeof(uint32_t*));
9196 if (pSwapchainImageCount)
9197 {
9198 countingStream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t));
9199 }
9200 countingStream->write((VkImage**)&pSwapchainImages, sizeof(VkImage*));
9201 if (pSwapchainImages)
9202 {
9203 countingStream->write((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage));
9204 }
9205 }
9206 uint32_t packetSize_vkGetSwapchainImagesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9207 countingStream->rewind();
9208 uint32_t opcode_vkGetSwapchainImagesKHR = OP_vkGetSwapchainImagesKHR;
9209 stream->write(&opcode_vkGetSwapchainImagesKHR, sizeof(uint32_t));
9210 stream->write(&packetSize_vkGetSwapchainImagesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009211 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
9212 stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009213 stream->write((uint32_t**)&pSwapchainImageCount, sizeof(uint32_t*));
9214 if (pSwapchainImageCount)
9215 {
9216 stream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t));
9217 }
9218 stream->write((VkImage**)&pSwapchainImages, sizeof(VkImage*));
9219 if (pSwapchainImages)
9220 {
9221 stream->write((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage));
9222 }
9223 uint32_t* check_pSwapchainImageCount;
9224 stream->read((uint32_t**)&check_pSwapchainImageCount, sizeof(uint32_t*));
9225 if (pSwapchainImageCount)
9226 {
9227 if (!(check_pSwapchainImageCount))
9228 {
9229 fprintf(stderr, "fatal: pSwapchainImageCount inconsistent between guest and host\n");
9230 }
9231 stream->read((uint32_t*)pSwapchainImageCount, sizeof(uint32_t));
9232 }
9233 VkImage* check_pSwapchainImages;
9234 stream->read((VkImage**)&check_pSwapchainImages, sizeof(VkImage*));
9235 if (pSwapchainImages)
9236 {
9237 if (!(check_pSwapchainImages))
9238 {
9239 fprintf(stderr, "fatal: pSwapchainImages inconsistent between guest and host\n");
9240 }
9241 stream->read((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage));
9242 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009243 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009244 VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0;
9245 stream->read(&vkGetSwapchainImagesKHR_VkResult_return, sizeof(VkResult));
9246 return vkGetSwapchainImagesKHR_VkResult_return;
9247}
9248
9249VkResult VkEncoder::vkAcquireNextImageKHR(
9250 VkDevice device,
9251 VkSwapchainKHR swapchain,
9252 uint64_t timeout,
9253 VkSemaphore semaphore,
9254 VkFence fence,
9255 uint32_t* pImageIndex)
9256{
9257 auto stream = mImpl->stream();
9258 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009259 auto resources = mImpl->resources();
9260 auto pool = mImpl->pool();
9261 VkDevice local_device;
9262 local_device = device;
9263 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9264 VkSwapchainKHR local_swapchain;
9265 local_swapchain = swapchain;
9266 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
9267 uint64_t local_timeout;
9268 local_timeout = timeout;
9269 VkSemaphore local_semaphore;
9270 local_semaphore = semaphore;
9271 resources->unwrapMapping()->mapHandles_VkSemaphore((VkSemaphore*)&local_semaphore);
9272 VkFence local_fence;
9273 local_fence = fence;
9274 resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009275 countingStream->rewind();
9276 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009277 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
9278 countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
9279 countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
9280 countingStream->write((VkSemaphore*)&local_semaphore, sizeof(VkSemaphore));
9281 countingStream->write((VkFence*)&local_fence, sizeof(VkFence));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009282 countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
9283 }
9284 uint32_t packetSize_vkAcquireNextImageKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9285 countingStream->rewind();
9286 uint32_t opcode_vkAcquireNextImageKHR = OP_vkAcquireNextImageKHR;
9287 stream->write(&opcode_vkAcquireNextImageKHR, sizeof(uint32_t));
9288 stream->write(&packetSize_vkAcquireNextImageKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009289 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
9290 stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
9291 stream->write((uint64_t*)&local_timeout, sizeof(uint64_t));
9292 stream->write((VkSemaphore*)&local_semaphore, sizeof(VkSemaphore));
9293 stream->write((VkFence*)&local_fence, sizeof(VkFence));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009294 stream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
9295 stream->read((uint32_t*)pImageIndex, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009296 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009297 VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0;
9298 stream->read(&vkAcquireNextImageKHR_VkResult_return, sizeof(VkResult));
9299 return vkAcquireNextImageKHR_VkResult_return;
9300}
9301
9302VkResult VkEncoder::vkQueuePresentKHR(
9303 VkQueue queue,
9304 const VkPresentInfoKHR* pPresentInfo)
9305{
9306 auto stream = mImpl->stream();
9307 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009308 auto resources = mImpl->resources();
9309 auto pool = mImpl->pool();
9310 VkQueue local_queue;
9311 local_queue = queue;
9312 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
9313 VkPresentInfoKHR* local_pPresentInfo;
9314 local_pPresentInfo = nullptr;
9315 if (pPresentInfo)
9316 {
9317 local_pPresentInfo = (VkPresentInfoKHR*)pool->alloc(sizeof(const VkPresentInfoKHR));
9318 deepcopy_VkPresentInfoKHR(pool, pPresentInfo, (VkPresentInfoKHR*)(local_pPresentInfo));
9319 }
9320 if (local_pPresentInfo)
9321 {
9322 handlemap_VkPresentInfoKHR(resources->unwrapMapping(), (VkPresentInfoKHR*)(local_pPresentInfo));
9323 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009324 countingStream->rewind();
9325 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009326 countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue));
9327 marshal_VkPresentInfoKHR(countingStream, (VkPresentInfoKHR*)(local_pPresentInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009328 }
9329 uint32_t packetSize_vkQueuePresentKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9330 countingStream->rewind();
9331 uint32_t opcode_vkQueuePresentKHR = OP_vkQueuePresentKHR;
9332 stream->write(&opcode_vkQueuePresentKHR, sizeof(uint32_t));
9333 stream->write(&packetSize_vkQueuePresentKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009334 stream->write((VkQueue*)&local_queue, sizeof(VkQueue));
9335 marshal_VkPresentInfoKHR(stream, (VkPresentInfoKHR*)(local_pPresentInfo));
9336 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009337 VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0;
9338 stream->read(&vkQueuePresentKHR_VkResult_return, sizeof(VkResult));
9339 return vkQueuePresentKHR_VkResult_return;
9340}
9341
9342VkResult VkEncoder::vkGetDeviceGroupPresentCapabilitiesKHR(
9343 VkDevice device,
9344 VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities)
9345{
9346 auto stream = mImpl->stream();
9347 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009348 auto resources = mImpl->resources();
9349 auto pool = mImpl->pool();
9350 VkDevice local_device;
9351 local_device = device;
9352 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009353 countingStream->rewind();
9354 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009355 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009356 marshal_VkDeviceGroupPresentCapabilitiesKHR(countingStream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
9357 }
9358 uint32_t packetSize_vkGetDeviceGroupPresentCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9359 countingStream->rewind();
9360 uint32_t opcode_vkGetDeviceGroupPresentCapabilitiesKHR = OP_vkGetDeviceGroupPresentCapabilitiesKHR;
9361 stream->write(&opcode_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t));
9362 stream->write(&packetSize_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009363 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009364 marshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
9365 unmarshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009366 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009367 VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0;
9368 stream->read(&vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return, sizeof(VkResult));
9369 return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return;
9370}
9371
9372VkResult VkEncoder::vkGetDeviceGroupSurfacePresentModesKHR(
9373 VkDevice device,
9374 VkSurfaceKHR surface,
9375 VkDeviceGroupPresentModeFlagsKHR* pModes)
9376{
9377 auto stream = mImpl->stream();
9378 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009379 auto resources = mImpl->resources();
9380 auto pool = mImpl->pool();
9381 VkDevice local_device;
9382 local_device = device;
9383 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9384 VkSurfaceKHR local_surface;
9385 local_surface = surface;
9386 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009387 countingStream->rewind();
9388 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009389 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
9390 countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009391 countingStream->write((VkDeviceGroupPresentModeFlagsKHR**)&pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR*));
9392 if (pModes)
9393 {
9394 countingStream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR));
9395 }
9396 }
9397 uint32_t packetSize_vkGetDeviceGroupSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9398 countingStream->rewind();
9399 uint32_t opcode_vkGetDeviceGroupSurfacePresentModesKHR = OP_vkGetDeviceGroupSurfacePresentModesKHR;
9400 stream->write(&opcode_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t));
9401 stream->write(&packetSize_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009402 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
9403 stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009404 stream->write((VkDeviceGroupPresentModeFlagsKHR**)&pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR*));
9405 if (pModes)
9406 {
9407 stream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR));
9408 }
9409 VkDeviceGroupPresentModeFlagsKHR* check_pModes;
9410 stream->read((VkDeviceGroupPresentModeFlagsKHR**)&check_pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR*));
9411 if (pModes)
9412 {
9413 if (!(check_pModes))
9414 {
9415 fprintf(stderr, "fatal: pModes inconsistent between guest and host\n");
9416 }
9417 stream->read((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR));
9418 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009419 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009420 VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0;
9421 stream->read(&vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return, sizeof(VkResult));
9422 return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return;
9423}
9424
9425VkResult VkEncoder::vkGetPhysicalDevicePresentRectanglesKHR(
9426 VkPhysicalDevice physicalDevice,
9427 VkSurfaceKHR surface,
9428 uint32_t* pRectCount,
9429 VkRect2D* pRects)
9430{
9431 auto stream = mImpl->stream();
9432 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009433 auto resources = mImpl->resources();
9434 auto pool = mImpl->pool();
9435 VkPhysicalDevice local_physicalDevice;
9436 local_physicalDevice = physicalDevice;
9437 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9438 VkSurfaceKHR local_surface;
9439 local_surface = surface;
9440 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009441 countingStream->rewind();
9442 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009443 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9444 countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009445 countingStream->write((uint32_t**)&pRectCount, sizeof(uint32_t*));
9446 if (pRectCount)
9447 {
9448 countingStream->write((uint32_t*)pRectCount, sizeof(uint32_t));
9449 }
9450 countingStream->write((VkRect2D**)&pRects, sizeof(VkRect2D*));
9451 if (pRects)
9452 {
9453 for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i)
9454 {
9455 marshal_VkRect2D(countingStream, (VkRect2D*)(pRects + i));
9456 }
9457 }
9458 }
9459 uint32_t packetSize_vkGetPhysicalDevicePresentRectanglesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9460 countingStream->rewind();
9461 uint32_t opcode_vkGetPhysicalDevicePresentRectanglesKHR = OP_vkGetPhysicalDevicePresentRectanglesKHR;
9462 stream->write(&opcode_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t));
9463 stream->write(&packetSize_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009464 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9465 stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009466 stream->write((uint32_t**)&pRectCount, sizeof(uint32_t*));
9467 if (pRectCount)
9468 {
9469 stream->write((uint32_t*)pRectCount, sizeof(uint32_t));
9470 }
9471 stream->write((VkRect2D**)&pRects, sizeof(VkRect2D*));
9472 if (pRects)
9473 {
9474 for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i)
9475 {
9476 marshal_VkRect2D(stream, (VkRect2D*)(pRects + i));
9477 }
9478 }
9479 uint32_t* check_pRectCount;
9480 stream->read((uint32_t**)&check_pRectCount, sizeof(uint32_t*));
9481 if (pRectCount)
9482 {
9483 if (!(check_pRectCount))
9484 {
9485 fprintf(stderr, "fatal: pRectCount inconsistent between guest and host\n");
9486 }
9487 stream->read((uint32_t*)pRectCount, sizeof(uint32_t));
9488 }
9489 VkRect2D* check_pRects;
9490 stream->read((VkRect2D**)&check_pRects, sizeof(VkRect2D*));
9491 if (pRects)
9492 {
9493 if (!(check_pRects))
9494 {
9495 fprintf(stderr, "fatal: pRects inconsistent between guest and host\n");
9496 }
9497 for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i)
9498 {
9499 unmarshal_VkRect2D(stream, (VkRect2D*)(pRects + i));
9500 }
9501 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009502 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009503 VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0;
9504 stream->read(&vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return, sizeof(VkResult));
9505 return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return;
9506}
9507
9508VkResult VkEncoder::vkAcquireNextImage2KHR(
9509 VkDevice device,
9510 const VkAcquireNextImageInfoKHR* pAcquireInfo,
9511 uint32_t* pImageIndex)
9512{
9513 auto stream = mImpl->stream();
9514 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009515 auto resources = mImpl->resources();
9516 auto pool = mImpl->pool();
9517 VkDevice local_device;
9518 local_device = device;
9519 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
9520 VkAcquireNextImageInfoKHR* local_pAcquireInfo;
9521 local_pAcquireInfo = nullptr;
9522 if (pAcquireInfo)
9523 {
9524 local_pAcquireInfo = (VkAcquireNextImageInfoKHR*)pool->alloc(sizeof(const VkAcquireNextImageInfoKHR));
9525 deepcopy_VkAcquireNextImageInfoKHR(pool, pAcquireInfo, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
9526 }
9527 if (local_pAcquireInfo)
9528 {
9529 handlemap_VkAcquireNextImageInfoKHR(resources->unwrapMapping(), (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
9530 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009531 countingStream->rewind();
9532 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009533 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
9534 marshal_VkAcquireNextImageInfoKHR(countingStream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009535 countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
9536 }
9537 uint32_t packetSize_vkAcquireNextImage2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9538 countingStream->rewind();
9539 uint32_t opcode_vkAcquireNextImage2KHR = OP_vkAcquireNextImage2KHR;
9540 stream->write(&opcode_vkAcquireNextImage2KHR, sizeof(uint32_t));
9541 stream->write(&packetSize_vkAcquireNextImage2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009542 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
9543 marshal_VkAcquireNextImageInfoKHR(stream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009544 stream->write((uint32_t*)pImageIndex, sizeof(uint32_t));
9545 stream->read((uint32_t*)pImageIndex, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009546 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009547 VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0;
9548 stream->read(&vkAcquireNextImage2KHR_VkResult_return, sizeof(VkResult));
9549 return vkAcquireNextImage2KHR_VkResult_return;
9550}
9551
9552#endif
9553#ifdef VK_KHR_display
9554VkResult VkEncoder::vkGetPhysicalDeviceDisplayPropertiesKHR(
9555 VkPhysicalDevice physicalDevice,
9556 uint32_t* pPropertyCount,
9557 VkDisplayPropertiesKHR* pProperties)
9558{
9559 auto stream = mImpl->stream();
9560 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009561 auto resources = mImpl->resources();
9562 auto pool = mImpl->pool();
9563 VkPhysicalDevice local_physicalDevice;
9564 local_physicalDevice = physicalDevice;
9565 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009566 countingStream->rewind();
9567 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009568 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009569 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
9570 if (pPropertyCount)
9571 {
9572 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
9573 }
9574 countingStream->write((VkDisplayPropertiesKHR**)&pProperties, sizeof(VkDisplayPropertiesKHR*));
9575 if (pProperties)
9576 {
9577 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9578 {
9579 marshal_VkDisplayPropertiesKHR(countingStream, (VkDisplayPropertiesKHR*)(pProperties + i));
9580 }
9581 }
9582 }
9583 uint32_t packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9584 countingStream->rewind();
9585 uint32_t opcode_vkGetPhysicalDeviceDisplayPropertiesKHR = OP_vkGetPhysicalDeviceDisplayPropertiesKHR;
9586 stream->write(&opcode_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t));
9587 stream->write(&packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009588 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009589 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
9590 if (pPropertyCount)
9591 {
9592 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
9593 }
9594 stream->write((VkDisplayPropertiesKHR**)&pProperties, sizeof(VkDisplayPropertiesKHR*));
9595 if (pProperties)
9596 {
9597 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9598 {
9599 marshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i));
9600 }
9601 }
9602 uint32_t* check_pPropertyCount;
9603 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
9604 if (pPropertyCount)
9605 {
9606 if (!(check_pPropertyCount))
9607 {
9608 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
9609 }
9610 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
9611 }
9612 VkDisplayPropertiesKHR* check_pProperties;
9613 stream->read((VkDisplayPropertiesKHR**)&check_pProperties, sizeof(VkDisplayPropertiesKHR*));
9614 if (pProperties)
9615 {
9616 if (!(check_pProperties))
9617 {
9618 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
9619 }
9620 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9621 {
9622 unmarshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i));
9623 }
9624 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009625 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009626 VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0;
9627 stream->read(&vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return, sizeof(VkResult));
9628 return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return;
9629}
9630
9631VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
9632 VkPhysicalDevice physicalDevice,
9633 uint32_t* pPropertyCount,
9634 VkDisplayPlanePropertiesKHR* pProperties)
9635{
9636 auto stream = mImpl->stream();
9637 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009638 auto resources = mImpl->resources();
9639 auto pool = mImpl->pool();
9640 VkPhysicalDevice local_physicalDevice;
9641 local_physicalDevice = physicalDevice;
9642 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009643 countingStream->rewind();
9644 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009645 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009646 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
9647 if (pPropertyCount)
9648 {
9649 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
9650 }
9651 countingStream->write((VkDisplayPlanePropertiesKHR**)&pProperties, sizeof(VkDisplayPlanePropertiesKHR*));
9652 if (pProperties)
9653 {
9654 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9655 {
9656 marshal_VkDisplayPlanePropertiesKHR(countingStream, (VkDisplayPlanePropertiesKHR*)(pProperties + i));
9657 }
9658 }
9659 }
9660 uint32_t packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9661 countingStream->rewind();
9662 uint32_t opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR;
9663 stream->write(&opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t));
9664 stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009665 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009666 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
9667 if (pPropertyCount)
9668 {
9669 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
9670 }
9671 stream->write((VkDisplayPlanePropertiesKHR**)&pProperties, sizeof(VkDisplayPlanePropertiesKHR*));
9672 if (pProperties)
9673 {
9674 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9675 {
9676 marshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i));
9677 }
9678 }
9679 uint32_t* check_pPropertyCount;
9680 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
9681 if (pPropertyCount)
9682 {
9683 if (!(check_pPropertyCount))
9684 {
9685 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
9686 }
9687 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
9688 }
9689 VkDisplayPlanePropertiesKHR* check_pProperties;
9690 stream->read((VkDisplayPlanePropertiesKHR**)&check_pProperties, sizeof(VkDisplayPlanePropertiesKHR*));
9691 if (pProperties)
9692 {
9693 if (!(check_pProperties))
9694 {
9695 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
9696 }
9697 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9698 {
9699 unmarshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i));
9700 }
9701 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009702 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009703 VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0;
9704 stream->read(&vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return, sizeof(VkResult));
9705 return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return;
9706}
9707
9708VkResult VkEncoder::vkGetDisplayPlaneSupportedDisplaysKHR(
9709 VkPhysicalDevice physicalDevice,
9710 uint32_t planeIndex,
9711 uint32_t* pDisplayCount,
9712 VkDisplayKHR* pDisplays)
9713{
9714 auto stream = mImpl->stream();
9715 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009716 auto resources = mImpl->resources();
9717 auto pool = mImpl->pool();
9718 VkPhysicalDevice local_physicalDevice;
9719 local_physicalDevice = physicalDevice;
9720 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9721 uint32_t local_planeIndex;
9722 local_planeIndex = planeIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009723 countingStream->rewind();
9724 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009725 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9726 countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009727 countingStream->write((uint32_t**)&pDisplayCount, sizeof(uint32_t*));
9728 if (pDisplayCount)
9729 {
9730 countingStream->write((uint32_t*)pDisplayCount, sizeof(uint32_t));
9731 }
9732 countingStream->write((VkDisplayKHR**)&pDisplays, sizeof(VkDisplayKHR*));
9733 if (pDisplays)
9734 {
9735 countingStream->write((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR));
9736 }
9737 }
9738 uint32_t packetSize_vkGetDisplayPlaneSupportedDisplaysKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9739 countingStream->rewind();
9740 uint32_t opcode_vkGetDisplayPlaneSupportedDisplaysKHR = OP_vkGetDisplayPlaneSupportedDisplaysKHR;
9741 stream->write(&opcode_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t));
9742 stream->write(&packetSize_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009743 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9744 stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009745 stream->write((uint32_t**)&pDisplayCount, sizeof(uint32_t*));
9746 if (pDisplayCount)
9747 {
9748 stream->write((uint32_t*)pDisplayCount, sizeof(uint32_t));
9749 }
9750 stream->write((VkDisplayKHR**)&pDisplays, sizeof(VkDisplayKHR*));
9751 if (pDisplays)
9752 {
9753 stream->write((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR));
9754 }
9755 uint32_t* check_pDisplayCount;
9756 stream->read((uint32_t**)&check_pDisplayCount, sizeof(uint32_t*));
9757 if (pDisplayCount)
9758 {
9759 if (!(check_pDisplayCount))
9760 {
9761 fprintf(stderr, "fatal: pDisplayCount inconsistent between guest and host\n");
9762 }
9763 stream->read((uint32_t*)pDisplayCount, sizeof(uint32_t));
9764 }
9765 VkDisplayKHR* check_pDisplays;
9766 stream->read((VkDisplayKHR**)&check_pDisplays, sizeof(VkDisplayKHR*));
9767 if (pDisplays)
9768 {
9769 if (!(check_pDisplays))
9770 {
9771 fprintf(stderr, "fatal: pDisplays inconsistent between guest and host\n");
9772 }
9773 stream->read((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR));
9774 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009775 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009776 VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0;
9777 stream->read(&vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return, sizeof(VkResult));
9778 return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return;
9779}
9780
9781VkResult VkEncoder::vkGetDisplayModePropertiesKHR(
9782 VkPhysicalDevice physicalDevice,
9783 VkDisplayKHR display,
9784 uint32_t* pPropertyCount,
9785 VkDisplayModePropertiesKHR* pProperties)
9786{
9787 auto stream = mImpl->stream();
9788 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009789 auto resources = mImpl->resources();
9790 auto pool = mImpl->pool();
9791 VkPhysicalDevice local_physicalDevice;
9792 local_physicalDevice = physicalDevice;
9793 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9794 VkDisplayKHR local_display;
9795 local_display = display;
9796 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009797 countingStream->rewind();
9798 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009799 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9800 countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009801 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
9802 if (pPropertyCount)
9803 {
9804 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
9805 }
9806 countingStream->write((VkDisplayModePropertiesKHR**)&pProperties, sizeof(VkDisplayModePropertiesKHR*));
9807 if (pProperties)
9808 {
9809 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9810 {
9811 marshal_VkDisplayModePropertiesKHR(countingStream, (VkDisplayModePropertiesKHR*)(pProperties + i));
9812 }
9813 }
9814 }
9815 uint32_t packetSize_vkGetDisplayModePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9816 countingStream->rewind();
9817 uint32_t opcode_vkGetDisplayModePropertiesKHR = OP_vkGetDisplayModePropertiesKHR;
9818 stream->write(&opcode_vkGetDisplayModePropertiesKHR, sizeof(uint32_t));
9819 stream->write(&packetSize_vkGetDisplayModePropertiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009820 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9821 stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009822 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
9823 if (pPropertyCount)
9824 {
9825 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
9826 }
9827 stream->write((VkDisplayModePropertiesKHR**)&pProperties, sizeof(VkDisplayModePropertiesKHR*));
9828 if (pProperties)
9829 {
9830 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9831 {
9832 marshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i));
9833 }
9834 }
9835 uint32_t* check_pPropertyCount;
9836 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
9837 if (pPropertyCount)
9838 {
9839 if (!(check_pPropertyCount))
9840 {
9841 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
9842 }
9843 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
9844 }
9845 VkDisplayModePropertiesKHR* check_pProperties;
9846 stream->read((VkDisplayModePropertiesKHR**)&check_pProperties, sizeof(VkDisplayModePropertiesKHR*));
9847 if (pProperties)
9848 {
9849 if (!(check_pProperties))
9850 {
9851 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
9852 }
9853 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
9854 {
9855 unmarshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i));
9856 }
9857 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009858 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009859 VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0;
9860 stream->read(&vkGetDisplayModePropertiesKHR_VkResult_return, sizeof(VkResult));
9861 return vkGetDisplayModePropertiesKHR_VkResult_return;
9862}
9863
9864VkResult VkEncoder::vkCreateDisplayModeKHR(
9865 VkPhysicalDevice physicalDevice,
9866 VkDisplayKHR display,
9867 const VkDisplayModeCreateInfoKHR* pCreateInfo,
9868 const VkAllocationCallbacks* pAllocator,
9869 VkDisplayModeKHR* pMode)
9870{
9871 auto stream = mImpl->stream();
9872 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009873 auto resources = mImpl->resources();
9874 auto pool = mImpl->pool();
9875 VkPhysicalDevice local_physicalDevice;
9876 local_physicalDevice = physicalDevice;
9877 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9878 VkDisplayKHR local_display;
9879 local_display = display;
9880 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
9881 VkDisplayModeCreateInfoKHR* local_pCreateInfo;
9882 local_pCreateInfo = nullptr;
9883 if (pCreateInfo)
9884 {
9885 local_pCreateInfo = (VkDisplayModeCreateInfoKHR*)pool->alloc(sizeof(const VkDisplayModeCreateInfoKHR));
9886 deepcopy_VkDisplayModeCreateInfoKHR(pool, pCreateInfo, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
9887 }
9888 if (local_pCreateInfo)
9889 {
9890 handlemap_VkDisplayModeCreateInfoKHR(resources->unwrapMapping(), (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
9891 }
9892 VkAllocationCallbacks* local_pAllocator;
9893 local_pAllocator = nullptr;
9894 if (pAllocator)
9895 {
9896 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
9897 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
9898 }
9899 if (local_pAllocator)
9900 {
9901 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
9902 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009903 countingStream->rewind();
9904 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009905 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9906 countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
9907 marshal_VkDisplayModeCreateInfoKHR(countingStream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
9908 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
9909 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009910 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009911 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009912 }
9913 countingStream->write((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR));
9914 }
9915 uint32_t packetSize_vkCreateDisplayModeKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9916 countingStream->rewind();
9917 uint32_t opcode_vkCreateDisplayModeKHR = OP_vkCreateDisplayModeKHR;
9918 stream->write(&opcode_vkCreateDisplayModeKHR, sizeof(uint32_t));
9919 stream->write(&packetSize_vkCreateDisplayModeKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009920 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9921 stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
9922 marshal_VkDisplayModeCreateInfoKHR(stream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo));
9923 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
9924 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009925 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009926 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009927 }
9928 stream->write((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR));
9929 stream->read((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009930 if (pMode)
9931 {
9932 resources->createMapping()->mapHandles_VkDisplayModeKHR((VkDisplayModeKHR*)pMode, 1);
9933 }
9934 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009935 VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0;
9936 stream->read(&vkCreateDisplayModeKHR_VkResult_return, sizeof(VkResult));
9937 return vkCreateDisplayModeKHR_VkResult_return;
9938}
9939
9940VkResult VkEncoder::vkGetDisplayPlaneCapabilitiesKHR(
9941 VkPhysicalDevice physicalDevice,
9942 VkDisplayModeKHR mode,
9943 uint32_t planeIndex,
9944 VkDisplayPlaneCapabilitiesKHR* pCapabilities)
9945{
9946 auto stream = mImpl->stream();
9947 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009948 auto resources = mImpl->resources();
9949 auto pool = mImpl->pool();
9950 VkPhysicalDevice local_physicalDevice;
9951 local_physicalDevice = physicalDevice;
9952 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
9953 VkDisplayModeKHR local_mode;
9954 local_mode = mode;
9955 resources->unwrapMapping()->mapHandles_VkDisplayModeKHR((VkDisplayModeKHR*)&local_mode);
9956 uint32_t local_planeIndex;
9957 local_planeIndex = planeIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009958 countingStream->rewind();
9959 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009960 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9961 countingStream->write((VkDisplayModeKHR*)&local_mode, sizeof(VkDisplayModeKHR));
9962 countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009963 marshal_VkDisplayPlaneCapabilitiesKHR(countingStream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
9964 }
9965 uint32_t packetSize_vkGetDisplayPlaneCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
9966 countingStream->rewind();
9967 uint32_t opcode_vkGetDisplayPlaneCapabilitiesKHR = OP_vkGetDisplayPlaneCapabilitiesKHR;
9968 stream->write(&opcode_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t));
9969 stream->write(&packetSize_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009970 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
9971 stream->write((VkDisplayModeKHR*)&local_mode, sizeof(VkDisplayModeKHR));
9972 stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009973 marshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
9974 unmarshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009975 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -07009976 VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0;
9977 stream->read(&vkGetDisplayPlaneCapabilitiesKHR_VkResult_return, sizeof(VkResult));
9978 return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return;
9979}
9980
9981VkResult VkEncoder::vkCreateDisplayPlaneSurfaceKHR(
9982 VkInstance instance,
9983 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
9984 const VkAllocationCallbacks* pAllocator,
9985 VkSurfaceKHR* pSurface)
9986{
9987 auto stream = mImpl->stream();
9988 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -08009989 auto resources = mImpl->resources();
9990 auto pool = mImpl->pool();
9991 VkInstance local_instance;
9992 local_instance = instance;
9993 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
9994 VkDisplaySurfaceCreateInfoKHR* local_pCreateInfo;
9995 local_pCreateInfo = nullptr;
9996 if (pCreateInfo)
9997 {
9998 local_pCreateInfo = (VkDisplaySurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkDisplaySurfaceCreateInfoKHR));
9999 deepcopy_VkDisplaySurfaceCreateInfoKHR(pool, pCreateInfo, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
10000 }
10001 if (local_pCreateInfo)
10002 {
10003 handlemap_VkDisplaySurfaceCreateInfoKHR(resources->unwrapMapping(), (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
10004 }
10005 VkAllocationCallbacks* local_pAllocator;
10006 local_pAllocator = nullptr;
10007 if (pAllocator)
10008 {
10009 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10010 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10011 }
10012 if (local_pAllocator)
10013 {
10014 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10015 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010016 countingStream->rewind();
10017 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010018 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10019 marshal_VkDisplaySurfaceCreateInfoKHR(countingStream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
10020 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10021 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010022 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010023 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010024 }
10025 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10026 }
10027 uint32_t packetSize_vkCreateDisplayPlaneSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10028 countingStream->rewind();
10029 uint32_t opcode_vkCreateDisplayPlaneSurfaceKHR = OP_vkCreateDisplayPlaneSurfaceKHR;
10030 stream->write(&opcode_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t));
10031 stream->write(&packetSize_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010032 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10033 marshal_VkDisplaySurfaceCreateInfoKHR(stream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo));
10034 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10035 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010036 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010037 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010038 }
10039 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10040 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010041 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010042 VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0;
10043 stream->read(&vkCreateDisplayPlaneSurfaceKHR_VkResult_return, sizeof(VkResult));
10044 return vkCreateDisplayPlaneSurfaceKHR_VkResult_return;
10045}
10046
10047#endif
10048#ifdef VK_KHR_display_swapchain
10049VkResult VkEncoder::vkCreateSharedSwapchainsKHR(
10050 VkDevice device,
10051 uint32_t swapchainCount,
10052 const VkSwapchainCreateInfoKHR* pCreateInfos,
10053 const VkAllocationCallbacks* pAllocator,
10054 VkSwapchainKHR* pSwapchains)
10055{
10056 auto stream = mImpl->stream();
10057 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010058 auto resources = mImpl->resources();
10059 auto pool = mImpl->pool();
10060 VkDevice local_device;
10061 local_device = device;
10062 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
10063 uint32_t local_swapchainCount;
10064 local_swapchainCount = swapchainCount;
10065 VkSwapchainCreateInfoKHR* local_pCreateInfos;
10066 local_pCreateInfos = nullptr;
10067 if (pCreateInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010068 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010069 local_pCreateInfos = (VkSwapchainCreateInfoKHR*)pool->alloc(((swapchainCount)) * sizeof(const VkSwapchainCreateInfoKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010070 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
10071 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010072 deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfos + i, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010073 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010074 }
10075 if (local_pCreateInfos)
10076 {
10077 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010078 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010079 handlemap_VkSwapchainCreateInfoKHR(resources->unwrapMapping(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
10080 }
10081 }
10082 VkAllocationCallbacks* local_pAllocator;
10083 local_pAllocator = nullptr;
10084 if (pAllocator)
10085 {
10086 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10087 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10088 }
10089 if (local_pAllocator)
10090 {
10091 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10092 }
10093 countingStream->rewind();
10094 {
10095 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
10096 countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
10097 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
10098 {
10099 marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
10100 }
10101 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10102 if (local_pAllocator)
10103 {
10104 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010105 }
10106 countingStream->write((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
10107 }
10108 uint32_t packetSize_vkCreateSharedSwapchainsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10109 countingStream->rewind();
10110 uint32_t opcode_vkCreateSharedSwapchainsKHR = OP_vkCreateSharedSwapchainsKHR;
10111 stream->write(&opcode_vkCreateSharedSwapchainsKHR, sizeof(uint32_t));
10112 stream->write(&packetSize_vkCreateSharedSwapchainsKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010113 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
10114 stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010115 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
10116 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010117 marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010118 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010119 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10120 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010121 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010122 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010123 }
10124 stream->write((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
10125 stream->read((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010126 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010127 VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0;
10128 stream->read(&vkCreateSharedSwapchainsKHR_VkResult_return, sizeof(VkResult));
10129 return vkCreateSharedSwapchainsKHR_VkResult_return;
10130}
10131
10132#endif
10133#ifdef VK_KHR_xlib_surface
10134VkResult VkEncoder::vkCreateXlibSurfaceKHR(
10135 VkInstance instance,
10136 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
10137 const VkAllocationCallbacks* pAllocator,
10138 VkSurfaceKHR* pSurface)
10139{
10140 auto stream = mImpl->stream();
10141 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010142 auto resources = mImpl->resources();
10143 auto pool = mImpl->pool();
10144 VkInstance local_instance;
10145 local_instance = instance;
10146 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
10147 VkXlibSurfaceCreateInfoKHR* local_pCreateInfo;
10148 local_pCreateInfo = nullptr;
10149 if (pCreateInfo)
10150 {
10151 local_pCreateInfo = (VkXlibSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXlibSurfaceCreateInfoKHR));
10152 deepcopy_VkXlibSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
10153 }
10154 if (local_pCreateInfo)
10155 {
10156 handlemap_VkXlibSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
10157 }
10158 VkAllocationCallbacks* local_pAllocator;
10159 local_pAllocator = nullptr;
10160 if (pAllocator)
10161 {
10162 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10163 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10164 }
10165 if (local_pAllocator)
10166 {
10167 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10168 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010169 countingStream->rewind();
10170 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010171 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10172 marshal_VkXlibSurfaceCreateInfoKHR(countingStream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
10173 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10174 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010175 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010176 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010177 }
10178 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10179 }
10180 uint32_t packetSize_vkCreateXlibSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10181 countingStream->rewind();
10182 uint32_t opcode_vkCreateXlibSurfaceKHR = OP_vkCreateXlibSurfaceKHR;
10183 stream->write(&opcode_vkCreateXlibSurfaceKHR, sizeof(uint32_t));
10184 stream->write(&packetSize_vkCreateXlibSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010185 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10186 marshal_VkXlibSurfaceCreateInfoKHR(stream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo));
10187 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10188 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010189 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010190 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010191 }
10192 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10193 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010194 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010195 VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0;
10196 stream->read(&vkCreateXlibSurfaceKHR_VkResult_return, sizeof(VkResult));
10197 return vkCreateXlibSurfaceKHR_VkResult_return;
10198}
10199
10200VkBool32 VkEncoder::vkGetPhysicalDeviceXlibPresentationSupportKHR(
10201 VkPhysicalDevice physicalDevice,
10202 uint32_t queueFamilyIndex,
10203 Display* dpy,
10204 VisualID visualID)
10205{
10206 auto stream = mImpl->stream();
10207 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010208 auto resources = mImpl->resources();
10209 auto pool = mImpl->pool();
10210 VkPhysicalDevice local_physicalDevice;
10211 local_physicalDevice = physicalDevice;
10212 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10213 uint32_t local_queueFamilyIndex;
10214 local_queueFamilyIndex = queueFamilyIndex;
10215 VisualID local_visualID;
10216 local_visualID = visualID;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010217 countingStream->rewind();
10218 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010219 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10220 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010221 countingStream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010222 countingStream->write((VisualID*)&local_visualID, sizeof(VisualID));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010223 }
10224 uint32_t packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10225 countingStream->rewind();
10226 uint32_t opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR = OP_vkGetPhysicalDeviceXlibPresentationSupportKHR;
10227 stream->write(&opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t));
10228 stream->write(&packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010229 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10230 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010231 stream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010232 stream->write((VisualID*)&local_visualID, sizeof(VisualID));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010233 stream->read((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010234 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010235 VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0;
10236 stream->read(&vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
10237 return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return;
10238}
10239
10240#endif
10241#ifdef VK_KHR_xcb_surface
10242VkResult VkEncoder::vkCreateXcbSurfaceKHR(
10243 VkInstance instance,
10244 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
10245 const VkAllocationCallbacks* pAllocator,
10246 VkSurfaceKHR* pSurface)
10247{
10248 auto stream = mImpl->stream();
10249 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010250 auto resources = mImpl->resources();
10251 auto pool = mImpl->pool();
10252 VkInstance local_instance;
10253 local_instance = instance;
10254 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
10255 VkXcbSurfaceCreateInfoKHR* local_pCreateInfo;
10256 local_pCreateInfo = nullptr;
10257 if (pCreateInfo)
10258 {
10259 local_pCreateInfo = (VkXcbSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXcbSurfaceCreateInfoKHR));
10260 deepcopy_VkXcbSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
10261 }
10262 if (local_pCreateInfo)
10263 {
10264 handlemap_VkXcbSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
10265 }
10266 VkAllocationCallbacks* local_pAllocator;
10267 local_pAllocator = nullptr;
10268 if (pAllocator)
10269 {
10270 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10271 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10272 }
10273 if (local_pAllocator)
10274 {
10275 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10276 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010277 countingStream->rewind();
10278 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010279 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10280 marshal_VkXcbSurfaceCreateInfoKHR(countingStream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
10281 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10282 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010283 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010284 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010285 }
10286 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10287 }
10288 uint32_t packetSize_vkCreateXcbSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10289 countingStream->rewind();
10290 uint32_t opcode_vkCreateXcbSurfaceKHR = OP_vkCreateXcbSurfaceKHR;
10291 stream->write(&opcode_vkCreateXcbSurfaceKHR, sizeof(uint32_t));
10292 stream->write(&packetSize_vkCreateXcbSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010293 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10294 marshal_VkXcbSurfaceCreateInfoKHR(stream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo));
10295 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10296 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010297 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010298 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010299 }
10300 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10301 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010302 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010303 VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0;
10304 stream->read(&vkCreateXcbSurfaceKHR_VkResult_return, sizeof(VkResult));
10305 return vkCreateXcbSurfaceKHR_VkResult_return;
10306}
10307
10308VkBool32 VkEncoder::vkGetPhysicalDeviceXcbPresentationSupportKHR(
10309 VkPhysicalDevice physicalDevice,
10310 uint32_t queueFamilyIndex,
10311 xcb_connection_t* connection,
10312 xcb_visualid_t visual_id)
10313{
10314 auto stream = mImpl->stream();
10315 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010316 auto resources = mImpl->resources();
10317 auto pool = mImpl->pool();
10318 VkPhysicalDevice local_physicalDevice;
10319 local_physicalDevice = physicalDevice;
10320 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10321 uint32_t local_queueFamilyIndex;
10322 local_queueFamilyIndex = queueFamilyIndex;
10323 xcb_visualid_t local_visual_id;
10324 local_visual_id = visual_id;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010325 countingStream->rewind();
10326 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010327 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10328 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010329 countingStream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010330 countingStream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010331 }
10332 uint32_t packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10333 countingStream->rewind();
10334 uint32_t opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR = OP_vkGetPhysicalDeviceXcbPresentationSupportKHR;
10335 stream->write(&opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t));
10336 stream->write(&packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010337 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10338 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010339 stream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010340 stream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010341 stream->read((xcb_connection_t*)connection, sizeof(xcb_connection_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010342 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010343 VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0;
10344 stream->read(&vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
10345 return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return;
10346}
10347
10348#endif
10349#ifdef VK_KHR_wayland_surface
10350VkResult VkEncoder::vkCreateWaylandSurfaceKHR(
10351 VkInstance instance,
10352 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
10353 const VkAllocationCallbacks* pAllocator,
10354 VkSurfaceKHR* pSurface)
10355{
10356 auto stream = mImpl->stream();
10357 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010358 auto resources = mImpl->resources();
10359 auto pool = mImpl->pool();
10360 VkInstance local_instance;
10361 local_instance = instance;
10362 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
10363 VkWaylandSurfaceCreateInfoKHR* local_pCreateInfo;
10364 local_pCreateInfo = nullptr;
10365 if (pCreateInfo)
10366 {
10367 local_pCreateInfo = (VkWaylandSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWaylandSurfaceCreateInfoKHR));
10368 deepcopy_VkWaylandSurfaceCreateInfoKHR(pool, pCreateInfo, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
10369 }
10370 if (local_pCreateInfo)
10371 {
10372 handlemap_VkWaylandSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
10373 }
10374 VkAllocationCallbacks* local_pAllocator;
10375 local_pAllocator = nullptr;
10376 if (pAllocator)
10377 {
10378 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10379 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10380 }
10381 if (local_pAllocator)
10382 {
10383 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10384 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010385 countingStream->rewind();
10386 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010387 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10388 marshal_VkWaylandSurfaceCreateInfoKHR(countingStream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
10389 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10390 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010391 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010392 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010393 }
10394 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10395 }
10396 uint32_t packetSize_vkCreateWaylandSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10397 countingStream->rewind();
10398 uint32_t opcode_vkCreateWaylandSurfaceKHR = OP_vkCreateWaylandSurfaceKHR;
10399 stream->write(&opcode_vkCreateWaylandSurfaceKHR, sizeof(uint32_t));
10400 stream->write(&packetSize_vkCreateWaylandSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010401 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10402 marshal_VkWaylandSurfaceCreateInfoKHR(stream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo));
10403 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10404 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010405 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010406 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010407 }
10408 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10409 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010410 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010411 VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0;
10412 stream->read(&vkCreateWaylandSurfaceKHR_VkResult_return, sizeof(VkResult));
10413 return vkCreateWaylandSurfaceKHR_VkResult_return;
10414}
10415
10416VkBool32 VkEncoder::vkGetPhysicalDeviceWaylandPresentationSupportKHR(
10417 VkPhysicalDevice physicalDevice,
10418 uint32_t queueFamilyIndex,
10419 wl_display* display)
10420{
10421 auto stream = mImpl->stream();
10422 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010423 auto resources = mImpl->resources();
10424 auto pool = mImpl->pool();
10425 VkPhysicalDevice local_physicalDevice;
10426 local_physicalDevice = physicalDevice;
10427 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10428 uint32_t local_queueFamilyIndex;
10429 local_queueFamilyIndex = queueFamilyIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010430 countingStream->rewind();
10431 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010432 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10433 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010434 countingStream->write((wl_display*)display, sizeof(wl_display));
10435 }
10436 uint32_t packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10437 countingStream->rewind();
10438 uint32_t opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR = OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR;
10439 stream->write(&opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t));
10440 stream->write(&packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010441 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10442 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010443 stream->write((wl_display*)display, sizeof(wl_display));
10444 stream->read((wl_display*)display, sizeof(wl_display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010445 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010446 VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0;
10447 stream->read(&vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
10448 return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return;
10449}
10450
10451#endif
10452#ifdef VK_KHR_mir_surface
10453VkResult VkEncoder::vkCreateMirSurfaceKHR(
10454 VkInstance instance,
10455 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
10456 const VkAllocationCallbacks* pAllocator,
10457 VkSurfaceKHR* pSurface)
10458{
10459 auto stream = mImpl->stream();
10460 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010461 auto resources = mImpl->resources();
10462 auto pool = mImpl->pool();
10463 VkInstance local_instance;
10464 local_instance = instance;
10465 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
10466 VkMirSurfaceCreateInfoKHR* local_pCreateInfo;
10467 local_pCreateInfo = nullptr;
10468 if (pCreateInfo)
10469 {
10470 local_pCreateInfo = (VkMirSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkMirSurfaceCreateInfoKHR));
10471 deepcopy_VkMirSurfaceCreateInfoKHR(pool, pCreateInfo, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo));
10472 }
10473 if (local_pCreateInfo)
10474 {
10475 handlemap_VkMirSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo));
10476 }
10477 VkAllocationCallbacks* local_pAllocator;
10478 local_pAllocator = nullptr;
10479 if (pAllocator)
10480 {
10481 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10482 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10483 }
10484 if (local_pAllocator)
10485 {
10486 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10487 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010488 countingStream->rewind();
10489 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010490 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10491 marshal_VkMirSurfaceCreateInfoKHR(countingStream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo));
10492 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10493 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010494 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010495 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010496 }
10497 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10498 }
10499 uint32_t packetSize_vkCreateMirSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10500 countingStream->rewind();
10501 uint32_t opcode_vkCreateMirSurfaceKHR = OP_vkCreateMirSurfaceKHR;
10502 stream->write(&opcode_vkCreateMirSurfaceKHR, sizeof(uint32_t));
10503 stream->write(&packetSize_vkCreateMirSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010504 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10505 marshal_VkMirSurfaceCreateInfoKHR(stream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo));
10506 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10507 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010508 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010509 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010510 }
10511 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10512 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010513 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010514 VkResult vkCreateMirSurfaceKHR_VkResult_return = (VkResult)0;
10515 stream->read(&vkCreateMirSurfaceKHR_VkResult_return, sizeof(VkResult));
10516 return vkCreateMirSurfaceKHR_VkResult_return;
10517}
10518
10519VkBool32 VkEncoder::vkGetPhysicalDeviceMirPresentationSupportKHR(
10520 VkPhysicalDevice physicalDevice,
10521 uint32_t queueFamilyIndex,
10522 MirConnection* connection)
10523{
10524 auto stream = mImpl->stream();
10525 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010526 auto resources = mImpl->resources();
10527 auto pool = mImpl->pool();
10528 VkPhysicalDevice local_physicalDevice;
10529 local_physicalDevice = physicalDevice;
10530 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10531 uint32_t local_queueFamilyIndex;
10532 local_queueFamilyIndex = queueFamilyIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010533 countingStream->rewind();
10534 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010535 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10536 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010537 countingStream->write((MirConnection*)connection, sizeof(MirConnection));
10538 }
10539 uint32_t packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10540 countingStream->rewind();
10541 uint32_t opcode_vkGetPhysicalDeviceMirPresentationSupportKHR = OP_vkGetPhysicalDeviceMirPresentationSupportKHR;
10542 stream->write(&opcode_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t));
10543 stream->write(&packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010544 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10545 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010546 stream->write((MirConnection*)connection, sizeof(MirConnection));
10547 stream->read((MirConnection*)connection, sizeof(MirConnection));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010548 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010549 VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return = (VkBool32)0;
10550 stream->read(&vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
10551 return vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return;
10552}
10553
10554#endif
10555#ifdef VK_KHR_android_surface
10556VkResult VkEncoder::vkCreateAndroidSurfaceKHR(
10557 VkInstance instance,
10558 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
10559 const VkAllocationCallbacks* pAllocator,
10560 VkSurfaceKHR* pSurface)
10561{
10562 auto stream = mImpl->stream();
10563 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010564 auto resources = mImpl->resources();
10565 auto pool = mImpl->pool();
10566 VkInstance local_instance;
10567 local_instance = instance;
10568 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
10569 VkAndroidSurfaceCreateInfoKHR* local_pCreateInfo;
10570 local_pCreateInfo = nullptr;
10571 if (pCreateInfo)
10572 {
10573 local_pCreateInfo = (VkAndroidSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkAndroidSurfaceCreateInfoKHR));
10574 deepcopy_VkAndroidSurfaceCreateInfoKHR(pool, pCreateInfo, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
10575 }
10576 if (local_pCreateInfo)
10577 {
10578 handlemap_VkAndroidSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
10579 }
10580 VkAllocationCallbacks* local_pAllocator;
10581 local_pAllocator = nullptr;
10582 if (pAllocator)
10583 {
10584 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10585 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10586 }
10587 if (local_pAllocator)
10588 {
10589 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10590 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010591 countingStream->rewind();
10592 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010593 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10594 marshal_VkAndroidSurfaceCreateInfoKHR(countingStream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
10595 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10596 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010597 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010598 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010599 }
10600 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10601 }
10602 uint32_t packetSize_vkCreateAndroidSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10603 countingStream->rewind();
10604 uint32_t opcode_vkCreateAndroidSurfaceKHR = OP_vkCreateAndroidSurfaceKHR;
10605 stream->write(&opcode_vkCreateAndroidSurfaceKHR, sizeof(uint32_t));
10606 stream->write(&packetSize_vkCreateAndroidSurfaceKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010607 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10608 marshal_VkAndroidSurfaceCreateInfoKHR(stream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo));
10609 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10610 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010611 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010612 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010613 }
10614 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10615 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010616 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010617 VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0;
10618 stream->read(&vkCreateAndroidSurfaceKHR_VkResult_return, sizeof(VkResult));
10619 return vkCreateAndroidSurfaceKHR_VkResult_return;
10620}
10621
10622#endif
10623#ifdef VK_KHR_win32_surface
10624VkResult VkEncoder::vkCreateWin32SurfaceKHR(
10625 VkInstance instance,
10626 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
10627 const VkAllocationCallbacks* pAllocator,
10628 VkSurfaceKHR* pSurface)
10629{
10630 auto stream = mImpl->stream();
10631 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010632 auto resources = mImpl->resources();
10633 auto pool = mImpl->pool();
10634 VkInstance local_instance;
10635 local_instance = instance;
10636 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
10637 VkWin32SurfaceCreateInfoKHR* local_pCreateInfo;
10638 local_pCreateInfo = nullptr;
10639 if (pCreateInfo)
10640 {
10641 local_pCreateInfo = (VkWin32SurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWin32SurfaceCreateInfoKHR));
10642 deepcopy_VkWin32SurfaceCreateInfoKHR(pool, pCreateInfo, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
10643 }
10644 if (local_pCreateInfo)
10645 {
10646 handlemap_VkWin32SurfaceCreateInfoKHR(resources->unwrapMapping(), (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
10647 }
10648 VkAllocationCallbacks* local_pAllocator;
10649 local_pAllocator = nullptr;
10650 if (pAllocator)
10651 {
10652 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
10653 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
10654 }
10655 if (local_pAllocator)
10656 {
10657 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
10658 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010659 countingStream->rewind();
10660 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010661 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10662 marshal_VkWin32SurfaceCreateInfoKHR(countingStream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
10663 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10664 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010665 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010666 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010667 }
10668 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10669 }
10670 uint32_t packetSize_vkCreateWin32SurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10671 countingStream->rewind();
10672 uint32_t opcode_vkCreateWin32SurfaceKHR = OP_vkCreateWin32SurfaceKHR;
10673 stream->write(&opcode_vkCreateWin32SurfaceKHR, sizeof(uint32_t));
10674 stream->write(&packetSize_vkCreateWin32SurfaceKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010675 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
10676 marshal_VkWin32SurfaceCreateInfoKHR(stream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo));
10677 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
10678 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010679 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010680 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010681 }
10682 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
10683 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010684 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010685 VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0;
10686 stream->read(&vkCreateWin32SurfaceKHR_VkResult_return, sizeof(VkResult));
10687 return vkCreateWin32SurfaceKHR_VkResult_return;
10688}
10689
10690VkBool32 VkEncoder::vkGetPhysicalDeviceWin32PresentationSupportKHR(
10691 VkPhysicalDevice physicalDevice,
10692 uint32_t queueFamilyIndex)
10693{
10694 auto stream = mImpl->stream();
10695 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010696 auto resources = mImpl->resources();
10697 auto pool = mImpl->pool();
10698 VkPhysicalDevice local_physicalDevice;
10699 local_physicalDevice = physicalDevice;
10700 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10701 uint32_t local_queueFamilyIndex;
10702 local_queueFamilyIndex = queueFamilyIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010703 countingStream->rewind();
10704 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010705 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10706 countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010707 }
10708 uint32_t packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10709 countingStream->rewind();
10710 uint32_t opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR = OP_vkGetPhysicalDeviceWin32PresentationSupportKHR;
10711 stream->write(&opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t));
10712 stream->write(&packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010713 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10714 stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t));
10715 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010716 VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0;
10717 stream->read(&vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return, sizeof(VkBool32));
10718 return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return;
10719}
10720
10721#endif
10722#ifdef VK_KHR_sampler_mirror_clamp_to_edge
10723#endif
10724#ifdef VK_KHR_multiview
10725#endif
10726#ifdef VK_KHR_get_physical_device_properties2
10727void VkEncoder::vkGetPhysicalDeviceFeatures2KHR(
10728 VkPhysicalDevice physicalDevice,
10729 VkPhysicalDeviceFeatures2* pFeatures)
10730{
10731 auto stream = mImpl->stream();
10732 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010733 auto resources = mImpl->resources();
10734 auto pool = mImpl->pool();
10735 VkPhysicalDevice local_physicalDevice;
10736 local_physicalDevice = physicalDevice;
10737 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010738 countingStream->rewind();
10739 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010740 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010741 marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures));
10742 }
10743 uint32_t packetSize_vkGetPhysicalDeviceFeatures2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10744 countingStream->rewind();
10745 uint32_t opcode_vkGetPhysicalDeviceFeatures2KHR = OP_vkGetPhysicalDeviceFeatures2KHR;
10746 stream->write(&opcode_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t));
10747 stream->write(&packetSize_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010748 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010749 marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
10750 unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010751 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010752}
10753
10754void VkEncoder::vkGetPhysicalDeviceProperties2KHR(
10755 VkPhysicalDevice physicalDevice,
10756 VkPhysicalDeviceProperties2* pProperties)
10757{
10758 auto stream = mImpl->stream();
10759 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010760 auto resources = mImpl->resources();
10761 auto pool = mImpl->pool();
10762 VkPhysicalDevice local_physicalDevice;
10763 local_physicalDevice = physicalDevice;
10764 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010765 countingStream->rewind();
10766 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010767 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010768 marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties));
10769 }
10770 uint32_t packetSize_vkGetPhysicalDeviceProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10771 countingStream->rewind();
10772 uint32_t opcode_vkGetPhysicalDeviceProperties2KHR = OP_vkGetPhysicalDeviceProperties2KHR;
10773 stream->write(&opcode_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t));
10774 stream->write(&packetSize_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010775 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010776 marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties));
10777 unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010778 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010779}
10780
10781void VkEncoder::vkGetPhysicalDeviceFormatProperties2KHR(
10782 VkPhysicalDevice physicalDevice,
10783 VkFormat format,
10784 VkFormatProperties2* pFormatProperties)
10785{
10786 auto stream = mImpl->stream();
10787 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010788 auto resources = mImpl->resources();
10789 auto pool = mImpl->pool();
10790 VkPhysicalDevice local_physicalDevice;
10791 local_physicalDevice = physicalDevice;
10792 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10793 VkFormat local_format;
10794 local_format = format;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010795 countingStream->rewind();
10796 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010797 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10798 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010799 marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties));
10800 }
10801 uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10802 countingStream->rewind();
10803 uint32_t opcode_vkGetPhysicalDeviceFormatProperties2KHR = OP_vkGetPhysicalDeviceFormatProperties2KHR;
10804 stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t));
10805 stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010806 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10807 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010808 marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
10809 unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010810 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010811}
10812
10813VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2KHR(
10814 VkPhysicalDevice physicalDevice,
10815 const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
10816 VkImageFormatProperties2* pImageFormatProperties)
10817{
10818 auto stream = mImpl->stream();
10819 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010820 auto resources = mImpl->resources();
10821 auto pool = mImpl->pool();
10822 VkPhysicalDevice local_physicalDevice;
10823 local_physicalDevice = physicalDevice;
10824 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10825 VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo;
10826 local_pImageFormatInfo = nullptr;
10827 if (pImageFormatInfo)
10828 {
10829 local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2));
10830 deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
10831 }
10832 if (local_pImageFormatInfo)
10833 {
10834 handlemap_VkPhysicalDeviceImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
10835 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010836 countingStream->rewind();
10837 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010838 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10839 marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010840 marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties));
10841 }
10842 uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10843 countingStream->rewind();
10844 uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2KHR = OP_vkGetPhysicalDeviceImageFormatProperties2KHR;
10845 stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t));
10846 stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010847 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10848 marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010849 marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
10850 unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010851 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010852 VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0;
10853 stream->read(&vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return, sizeof(VkResult));
10854 return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return;
10855}
10856
10857void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2KHR(
10858 VkPhysicalDevice physicalDevice,
10859 uint32_t* pQueueFamilyPropertyCount,
10860 VkQueueFamilyProperties2* pQueueFamilyProperties)
10861{
10862 auto stream = mImpl->stream();
10863 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010864 auto resources = mImpl->resources();
10865 auto pool = mImpl->pool();
10866 VkPhysicalDevice local_physicalDevice;
10867 local_physicalDevice = physicalDevice;
10868 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010869 countingStream->rewind();
10870 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010871 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010872 countingStream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*));
10873 if (pQueueFamilyPropertyCount)
10874 {
10875 countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
10876 }
10877 countingStream->write((VkQueueFamilyProperties2**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*));
10878 if (pQueueFamilyProperties)
10879 {
10880 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
10881 {
10882 marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
10883 }
10884 }
10885 }
10886 uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10887 countingStream->rewind();
10888 uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR = OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR;
10889 stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t));
10890 stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010891 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010892 stream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*));
10893 if (pQueueFamilyPropertyCount)
10894 {
10895 stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
10896 }
10897 stream->write((VkQueueFamilyProperties2**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*));
10898 if (pQueueFamilyProperties)
10899 {
10900 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
10901 {
10902 marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
10903 }
10904 }
10905 uint32_t* check_pQueueFamilyPropertyCount;
10906 stream->read((uint32_t**)&check_pQueueFamilyPropertyCount, sizeof(uint32_t*));
10907 if (pQueueFamilyPropertyCount)
10908 {
10909 if (!(check_pQueueFamilyPropertyCount))
10910 {
10911 fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n");
10912 }
10913 stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t));
10914 }
10915 VkQueueFamilyProperties2* check_pQueueFamilyProperties;
10916 stream->read((VkQueueFamilyProperties2**)&check_pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*));
10917 if (pQueueFamilyProperties)
10918 {
10919 if (!(check_pQueueFamilyProperties))
10920 {
10921 fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n");
10922 }
10923 for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i)
10924 {
10925 unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i));
10926 }
10927 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010928 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010929}
10930
10931void VkEncoder::vkGetPhysicalDeviceMemoryProperties2KHR(
10932 VkPhysicalDevice physicalDevice,
10933 VkPhysicalDeviceMemoryProperties2* pMemoryProperties)
10934{
10935 auto stream = mImpl->stream();
10936 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010937 auto resources = mImpl->resources();
10938 auto pool = mImpl->pool();
10939 VkPhysicalDevice local_physicalDevice;
10940 local_physicalDevice = physicalDevice;
10941 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010942 countingStream->rewind();
10943 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010944 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010945 marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
10946 }
10947 uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
10948 countingStream->rewind();
10949 uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2KHR = OP_vkGetPhysicalDeviceMemoryProperties2KHR;
10950 stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t));
10951 stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010952 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010953 marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
10954 unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010955 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010956}
10957
10958void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
10959 VkPhysicalDevice physicalDevice,
10960 const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
10961 uint32_t* pPropertyCount,
10962 VkSparseImageFormatProperties2* pProperties)
10963{
10964 auto stream = mImpl->stream();
10965 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010966 auto resources = mImpl->resources();
10967 auto pool = mImpl->pool();
10968 VkPhysicalDevice local_physicalDevice;
10969 local_physicalDevice = physicalDevice;
10970 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
10971 VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo;
10972 local_pFormatInfo = nullptr;
10973 if (pFormatInfo)
10974 {
10975 local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2));
10976 deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
10977 }
10978 if (local_pFormatInfo)
10979 {
10980 handlemap_VkPhysicalDeviceSparseImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
10981 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010982 countingStream->rewind();
10983 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080010984 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
10985 marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070010986 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
10987 if (pPropertyCount)
10988 {
10989 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
10990 }
10991 countingStream->write((VkSparseImageFormatProperties2**)&pProperties, sizeof(VkSparseImageFormatProperties2*));
10992 if (pProperties)
10993 {
10994 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
10995 {
10996 marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i));
10997 }
10998 }
10999 }
11000 uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11001 countingStream->rewind();
11002 uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR;
11003 stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t));
11004 stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011005 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
11006 marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011007 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
11008 if (pPropertyCount)
11009 {
11010 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
11011 }
11012 stream->write((VkSparseImageFormatProperties2**)&pProperties, sizeof(VkSparseImageFormatProperties2*));
11013 if (pProperties)
11014 {
11015 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
11016 {
11017 marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i));
11018 }
11019 }
11020 uint32_t* check_pPropertyCount;
11021 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
11022 if (pPropertyCount)
11023 {
11024 if (!(check_pPropertyCount))
11025 {
11026 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
11027 }
11028 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
11029 }
11030 VkSparseImageFormatProperties2* check_pProperties;
11031 stream->read((VkSparseImageFormatProperties2**)&check_pProperties, sizeof(VkSparseImageFormatProperties2*));
11032 if (pProperties)
11033 {
11034 if (!(check_pProperties))
11035 {
11036 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
11037 }
11038 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
11039 {
11040 unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i));
11041 }
11042 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011043 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011044}
11045
11046#endif
11047#ifdef VK_KHR_device_group
11048void VkEncoder::vkGetDeviceGroupPeerMemoryFeaturesKHR(
11049 VkDevice device,
11050 uint32_t heapIndex,
11051 uint32_t localDeviceIndex,
11052 uint32_t remoteDeviceIndex,
11053 VkPeerMemoryFeatureFlags* pPeerMemoryFeatures)
11054{
11055 auto stream = mImpl->stream();
11056 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011057 auto resources = mImpl->resources();
11058 auto pool = mImpl->pool();
11059 VkDevice local_device;
11060 local_device = device;
11061 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11062 uint32_t local_heapIndex;
11063 local_heapIndex = heapIndex;
11064 uint32_t local_localDeviceIndex;
11065 local_localDeviceIndex = localDeviceIndex;
11066 uint32_t local_remoteDeviceIndex;
11067 local_remoteDeviceIndex = remoteDeviceIndex;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011068 countingStream->rewind();
11069 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011070 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11071 countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
11072 countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
11073 countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011074 countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
11075 }
11076 uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11077 countingStream->rewind();
11078 uint32_t opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR = OP_vkGetDeviceGroupPeerMemoryFeaturesKHR;
11079 stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t));
11080 stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011081 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11082 stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t));
11083 stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t));
11084 stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011085 stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
11086 stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011087 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011088}
11089
11090void VkEncoder::vkCmdSetDeviceMaskKHR(
11091 VkCommandBuffer commandBuffer,
11092 uint32_t deviceMask)
11093{
11094 auto stream = mImpl->stream();
11095 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011096 auto resources = mImpl->resources();
11097 auto pool = mImpl->pool();
11098 VkCommandBuffer local_commandBuffer;
11099 local_commandBuffer = commandBuffer;
11100 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
11101 uint32_t local_deviceMask;
11102 local_deviceMask = deviceMask;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011103 countingStream->rewind();
11104 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011105 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
11106 countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011107 }
11108 uint32_t packetSize_vkCmdSetDeviceMaskKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11109 countingStream->rewind();
11110 uint32_t opcode_vkCmdSetDeviceMaskKHR = OP_vkCmdSetDeviceMaskKHR;
11111 stream->write(&opcode_vkCmdSetDeviceMaskKHR, sizeof(uint32_t));
11112 stream->write(&packetSize_vkCmdSetDeviceMaskKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011113 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
11114 stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t));
11115 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011116}
11117
11118void VkEncoder::vkCmdDispatchBaseKHR(
11119 VkCommandBuffer commandBuffer,
11120 uint32_t baseGroupX,
11121 uint32_t baseGroupY,
11122 uint32_t baseGroupZ,
11123 uint32_t groupCountX,
11124 uint32_t groupCountY,
11125 uint32_t groupCountZ)
11126{
11127 auto stream = mImpl->stream();
11128 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011129 auto resources = mImpl->resources();
11130 auto pool = mImpl->pool();
11131 VkCommandBuffer local_commandBuffer;
11132 local_commandBuffer = commandBuffer;
11133 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
11134 uint32_t local_baseGroupX;
11135 local_baseGroupX = baseGroupX;
11136 uint32_t local_baseGroupY;
11137 local_baseGroupY = baseGroupY;
11138 uint32_t local_baseGroupZ;
11139 local_baseGroupZ = baseGroupZ;
11140 uint32_t local_groupCountX;
11141 local_groupCountX = groupCountX;
11142 uint32_t local_groupCountY;
11143 local_groupCountY = groupCountY;
11144 uint32_t local_groupCountZ;
11145 local_groupCountZ = groupCountZ;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011146 countingStream->rewind();
11147 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011148 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
11149 countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
11150 countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
11151 countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
11152 countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
11153 countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
11154 countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011155 }
11156 uint32_t packetSize_vkCmdDispatchBaseKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11157 countingStream->rewind();
11158 uint32_t opcode_vkCmdDispatchBaseKHR = OP_vkCmdDispatchBaseKHR;
11159 stream->write(&opcode_vkCmdDispatchBaseKHR, sizeof(uint32_t));
11160 stream->write(&packetSize_vkCmdDispatchBaseKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011161 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
11162 stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t));
11163 stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t));
11164 stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t));
11165 stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t));
11166 stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t));
11167 stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t));
11168 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011169}
11170
11171#endif
11172#ifdef VK_KHR_shader_draw_parameters
11173#endif
11174#ifdef VK_KHR_maintenance1
11175void VkEncoder::vkTrimCommandPoolKHR(
11176 VkDevice device,
11177 VkCommandPool commandPool,
11178 VkCommandPoolTrimFlags flags)
11179{
11180 auto stream = mImpl->stream();
11181 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011182 auto resources = mImpl->resources();
11183 auto pool = mImpl->pool();
11184 VkDevice local_device;
11185 local_device = device;
11186 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11187 VkCommandPool local_commandPool;
11188 local_commandPool = commandPool;
11189 resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool);
11190 VkCommandPoolTrimFlags local_flags;
11191 local_flags = flags;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011192 countingStream->rewind();
11193 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011194 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11195 countingStream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool));
11196 countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011197 }
11198 uint32_t packetSize_vkTrimCommandPoolKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11199 countingStream->rewind();
11200 uint32_t opcode_vkTrimCommandPoolKHR = OP_vkTrimCommandPoolKHR;
11201 stream->write(&opcode_vkTrimCommandPoolKHR, sizeof(uint32_t));
11202 stream->write(&packetSize_vkTrimCommandPoolKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011203 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11204 stream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool));
11205 stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags));
11206 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011207}
11208
11209#endif
11210#ifdef VK_KHR_device_group_creation
11211VkResult VkEncoder::vkEnumeratePhysicalDeviceGroupsKHR(
11212 VkInstance instance,
11213 uint32_t* pPhysicalDeviceGroupCount,
11214 VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties)
11215{
11216 auto stream = mImpl->stream();
11217 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011218 auto resources = mImpl->resources();
11219 auto pool = mImpl->pool();
11220 VkInstance local_instance;
11221 local_instance = instance;
11222 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011223 countingStream->rewind();
11224 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011225 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011226 countingStream->write((uint32_t**)&pPhysicalDeviceGroupCount, sizeof(uint32_t*));
11227 if (pPhysicalDeviceGroupCount)
11228 {
11229 countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
11230 }
11231 countingStream->write((VkPhysicalDeviceGroupProperties**)&pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*));
11232 if (pPhysicalDeviceGroupProperties)
11233 {
11234 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
11235 {
11236 marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
11237 }
11238 }
11239 }
11240 uint32_t packetSize_vkEnumeratePhysicalDeviceGroupsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11241 countingStream->rewind();
11242 uint32_t opcode_vkEnumeratePhysicalDeviceGroupsKHR = OP_vkEnumeratePhysicalDeviceGroupsKHR;
11243 stream->write(&opcode_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t));
11244 stream->write(&packetSize_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011245 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011246 stream->write((uint32_t**)&pPhysicalDeviceGroupCount, sizeof(uint32_t*));
11247 if (pPhysicalDeviceGroupCount)
11248 {
11249 stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
11250 }
11251 stream->write((VkPhysicalDeviceGroupProperties**)&pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*));
11252 if (pPhysicalDeviceGroupProperties)
11253 {
11254 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
11255 {
11256 marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
11257 }
11258 }
11259 uint32_t* check_pPhysicalDeviceGroupCount;
11260 stream->read((uint32_t**)&check_pPhysicalDeviceGroupCount, sizeof(uint32_t*));
11261 if (pPhysicalDeviceGroupCount)
11262 {
11263 if (!(check_pPhysicalDeviceGroupCount))
11264 {
11265 fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n");
11266 }
11267 stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t));
11268 }
11269 VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties;
11270 stream->read((VkPhysicalDeviceGroupProperties**)&check_pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*));
11271 if (pPhysicalDeviceGroupProperties)
11272 {
11273 if (!(check_pPhysicalDeviceGroupProperties))
11274 {
11275 fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n");
11276 }
11277 for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i)
11278 {
11279 unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i));
11280 }
11281 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011282 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011283 VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0;
11284 stream->read(&vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return, sizeof(VkResult));
11285 return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return;
11286}
11287
11288#endif
11289#ifdef VK_KHR_external_memory_capabilities
11290void VkEncoder::vkGetPhysicalDeviceExternalBufferPropertiesKHR(
11291 VkPhysicalDevice physicalDevice,
11292 const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
11293 VkExternalBufferProperties* pExternalBufferProperties)
11294{
11295 auto stream = mImpl->stream();
11296 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011297 auto resources = mImpl->resources();
11298 auto pool = mImpl->pool();
11299 VkPhysicalDevice local_physicalDevice;
11300 local_physicalDevice = physicalDevice;
11301 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
11302 VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo;
11303 local_pExternalBufferInfo = nullptr;
11304 if (pExternalBufferInfo)
11305 {
11306 local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo));
11307 deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
11308 }
11309 if (local_pExternalBufferInfo)
11310 {
11311 handlemap_VkPhysicalDeviceExternalBufferInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
11312 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011313 countingStream->rewind();
11314 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011315 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
11316 marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011317 marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties));
11318 }
11319 uint32_t packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11320 countingStream->rewind();
11321 uint32_t opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR = OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR;
11322 stream->write(&opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t));
11323 stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011324 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
11325 marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011326 marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
11327 unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011328 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011329}
11330
11331#endif
11332#ifdef VK_KHR_external_memory
11333#endif
11334#ifdef VK_KHR_external_memory_win32
11335VkResult VkEncoder::vkGetMemoryWin32HandleKHR(
11336 VkDevice device,
11337 const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
11338 HANDLE* pHandle)
11339{
11340 auto stream = mImpl->stream();
11341 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011342 auto resources = mImpl->resources();
11343 auto pool = mImpl->pool();
11344 VkDevice local_device;
11345 local_device = device;
11346 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11347 VkMemoryGetWin32HandleInfoKHR* local_pGetWin32HandleInfo;
11348 local_pGetWin32HandleInfo = nullptr;
11349 if (pGetWin32HandleInfo)
11350 {
11351 local_pGetWin32HandleInfo = (VkMemoryGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkMemoryGetWin32HandleInfoKHR));
11352 deepcopy_VkMemoryGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
11353 }
11354 if (local_pGetWin32HandleInfo)
11355 {
11356 handlemap_VkMemoryGetWin32HandleInfoKHR(resources->unwrapMapping(), (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
11357 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011358 countingStream->rewind();
11359 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011360 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11361 marshal_VkMemoryGetWin32HandleInfoKHR(countingStream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011362 countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
11363 }
11364 uint32_t packetSize_vkGetMemoryWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11365 countingStream->rewind();
11366 uint32_t opcode_vkGetMemoryWin32HandleKHR = OP_vkGetMemoryWin32HandleKHR;
11367 stream->write(&opcode_vkGetMemoryWin32HandleKHR, sizeof(uint32_t));
11368 stream->write(&packetSize_vkGetMemoryWin32HandleKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011369 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11370 marshal_VkMemoryGetWin32HandleInfoKHR(stream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011371 stream->write((HANDLE*)pHandle, sizeof(HANDLE));
11372 stream->read((HANDLE*)pHandle, sizeof(HANDLE));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011373 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011374 VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0;
11375 stream->read(&vkGetMemoryWin32HandleKHR_VkResult_return, sizeof(VkResult));
11376 return vkGetMemoryWin32HandleKHR_VkResult_return;
11377}
11378
11379VkResult VkEncoder::vkGetMemoryWin32HandlePropertiesKHR(
11380 VkDevice device,
11381 VkExternalMemoryHandleTypeFlagBits handleType,
11382 HANDLE handle,
11383 VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties)
11384{
11385 auto stream = mImpl->stream();
11386 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011387 auto resources = mImpl->resources();
11388 auto pool = mImpl->pool();
11389 VkDevice local_device;
11390 local_device = device;
11391 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11392 VkExternalMemoryHandleTypeFlagBits local_handleType;
11393 local_handleType = handleType;
11394 HANDLE local_handle;
11395 local_handle = handle;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011396 countingStream->rewind();
11397 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011398 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11399 countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
11400 countingStream->write((HANDLE*)&local_handle, sizeof(HANDLE));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011401 marshal_VkMemoryWin32HandlePropertiesKHR(countingStream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties));
11402 }
11403 uint32_t packetSize_vkGetMemoryWin32HandlePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11404 countingStream->rewind();
11405 uint32_t opcode_vkGetMemoryWin32HandlePropertiesKHR = OP_vkGetMemoryWin32HandlePropertiesKHR;
11406 stream->write(&opcode_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t));
11407 stream->write(&packetSize_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011408 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11409 stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
11410 stream->write((HANDLE*)&local_handle, sizeof(HANDLE));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011411 marshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties));
11412 unmarshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011413 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011414 VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0;
11415 stream->read(&vkGetMemoryWin32HandlePropertiesKHR_VkResult_return, sizeof(VkResult));
11416 return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return;
11417}
11418
11419#endif
11420#ifdef VK_KHR_external_memory_fd
11421VkResult VkEncoder::vkGetMemoryFdKHR(
11422 VkDevice device,
11423 const VkMemoryGetFdInfoKHR* pGetFdInfo,
11424 int* pFd)
11425{
11426 auto stream = mImpl->stream();
11427 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011428 auto resources = mImpl->resources();
11429 auto pool = mImpl->pool();
11430 VkDevice local_device;
11431 local_device = device;
11432 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11433 VkMemoryGetFdInfoKHR* local_pGetFdInfo;
11434 local_pGetFdInfo = nullptr;
11435 if (pGetFdInfo)
11436 {
11437 local_pGetFdInfo = (VkMemoryGetFdInfoKHR*)pool->alloc(sizeof(const VkMemoryGetFdInfoKHR));
11438 deepcopy_VkMemoryGetFdInfoKHR(pool, pGetFdInfo, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
11439 }
11440 if (local_pGetFdInfo)
11441 {
11442 handlemap_VkMemoryGetFdInfoKHR(resources->unwrapMapping(), (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
11443 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011444 countingStream->rewind();
11445 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011446 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11447 marshal_VkMemoryGetFdInfoKHR(countingStream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011448 countingStream->write((int*)pFd, sizeof(int));
11449 }
11450 uint32_t packetSize_vkGetMemoryFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11451 countingStream->rewind();
11452 uint32_t opcode_vkGetMemoryFdKHR = OP_vkGetMemoryFdKHR;
11453 stream->write(&opcode_vkGetMemoryFdKHR, sizeof(uint32_t));
11454 stream->write(&packetSize_vkGetMemoryFdKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011455 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11456 marshal_VkMemoryGetFdInfoKHR(stream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011457 stream->write((int*)pFd, sizeof(int));
11458 stream->read((int*)pFd, sizeof(int));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011459 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011460 VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0;
11461 stream->read(&vkGetMemoryFdKHR_VkResult_return, sizeof(VkResult));
11462 return vkGetMemoryFdKHR_VkResult_return;
11463}
11464
11465VkResult VkEncoder::vkGetMemoryFdPropertiesKHR(
11466 VkDevice device,
11467 VkExternalMemoryHandleTypeFlagBits handleType,
11468 int fd,
11469 VkMemoryFdPropertiesKHR* pMemoryFdProperties)
11470{
11471 auto stream = mImpl->stream();
11472 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011473 auto resources = mImpl->resources();
11474 auto pool = mImpl->pool();
11475 VkDevice local_device;
11476 local_device = device;
11477 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11478 VkExternalMemoryHandleTypeFlagBits local_handleType;
11479 local_handleType = handleType;
11480 int local_fd;
11481 local_fd = fd;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011482 countingStream->rewind();
11483 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011484 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11485 countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
11486 countingStream->write((int*)&local_fd, sizeof(int));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011487 marshal_VkMemoryFdPropertiesKHR(countingStream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties));
11488 }
11489 uint32_t packetSize_vkGetMemoryFdPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11490 countingStream->rewind();
11491 uint32_t opcode_vkGetMemoryFdPropertiesKHR = OP_vkGetMemoryFdPropertiesKHR;
11492 stream->write(&opcode_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t));
11493 stream->write(&packetSize_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011494 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11495 stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
11496 stream->write((int*)&local_fd, sizeof(int));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011497 marshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties));
11498 unmarshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011499 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011500 VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0;
11501 stream->read(&vkGetMemoryFdPropertiesKHR_VkResult_return, sizeof(VkResult));
11502 return vkGetMemoryFdPropertiesKHR_VkResult_return;
11503}
11504
11505#endif
11506#ifdef VK_KHR_win32_keyed_mutex
11507#endif
11508#ifdef VK_KHR_external_semaphore_capabilities
11509void VkEncoder::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
11510 VkPhysicalDevice physicalDevice,
11511 const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
11512 VkExternalSemaphoreProperties* pExternalSemaphoreProperties)
11513{
11514 auto stream = mImpl->stream();
11515 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011516 auto resources = mImpl->resources();
11517 auto pool = mImpl->pool();
11518 VkPhysicalDevice local_physicalDevice;
11519 local_physicalDevice = physicalDevice;
11520 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
11521 VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo;
11522 local_pExternalSemaphoreInfo = nullptr;
11523 if (pExternalSemaphoreInfo)
11524 {
11525 local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo));
11526 deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
11527 }
11528 if (local_pExternalSemaphoreInfo)
11529 {
11530 handlemap_VkPhysicalDeviceExternalSemaphoreInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
11531 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011532 countingStream->rewind();
11533 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011534 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
11535 marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011536 marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
11537 }
11538 uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11539 countingStream->rewind();
11540 uint32_t opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR;
11541 stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t));
11542 stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011543 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
11544 marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011545 marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
11546 unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011547 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011548}
11549
11550#endif
11551#ifdef VK_KHR_external_semaphore
11552#endif
11553#ifdef VK_KHR_external_semaphore_win32
11554VkResult VkEncoder::vkImportSemaphoreWin32HandleKHR(
11555 VkDevice device,
11556 const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo)
11557{
11558 auto stream = mImpl->stream();
11559 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011560 auto resources = mImpl->resources();
11561 auto pool = mImpl->pool();
11562 VkDevice local_device;
11563 local_device = device;
11564 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11565 VkImportSemaphoreWin32HandleInfoKHR* local_pImportSemaphoreWin32HandleInfo;
11566 local_pImportSemaphoreWin32HandleInfo = nullptr;
11567 if (pImportSemaphoreWin32HandleInfo)
11568 {
11569 local_pImportSemaphoreWin32HandleInfo = (VkImportSemaphoreWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreWin32HandleInfoKHR));
11570 deepcopy_VkImportSemaphoreWin32HandleInfoKHR(pool, pImportSemaphoreWin32HandleInfo, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
11571 }
11572 if (local_pImportSemaphoreWin32HandleInfo)
11573 {
11574 handlemap_VkImportSemaphoreWin32HandleInfoKHR(resources->unwrapMapping(), (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
11575 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011576 countingStream->rewind();
11577 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011578 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11579 marshal_VkImportSemaphoreWin32HandleInfoKHR(countingStream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011580 }
11581 uint32_t packetSize_vkImportSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11582 countingStream->rewind();
11583 uint32_t opcode_vkImportSemaphoreWin32HandleKHR = OP_vkImportSemaphoreWin32HandleKHR;
11584 stream->write(&opcode_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t));
11585 stream->write(&packetSize_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011586 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11587 marshal_VkImportSemaphoreWin32HandleInfoKHR(stream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo));
11588 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011589 VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
11590 stream->read(&vkImportSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult));
11591 return vkImportSemaphoreWin32HandleKHR_VkResult_return;
11592}
11593
11594VkResult VkEncoder::vkGetSemaphoreWin32HandleKHR(
11595 VkDevice device,
11596 const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
11597 HANDLE* pHandle)
11598{
11599 auto stream = mImpl->stream();
11600 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011601 auto resources = mImpl->resources();
11602 auto pool = mImpl->pool();
11603 VkDevice local_device;
11604 local_device = device;
11605 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11606 VkSemaphoreGetWin32HandleInfoKHR* local_pGetWin32HandleInfo;
11607 local_pGetWin32HandleInfo = nullptr;
11608 if (pGetWin32HandleInfo)
11609 {
11610 local_pGetWin32HandleInfo = (VkSemaphoreGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetWin32HandleInfoKHR));
11611 deepcopy_VkSemaphoreGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
11612 }
11613 if (local_pGetWin32HandleInfo)
11614 {
11615 handlemap_VkSemaphoreGetWin32HandleInfoKHR(resources->unwrapMapping(), (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
11616 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011617 countingStream->rewind();
11618 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011619 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11620 marshal_VkSemaphoreGetWin32HandleInfoKHR(countingStream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011621 countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
11622 }
11623 uint32_t packetSize_vkGetSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11624 countingStream->rewind();
11625 uint32_t opcode_vkGetSemaphoreWin32HandleKHR = OP_vkGetSemaphoreWin32HandleKHR;
11626 stream->write(&opcode_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t));
11627 stream->write(&packetSize_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011628 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11629 marshal_VkSemaphoreGetWin32HandleInfoKHR(stream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011630 stream->write((HANDLE*)pHandle, sizeof(HANDLE));
11631 stream->read((HANDLE*)pHandle, sizeof(HANDLE));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011632 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011633 VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0;
11634 stream->read(&vkGetSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult));
11635 return vkGetSemaphoreWin32HandleKHR_VkResult_return;
11636}
11637
11638#endif
11639#ifdef VK_KHR_external_semaphore_fd
11640VkResult VkEncoder::vkImportSemaphoreFdKHR(
11641 VkDevice device,
11642 const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo)
11643{
11644 auto stream = mImpl->stream();
11645 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011646 auto resources = mImpl->resources();
11647 auto pool = mImpl->pool();
11648 VkDevice local_device;
11649 local_device = device;
11650 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11651 VkImportSemaphoreFdInfoKHR* local_pImportSemaphoreFdInfo;
11652 local_pImportSemaphoreFdInfo = nullptr;
11653 if (pImportSemaphoreFdInfo)
11654 {
11655 local_pImportSemaphoreFdInfo = (VkImportSemaphoreFdInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreFdInfoKHR));
11656 deepcopy_VkImportSemaphoreFdInfoKHR(pool, pImportSemaphoreFdInfo, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
11657 }
11658 if (local_pImportSemaphoreFdInfo)
11659 {
11660 handlemap_VkImportSemaphoreFdInfoKHR(resources->unwrapMapping(), (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
11661 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011662 countingStream->rewind();
11663 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011664 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11665 marshal_VkImportSemaphoreFdInfoKHR(countingStream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011666 }
11667 uint32_t packetSize_vkImportSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11668 countingStream->rewind();
11669 uint32_t opcode_vkImportSemaphoreFdKHR = OP_vkImportSemaphoreFdKHR;
11670 stream->write(&opcode_vkImportSemaphoreFdKHR, sizeof(uint32_t));
11671 stream->write(&packetSize_vkImportSemaphoreFdKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011672 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11673 marshal_VkImportSemaphoreFdInfoKHR(stream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo));
11674 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011675 VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0;
11676 stream->read(&vkImportSemaphoreFdKHR_VkResult_return, sizeof(VkResult));
11677 return vkImportSemaphoreFdKHR_VkResult_return;
11678}
11679
11680VkResult VkEncoder::vkGetSemaphoreFdKHR(
11681 VkDevice device,
11682 const VkSemaphoreGetFdInfoKHR* pGetFdInfo,
11683 int* pFd)
11684{
11685 auto stream = mImpl->stream();
11686 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011687 auto resources = mImpl->resources();
11688 auto pool = mImpl->pool();
11689 VkDevice local_device;
11690 local_device = device;
11691 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11692 VkSemaphoreGetFdInfoKHR* local_pGetFdInfo;
11693 local_pGetFdInfo = nullptr;
11694 if (pGetFdInfo)
11695 {
11696 local_pGetFdInfo = (VkSemaphoreGetFdInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetFdInfoKHR));
11697 deepcopy_VkSemaphoreGetFdInfoKHR(pool, pGetFdInfo, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
11698 }
11699 if (local_pGetFdInfo)
11700 {
11701 handlemap_VkSemaphoreGetFdInfoKHR(resources->unwrapMapping(), (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
11702 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011703 countingStream->rewind();
11704 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011705 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11706 marshal_VkSemaphoreGetFdInfoKHR(countingStream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011707 countingStream->write((int*)pFd, sizeof(int));
11708 }
11709 uint32_t packetSize_vkGetSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11710 countingStream->rewind();
11711 uint32_t opcode_vkGetSemaphoreFdKHR = OP_vkGetSemaphoreFdKHR;
11712 stream->write(&opcode_vkGetSemaphoreFdKHR, sizeof(uint32_t));
11713 stream->write(&packetSize_vkGetSemaphoreFdKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011714 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11715 marshal_VkSemaphoreGetFdInfoKHR(stream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011716 stream->write((int*)pFd, sizeof(int));
11717 stream->read((int*)pFd, sizeof(int));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011718 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011719 VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0;
11720 stream->read(&vkGetSemaphoreFdKHR_VkResult_return, sizeof(VkResult));
11721 return vkGetSemaphoreFdKHR_VkResult_return;
11722}
11723
11724#endif
11725#ifdef VK_KHR_push_descriptor
11726void VkEncoder::vkCmdPushDescriptorSetKHR(
11727 VkCommandBuffer commandBuffer,
11728 VkPipelineBindPoint pipelineBindPoint,
11729 VkPipelineLayout layout,
11730 uint32_t set,
11731 uint32_t descriptorWriteCount,
11732 const VkWriteDescriptorSet* pDescriptorWrites)
11733{
11734 auto stream = mImpl->stream();
11735 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011736 auto resources = mImpl->resources();
11737 auto pool = mImpl->pool();
11738 VkCommandBuffer local_commandBuffer;
11739 local_commandBuffer = commandBuffer;
11740 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
11741 VkPipelineBindPoint local_pipelineBindPoint;
11742 local_pipelineBindPoint = pipelineBindPoint;
11743 VkPipelineLayout local_layout;
11744 local_layout = layout;
11745 resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout);
11746 uint32_t local_set;
11747 local_set = set;
11748 uint32_t local_descriptorWriteCount;
11749 local_descriptorWriteCount = descriptorWriteCount;
11750 VkWriteDescriptorSet* local_pDescriptorWrites;
11751 local_pDescriptorWrites = nullptr;
11752 if (pDescriptorWrites)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011753 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011754 local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011755 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
11756 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011757 deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
11758 }
11759 }
11760 if (local_pDescriptorWrites)
11761 {
11762 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
11763 {
11764 handlemap_VkWriteDescriptorSet(resources->unwrapMapping(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
11765 }
11766 }
11767 countingStream->rewind();
11768 {
11769 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
11770 countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
11771 countingStream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout));
11772 countingStream->write((uint32_t*)&local_set, sizeof(uint32_t));
11773 countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
11774 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
11775 {
11776 marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011777 }
11778 }
11779 uint32_t packetSize_vkCmdPushDescriptorSetKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11780 countingStream->rewind();
11781 uint32_t opcode_vkCmdPushDescriptorSetKHR = OP_vkCmdPushDescriptorSetKHR;
11782 stream->write(&opcode_vkCmdPushDescriptorSetKHR, sizeof(uint32_t));
11783 stream->write(&packetSize_vkCmdPushDescriptorSetKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011784 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
11785 stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint));
11786 stream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout));
11787 stream->write((uint32_t*)&local_set, sizeof(uint32_t));
11788 stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011789 for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i)
11790 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011791 marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011792 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011793 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011794}
11795
11796void VkEncoder::vkCmdPushDescriptorSetWithTemplateKHR(
11797 VkCommandBuffer commandBuffer,
11798 VkDescriptorUpdateTemplate descriptorUpdateTemplate,
11799 VkPipelineLayout layout,
11800 uint32_t set,
11801 const void* pData)
11802{
11803 auto stream = mImpl->stream();
11804 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011805 auto resources = mImpl->resources();
11806 auto pool = mImpl->pool();
11807 VkCommandBuffer local_commandBuffer;
11808 local_commandBuffer = commandBuffer;
11809 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
11810 VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
11811 local_descriptorUpdateTemplate = descriptorUpdateTemplate;
11812 resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate);
11813 VkPipelineLayout local_layout;
11814 local_layout = layout;
11815 resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout);
11816 uint32_t local_set;
11817 local_set = set;
11818 void* local_pData;
11819 local_pData = nullptr;
11820 if (pData)
11821 {
11822 local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t));
11823 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011824 countingStream->rewind();
11825 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011826 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
11827 countingStream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
11828 countingStream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout));
11829 countingStream->write((uint32_t*)&local_set, sizeof(uint32_t));
11830 countingStream->write((void**)&local_pData, sizeof(void*));
11831 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011832 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011833 countingStream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011834 }
11835 }
11836 uint32_t packetSize_vkCmdPushDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11837 countingStream->rewind();
11838 uint32_t opcode_vkCmdPushDescriptorSetWithTemplateKHR = OP_vkCmdPushDescriptorSetWithTemplateKHR;
11839 stream->write(&opcode_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t));
11840 stream->write(&packetSize_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011841 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
11842 stream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
11843 stream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout));
11844 stream->write((uint32_t*)&local_set, sizeof(uint32_t));
11845 stream->write((void**)&local_pData, sizeof(void*));
11846 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011847 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011848 stream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011849 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011850 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011851}
11852
11853#endif
11854#ifdef VK_KHR_16bit_storage
11855#endif
11856#ifdef VK_KHR_incremental_present
11857#endif
11858#ifdef VK_KHR_descriptor_update_template
11859VkResult VkEncoder::vkCreateDescriptorUpdateTemplateKHR(
11860 VkDevice device,
11861 const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
11862 const VkAllocationCallbacks* pAllocator,
11863 VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate)
11864{
11865 auto stream = mImpl->stream();
11866 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011867 auto resources = mImpl->resources();
11868 auto pool = mImpl->pool();
11869 VkDevice local_device;
11870 local_device = device;
11871 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11872 VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo;
11873 local_pCreateInfo = nullptr;
11874 if (pCreateInfo)
11875 {
11876 local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo));
11877 deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
11878 }
11879 if (local_pCreateInfo)
11880 {
11881 handlemap_VkDescriptorUpdateTemplateCreateInfo(resources->unwrapMapping(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
11882 }
11883 VkAllocationCallbacks* local_pAllocator;
11884 local_pAllocator = nullptr;
11885 if (pAllocator)
11886 {
11887 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
11888 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
11889 }
11890 if (local_pAllocator)
11891 {
11892 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
11893 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011894 countingStream->rewind();
11895 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011896 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11897 marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
11898 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
11899 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011900 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011901 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011902 }
11903 countingStream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
11904 }
11905 uint32_t packetSize_vkCreateDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11906 countingStream->rewind();
11907 uint32_t opcode_vkCreateDescriptorUpdateTemplateKHR = OP_vkCreateDescriptorUpdateTemplateKHR;
11908 stream->write(&opcode_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t));
11909 stream->write(&packetSize_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011910 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11911 marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo));
11912 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
11913 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011914 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011915 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011916 }
11917 stream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
11918 stream->read((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011919 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011920 VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0;
11921 stream->read(&vkCreateDescriptorUpdateTemplateKHR_VkResult_return, sizeof(VkResult));
11922 return vkCreateDescriptorUpdateTemplateKHR_VkResult_return;
11923}
11924
11925void VkEncoder::vkDestroyDescriptorUpdateTemplateKHR(
11926 VkDevice device,
11927 VkDescriptorUpdateTemplate descriptorUpdateTemplate,
11928 const VkAllocationCallbacks* pAllocator)
11929{
11930 auto stream = mImpl->stream();
11931 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011932 auto resources = mImpl->resources();
11933 auto pool = mImpl->pool();
11934 VkDevice local_device;
11935 local_device = device;
11936 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11937 VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
11938 local_descriptorUpdateTemplate = descriptorUpdateTemplate;
11939 resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate);
11940 VkAllocationCallbacks* local_pAllocator;
11941 local_pAllocator = nullptr;
11942 if (pAllocator)
11943 {
11944 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
11945 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
11946 }
11947 if (local_pAllocator)
11948 {
11949 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
11950 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011951 countingStream->rewind();
11952 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011953 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
11954 countingStream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
11955 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
11956 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011957 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011958 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011959 }
11960 }
11961 uint32_t packetSize_vkDestroyDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
11962 countingStream->rewind();
11963 uint32_t opcode_vkDestroyDescriptorUpdateTemplateKHR = OP_vkDestroyDescriptorUpdateTemplateKHR;
11964 stream->write(&opcode_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t));
11965 stream->write(&packetSize_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011966 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
11967 stream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
11968 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
11969 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011970 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011971 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011972 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011973 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070011974}
11975
11976void VkEncoder::vkUpdateDescriptorSetWithTemplateKHR(
11977 VkDevice device,
11978 VkDescriptorSet descriptorSet,
11979 VkDescriptorUpdateTemplate descriptorUpdateTemplate,
11980 const void* pData)
11981{
11982 auto stream = mImpl->stream();
11983 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080011984 auto resources = mImpl->resources();
11985 auto pool = mImpl->pool();
11986 VkDevice local_device;
11987 local_device = device;
11988 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
11989 VkDescriptorSet local_descriptorSet;
11990 local_descriptorSet = descriptorSet;
11991 resources->unwrapMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)&local_descriptorSet);
11992 VkDescriptorUpdateTemplate local_descriptorUpdateTemplate;
11993 local_descriptorUpdateTemplate = descriptorUpdateTemplate;
11994 resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate);
11995 void* local_pData;
11996 local_pData = nullptr;
11997 if (pData)
11998 {
11999 local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t));
12000 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012001 countingStream->rewind();
12002 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012003 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
12004 countingStream->write((VkDescriptorSet*)&local_descriptorSet, sizeof(VkDescriptorSet));
12005 countingStream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
12006 countingStream->write((void**)&local_pData, sizeof(void*));
12007 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012008 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012009 countingStream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012010 }
12011 }
12012 uint32_t packetSize_vkUpdateDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12013 countingStream->rewind();
12014 uint32_t opcode_vkUpdateDescriptorSetWithTemplateKHR = OP_vkUpdateDescriptorSetWithTemplateKHR;
12015 stream->write(&opcode_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t));
12016 stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012017 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
12018 stream->write((VkDescriptorSet*)&local_descriptorSet, sizeof(VkDescriptorSet));
12019 stream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate));
12020 stream->write((void**)&local_pData, sizeof(void*));
12021 if (local_pData)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012022 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012023 stream->write((void*)local_pData, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012024 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012025 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012026}
12027
12028#endif
12029#ifdef VK_KHR_create_renderpass2
12030VkResult VkEncoder::vkCreateRenderPass2KHR(
12031 VkDevice device,
12032 const VkRenderPassCreateInfo2KHR* pCreateInfo,
12033 const VkAllocationCallbacks* pAllocator,
12034 VkRenderPass* pRenderPass)
12035{
12036 auto stream = mImpl->stream();
12037 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012038 auto resources = mImpl->resources();
12039 auto pool = mImpl->pool();
12040 VkDevice local_device;
12041 local_device = device;
12042 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12043 VkRenderPassCreateInfo2KHR* local_pCreateInfo;
12044 local_pCreateInfo = nullptr;
12045 if (pCreateInfo)
12046 {
12047 local_pCreateInfo = (VkRenderPassCreateInfo2KHR*)pool->alloc(sizeof(const VkRenderPassCreateInfo2KHR));
12048 deepcopy_VkRenderPassCreateInfo2KHR(pool, pCreateInfo, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo));
12049 }
12050 if (local_pCreateInfo)
12051 {
12052 handlemap_VkRenderPassCreateInfo2KHR(resources->unwrapMapping(), (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo));
12053 }
12054 VkAllocationCallbacks* local_pAllocator;
12055 local_pAllocator = nullptr;
12056 if (pAllocator)
12057 {
12058 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
12059 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
12060 }
12061 if (local_pAllocator)
12062 {
12063 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
12064 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012065 countingStream->rewind();
12066 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012067 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
12068 marshal_VkRenderPassCreateInfo2KHR(countingStream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo));
12069 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
12070 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012071 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012072 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012073 }
12074 countingStream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
12075 }
12076 uint32_t packetSize_vkCreateRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12077 countingStream->rewind();
12078 uint32_t opcode_vkCreateRenderPass2KHR = OP_vkCreateRenderPass2KHR;
12079 stream->write(&opcode_vkCreateRenderPass2KHR, sizeof(uint32_t));
12080 stream->write(&packetSize_vkCreateRenderPass2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012081 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
12082 marshal_VkRenderPassCreateInfo2KHR(stream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo));
12083 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
12084 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012085 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012086 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012087 }
12088 stream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
12089 stream->read((VkRenderPass*)pRenderPass, sizeof(VkRenderPass));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012090 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012091 VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0;
12092 stream->read(&vkCreateRenderPass2KHR_VkResult_return, sizeof(VkResult));
12093 return vkCreateRenderPass2KHR_VkResult_return;
12094}
12095
12096void VkEncoder::vkCmdBeginRenderPass2KHR(
12097 VkCommandBuffer commandBuffer,
12098 const VkRenderPassBeginInfo* pRenderPassBegin,
12099 const VkSubpassBeginInfoKHR* pSubpassBeginInfo)
12100{
12101 auto stream = mImpl->stream();
12102 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012103 auto resources = mImpl->resources();
12104 auto pool = mImpl->pool();
12105 VkCommandBuffer local_commandBuffer;
12106 local_commandBuffer = commandBuffer;
12107 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
12108 VkRenderPassBeginInfo* local_pRenderPassBegin;
12109 local_pRenderPassBegin = nullptr;
12110 if (pRenderPassBegin)
12111 {
12112 local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo));
12113 deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
12114 }
12115 if (local_pRenderPassBegin)
12116 {
12117 handlemap_VkRenderPassBeginInfo(resources->unwrapMapping(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
12118 }
12119 VkSubpassBeginInfoKHR* local_pSubpassBeginInfo;
12120 local_pSubpassBeginInfo = nullptr;
12121 if (pSubpassBeginInfo)
12122 {
12123 local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR));
12124 deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
12125 }
12126 if (local_pSubpassBeginInfo)
12127 {
12128 handlemap_VkSubpassBeginInfoKHR(resources->unwrapMapping(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
12129 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012130 countingStream->rewind();
12131 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012132 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
12133 marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
12134 marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012135 }
12136 uint32_t packetSize_vkCmdBeginRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12137 countingStream->rewind();
12138 uint32_t opcode_vkCmdBeginRenderPass2KHR = OP_vkCmdBeginRenderPass2KHR;
12139 stream->write(&opcode_vkCmdBeginRenderPass2KHR, sizeof(uint32_t));
12140 stream->write(&packetSize_vkCmdBeginRenderPass2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012141 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
12142 marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin));
12143 marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
12144 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012145}
12146
12147void VkEncoder::vkCmdNextSubpass2KHR(
12148 VkCommandBuffer commandBuffer,
12149 const VkSubpassBeginInfoKHR* pSubpassBeginInfo,
12150 const VkSubpassEndInfoKHR* pSubpassEndInfo)
12151{
12152 auto stream = mImpl->stream();
12153 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012154 auto resources = mImpl->resources();
12155 auto pool = mImpl->pool();
12156 VkCommandBuffer local_commandBuffer;
12157 local_commandBuffer = commandBuffer;
12158 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
12159 VkSubpassBeginInfoKHR* local_pSubpassBeginInfo;
12160 local_pSubpassBeginInfo = nullptr;
12161 if (pSubpassBeginInfo)
12162 {
12163 local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR));
12164 deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
12165 }
12166 if (local_pSubpassBeginInfo)
12167 {
12168 handlemap_VkSubpassBeginInfoKHR(resources->unwrapMapping(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
12169 }
12170 VkSubpassEndInfoKHR* local_pSubpassEndInfo;
12171 local_pSubpassEndInfo = nullptr;
12172 if (pSubpassEndInfo)
12173 {
12174 local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR));
12175 deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
12176 }
12177 if (local_pSubpassEndInfo)
12178 {
12179 handlemap_VkSubpassEndInfoKHR(resources->unwrapMapping(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
12180 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012181 countingStream->rewind();
12182 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012183 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
12184 marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
12185 marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012186 }
12187 uint32_t packetSize_vkCmdNextSubpass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12188 countingStream->rewind();
12189 uint32_t opcode_vkCmdNextSubpass2KHR = OP_vkCmdNextSubpass2KHR;
12190 stream->write(&opcode_vkCmdNextSubpass2KHR, sizeof(uint32_t));
12191 stream->write(&packetSize_vkCmdNextSubpass2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012192 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
12193 marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo));
12194 marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
12195 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012196}
12197
12198void VkEncoder::vkCmdEndRenderPass2KHR(
12199 VkCommandBuffer commandBuffer,
12200 const VkSubpassEndInfoKHR* pSubpassEndInfo)
12201{
12202 auto stream = mImpl->stream();
12203 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012204 auto resources = mImpl->resources();
12205 auto pool = mImpl->pool();
12206 VkCommandBuffer local_commandBuffer;
12207 local_commandBuffer = commandBuffer;
12208 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
12209 VkSubpassEndInfoKHR* local_pSubpassEndInfo;
12210 local_pSubpassEndInfo = nullptr;
12211 if (pSubpassEndInfo)
12212 {
12213 local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR));
12214 deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
12215 }
12216 if (local_pSubpassEndInfo)
12217 {
12218 handlemap_VkSubpassEndInfoKHR(resources->unwrapMapping(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
12219 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012220 countingStream->rewind();
12221 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012222 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
12223 marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012224 }
12225 uint32_t packetSize_vkCmdEndRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12226 countingStream->rewind();
12227 uint32_t opcode_vkCmdEndRenderPass2KHR = OP_vkCmdEndRenderPass2KHR;
12228 stream->write(&opcode_vkCmdEndRenderPass2KHR, sizeof(uint32_t));
12229 stream->write(&packetSize_vkCmdEndRenderPass2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012230 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
12231 marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo));
12232 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012233}
12234
12235#endif
12236#ifdef VK_KHR_shared_presentable_image
12237VkResult VkEncoder::vkGetSwapchainStatusKHR(
12238 VkDevice device,
12239 VkSwapchainKHR swapchain)
12240{
12241 auto stream = mImpl->stream();
12242 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012243 auto resources = mImpl->resources();
12244 auto pool = mImpl->pool();
12245 VkDevice local_device;
12246 local_device = device;
12247 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12248 VkSwapchainKHR local_swapchain;
12249 local_swapchain = swapchain;
12250 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012251 countingStream->rewind();
12252 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012253 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
12254 countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012255 }
12256 uint32_t packetSize_vkGetSwapchainStatusKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12257 countingStream->rewind();
12258 uint32_t opcode_vkGetSwapchainStatusKHR = OP_vkGetSwapchainStatusKHR;
12259 stream->write(&opcode_vkGetSwapchainStatusKHR, sizeof(uint32_t));
12260 stream->write(&packetSize_vkGetSwapchainStatusKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012261 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
12262 stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
12263 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012264 VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0;
12265 stream->read(&vkGetSwapchainStatusKHR_VkResult_return, sizeof(VkResult));
12266 return vkGetSwapchainStatusKHR_VkResult_return;
12267}
12268
12269#endif
12270#ifdef VK_KHR_external_fence_capabilities
12271void VkEncoder::vkGetPhysicalDeviceExternalFencePropertiesKHR(
12272 VkPhysicalDevice physicalDevice,
12273 const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
12274 VkExternalFenceProperties* pExternalFenceProperties)
12275{
12276 auto stream = mImpl->stream();
12277 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012278 auto resources = mImpl->resources();
12279 auto pool = mImpl->pool();
12280 VkPhysicalDevice local_physicalDevice;
12281 local_physicalDevice = physicalDevice;
12282 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
12283 VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo;
12284 local_pExternalFenceInfo = nullptr;
12285 if (pExternalFenceInfo)
12286 {
12287 local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo));
12288 deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
12289 }
12290 if (local_pExternalFenceInfo)
12291 {
12292 handlemap_VkPhysicalDeviceExternalFenceInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
12293 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012294 countingStream->rewind();
12295 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012296 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
12297 marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012298 marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties));
12299 }
12300 uint32_t packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12301 countingStream->rewind();
12302 uint32_t opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR = OP_vkGetPhysicalDeviceExternalFencePropertiesKHR;
12303 stream->write(&opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t));
12304 stream->write(&packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012305 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
12306 marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012307 marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
12308 unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012309 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012310}
12311
12312#endif
12313#ifdef VK_KHR_external_fence
12314#endif
12315#ifdef VK_KHR_external_fence_win32
12316VkResult VkEncoder::vkImportFenceWin32HandleKHR(
12317 VkDevice device,
12318 const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo)
12319{
12320 auto stream = mImpl->stream();
12321 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012322 auto resources = mImpl->resources();
12323 auto pool = mImpl->pool();
12324 VkDevice local_device;
12325 local_device = device;
12326 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12327 VkImportFenceWin32HandleInfoKHR* local_pImportFenceWin32HandleInfo;
12328 local_pImportFenceWin32HandleInfo = nullptr;
12329 if (pImportFenceWin32HandleInfo)
12330 {
12331 local_pImportFenceWin32HandleInfo = (VkImportFenceWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportFenceWin32HandleInfoKHR));
12332 deepcopy_VkImportFenceWin32HandleInfoKHR(pool, pImportFenceWin32HandleInfo, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
12333 }
12334 if (local_pImportFenceWin32HandleInfo)
12335 {
12336 handlemap_VkImportFenceWin32HandleInfoKHR(resources->unwrapMapping(), (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
12337 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012338 countingStream->rewind();
12339 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012340 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
12341 marshal_VkImportFenceWin32HandleInfoKHR(countingStream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012342 }
12343 uint32_t packetSize_vkImportFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12344 countingStream->rewind();
12345 uint32_t opcode_vkImportFenceWin32HandleKHR = OP_vkImportFenceWin32HandleKHR;
12346 stream->write(&opcode_vkImportFenceWin32HandleKHR, sizeof(uint32_t));
12347 stream->write(&packetSize_vkImportFenceWin32HandleKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012348 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
12349 marshal_VkImportFenceWin32HandleInfoKHR(stream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo));
12350 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012351 VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0;
12352 stream->read(&vkImportFenceWin32HandleKHR_VkResult_return, sizeof(VkResult));
12353 return vkImportFenceWin32HandleKHR_VkResult_return;
12354}
12355
12356VkResult VkEncoder::vkGetFenceWin32HandleKHR(
12357 VkDevice device,
12358 const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
12359 HANDLE* pHandle)
12360{
12361 auto stream = mImpl->stream();
12362 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012363 auto resources = mImpl->resources();
12364 auto pool = mImpl->pool();
12365 VkDevice local_device;
12366 local_device = device;
12367 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12368 VkFenceGetWin32HandleInfoKHR* local_pGetWin32HandleInfo;
12369 local_pGetWin32HandleInfo = nullptr;
12370 if (pGetWin32HandleInfo)
12371 {
12372 local_pGetWin32HandleInfo = (VkFenceGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkFenceGetWin32HandleInfoKHR));
12373 deepcopy_VkFenceGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
12374 }
12375 if (local_pGetWin32HandleInfo)
12376 {
12377 handlemap_VkFenceGetWin32HandleInfoKHR(resources->unwrapMapping(), (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
12378 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012379 countingStream->rewind();
12380 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012381 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
12382 marshal_VkFenceGetWin32HandleInfoKHR(countingStream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012383 countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
12384 }
12385 uint32_t packetSize_vkGetFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12386 countingStream->rewind();
12387 uint32_t opcode_vkGetFenceWin32HandleKHR = OP_vkGetFenceWin32HandleKHR;
12388 stream->write(&opcode_vkGetFenceWin32HandleKHR, sizeof(uint32_t));
12389 stream->write(&packetSize_vkGetFenceWin32HandleKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012390 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
12391 marshal_VkFenceGetWin32HandleInfoKHR(stream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012392 stream->write((HANDLE*)pHandle, sizeof(HANDLE));
12393 stream->read((HANDLE*)pHandle, sizeof(HANDLE));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012394 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012395 VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0;
12396 stream->read(&vkGetFenceWin32HandleKHR_VkResult_return, sizeof(VkResult));
12397 return vkGetFenceWin32HandleKHR_VkResult_return;
12398}
12399
12400#endif
12401#ifdef VK_KHR_external_fence_fd
12402VkResult VkEncoder::vkImportFenceFdKHR(
12403 VkDevice device,
12404 const VkImportFenceFdInfoKHR* pImportFenceFdInfo)
12405{
12406 auto stream = mImpl->stream();
12407 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012408 auto resources = mImpl->resources();
12409 auto pool = mImpl->pool();
12410 VkDevice local_device;
12411 local_device = device;
12412 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12413 VkImportFenceFdInfoKHR* local_pImportFenceFdInfo;
12414 local_pImportFenceFdInfo = nullptr;
12415 if (pImportFenceFdInfo)
12416 {
12417 local_pImportFenceFdInfo = (VkImportFenceFdInfoKHR*)pool->alloc(sizeof(const VkImportFenceFdInfoKHR));
12418 deepcopy_VkImportFenceFdInfoKHR(pool, pImportFenceFdInfo, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
12419 }
12420 if (local_pImportFenceFdInfo)
12421 {
12422 handlemap_VkImportFenceFdInfoKHR(resources->unwrapMapping(), (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
12423 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012424 countingStream->rewind();
12425 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012426 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
12427 marshal_VkImportFenceFdInfoKHR(countingStream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012428 }
12429 uint32_t packetSize_vkImportFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12430 countingStream->rewind();
12431 uint32_t opcode_vkImportFenceFdKHR = OP_vkImportFenceFdKHR;
12432 stream->write(&opcode_vkImportFenceFdKHR, sizeof(uint32_t));
12433 stream->write(&packetSize_vkImportFenceFdKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012434 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
12435 marshal_VkImportFenceFdInfoKHR(stream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo));
12436 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012437 VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0;
12438 stream->read(&vkImportFenceFdKHR_VkResult_return, sizeof(VkResult));
12439 return vkImportFenceFdKHR_VkResult_return;
12440}
12441
12442VkResult VkEncoder::vkGetFenceFdKHR(
12443 VkDevice device,
12444 const VkFenceGetFdInfoKHR* pGetFdInfo,
12445 int* pFd)
12446{
12447 auto stream = mImpl->stream();
12448 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012449 auto resources = mImpl->resources();
12450 auto pool = mImpl->pool();
12451 VkDevice local_device;
12452 local_device = device;
12453 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12454 VkFenceGetFdInfoKHR* local_pGetFdInfo;
12455 local_pGetFdInfo = nullptr;
12456 if (pGetFdInfo)
12457 {
12458 local_pGetFdInfo = (VkFenceGetFdInfoKHR*)pool->alloc(sizeof(const VkFenceGetFdInfoKHR));
12459 deepcopy_VkFenceGetFdInfoKHR(pool, pGetFdInfo, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
12460 }
12461 if (local_pGetFdInfo)
12462 {
12463 handlemap_VkFenceGetFdInfoKHR(resources->unwrapMapping(), (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
12464 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012465 countingStream->rewind();
12466 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012467 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
12468 marshal_VkFenceGetFdInfoKHR(countingStream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012469 countingStream->write((int*)pFd, sizeof(int));
12470 }
12471 uint32_t packetSize_vkGetFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12472 countingStream->rewind();
12473 uint32_t opcode_vkGetFenceFdKHR = OP_vkGetFenceFdKHR;
12474 stream->write(&opcode_vkGetFenceFdKHR, sizeof(uint32_t));
12475 stream->write(&packetSize_vkGetFenceFdKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012476 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
12477 marshal_VkFenceGetFdInfoKHR(stream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012478 stream->write((int*)pFd, sizeof(int));
12479 stream->read((int*)pFd, sizeof(int));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012480 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012481 VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0;
12482 stream->read(&vkGetFenceFdKHR_VkResult_return, sizeof(VkResult));
12483 return vkGetFenceFdKHR_VkResult_return;
12484}
12485
12486#endif
12487#ifdef VK_KHR_maintenance2
12488#endif
12489#ifdef VK_KHR_get_surface_capabilities2
12490VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2KHR(
12491 VkPhysicalDevice physicalDevice,
12492 const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
12493 VkSurfaceCapabilities2KHR* pSurfaceCapabilities)
12494{
12495 auto stream = mImpl->stream();
12496 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012497 auto resources = mImpl->resources();
12498 auto pool = mImpl->pool();
12499 VkPhysicalDevice local_physicalDevice;
12500 local_physicalDevice = physicalDevice;
12501 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
12502 VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo;
12503 local_pSurfaceInfo = nullptr;
12504 if (pSurfaceInfo)
12505 {
12506 local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR));
12507 deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
12508 }
12509 if (local_pSurfaceInfo)
12510 {
12511 handlemap_VkPhysicalDeviceSurfaceInfo2KHR(resources->unwrapMapping(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
12512 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012513 countingStream->rewind();
12514 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012515 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
12516 marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012517 marshal_VkSurfaceCapabilities2KHR(countingStream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
12518 }
12519 uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12520 countingStream->rewind();
12521 uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR = OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR;
12522 stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t));
12523 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012524 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
12525 marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012526 marshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
12527 unmarshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012528 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012529 VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0;
12530 stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return, sizeof(VkResult));
12531 return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return;
12532}
12533
12534VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormats2KHR(
12535 VkPhysicalDevice physicalDevice,
12536 const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
12537 uint32_t* pSurfaceFormatCount,
12538 VkSurfaceFormat2KHR* pSurfaceFormats)
12539{
12540 auto stream = mImpl->stream();
12541 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012542 auto resources = mImpl->resources();
12543 auto pool = mImpl->pool();
12544 VkPhysicalDevice local_physicalDevice;
12545 local_physicalDevice = physicalDevice;
12546 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
12547 VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo;
12548 local_pSurfaceInfo = nullptr;
12549 if (pSurfaceInfo)
12550 {
12551 local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR));
12552 deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
12553 }
12554 if (local_pSurfaceInfo)
12555 {
12556 handlemap_VkPhysicalDeviceSurfaceInfo2KHR(resources->unwrapMapping(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
12557 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012558 countingStream->rewind();
12559 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012560 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
12561 marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012562 countingStream->write((uint32_t**)&pSurfaceFormatCount, sizeof(uint32_t*));
12563 if (pSurfaceFormatCount)
12564 {
12565 countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
12566 }
12567 countingStream->write((VkSurfaceFormat2KHR**)&pSurfaceFormats, sizeof(VkSurfaceFormat2KHR*));
12568 if (pSurfaceFormats)
12569 {
12570 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
12571 {
12572 marshal_VkSurfaceFormat2KHR(countingStream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i));
12573 }
12574 }
12575 }
12576 uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12577 countingStream->rewind();
12578 uint32_t opcode_vkGetPhysicalDeviceSurfaceFormats2KHR = OP_vkGetPhysicalDeviceSurfaceFormats2KHR;
12579 stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t));
12580 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012581 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
12582 marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012583 stream->write((uint32_t**)&pSurfaceFormatCount, sizeof(uint32_t*));
12584 if (pSurfaceFormatCount)
12585 {
12586 stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
12587 }
12588 stream->write((VkSurfaceFormat2KHR**)&pSurfaceFormats, sizeof(VkSurfaceFormat2KHR*));
12589 if (pSurfaceFormats)
12590 {
12591 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
12592 {
12593 marshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i));
12594 }
12595 }
12596 uint32_t* check_pSurfaceFormatCount;
12597 stream->read((uint32_t**)&check_pSurfaceFormatCount, sizeof(uint32_t*));
12598 if (pSurfaceFormatCount)
12599 {
12600 if (!(check_pSurfaceFormatCount))
12601 {
12602 fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n");
12603 }
12604 stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t));
12605 }
12606 VkSurfaceFormat2KHR* check_pSurfaceFormats;
12607 stream->read((VkSurfaceFormat2KHR**)&check_pSurfaceFormats, sizeof(VkSurfaceFormat2KHR*));
12608 if (pSurfaceFormats)
12609 {
12610 if (!(check_pSurfaceFormats))
12611 {
12612 fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n");
12613 }
12614 for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i)
12615 {
12616 unmarshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i));
12617 }
12618 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012619 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012620 VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0;
12621 stream->read(&vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return, sizeof(VkResult));
12622 return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return;
12623}
12624
12625#endif
12626#ifdef VK_KHR_variable_pointers
12627#endif
12628#ifdef VK_KHR_get_display_properties2
12629VkResult VkEncoder::vkGetPhysicalDeviceDisplayProperties2KHR(
12630 VkPhysicalDevice physicalDevice,
12631 uint32_t* pPropertyCount,
12632 VkDisplayProperties2KHR* pProperties)
12633{
12634 auto stream = mImpl->stream();
12635 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012636 auto resources = mImpl->resources();
12637 auto pool = mImpl->pool();
12638 VkPhysicalDevice local_physicalDevice;
12639 local_physicalDevice = physicalDevice;
12640 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012641 countingStream->rewind();
12642 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012643 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012644 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
12645 if (pPropertyCount)
12646 {
12647 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
12648 }
12649 countingStream->write((VkDisplayProperties2KHR**)&pProperties, sizeof(VkDisplayProperties2KHR*));
12650 if (pProperties)
12651 {
12652 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12653 {
12654 marshal_VkDisplayProperties2KHR(countingStream, (VkDisplayProperties2KHR*)(pProperties + i));
12655 }
12656 }
12657 }
12658 uint32_t packetSize_vkGetPhysicalDeviceDisplayProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12659 countingStream->rewind();
12660 uint32_t opcode_vkGetPhysicalDeviceDisplayProperties2KHR = OP_vkGetPhysicalDeviceDisplayProperties2KHR;
12661 stream->write(&opcode_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t));
12662 stream->write(&packetSize_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012663 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012664 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
12665 if (pPropertyCount)
12666 {
12667 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
12668 }
12669 stream->write((VkDisplayProperties2KHR**)&pProperties, sizeof(VkDisplayProperties2KHR*));
12670 if (pProperties)
12671 {
12672 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12673 {
12674 marshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i));
12675 }
12676 }
12677 uint32_t* check_pPropertyCount;
12678 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
12679 if (pPropertyCount)
12680 {
12681 if (!(check_pPropertyCount))
12682 {
12683 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
12684 }
12685 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
12686 }
12687 VkDisplayProperties2KHR* check_pProperties;
12688 stream->read((VkDisplayProperties2KHR**)&check_pProperties, sizeof(VkDisplayProperties2KHR*));
12689 if (pProperties)
12690 {
12691 if (!(check_pProperties))
12692 {
12693 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
12694 }
12695 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12696 {
12697 unmarshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i));
12698 }
12699 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012700 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012701 VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0;
12702 stream->read(&vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return, sizeof(VkResult));
12703 return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return;
12704}
12705
12706VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlaneProperties2KHR(
12707 VkPhysicalDevice physicalDevice,
12708 uint32_t* pPropertyCount,
12709 VkDisplayPlaneProperties2KHR* pProperties)
12710{
12711 auto stream = mImpl->stream();
12712 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012713 auto resources = mImpl->resources();
12714 auto pool = mImpl->pool();
12715 VkPhysicalDevice local_physicalDevice;
12716 local_physicalDevice = physicalDevice;
12717 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012718 countingStream->rewind();
12719 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012720 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012721 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
12722 if (pPropertyCount)
12723 {
12724 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
12725 }
12726 countingStream->write((VkDisplayPlaneProperties2KHR**)&pProperties, sizeof(VkDisplayPlaneProperties2KHR*));
12727 if (pProperties)
12728 {
12729 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12730 {
12731 marshal_VkDisplayPlaneProperties2KHR(countingStream, (VkDisplayPlaneProperties2KHR*)(pProperties + i));
12732 }
12733 }
12734 }
12735 uint32_t packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12736 countingStream->rewind();
12737 uint32_t opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR;
12738 stream->write(&opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t));
12739 stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012740 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012741 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
12742 if (pPropertyCount)
12743 {
12744 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
12745 }
12746 stream->write((VkDisplayPlaneProperties2KHR**)&pProperties, sizeof(VkDisplayPlaneProperties2KHR*));
12747 if (pProperties)
12748 {
12749 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12750 {
12751 marshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i));
12752 }
12753 }
12754 uint32_t* check_pPropertyCount;
12755 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
12756 if (pPropertyCount)
12757 {
12758 if (!(check_pPropertyCount))
12759 {
12760 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
12761 }
12762 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
12763 }
12764 VkDisplayPlaneProperties2KHR* check_pProperties;
12765 stream->read((VkDisplayPlaneProperties2KHR**)&check_pProperties, sizeof(VkDisplayPlaneProperties2KHR*));
12766 if (pProperties)
12767 {
12768 if (!(check_pProperties))
12769 {
12770 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
12771 }
12772 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12773 {
12774 unmarshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i));
12775 }
12776 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012777 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012778 VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0;
12779 stream->read(&vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return, sizeof(VkResult));
12780 return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return;
12781}
12782
12783VkResult VkEncoder::vkGetDisplayModeProperties2KHR(
12784 VkPhysicalDevice physicalDevice,
12785 VkDisplayKHR display,
12786 uint32_t* pPropertyCount,
12787 VkDisplayModeProperties2KHR* pProperties)
12788{
12789 auto stream = mImpl->stream();
12790 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012791 auto resources = mImpl->resources();
12792 auto pool = mImpl->pool();
12793 VkPhysicalDevice local_physicalDevice;
12794 local_physicalDevice = physicalDevice;
12795 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
12796 VkDisplayKHR local_display;
12797 local_display = display;
12798 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012799 countingStream->rewind();
12800 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012801 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
12802 countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012803 countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
12804 if (pPropertyCount)
12805 {
12806 countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
12807 }
12808 countingStream->write((VkDisplayModeProperties2KHR**)&pProperties, sizeof(VkDisplayModeProperties2KHR*));
12809 if (pProperties)
12810 {
12811 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12812 {
12813 marshal_VkDisplayModeProperties2KHR(countingStream, (VkDisplayModeProperties2KHR*)(pProperties + i));
12814 }
12815 }
12816 }
12817 uint32_t packetSize_vkGetDisplayModeProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12818 countingStream->rewind();
12819 uint32_t opcode_vkGetDisplayModeProperties2KHR = OP_vkGetDisplayModeProperties2KHR;
12820 stream->write(&opcode_vkGetDisplayModeProperties2KHR, sizeof(uint32_t));
12821 stream->write(&packetSize_vkGetDisplayModeProperties2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012822 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
12823 stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012824 stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*));
12825 if (pPropertyCount)
12826 {
12827 stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t));
12828 }
12829 stream->write((VkDisplayModeProperties2KHR**)&pProperties, sizeof(VkDisplayModeProperties2KHR*));
12830 if (pProperties)
12831 {
12832 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12833 {
12834 marshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i));
12835 }
12836 }
12837 uint32_t* check_pPropertyCount;
12838 stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*));
12839 if (pPropertyCount)
12840 {
12841 if (!(check_pPropertyCount))
12842 {
12843 fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n");
12844 }
12845 stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t));
12846 }
12847 VkDisplayModeProperties2KHR* check_pProperties;
12848 stream->read((VkDisplayModeProperties2KHR**)&check_pProperties, sizeof(VkDisplayModeProperties2KHR*));
12849 if (pProperties)
12850 {
12851 if (!(check_pProperties))
12852 {
12853 fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n");
12854 }
12855 for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i)
12856 {
12857 unmarshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i));
12858 }
12859 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012860 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012861 VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0;
12862 stream->read(&vkGetDisplayModeProperties2KHR_VkResult_return, sizeof(VkResult));
12863 return vkGetDisplayModeProperties2KHR_VkResult_return;
12864}
12865
12866VkResult VkEncoder::vkGetDisplayPlaneCapabilities2KHR(
12867 VkPhysicalDevice physicalDevice,
12868 const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo,
12869 VkDisplayPlaneCapabilities2KHR* pCapabilities)
12870{
12871 auto stream = mImpl->stream();
12872 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012873 auto resources = mImpl->resources();
12874 auto pool = mImpl->pool();
12875 VkPhysicalDevice local_physicalDevice;
12876 local_physicalDevice = physicalDevice;
12877 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
12878 VkDisplayPlaneInfo2KHR* local_pDisplayPlaneInfo;
12879 local_pDisplayPlaneInfo = nullptr;
12880 if (pDisplayPlaneInfo)
12881 {
12882 local_pDisplayPlaneInfo = (VkDisplayPlaneInfo2KHR*)pool->alloc(sizeof(const VkDisplayPlaneInfo2KHR));
12883 deepcopy_VkDisplayPlaneInfo2KHR(pool, pDisplayPlaneInfo, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
12884 }
12885 if (local_pDisplayPlaneInfo)
12886 {
12887 handlemap_VkDisplayPlaneInfo2KHR(resources->unwrapMapping(), (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
12888 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012889 countingStream->rewind();
12890 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012891 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
12892 marshal_VkDisplayPlaneInfo2KHR(countingStream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012893 marshal_VkDisplayPlaneCapabilities2KHR(countingStream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
12894 }
12895 uint32_t packetSize_vkGetDisplayPlaneCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12896 countingStream->rewind();
12897 uint32_t opcode_vkGetDisplayPlaneCapabilities2KHR = OP_vkGetDisplayPlaneCapabilities2KHR;
12898 stream->write(&opcode_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t));
12899 stream->write(&packetSize_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012900 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
12901 marshal_VkDisplayPlaneInfo2KHR(stream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012902 marshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
12903 unmarshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012904 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012905 VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0;
12906 stream->read(&vkGetDisplayPlaneCapabilities2KHR_VkResult_return, sizeof(VkResult));
12907 return vkGetDisplayPlaneCapabilities2KHR_VkResult_return;
12908}
12909
12910#endif
12911#ifdef VK_KHR_dedicated_allocation
12912#endif
12913#ifdef VK_KHR_storage_buffer_storage_class
12914#endif
12915#ifdef VK_KHR_relaxed_block_layout
12916#endif
12917#ifdef VK_KHR_get_memory_requirements2
12918void VkEncoder::vkGetImageMemoryRequirements2KHR(
12919 VkDevice device,
12920 const VkImageMemoryRequirementsInfo2* pInfo,
12921 VkMemoryRequirements2* pMemoryRequirements)
12922{
12923 auto stream = mImpl->stream();
12924 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012925 auto resources = mImpl->resources();
12926 auto pool = mImpl->pool();
12927 VkDevice local_device;
12928 local_device = device;
12929 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12930 VkImageMemoryRequirementsInfo2* local_pInfo;
12931 local_pInfo = nullptr;
12932 if (pInfo)
12933 {
12934 local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2));
12935 deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
12936 }
12937 if (local_pInfo)
12938 {
12939 handlemap_VkImageMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageMemoryRequirementsInfo2*)(local_pInfo));
12940 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012941 countingStream->rewind();
12942 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012943 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
12944 marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012945 marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
12946 }
12947 uint32_t packetSize_vkGetImageMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12948 countingStream->rewind();
12949 uint32_t opcode_vkGetImageMemoryRequirements2KHR = OP_vkGetImageMemoryRequirements2KHR;
12950 stream->write(&opcode_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t));
12951 stream->write(&packetSize_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012952 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
12953 marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012954 marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
12955 unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012956 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012957}
12958
12959void VkEncoder::vkGetBufferMemoryRequirements2KHR(
12960 VkDevice device,
12961 const VkBufferMemoryRequirementsInfo2* pInfo,
12962 VkMemoryRequirements2* pMemoryRequirements)
12963{
12964 auto stream = mImpl->stream();
12965 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012966 auto resources = mImpl->resources();
12967 auto pool = mImpl->pool();
12968 VkDevice local_device;
12969 local_device = device;
12970 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
12971 VkBufferMemoryRequirementsInfo2* local_pInfo;
12972 local_pInfo = nullptr;
12973 if (pInfo)
12974 {
12975 local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2));
12976 deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
12977 }
12978 if (local_pInfo)
12979 {
12980 handlemap_VkBufferMemoryRequirementsInfo2(resources->unwrapMapping(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
12981 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012982 countingStream->rewind();
12983 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012984 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
12985 marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012986 marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements));
12987 }
12988 uint32_t packetSize_vkGetBufferMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
12989 countingStream->rewind();
12990 uint32_t opcode_vkGetBufferMemoryRequirements2KHR = OP_vkGetBufferMemoryRequirements2KHR;
12991 stream->write(&opcode_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t));
12992 stream->write(&packetSize_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012993 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
12994 marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012995 marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
12996 unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080012997 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070012998}
12999
13000void VkEncoder::vkGetImageSparseMemoryRequirements2KHR(
13001 VkDevice device,
13002 const VkImageSparseMemoryRequirementsInfo2* pInfo,
13003 uint32_t* pSparseMemoryRequirementCount,
13004 VkSparseImageMemoryRequirements2* pSparseMemoryRequirements)
13005{
13006 auto stream = mImpl->stream();
13007 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013008 auto resources = mImpl->resources();
13009 auto pool = mImpl->pool();
13010 VkDevice local_device;
13011 local_device = device;
13012 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13013 VkImageSparseMemoryRequirementsInfo2* local_pInfo;
13014 local_pInfo = nullptr;
13015 if (pInfo)
13016 {
13017 local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2));
13018 deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
13019 }
13020 if (local_pInfo)
13021 {
13022 handlemap_VkImageSparseMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
13023 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013024 countingStream->rewind();
13025 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013026 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
13027 marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013028 countingStream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*));
13029 if (pSparseMemoryRequirementCount)
13030 {
13031 countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
13032 }
13033 countingStream->write((VkSparseImageMemoryRequirements2**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*));
13034 if (pSparseMemoryRequirements)
13035 {
13036 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
13037 {
13038 marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
13039 }
13040 }
13041 }
13042 uint32_t packetSize_vkGetImageSparseMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13043 countingStream->rewind();
13044 uint32_t opcode_vkGetImageSparseMemoryRequirements2KHR = OP_vkGetImageSparseMemoryRequirements2KHR;
13045 stream->write(&opcode_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t));
13046 stream->write(&packetSize_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013047 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
13048 marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013049 stream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*));
13050 if (pSparseMemoryRequirementCount)
13051 {
13052 stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
13053 }
13054 stream->write((VkSparseImageMemoryRequirements2**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*));
13055 if (pSparseMemoryRequirements)
13056 {
13057 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
13058 {
13059 marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
13060 }
13061 }
13062 uint32_t* check_pSparseMemoryRequirementCount;
13063 stream->read((uint32_t**)&check_pSparseMemoryRequirementCount, sizeof(uint32_t*));
13064 if (pSparseMemoryRequirementCount)
13065 {
13066 if (!(check_pSparseMemoryRequirementCount))
13067 {
13068 fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n");
13069 }
13070 stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t));
13071 }
13072 VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements;
13073 stream->read((VkSparseImageMemoryRequirements2**)&check_pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*));
13074 if (pSparseMemoryRequirements)
13075 {
13076 if (!(check_pSparseMemoryRequirements))
13077 {
13078 fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n");
13079 }
13080 for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i)
13081 {
13082 unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i));
13083 }
13084 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013085 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013086}
13087
13088#endif
13089#ifdef VK_KHR_image_format_list
13090#endif
13091#ifdef VK_KHR_sampler_ycbcr_conversion
13092VkResult VkEncoder::vkCreateSamplerYcbcrConversionKHR(
13093 VkDevice device,
13094 const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
13095 const VkAllocationCallbacks* pAllocator,
13096 VkSamplerYcbcrConversion* pYcbcrConversion)
13097{
13098 auto stream = mImpl->stream();
13099 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013100 auto resources = mImpl->resources();
13101 auto pool = mImpl->pool();
13102 VkDevice local_device;
13103 local_device = device;
13104 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13105 VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo;
13106 local_pCreateInfo = nullptr;
13107 if (pCreateInfo)
13108 {
13109 local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo));
13110 deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
13111 }
13112 if (local_pCreateInfo)
13113 {
13114 handlemap_VkSamplerYcbcrConversionCreateInfo(resources->unwrapMapping(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
13115 }
13116 VkAllocationCallbacks* local_pAllocator;
13117 local_pAllocator = nullptr;
13118 if (pAllocator)
13119 {
13120 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
13121 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
13122 }
13123 if (local_pAllocator)
13124 {
13125 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
13126 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013127 countingStream->rewind();
13128 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013129 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
13130 marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
13131 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
13132 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013133 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013134 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013135 }
13136 countingStream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
13137 }
13138 uint32_t packetSize_vkCreateSamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13139 countingStream->rewind();
13140 uint32_t opcode_vkCreateSamplerYcbcrConversionKHR = OP_vkCreateSamplerYcbcrConversionKHR;
13141 stream->write(&opcode_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t));
13142 stream->write(&packetSize_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013143 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
13144 marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo));
13145 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
13146 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013147 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013148 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013149 }
13150 stream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
13151 stream->read((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013152 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013153 VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0;
13154 stream->read(&vkCreateSamplerYcbcrConversionKHR_VkResult_return, sizeof(VkResult));
13155 return vkCreateSamplerYcbcrConversionKHR_VkResult_return;
13156}
13157
13158void VkEncoder::vkDestroySamplerYcbcrConversionKHR(
13159 VkDevice device,
13160 VkSamplerYcbcrConversion ycbcrConversion,
13161 const VkAllocationCallbacks* pAllocator)
13162{
13163 auto stream = mImpl->stream();
13164 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013165 auto resources = mImpl->resources();
13166 auto pool = mImpl->pool();
13167 VkDevice local_device;
13168 local_device = device;
13169 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13170 VkSamplerYcbcrConversion local_ycbcrConversion;
13171 local_ycbcrConversion = ycbcrConversion;
13172 resources->unwrapMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&local_ycbcrConversion);
13173 VkAllocationCallbacks* local_pAllocator;
13174 local_pAllocator = nullptr;
13175 if (pAllocator)
13176 {
13177 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
13178 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
13179 }
13180 if (local_pAllocator)
13181 {
13182 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
13183 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013184 countingStream->rewind();
13185 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013186 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
13187 countingStream->write((VkSamplerYcbcrConversion*)&local_ycbcrConversion, sizeof(VkSamplerYcbcrConversion));
13188 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
13189 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013190 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013191 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013192 }
13193 }
13194 uint32_t packetSize_vkDestroySamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13195 countingStream->rewind();
13196 uint32_t opcode_vkDestroySamplerYcbcrConversionKHR = OP_vkDestroySamplerYcbcrConversionKHR;
13197 stream->write(&opcode_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t));
13198 stream->write(&packetSize_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013199 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
13200 stream->write((VkSamplerYcbcrConversion*)&local_ycbcrConversion, sizeof(VkSamplerYcbcrConversion));
13201 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
13202 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013203 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013204 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013205 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013206 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013207}
13208
13209#endif
13210#ifdef VK_KHR_bind_memory2
13211VkResult VkEncoder::vkBindBufferMemory2KHR(
13212 VkDevice device,
13213 uint32_t bindInfoCount,
13214 const VkBindBufferMemoryInfo* pBindInfos)
13215{
13216 auto stream = mImpl->stream();
13217 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013218 auto resources = mImpl->resources();
13219 auto pool = mImpl->pool();
13220 VkDevice local_device;
13221 local_device = device;
13222 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13223 uint32_t local_bindInfoCount;
13224 local_bindInfoCount = bindInfoCount;
13225 VkBindBufferMemoryInfo* local_pBindInfos;
13226 local_pBindInfos = nullptr;
13227 if (pBindInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013228 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013229 local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013230 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
13231 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013232 deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
13233 }
13234 }
13235 if (local_pBindInfos)
13236 {
13237 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
13238 {
13239 handlemap_VkBindBufferMemoryInfo(resources->unwrapMapping(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
13240 }
13241 }
13242 countingStream->rewind();
13243 {
13244 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
13245 countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
13246 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
13247 {
13248 marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013249 }
13250 }
13251 uint32_t packetSize_vkBindBufferMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13252 countingStream->rewind();
13253 uint32_t opcode_vkBindBufferMemory2KHR = OP_vkBindBufferMemory2KHR;
13254 stream->write(&opcode_vkBindBufferMemory2KHR, sizeof(uint32_t));
13255 stream->write(&packetSize_vkBindBufferMemory2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013256 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
13257 stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013258 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
13259 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013260 marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013261 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013262 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013263 VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0;
13264 stream->read(&vkBindBufferMemory2KHR_VkResult_return, sizeof(VkResult));
13265 return vkBindBufferMemory2KHR_VkResult_return;
13266}
13267
13268VkResult VkEncoder::vkBindImageMemory2KHR(
13269 VkDevice device,
13270 uint32_t bindInfoCount,
13271 const VkBindImageMemoryInfo* pBindInfos)
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 uint32_t local_bindInfoCount;
13281 local_bindInfoCount = bindInfoCount;
13282 VkBindImageMemoryInfo* local_pBindInfos;
13283 local_pBindInfos = nullptr;
13284 if (pBindInfos)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013285 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013286 local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013287 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
13288 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013289 deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
13290 }
13291 }
13292 if (local_pBindInfos)
13293 {
13294 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
13295 {
13296 handlemap_VkBindImageMemoryInfo(resources->unwrapMapping(), (VkBindImageMemoryInfo*)(local_pBindInfos + i));
13297 }
13298 }
13299 countingStream->rewind();
13300 {
13301 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
13302 countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
13303 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
13304 {
13305 marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013306 }
13307 }
13308 uint32_t packetSize_vkBindImageMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13309 countingStream->rewind();
13310 uint32_t opcode_vkBindImageMemory2KHR = OP_vkBindImageMemory2KHR;
13311 stream->write(&opcode_vkBindImageMemory2KHR, sizeof(uint32_t));
13312 stream->write(&packetSize_vkBindImageMemory2KHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013313 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
13314 stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013315 for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i)
13316 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013317 marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013318 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013319 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013320 VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0;
13321 stream->read(&vkBindImageMemory2KHR_VkResult_return, sizeof(VkResult));
13322 return vkBindImageMemory2KHR_VkResult_return;
13323}
13324
13325#endif
13326#ifdef VK_KHR_maintenance3
13327void VkEncoder::vkGetDescriptorSetLayoutSupportKHR(
13328 VkDevice device,
13329 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
13330 VkDescriptorSetLayoutSupport* pSupport)
13331{
13332 auto stream = mImpl->stream();
13333 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013334 auto resources = mImpl->resources();
13335 auto pool = mImpl->pool();
13336 VkDevice local_device;
13337 local_device = device;
13338 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13339 VkDescriptorSetLayoutCreateInfo* local_pCreateInfo;
13340 local_pCreateInfo = nullptr;
13341 if (pCreateInfo)
13342 {
13343 local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo));
13344 deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
13345 }
13346 if (local_pCreateInfo)
13347 {
13348 handlemap_VkDescriptorSetLayoutCreateInfo(resources->unwrapMapping(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
13349 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013350 countingStream->rewind();
13351 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013352 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
13353 marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013354 marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport));
13355 }
13356 uint32_t packetSize_vkGetDescriptorSetLayoutSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13357 countingStream->rewind();
13358 uint32_t opcode_vkGetDescriptorSetLayoutSupportKHR = OP_vkGetDescriptorSetLayoutSupportKHR;
13359 stream->write(&opcode_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t));
13360 stream->write(&packetSize_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013361 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
13362 marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013363 marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
13364 unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013365 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013366}
13367
13368#endif
13369#ifdef VK_KHR_draw_indirect_count
13370void VkEncoder::vkCmdDrawIndirectCountKHR(
13371 VkCommandBuffer commandBuffer,
13372 VkBuffer buffer,
13373 VkDeviceSize offset,
13374 VkBuffer countBuffer,
13375 VkDeviceSize countBufferOffset,
13376 uint32_t maxDrawCount,
13377 uint32_t stride)
13378{
13379 auto stream = mImpl->stream();
13380 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013381 auto resources = mImpl->resources();
13382 auto pool = mImpl->pool();
13383 VkCommandBuffer local_commandBuffer;
13384 local_commandBuffer = commandBuffer;
13385 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
13386 VkBuffer local_buffer;
13387 local_buffer = buffer;
13388 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
13389 VkDeviceSize local_offset;
13390 local_offset = offset;
13391 VkBuffer local_countBuffer;
13392 local_countBuffer = countBuffer;
13393 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer);
13394 VkDeviceSize local_countBufferOffset;
13395 local_countBufferOffset = countBufferOffset;
13396 uint32_t local_maxDrawCount;
13397 local_maxDrawCount = maxDrawCount;
13398 uint32_t local_stride;
13399 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013400 countingStream->rewind();
13401 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013402 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13403 countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
13404 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
13405 countingStream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer));
13406 countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
13407 countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
13408 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013409 }
13410 uint32_t packetSize_vkCmdDrawIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13411 countingStream->rewind();
13412 uint32_t opcode_vkCmdDrawIndirectCountKHR = OP_vkCmdDrawIndirectCountKHR;
13413 stream->write(&opcode_vkCmdDrawIndirectCountKHR, sizeof(uint32_t));
13414 stream->write(&packetSize_vkCmdDrawIndirectCountKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013415 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13416 stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
13417 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
13418 stream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer));
13419 stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
13420 stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
13421 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
13422 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013423}
13424
13425void VkEncoder::vkCmdDrawIndexedIndirectCountKHR(
13426 VkCommandBuffer commandBuffer,
13427 VkBuffer buffer,
13428 VkDeviceSize offset,
13429 VkBuffer countBuffer,
13430 VkDeviceSize countBufferOffset,
13431 uint32_t maxDrawCount,
13432 uint32_t stride)
13433{
13434 auto stream = mImpl->stream();
13435 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013436 auto resources = mImpl->resources();
13437 auto pool = mImpl->pool();
13438 VkCommandBuffer local_commandBuffer;
13439 local_commandBuffer = commandBuffer;
13440 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
13441 VkBuffer local_buffer;
13442 local_buffer = buffer;
13443 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
13444 VkDeviceSize local_offset;
13445 local_offset = offset;
13446 VkBuffer local_countBuffer;
13447 local_countBuffer = countBuffer;
13448 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer);
13449 VkDeviceSize local_countBufferOffset;
13450 local_countBufferOffset = countBufferOffset;
13451 uint32_t local_maxDrawCount;
13452 local_maxDrawCount = maxDrawCount;
13453 uint32_t local_stride;
13454 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013455 countingStream->rewind();
13456 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013457 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13458 countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
13459 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
13460 countingStream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer));
13461 countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
13462 countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
13463 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013464 }
13465 uint32_t packetSize_vkCmdDrawIndexedIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13466 countingStream->rewind();
13467 uint32_t opcode_vkCmdDrawIndexedIndirectCountKHR = OP_vkCmdDrawIndexedIndirectCountKHR;
13468 stream->write(&opcode_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t));
13469 stream->write(&packetSize_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013470 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13471 stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
13472 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
13473 stream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer));
13474 stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
13475 stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
13476 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
13477 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013478}
13479
13480#endif
13481#ifdef VK_KHR_8bit_storage
13482#endif
13483#ifdef VK_EXT_debug_report
13484VkResult VkEncoder::vkCreateDebugReportCallbackEXT(
13485 VkInstance instance,
13486 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
13487 const VkAllocationCallbacks* pAllocator,
13488 VkDebugReportCallbackEXT* pCallback)
13489{
13490 auto stream = mImpl->stream();
13491 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013492 auto resources = mImpl->resources();
13493 auto pool = mImpl->pool();
13494 VkInstance local_instance;
13495 local_instance = instance;
13496 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
13497 VkDebugReportCallbackCreateInfoEXT* local_pCreateInfo;
13498 local_pCreateInfo = nullptr;
13499 if (pCreateInfo)
13500 {
13501 local_pCreateInfo = (VkDebugReportCallbackCreateInfoEXT*)pool->alloc(sizeof(const VkDebugReportCallbackCreateInfoEXT));
13502 deepcopy_VkDebugReportCallbackCreateInfoEXT(pool, pCreateInfo, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
13503 }
13504 if (local_pCreateInfo)
13505 {
13506 handlemap_VkDebugReportCallbackCreateInfoEXT(resources->unwrapMapping(), (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
13507 }
13508 VkAllocationCallbacks* local_pAllocator;
13509 local_pAllocator = nullptr;
13510 if (pAllocator)
13511 {
13512 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
13513 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
13514 }
13515 if (local_pAllocator)
13516 {
13517 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
13518 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013519 countingStream->rewind();
13520 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013521 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
13522 marshal_VkDebugReportCallbackCreateInfoEXT(countingStream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
13523 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
13524 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013525 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013526 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013527 }
13528 countingStream->write((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT));
13529 }
13530 uint32_t packetSize_vkCreateDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13531 countingStream->rewind();
13532 uint32_t opcode_vkCreateDebugReportCallbackEXT = OP_vkCreateDebugReportCallbackEXT;
13533 stream->write(&opcode_vkCreateDebugReportCallbackEXT, sizeof(uint32_t));
13534 stream->write(&packetSize_vkCreateDebugReportCallbackEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013535 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
13536 marshal_VkDebugReportCallbackCreateInfoEXT(stream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo));
13537 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
13538 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013539 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013540 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013541 }
13542 stream->write((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT));
13543 stream->read((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013544 if (pCallback)
13545 {
13546 resources->createMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)pCallback, 1);
13547 }
13548 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013549 VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0;
13550 stream->read(&vkCreateDebugReportCallbackEXT_VkResult_return, sizeof(VkResult));
13551 return vkCreateDebugReportCallbackEXT_VkResult_return;
13552}
13553
13554void VkEncoder::vkDestroyDebugReportCallbackEXT(
13555 VkInstance instance,
13556 VkDebugReportCallbackEXT callback,
13557 const VkAllocationCallbacks* pAllocator)
13558{
13559 auto stream = mImpl->stream();
13560 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013561 auto resources = mImpl->resources();
13562 auto pool = mImpl->pool();
13563 VkInstance local_instance;
13564 local_instance = instance;
13565 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
13566 VkAllocationCallbacks* local_pAllocator;
13567 local_pAllocator = nullptr;
13568 if (pAllocator)
13569 {
13570 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
13571 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
13572 }
13573 if (local_pAllocator)
13574 {
13575 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
13576 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013577 countingStream->rewind();
13578 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013579 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013580 countingStream->write((VkDebugReportCallbackEXT*)&callback, sizeof(VkDebugReportCallbackEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013581 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
13582 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013583 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013584 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013585 }
13586 }
13587 uint32_t packetSize_vkDestroyDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13588 countingStream->rewind();
13589 uint32_t opcode_vkDestroyDebugReportCallbackEXT = OP_vkDestroyDebugReportCallbackEXT;
13590 stream->write(&opcode_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t));
13591 stream->write(&packetSize_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013592 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013593 stream->write((VkDebugReportCallbackEXT*)&callback, sizeof(VkDebugReportCallbackEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013594 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
13595 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013596 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013597 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013598 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013599 resources->destroyMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)&callback);
13600 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013601}
13602
13603void VkEncoder::vkDebugReportMessageEXT(
13604 VkInstance instance,
13605 VkDebugReportFlagsEXT flags,
13606 VkDebugReportObjectTypeEXT objectType,
13607 uint64_t object,
13608 size_t location,
13609 int32_t messageCode,
13610 const char* pLayerPrefix,
13611 const char* pMessage)
13612{
13613 auto stream = mImpl->stream();
13614 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013615 auto resources = mImpl->resources();
13616 auto pool = mImpl->pool();
13617 VkInstance local_instance;
13618 local_instance = instance;
13619 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
13620 VkDebugReportFlagsEXT local_flags;
13621 local_flags = flags;
13622 VkDebugReportObjectTypeEXT local_objectType;
13623 local_objectType = objectType;
13624 uint64_t local_object;
13625 local_object = object;
13626 size_t local_location;
13627 local_location = location;
13628 int32_t local_messageCode;
13629 local_messageCode = messageCode;
13630 char* local_pLayerPrefix;
13631 local_pLayerPrefix = nullptr;
13632 if (pLayerPrefix)
13633 {
13634 local_pLayerPrefix = pool->strDup(pLayerPrefix);
13635 }
13636 char* local_pMessage;
13637 local_pMessage = nullptr;
13638 if (pMessage)
13639 {
13640 local_pMessage = pool->strDup(pMessage);
13641 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013642 countingStream->rewind();
13643 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013644 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
13645 countingStream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT));
13646 countingStream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT));
13647 countingStream->write((uint64_t*)&local_object, sizeof(uint64_t));
13648 countingStream->write((size_t*)&local_location, sizeof(size_t));
13649 countingStream->write((int32_t*)&local_messageCode, sizeof(int32_t));
13650 countingStream->putString(local_pLayerPrefix);
13651 countingStream->putString(local_pMessage);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013652 }
13653 uint32_t packetSize_vkDebugReportMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13654 countingStream->rewind();
13655 uint32_t opcode_vkDebugReportMessageEXT = OP_vkDebugReportMessageEXT;
13656 stream->write(&opcode_vkDebugReportMessageEXT, sizeof(uint32_t));
13657 stream->write(&packetSize_vkDebugReportMessageEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013658 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
13659 stream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT));
13660 stream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT));
13661 stream->write((uint64_t*)&local_object, sizeof(uint64_t));
13662 stream->write((size_t*)&local_location, sizeof(size_t));
13663 stream->write((int32_t*)&local_messageCode, sizeof(int32_t));
13664 stream->putString(local_pLayerPrefix);
13665 stream->putString(local_pMessage);
13666 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013667}
13668
13669#endif
13670#ifdef VK_NV_glsl_shader
13671#endif
13672#ifdef VK_EXT_depth_range_unrestricted
13673#endif
13674#ifdef VK_IMG_filter_cubic
13675#endif
13676#ifdef VK_AMD_rasterization_order
13677#endif
13678#ifdef VK_AMD_shader_trinary_minmax
13679#endif
13680#ifdef VK_AMD_shader_explicit_vertex_parameter
13681#endif
13682#ifdef VK_EXT_debug_marker
13683VkResult VkEncoder::vkDebugMarkerSetObjectTagEXT(
13684 VkDevice device,
13685 const VkDebugMarkerObjectTagInfoEXT* pTagInfo)
13686{
13687 auto stream = mImpl->stream();
13688 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013689 auto resources = mImpl->resources();
13690 auto pool = mImpl->pool();
13691 VkDevice local_device;
13692 local_device = device;
13693 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13694 VkDebugMarkerObjectTagInfoEXT* local_pTagInfo;
13695 local_pTagInfo = nullptr;
13696 if (pTagInfo)
13697 {
13698 local_pTagInfo = (VkDebugMarkerObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectTagInfoEXT));
13699 deepcopy_VkDebugMarkerObjectTagInfoEXT(pool, pTagInfo, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
13700 }
13701 if (local_pTagInfo)
13702 {
13703 handlemap_VkDebugMarkerObjectTagInfoEXT(resources->unwrapMapping(), (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
13704 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013705 countingStream->rewind();
13706 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013707 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
13708 marshal_VkDebugMarkerObjectTagInfoEXT(countingStream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013709 }
13710 uint32_t packetSize_vkDebugMarkerSetObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13711 countingStream->rewind();
13712 uint32_t opcode_vkDebugMarkerSetObjectTagEXT = OP_vkDebugMarkerSetObjectTagEXT;
13713 stream->write(&opcode_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t));
13714 stream->write(&packetSize_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013715 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
13716 marshal_VkDebugMarkerObjectTagInfoEXT(stream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo));
13717 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013718 VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0;
13719 stream->read(&vkDebugMarkerSetObjectTagEXT_VkResult_return, sizeof(VkResult));
13720 return vkDebugMarkerSetObjectTagEXT_VkResult_return;
13721}
13722
13723VkResult VkEncoder::vkDebugMarkerSetObjectNameEXT(
13724 VkDevice device,
13725 const VkDebugMarkerObjectNameInfoEXT* pNameInfo)
13726{
13727 auto stream = mImpl->stream();
13728 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013729 auto resources = mImpl->resources();
13730 auto pool = mImpl->pool();
13731 VkDevice local_device;
13732 local_device = device;
13733 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
13734 VkDebugMarkerObjectNameInfoEXT* local_pNameInfo;
13735 local_pNameInfo = nullptr;
13736 if (pNameInfo)
13737 {
13738 local_pNameInfo = (VkDebugMarkerObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectNameInfoEXT));
13739 deepcopy_VkDebugMarkerObjectNameInfoEXT(pool, pNameInfo, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
13740 }
13741 if (local_pNameInfo)
13742 {
13743 handlemap_VkDebugMarkerObjectNameInfoEXT(resources->unwrapMapping(), (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
13744 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013745 countingStream->rewind();
13746 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013747 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
13748 marshal_VkDebugMarkerObjectNameInfoEXT(countingStream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013749 }
13750 uint32_t packetSize_vkDebugMarkerSetObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13751 countingStream->rewind();
13752 uint32_t opcode_vkDebugMarkerSetObjectNameEXT = OP_vkDebugMarkerSetObjectNameEXT;
13753 stream->write(&opcode_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t));
13754 stream->write(&packetSize_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013755 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
13756 marshal_VkDebugMarkerObjectNameInfoEXT(stream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo));
13757 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013758 VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0;
13759 stream->read(&vkDebugMarkerSetObjectNameEXT_VkResult_return, sizeof(VkResult));
13760 return vkDebugMarkerSetObjectNameEXT_VkResult_return;
13761}
13762
13763void VkEncoder::vkCmdDebugMarkerBeginEXT(
13764 VkCommandBuffer commandBuffer,
13765 const VkDebugMarkerMarkerInfoEXT* pMarkerInfo)
13766{
13767 auto stream = mImpl->stream();
13768 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013769 auto resources = mImpl->resources();
13770 auto pool = mImpl->pool();
13771 VkCommandBuffer local_commandBuffer;
13772 local_commandBuffer = commandBuffer;
13773 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
13774 VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo;
13775 local_pMarkerInfo = nullptr;
13776 if (pMarkerInfo)
13777 {
13778 local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT));
13779 deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
13780 }
13781 if (local_pMarkerInfo)
13782 {
13783 handlemap_VkDebugMarkerMarkerInfoEXT(resources->unwrapMapping(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
13784 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013785 countingStream->rewind();
13786 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013787 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13788 marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013789 }
13790 uint32_t packetSize_vkCmdDebugMarkerBeginEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13791 countingStream->rewind();
13792 uint32_t opcode_vkCmdDebugMarkerBeginEXT = OP_vkCmdDebugMarkerBeginEXT;
13793 stream->write(&opcode_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t));
13794 stream->write(&packetSize_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013795 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13796 marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
13797 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013798}
13799
13800void VkEncoder::vkCmdDebugMarkerEndEXT(
13801 VkCommandBuffer commandBuffer)
13802{
13803 auto stream = mImpl->stream();
13804 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013805 auto resources = mImpl->resources();
13806 auto pool = mImpl->pool();
13807 VkCommandBuffer local_commandBuffer;
13808 local_commandBuffer = commandBuffer;
13809 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013810 countingStream->rewind();
13811 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013812 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013813 }
13814 uint32_t packetSize_vkCmdDebugMarkerEndEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13815 countingStream->rewind();
13816 uint32_t opcode_vkCmdDebugMarkerEndEXT = OP_vkCmdDebugMarkerEndEXT;
13817 stream->write(&opcode_vkCmdDebugMarkerEndEXT, sizeof(uint32_t));
13818 stream->write(&packetSize_vkCmdDebugMarkerEndEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013819 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13820 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013821}
13822
13823void VkEncoder::vkCmdDebugMarkerInsertEXT(
13824 VkCommandBuffer commandBuffer,
13825 const VkDebugMarkerMarkerInfoEXT* pMarkerInfo)
13826{
13827 auto stream = mImpl->stream();
13828 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013829 auto resources = mImpl->resources();
13830 auto pool = mImpl->pool();
13831 VkCommandBuffer local_commandBuffer;
13832 local_commandBuffer = commandBuffer;
13833 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
13834 VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo;
13835 local_pMarkerInfo = nullptr;
13836 if (pMarkerInfo)
13837 {
13838 local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT));
13839 deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
13840 }
13841 if (local_pMarkerInfo)
13842 {
13843 handlemap_VkDebugMarkerMarkerInfoEXT(resources->unwrapMapping(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
13844 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013845 countingStream->rewind();
13846 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013847 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13848 marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013849 }
13850 uint32_t packetSize_vkCmdDebugMarkerInsertEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13851 countingStream->rewind();
13852 uint32_t opcode_vkCmdDebugMarkerInsertEXT = OP_vkCmdDebugMarkerInsertEXT;
13853 stream->write(&opcode_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t));
13854 stream->write(&packetSize_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013855 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13856 marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo));
13857 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013858}
13859
13860#endif
13861#ifdef VK_AMD_gcn_shader
13862#endif
13863#ifdef VK_NV_dedicated_allocation
13864#endif
13865#ifdef VK_AMD_draw_indirect_count
13866void VkEncoder::vkCmdDrawIndirectCountAMD(
13867 VkCommandBuffer commandBuffer,
13868 VkBuffer buffer,
13869 VkDeviceSize offset,
13870 VkBuffer countBuffer,
13871 VkDeviceSize countBufferOffset,
13872 uint32_t maxDrawCount,
13873 uint32_t stride)
13874{
13875 auto stream = mImpl->stream();
13876 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013877 auto resources = mImpl->resources();
13878 auto pool = mImpl->pool();
13879 VkCommandBuffer local_commandBuffer;
13880 local_commandBuffer = commandBuffer;
13881 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
13882 VkBuffer local_buffer;
13883 local_buffer = buffer;
13884 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
13885 VkDeviceSize local_offset;
13886 local_offset = offset;
13887 VkBuffer local_countBuffer;
13888 local_countBuffer = countBuffer;
13889 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer);
13890 VkDeviceSize local_countBufferOffset;
13891 local_countBufferOffset = countBufferOffset;
13892 uint32_t local_maxDrawCount;
13893 local_maxDrawCount = maxDrawCount;
13894 uint32_t local_stride;
13895 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013896 countingStream->rewind();
13897 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013898 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13899 countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
13900 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
13901 countingStream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer));
13902 countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
13903 countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
13904 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013905 }
13906 uint32_t packetSize_vkCmdDrawIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13907 countingStream->rewind();
13908 uint32_t opcode_vkCmdDrawIndirectCountAMD = OP_vkCmdDrawIndirectCountAMD;
13909 stream->write(&opcode_vkCmdDrawIndirectCountAMD, sizeof(uint32_t));
13910 stream->write(&packetSize_vkCmdDrawIndirectCountAMD, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013911 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13912 stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
13913 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
13914 stream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer));
13915 stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
13916 stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
13917 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
13918 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013919}
13920
13921void VkEncoder::vkCmdDrawIndexedIndirectCountAMD(
13922 VkCommandBuffer commandBuffer,
13923 VkBuffer buffer,
13924 VkDeviceSize offset,
13925 VkBuffer countBuffer,
13926 VkDeviceSize countBufferOffset,
13927 uint32_t maxDrawCount,
13928 uint32_t stride)
13929{
13930 auto stream = mImpl->stream();
13931 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013932 auto resources = mImpl->resources();
13933 auto pool = mImpl->pool();
13934 VkCommandBuffer local_commandBuffer;
13935 local_commandBuffer = commandBuffer;
13936 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
13937 VkBuffer local_buffer;
13938 local_buffer = buffer;
13939 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer);
13940 VkDeviceSize local_offset;
13941 local_offset = offset;
13942 VkBuffer local_countBuffer;
13943 local_countBuffer = countBuffer;
13944 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer);
13945 VkDeviceSize local_countBufferOffset;
13946 local_countBufferOffset = countBufferOffset;
13947 uint32_t local_maxDrawCount;
13948 local_maxDrawCount = maxDrawCount;
13949 uint32_t local_stride;
13950 local_stride = stride;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013951 countingStream->rewind();
13952 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013953 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13954 countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
13955 countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
13956 countingStream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer));
13957 countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
13958 countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
13959 countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013960 }
13961 uint32_t packetSize_vkCmdDrawIndexedIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten();
13962 countingStream->rewind();
13963 uint32_t opcode_vkCmdDrawIndexedIndirectCountAMD = OP_vkCmdDrawIndexedIndirectCountAMD;
13964 stream->write(&opcode_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t));
13965 stream->write(&packetSize_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013966 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
13967 stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer));
13968 stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize));
13969 stream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer));
13970 stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize));
13971 stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t));
13972 stream->write((uint32_t*)&local_stride, sizeof(uint32_t));
13973 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070013974}
13975
13976#endif
13977#ifdef VK_AMD_negative_viewport_height
13978#endif
13979#ifdef VK_AMD_gpu_shader_half_float
13980#endif
13981#ifdef VK_AMD_shader_ballot
13982#endif
13983#ifdef VK_AMD_texture_gather_bias_lod
13984#endif
13985#ifdef VK_AMD_shader_info
13986VkResult VkEncoder::vkGetShaderInfoAMD(
13987 VkDevice device,
13988 VkPipeline pipeline,
13989 VkShaderStageFlagBits shaderStage,
13990 VkShaderInfoTypeAMD infoType,
13991 size_t* pInfoSize,
13992 void* pInfo)
13993{
13994 auto stream = mImpl->stream();
13995 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080013996 auto resources = mImpl->resources();
13997 auto pool = mImpl->pool();
13998 VkDevice local_device;
13999 local_device = device;
14000 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14001 VkPipeline local_pipeline;
14002 local_pipeline = pipeline;
14003 resources->unwrapMapping()->mapHandles_VkPipeline((VkPipeline*)&local_pipeline);
14004 VkShaderStageFlagBits local_shaderStage;
14005 local_shaderStage = shaderStage;
14006 VkShaderInfoTypeAMD local_infoType;
14007 local_infoType = infoType;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014008 countingStream->rewind();
14009 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014010 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
14011 countingStream->write((VkPipeline*)&local_pipeline, sizeof(VkPipeline));
14012 countingStream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits));
14013 countingStream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014014 countingStream->write((size_t**)&pInfoSize, sizeof(size_t*));
14015 if (pInfoSize)
14016 {
14017 countingStream->write((size_t*)pInfoSize, sizeof(size_t));
14018 }
14019 countingStream->write((void**)&pInfo, sizeof(void*));
14020 if (pInfo)
14021 {
14022 countingStream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t));
14023 }
14024 }
14025 uint32_t packetSize_vkGetShaderInfoAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14026 countingStream->rewind();
14027 uint32_t opcode_vkGetShaderInfoAMD = OP_vkGetShaderInfoAMD;
14028 stream->write(&opcode_vkGetShaderInfoAMD, sizeof(uint32_t));
14029 stream->write(&packetSize_vkGetShaderInfoAMD, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014030 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
14031 stream->write((VkPipeline*)&local_pipeline, sizeof(VkPipeline));
14032 stream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits));
14033 stream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014034 stream->write((size_t**)&pInfoSize, sizeof(size_t*));
14035 if (pInfoSize)
14036 {
14037 stream->write((size_t*)pInfoSize, sizeof(size_t));
14038 }
14039 stream->write((void**)&pInfo, sizeof(void*));
14040 if (pInfo)
14041 {
14042 stream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t));
14043 }
14044 size_t* check_pInfoSize;
14045 stream->read((size_t**)&check_pInfoSize, sizeof(size_t*));
14046 if (pInfoSize)
14047 {
14048 if (!(check_pInfoSize))
14049 {
14050 fprintf(stderr, "fatal: pInfoSize inconsistent between guest and host\n");
14051 }
14052 stream->read((size_t*)pInfoSize, sizeof(size_t));
14053 }
14054 void* check_pInfo;
14055 stream->read((void**)&check_pInfo, sizeof(void*));
14056 if (pInfo)
14057 {
14058 if (!(check_pInfo))
14059 {
14060 fprintf(stderr, "fatal: pInfo inconsistent between guest and host\n");
14061 }
14062 stream->read((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t));
14063 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014064 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014065 VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0;
14066 stream->read(&vkGetShaderInfoAMD_VkResult_return, sizeof(VkResult));
14067 return vkGetShaderInfoAMD_VkResult_return;
14068}
14069
14070#endif
14071#ifdef VK_AMD_shader_image_load_store_lod
14072#endif
14073#ifdef VK_IMG_format_pvrtc
14074#endif
14075#ifdef VK_NV_external_memory_capabilities
14076VkResult VkEncoder::vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
14077 VkPhysicalDevice physicalDevice,
14078 VkFormat format,
14079 VkImageType type,
14080 VkImageTiling tiling,
14081 VkImageUsageFlags usage,
14082 VkImageCreateFlags flags,
14083 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
14084 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties)
14085{
14086 auto stream = mImpl->stream();
14087 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014088 auto resources = mImpl->resources();
14089 auto pool = mImpl->pool();
14090 VkPhysicalDevice local_physicalDevice;
14091 local_physicalDevice = physicalDevice;
14092 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
14093 VkFormat local_format;
14094 local_format = format;
14095 VkImageType local_type;
14096 local_type = type;
14097 VkImageTiling local_tiling;
14098 local_tiling = tiling;
14099 VkImageUsageFlags local_usage;
14100 local_usage = usage;
14101 VkImageCreateFlags local_flags;
14102 local_flags = flags;
14103 VkExternalMemoryHandleTypeFlagsNV local_externalHandleType;
14104 local_externalHandleType = externalHandleType;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014105 countingStream->rewind();
14106 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014107 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
14108 countingStream->write((VkFormat*)&local_format, sizeof(VkFormat));
14109 countingStream->write((VkImageType*)&local_type, sizeof(VkImageType));
14110 countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
14111 countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
14112 countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags));
14113 countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014114 marshal_VkExternalImageFormatPropertiesNV(countingStream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties));
14115 }
14116 uint32_t packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14117 countingStream->rewind();
14118 uint32_t opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV;
14119 stream->write(&opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t));
14120 stream->write(&packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014121 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
14122 stream->write((VkFormat*)&local_format, sizeof(VkFormat));
14123 stream->write((VkImageType*)&local_type, sizeof(VkImageType));
14124 stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling));
14125 stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags));
14126 stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags));
14127 stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014128 marshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties));
14129 unmarshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014130 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014131 VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0;
14132 stream->read(&vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return, sizeof(VkResult));
14133 return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return;
14134}
14135
14136#endif
14137#ifdef VK_NV_external_memory
14138#endif
14139#ifdef VK_NV_external_memory_win32
14140VkResult VkEncoder::vkGetMemoryWin32HandleNV(
14141 VkDevice device,
14142 VkDeviceMemory memory,
14143 VkExternalMemoryHandleTypeFlagsNV handleType,
14144 HANDLE* pHandle)
14145{
14146 auto stream = mImpl->stream();
14147 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014148 auto resources = mImpl->resources();
14149 auto pool = mImpl->pool();
14150 VkDevice local_device;
14151 local_device = device;
14152 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14153 VkDeviceMemory local_memory;
14154 local_memory = memory;
14155 resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory);
14156 VkExternalMemoryHandleTypeFlagsNV local_handleType;
14157 local_handleType = handleType;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014158 countingStream->rewind();
14159 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014160 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
14161 countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
14162 countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014163 countingStream->write((HANDLE*)pHandle, sizeof(HANDLE));
14164 }
14165 uint32_t packetSize_vkGetMemoryWin32HandleNV = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14166 countingStream->rewind();
14167 uint32_t opcode_vkGetMemoryWin32HandleNV = OP_vkGetMemoryWin32HandleNV;
14168 stream->write(&opcode_vkGetMemoryWin32HandleNV, sizeof(uint32_t));
14169 stream->write(&packetSize_vkGetMemoryWin32HandleNV, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014170 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
14171 stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory));
14172 stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014173 stream->write((HANDLE*)pHandle, sizeof(HANDLE));
14174 stream->read((HANDLE*)pHandle, sizeof(HANDLE));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014175 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014176 VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0;
14177 stream->read(&vkGetMemoryWin32HandleNV_VkResult_return, sizeof(VkResult));
14178 return vkGetMemoryWin32HandleNV_VkResult_return;
14179}
14180
14181#endif
14182#ifdef VK_NV_win32_keyed_mutex
14183#endif
14184#ifdef VK_EXT_validation_flags
14185#endif
14186#ifdef VK_NN_vi_surface
14187VkResult VkEncoder::vkCreateViSurfaceNN(
14188 VkInstance instance,
14189 const VkViSurfaceCreateInfoNN* pCreateInfo,
14190 const VkAllocationCallbacks* pAllocator,
14191 VkSurfaceKHR* pSurface)
14192{
14193 auto stream = mImpl->stream();
14194 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014195 auto resources = mImpl->resources();
14196 auto pool = mImpl->pool();
14197 VkInstance local_instance;
14198 local_instance = instance;
14199 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
14200 VkViSurfaceCreateInfoNN* local_pCreateInfo;
14201 local_pCreateInfo = nullptr;
14202 if (pCreateInfo)
14203 {
14204 local_pCreateInfo = (VkViSurfaceCreateInfoNN*)pool->alloc(sizeof(const VkViSurfaceCreateInfoNN));
14205 deepcopy_VkViSurfaceCreateInfoNN(pool, pCreateInfo, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
14206 }
14207 if (local_pCreateInfo)
14208 {
14209 handlemap_VkViSurfaceCreateInfoNN(resources->unwrapMapping(), (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
14210 }
14211 VkAllocationCallbacks* local_pAllocator;
14212 local_pAllocator = nullptr;
14213 if (pAllocator)
14214 {
14215 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
14216 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
14217 }
14218 if (local_pAllocator)
14219 {
14220 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
14221 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014222 countingStream->rewind();
14223 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014224 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
14225 marshal_VkViSurfaceCreateInfoNN(countingStream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
14226 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
14227 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014228 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014229 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014230 }
14231 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
14232 }
14233 uint32_t packetSize_vkCreateViSurfaceNN = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14234 countingStream->rewind();
14235 uint32_t opcode_vkCreateViSurfaceNN = OP_vkCreateViSurfaceNN;
14236 stream->write(&opcode_vkCreateViSurfaceNN, sizeof(uint32_t));
14237 stream->write(&packetSize_vkCreateViSurfaceNN, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014238 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
14239 marshal_VkViSurfaceCreateInfoNN(stream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo));
14240 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
14241 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014242 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014243 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014244 }
14245 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
14246 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014247 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014248 VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0;
14249 stream->read(&vkCreateViSurfaceNN_VkResult_return, sizeof(VkResult));
14250 return vkCreateViSurfaceNN_VkResult_return;
14251}
14252
14253#endif
14254#ifdef VK_EXT_shader_subgroup_ballot
14255#endif
14256#ifdef VK_EXT_shader_subgroup_vote
14257#endif
14258#ifdef VK_EXT_conditional_rendering
14259void VkEncoder::vkCmdBeginConditionalRenderingEXT(
14260 VkCommandBuffer commandBuffer,
14261 const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin)
14262{
14263 auto stream = mImpl->stream();
14264 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014265 auto resources = mImpl->resources();
14266 auto pool = mImpl->pool();
14267 VkCommandBuffer local_commandBuffer;
14268 local_commandBuffer = commandBuffer;
14269 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
14270 VkConditionalRenderingBeginInfoEXT* local_pConditionalRenderingBegin;
14271 local_pConditionalRenderingBegin = nullptr;
14272 if (pConditionalRenderingBegin)
14273 {
14274 local_pConditionalRenderingBegin = (VkConditionalRenderingBeginInfoEXT*)pool->alloc(sizeof(const VkConditionalRenderingBeginInfoEXT));
14275 deepcopy_VkConditionalRenderingBeginInfoEXT(pool, pConditionalRenderingBegin, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
14276 }
14277 if (local_pConditionalRenderingBegin)
14278 {
14279 handlemap_VkConditionalRenderingBeginInfoEXT(resources->unwrapMapping(), (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
14280 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014281 countingStream->rewind();
14282 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014283 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
14284 marshal_VkConditionalRenderingBeginInfoEXT(countingStream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014285 }
14286 uint32_t packetSize_vkCmdBeginConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14287 countingStream->rewind();
14288 uint32_t opcode_vkCmdBeginConditionalRenderingEXT = OP_vkCmdBeginConditionalRenderingEXT;
14289 stream->write(&opcode_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t));
14290 stream->write(&packetSize_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014291 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
14292 marshal_VkConditionalRenderingBeginInfoEXT(stream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin));
14293 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014294}
14295
14296void VkEncoder::vkCmdEndConditionalRenderingEXT(
14297 VkCommandBuffer commandBuffer)
14298{
14299 auto stream = mImpl->stream();
14300 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014301 auto resources = mImpl->resources();
14302 auto pool = mImpl->pool();
14303 VkCommandBuffer local_commandBuffer;
14304 local_commandBuffer = commandBuffer;
14305 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014306 countingStream->rewind();
14307 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014308 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014309 }
14310 uint32_t packetSize_vkCmdEndConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14311 countingStream->rewind();
14312 uint32_t opcode_vkCmdEndConditionalRenderingEXT = OP_vkCmdEndConditionalRenderingEXT;
14313 stream->write(&opcode_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t));
14314 stream->write(&packetSize_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014315 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
14316 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014317}
14318
14319#endif
14320#ifdef VK_NVX_device_generated_commands
14321void VkEncoder::vkCmdProcessCommandsNVX(
14322 VkCommandBuffer commandBuffer,
14323 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo)
14324{
14325 auto stream = mImpl->stream();
14326 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014327 auto resources = mImpl->resources();
14328 auto pool = mImpl->pool();
14329 VkCommandBuffer local_commandBuffer;
14330 local_commandBuffer = commandBuffer;
14331 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
14332 VkCmdProcessCommandsInfoNVX* local_pProcessCommandsInfo;
14333 local_pProcessCommandsInfo = nullptr;
14334 if (pProcessCommandsInfo)
14335 {
14336 local_pProcessCommandsInfo = (VkCmdProcessCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdProcessCommandsInfoNVX));
14337 deepcopy_VkCmdProcessCommandsInfoNVX(pool, pProcessCommandsInfo, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo));
14338 }
14339 if (local_pProcessCommandsInfo)
14340 {
14341 handlemap_VkCmdProcessCommandsInfoNVX(resources->unwrapMapping(), (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo));
14342 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014343 countingStream->rewind();
14344 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014345 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
14346 marshal_VkCmdProcessCommandsInfoNVX(countingStream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014347 }
14348 uint32_t packetSize_vkCmdProcessCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14349 countingStream->rewind();
14350 uint32_t opcode_vkCmdProcessCommandsNVX = OP_vkCmdProcessCommandsNVX;
14351 stream->write(&opcode_vkCmdProcessCommandsNVX, sizeof(uint32_t));
14352 stream->write(&packetSize_vkCmdProcessCommandsNVX, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014353 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
14354 marshal_VkCmdProcessCommandsInfoNVX(stream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo));
14355 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014356}
14357
14358void VkEncoder::vkCmdReserveSpaceForCommandsNVX(
14359 VkCommandBuffer commandBuffer,
14360 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo)
14361{
14362 auto stream = mImpl->stream();
14363 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014364 auto resources = mImpl->resources();
14365 auto pool = mImpl->pool();
14366 VkCommandBuffer local_commandBuffer;
14367 local_commandBuffer = commandBuffer;
14368 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
14369 VkCmdReserveSpaceForCommandsInfoNVX* local_pReserveSpaceInfo;
14370 local_pReserveSpaceInfo = nullptr;
14371 if (pReserveSpaceInfo)
14372 {
14373 local_pReserveSpaceInfo = (VkCmdReserveSpaceForCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdReserveSpaceForCommandsInfoNVX));
14374 deepcopy_VkCmdReserveSpaceForCommandsInfoNVX(pool, pReserveSpaceInfo, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo));
14375 }
14376 if (local_pReserveSpaceInfo)
14377 {
14378 handlemap_VkCmdReserveSpaceForCommandsInfoNVX(resources->unwrapMapping(), (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo));
14379 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014380 countingStream->rewind();
14381 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014382 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
14383 marshal_VkCmdReserveSpaceForCommandsInfoNVX(countingStream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014384 }
14385 uint32_t packetSize_vkCmdReserveSpaceForCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14386 countingStream->rewind();
14387 uint32_t opcode_vkCmdReserveSpaceForCommandsNVX = OP_vkCmdReserveSpaceForCommandsNVX;
14388 stream->write(&opcode_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t));
14389 stream->write(&packetSize_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014390 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
14391 marshal_VkCmdReserveSpaceForCommandsInfoNVX(stream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo));
14392 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014393}
14394
14395VkResult VkEncoder::vkCreateIndirectCommandsLayoutNVX(
14396 VkDevice device,
14397 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
14398 const VkAllocationCallbacks* pAllocator,
14399 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout)
14400{
14401 auto stream = mImpl->stream();
14402 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014403 auto resources = mImpl->resources();
14404 auto pool = mImpl->pool();
14405 VkDevice local_device;
14406 local_device = device;
14407 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14408 VkIndirectCommandsLayoutCreateInfoNVX* local_pCreateInfo;
14409 local_pCreateInfo = nullptr;
14410 if (pCreateInfo)
14411 {
14412 local_pCreateInfo = (VkIndirectCommandsLayoutCreateInfoNVX*)pool->alloc(sizeof(const VkIndirectCommandsLayoutCreateInfoNVX));
14413 deepcopy_VkIndirectCommandsLayoutCreateInfoNVX(pool, pCreateInfo, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo));
14414 }
14415 if (local_pCreateInfo)
14416 {
14417 handlemap_VkIndirectCommandsLayoutCreateInfoNVX(resources->unwrapMapping(), (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo));
14418 }
14419 VkAllocationCallbacks* local_pAllocator;
14420 local_pAllocator = nullptr;
14421 if (pAllocator)
14422 {
14423 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
14424 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
14425 }
14426 if (local_pAllocator)
14427 {
14428 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
14429 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014430 countingStream->rewind();
14431 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014432 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
14433 marshal_VkIndirectCommandsLayoutCreateInfoNVX(countingStream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo));
14434 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
14435 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014436 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014437 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014438 }
14439 countingStream->write((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
14440 }
14441 uint32_t packetSize_vkCreateIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14442 countingStream->rewind();
14443 uint32_t opcode_vkCreateIndirectCommandsLayoutNVX = OP_vkCreateIndirectCommandsLayoutNVX;
14444 stream->write(&opcode_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t));
14445 stream->write(&packetSize_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014446 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
14447 marshal_VkIndirectCommandsLayoutCreateInfoNVX(stream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo));
14448 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
14449 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014450 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014451 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014452 }
14453 stream->write((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
14454 stream->read((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014455 if (pIndirectCommandsLayout)
14456 {
14457 resources->createMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, 1);
14458 }
14459 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014460 VkResult vkCreateIndirectCommandsLayoutNVX_VkResult_return = (VkResult)0;
14461 stream->read(&vkCreateIndirectCommandsLayoutNVX_VkResult_return, sizeof(VkResult));
14462 return vkCreateIndirectCommandsLayoutNVX_VkResult_return;
14463}
14464
14465void VkEncoder::vkDestroyIndirectCommandsLayoutNVX(
14466 VkDevice device,
14467 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
14468 const VkAllocationCallbacks* pAllocator)
14469{
14470 auto stream = mImpl->stream();
14471 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014472 auto resources = mImpl->resources();
14473 auto pool = mImpl->pool();
14474 VkDevice local_device;
14475 local_device = device;
14476 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14477 VkAllocationCallbacks* local_pAllocator;
14478 local_pAllocator = nullptr;
14479 if (pAllocator)
14480 {
14481 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
14482 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
14483 }
14484 if (local_pAllocator)
14485 {
14486 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
14487 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014488 countingStream->rewind();
14489 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014490 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014491 countingStream->write((VkIndirectCommandsLayoutNVX*)&indirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014492 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
14493 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014494 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014495 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014496 }
14497 }
14498 uint32_t packetSize_vkDestroyIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14499 countingStream->rewind();
14500 uint32_t opcode_vkDestroyIndirectCommandsLayoutNVX = OP_vkDestroyIndirectCommandsLayoutNVX;
14501 stream->write(&opcode_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t));
14502 stream->write(&packetSize_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014503 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014504 stream->write((VkIndirectCommandsLayoutNVX*)&indirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014505 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
14506 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014507 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014508 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014509 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014510 resources->destroyMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)&indirectCommandsLayout);
14511 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014512}
14513
14514VkResult VkEncoder::vkCreateObjectTableNVX(
14515 VkDevice device,
14516 const VkObjectTableCreateInfoNVX* pCreateInfo,
14517 const VkAllocationCallbacks* pAllocator,
14518 VkObjectTableNVX* pObjectTable)
14519{
14520 auto stream = mImpl->stream();
14521 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014522 auto resources = mImpl->resources();
14523 auto pool = mImpl->pool();
14524 VkDevice local_device;
14525 local_device = device;
14526 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14527 VkObjectTableCreateInfoNVX* local_pCreateInfo;
14528 local_pCreateInfo = nullptr;
14529 if (pCreateInfo)
14530 {
14531 local_pCreateInfo = (VkObjectTableCreateInfoNVX*)pool->alloc(sizeof(const VkObjectTableCreateInfoNVX));
14532 deepcopy_VkObjectTableCreateInfoNVX(pool, pCreateInfo, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo));
14533 }
14534 if (local_pCreateInfo)
14535 {
14536 handlemap_VkObjectTableCreateInfoNVX(resources->unwrapMapping(), (VkObjectTableCreateInfoNVX*)(local_pCreateInfo));
14537 }
14538 VkAllocationCallbacks* local_pAllocator;
14539 local_pAllocator = nullptr;
14540 if (pAllocator)
14541 {
14542 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
14543 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
14544 }
14545 if (local_pAllocator)
14546 {
14547 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
14548 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014549 countingStream->rewind();
14550 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014551 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
14552 marshal_VkObjectTableCreateInfoNVX(countingStream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo));
14553 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
14554 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014555 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014556 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014557 }
14558 countingStream->write((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX));
14559 }
14560 uint32_t packetSize_vkCreateObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14561 countingStream->rewind();
14562 uint32_t opcode_vkCreateObjectTableNVX = OP_vkCreateObjectTableNVX;
14563 stream->write(&opcode_vkCreateObjectTableNVX, sizeof(uint32_t));
14564 stream->write(&packetSize_vkCreateObjectTableNVX, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014565 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
14566 marshal_VkObjectTableCreateInfoNVX(stream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo));
14567 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
14568 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014569 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014570 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014571 }
14572 stream->write((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX));
14573 stream->read((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014574 if (pObjectTable)
14575 {
14576 resources->createMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)pObjectTable, 1);
14577 }
14578 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014579 VkResult vkCreateObjectTableNVX_VkResult_return = (VkResult)0;
14580 stream->read(&vkCreateObjectTableNVX_VkResult_return, sizeof(VkResult));
14581 return vkCreateObjectTableNVX_VkResult_return;
14582}
14583
14584void VkEncoder::vkDestroyObjectTableNVX(
14585 VkDevice device,
14586 VkObjectTableNVX objectTable,
14587 const VkAllocationCallbacks* pAllocator)
14588{
14589 auto stream = mImpl->stream();
14590 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014591 auto resources = mImpl->resources();
14592 auto pool = mImpl->pool();
14593 VkDevice local_device;
14594 local_device = device;
14595 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14596 VkAllocationCallbacks* local_pAllocator;
14597 local_pAllocator = nullptr;
14598 if (pAllocator)
14599 {
14600 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
14601 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
14602 }
14603 if (local_pAllocator)
14604 {
14605 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
14606 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014607 countingStream->rewind();
14608 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014609 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014610 countingStream->write((VkObjectTableNVX*)&objectTable, sizeof(VkObjectTableNVX));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014611 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
14612 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014613 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014614 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014615 }
14616 }
14617 uint32_t packetSize_vkDestroyObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14618 countingStream->rewind();
14619 uint32_t opcode_vkDestroyObjectTableNVX = OP_vkDestroyObjectTableNVX;
14620 stream->write(&opcode_vkDestroyObjectTableNVX, sizeof(uint32_t));
14621 stream->write(&packetSize_vkDestroyObjectTableNVX, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014622 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014623 stream->write((VkObjectTableNVX*)&objectTable, sizeof(VkObjectTableNVX));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014624 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
14625 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014626 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014627 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014628 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014629 resources->destroyMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&objectTable);
14630 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014631}
14632
14633VkResult VkEncoder::vkRegisterObjectsNVX(
14634 VkDevice device,
14635 VkObjectTableNVX objectTable,
14636 uint32_t objectCount,
14637 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
14638 const uint32_t* pObjectIndices)
14639{
14640 auto stream = mImpl->stream();
14641 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014642 auto resources = mImpl->resources();
14643 auto pool = mImpl->pool();
14644 VkDevice local_device;
14645 local_device = device;
14646 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14647 VkObjectTableNVX local_objectTable;
14648 local_objectTable = objectTable;
14649 resources->unwrapMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&local_objectTable);
14650 uint32_t local_objectCount;
14651 local_objectCount = objectCount;
14652 VkObjectTableEntryNVX** local_ppObjectTableEntries;
Lingfeng Yang36891c52018-11-09 14:18:35 -080014653 (void)ppObjectTableEntries;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014654 uint32_t* local_pObjectIndices;
14655 local_pObjectIndices = nullptr;
14656 if (pObjectIndices)
14657 {
14658 local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t));
14659 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014660 countingStream->rewind();
14661 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014662 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
14663 countingStream->write((VkObjectTableNVX*)&local_objectTable, sizeof(VkObjectTableNVX));
14664 countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
Lingfeng Yang36891c52018-11-09 14:18:35 -080014665 (void)local_ppObjectTableEntries;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014666 countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014667 }
14668 uint32_t packetSize_vkRegisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14669 countingStream->rewind();
14670 uint32_t opcode_vkRegisterObjectsNVX = OP_vkRegisterObjectsNVX;
14671 stream->write(&opcode_vkRegisterObjectsNVX, sizeof(uint32_t));
14672 stream->write(&packetSize_vkRegisterObjectsNVX, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014673 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
14674 stream->write((VkObjectTableNVX*)&local_objectTable, sizeof(VkObjectTableNVX));
14675 stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
Lingfeng Yang36891c52018-11-09 14:18:35 -080014676 (void)local_ppObjectTableEntries;
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014677 stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
14678 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014679 VkResult vkRegisterObjectsNVX_VkResult_return = (VkResult)0;
14680 stream->read(&vkRegisterObjectsNVX_VkResult_return, sizeof(VkResult));
14681 return vkRegisterObjectsNVX_VkResult_return;
14682}
14683
14684VkResult VkEncoder::vkUnregisterObjectsNVX(
14685 VkDevice device,
14686 VkObjectTableNVX objectTable,
14687 uint32_t objectCount,
14688 const VkObjectEntryTypeNVX* pObjectEntryTypes,
14689 const uint32_t* pObjectIndices)
14690{
14691 auto stream = mImpl->stream();
14692 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014693 auto resources = mImpl->resources();
14694 auto pool = mImpl->pool();
14695 VkDevice local_device;
14696 local_device = device;
14697 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14698 VkObjectTableNVX local_objectTable;
14699 local_objectTable = objectTable;
14700 resources->unwrapMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&local_objectTable);
14701 uint32_t local_objectCount;
14702 local_objectCount = objectCount;
14703 VkObjectEntryTypeNVX* local_pObjectEntryTypes;
14704 local_pObjectEntryTypes = nullptr;
14705 if (pObjectEntryTypes)
14706 {
14707 local_pObjectEntryTypes = (VkObjectEntryTypeNVX*)pool->dupArray(pObjectEntryTypes, ((objectCount)) * sizeof(const VkObjectEntryTypeNVX));
14708 }
14709 uint32_t* local_pObjectIndices;
14710 local_pObjectIndices = nullptr;
14711 if (pObjectIndices)
14712 {
14713 local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t));
14714 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014715 countingStream->rewind();
14716 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014717 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
14718 countingStream->write((VkObjectTableNVX*)&local_objectTable, sizeof(VkObjectTableNVX));
14719 countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
14720 countingStream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX));
14721 countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014722 }
14723 uint32_t packetSize_vkUnregisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14724 countingStream->rewind();
14725 uint32_t opcode_vkUnregisterObjectsNVX = OP_vkUnregisterObjectsNVX;
14726 stream->write(&opcode_vkUnregisterObjectsNVX, sizeof(uint32_t));
14727 stream->write(&packetSize_vkUnregisterObjectsNVX, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014728 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
14729 stream->write((VkObjectTableNVX*)&local_objectTable, sizeof(VkObjectTableNVX));
14730 stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t));
14731 stream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX));
14732 stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t));
14733 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014734 VkResult vkUnregisterObjectsNVX_VkResult_return = (VkResult)0;
14735 stream->read(&vkUnregisterObjectsNVX_VkResult_return, sizeof(VkResult));
14736 return vkUnregisterObjectsNVX_VkResult_return;
14737}
14738
14739void VkEncoder::vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
14740 VkPhysicalDevice physicalDevice,
14741 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
14742 VkDeviceGeneratedCommandsLimitsNVX* pLimits)
14743{
14744 auto stream = mImpl->stream();
14745 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014746 auto resources = mImpl->resources();
14747 auto pool = mImpl->pool();
14748 VkPhysicalDevice local_physicalDevice;
14749 local_physicalDevice = physicalDevice;
14750 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014751 countingStream->rewind();
14752 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014753 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014754 marshal_VkDeviceGeneratedCommandsFeaturesNVX(countingStream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures));
14755 marshal_VkDeviceGeneratedCommandsLimitsNVX(countingStream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits));
14756 }
14757 uint32_t packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14758 countingStream->rewind();
14759 uint32_t opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = OP_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX;
14760 stream->write(&opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t));
14761 stream->write(&packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014762 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014763 marshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures));
14764 marshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits));
14765 unmarshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures));
14766 unmarshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014767 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014768}
14769
14770#endif
14771#ifdef VK_NV_clip_space_w_scaling
14772void VkEncoder::vkCmdSetViewportWScalingNV(
14773 VkCommandBuffer commandBuffer,
14774 uint32_t firstViewport,
14775 uint32_t viewportCount,
14776 const VkViewportWScalingNV* pViewportWScalings)
14777{
14778 auto stream = mImpl->stream();
14779 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014780 auto resources = mImpl->resources();
14781 auto pool = mImpl->pool();
14782 VkCommandBuffer local_commandBuffer;
14783 local_commandBuffer = commandBuffer;
14784 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
14785 uint32_t local_firstViewport;
14786 local_firstViewport = firstViewport;
14787 uint32_t local_viewportCount;
14788 local_viewportCount = viewportCount;
14789 VkViewportWScalingNV* local_pViewportWScalings;
14790 local_pViewportWScalings = nullptr;
14791 if (pViewportWScalings)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014792 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014793 local_pViewportWScalings = (VkViewportWScalingNV*)pool->alloc(((viewportCount)) * sizeof(const VkViewportWScalingNV));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014794 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
14795 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014796 deepcopy_VkViewportWScalingNV(pool, pViewportWScalings + i, (VkViewportWScalingNV*)(local_pViewportWScalings + i));
14797 }
14798 }
14799 if (local_pViewportWScalings)
14800 {
14801 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
14802 {
14803 handlemap_VkViewportWScalingNV(resources->unwrapMapping(), (VkViewportWScalingNV*)(local_pViewportWScalings + i));
14804 }
14805 }
14806 countingStream->rewind();
14807 {
14808 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
14809 countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
14810 countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
14811 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
14812 {
14813 marshal_VkViewportWScalingNV(countingStream, (VkViewportWScalingNV*)(local_pViewportWScalings + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014814 }
14815 }
14816 uint32_t packetSize_vkCmdSetViewportWScalingNV = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14817 countingStream->rewind();
14818 uint32_t opcode_vkCmdSetViewportWScalingNV = OP_vkCmdSetViewportWScalingNV;
14819 stream->write(&opcode_vkCmdSetViewportWScalingNV, sizeof(uint32_t));
14820 stream->write(&packetSize_vkCmdSetViewportWScalingNV, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014821 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
14822 stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t));
14823 stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014824 for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i)
14825 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014826 marshal_VkViewportWScalingNV(stream, (VkViewportWScalingNV*)(local_pViewportWScalings + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014827 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014828 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014829}
14830
14831#endif
14832#ifdef VK_EXT_direct_mode_display
14833VkResult VkEncoder::vkReleaseDisplayEXT(
14834 VkPhysicalDevice physicalDevice,
14835 VkDisplayKHR display)
14836{
14837 auto stream = mImpl->stream();
14838 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014839 auto resources = mImpl->resources();
14840 auto pool = mImpl->pool();
14841 VkPhysicalDevice local_physicalDevice;
14842 local_physicalDevice = physicalDevice;
14843 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
14844 VkDisplayKHR local_display;
14845 local_display = display;
14846 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014847 countingStream->rewind();
14848 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014849 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
14850 countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014851 }
14852 uint32_t packetSize_vkReleaseDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14853 countingStream->rewind();
14854 uint32_t opcode_vkReleaseDisplayEXT = OP_vkReleaseDisplayEXT;
14855 stream->write(&opcode_vkReleaseDisplayEXT, sizeof(uint32_t));
14856 stream->write(&packetSize_vkReleaseDisplayEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014857 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
14858 stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
14859 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014860 VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0;
14861 stream->read(&vkReleaseDisplayEXT_VkResult_return, sizeof(VkResult));
14862 return vkReleaseDisplayEXT_VkResult_return;
14863}
14864
14865#endif
14866#ifdef VK_EXT_acquire_xlib_display
14867VkResult VkEncoder::vkAcquireXlibDisplayEXT(
14868 VkPhysicalDevice physicalDevice,
14869 Display* dpy,
14870 VkDisplayKHR display)
14871{
14872 auto stream = mImpl->stream();
14873 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014874 auto resources = mImpl->resources();
14875 auto pool = mImpl->pool();
14876 VkPhysicalDevice local_physicalDevice;
14877 local_physicalDevice = physicalDevice;
14878 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
14879 VkDisplayKHR local_display;
14880 local_display = display;
14881 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014882 countingStream->rewind();
14883 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014884 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014885 countingStream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014886 countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014887 }
14888 uint32_t packetSize_vkAcquireXlibDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14889 countingStream->rewind();
14890 uint32_t opcode_vkAcquireXlibDisplayEXT = OP_vkAcquireXlibDisplayEXT;
14891 stream->write(&opcode_vkAcquireXlibDisplayEXT, sizeof(uint32_t));
14892 stream->write(&packetSize_vkAcquireXlibDisplayEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014893 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014894 stream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014895 stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014896 stream->read((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014897 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014898 VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0;
14899 stream->read(&vkAcquireXlibDisplayEXT_VkResult_return, sizeof(VkResult));
14900 return vkAcquireXlibDisplayEXT_VkResult_return;
14901}
14902
14903VkResult VkEncoder::vkGetRandROutputDisplayEXT(
14904 VkPhysicalDevice physicalDevice,
14905 Display* dpy,
14906 RROutput rrOutput,
14907 VkDisplayKHR* pDisplay)
14908{
14909 auto stream = mImpl->stream();
14910 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014911 auto resources = mImpl->resources();
14912 auto pool = mImpl->pool();
14913 VkPhysicalDevice local_physicalDevice;
14914 local_physicalDevice = physicalDevice;
14915 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
14916 RROutput local_rrOutput;
14917 local_rrOutput = rrOutput;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014918 countingStream->rewind();
14919 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014920 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014921 countingStream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014922 countingStream->write((RROutput*)&local_rrOutput, sizeof(RROutput));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014923 countingStream->write((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR));
14924 }
14925 uint32_t packetSize_vkGetRandROutputDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14926 countingStream->rewind();
14927 uint32_t opcode_vkGetRandROutputDisplayEXT = OP_vkGetRandROutputDisplayEXT;
14928 stream->write(&opcode_vkGetRandROutputDisplayEXT, sizeof(uint32_t));
14929 stream->write(&packetSize_vkGetRandROutputDisplayEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014930 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014931 stream->write((Display*)dpy, sizeof(Display));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014932 stream->write((RROutput*)&local_rrOutput, sizeof(RROutput));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014933 stream->write((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR));
14934 stream->read((Display*)dpy, sizeof(Display));
14935 stream->read((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014936 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014937 VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0;
14938 stream->read(&vkGetRandROutputDisplayEXT_VkResult_return, sizeof(VkResult));
14939 return vkGetRandROutputDisplayEXT_VkResult_return;
14940}
14941
14942#endif
14943#ifdef VK_EXT_display_surface_counter
14944VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2EXT(
14945 VkPhysicalDevice physicalDevice,
14946 VkSurfaceKHR surface,
14947 VkSurfaceCapabilities2EXT* pSurfaceCapabilities)
14948{
14949 auto stream = mImpl->stream();
14950 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014951 auto resources = mImpl->resources();
14952 auto pool = mImpl->pool();
14953 VkPhysicalDevice local_physicalDevice;
14954 local_physicalDevice = physicalDevice;
14955 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
14956 VkSurfaceKHR local_surface;
14957 local_surface = surface;
14958 resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014959 countingStream->rewind();
14960 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014961 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
14962 countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014963 marshal_VkSurfaceCapabilities2EXT(countingStream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
14964 }
14965 uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
14966 countingStream->rewind();
14967 uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT = OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT;
14968 stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t));
14969 stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014970 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
14971 stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014972 marshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
14973 unmarshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014974 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070014975 VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0;
14976 stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return, sizeof(VkResult));
14977 return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return;
14978}
14979
14980#endif
14981#ifdef VK_EXT_display_control
14982VkResult VkEncoder::vkDisplayPowerControlEXT(
14983 VkDevice device,
14984 VkDisplayKHR display,
14985 const VkDisplayPowerInfoEXT* pDisplayPowerInfo)
14986{
14987 auto stream = mImpl->stream();
14988 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080014989 auto resources = mImpl->resources();
14990 auto pool = mImpl->pool();
14991 VkDevice local_device;
14992 local_device = device;
14993 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
14994 VkDisplayKHR local_display;
14995 local_display = display;
14996 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
14997 VkDisplayPowerInfoEXT* local_pDisplayPowerInfo;
14998 local_pDisplayPowerInfo = nullptr;
14999 if (pDisplayPowerInfo)
15000 {
15001 local_pDisplayPowerInfo = (VkDisplayPowerInfoEXT*)pool->alloc(sizeof(const VkDisplayPowerInfoEXT));
15002 deepcopy_VkDisplayPowerInfoEXT(pool, pDisplayPowerInfo, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
15003 }
15004 if (local_pDisplayPowerInfo)
15005 {
15006 handlemap_VkDisplayPowerInfoEXT(resources->unwrapMapping(), (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
15007 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015008 countingStream->rewind();
15009 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015010 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
15011 countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
15012 marshal_VkDisplayPowerInfoEXT(countingStream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015013 }
15014 uint32_t packetSize_vkDisplayPowerControlEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15015 countingStream->rewind();
15016 uint32_t opcode_vkDisplayPowerControlEXT = OP_vkDisplayPowerControlEXT;
15017 stream->write(&opcode_vkDisplayPowerControlEXT, sizeof(uint32_t));
15018 stream->write(&packetSize_vkDisplayPowerControlEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015019 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
15020 stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
15021 marshal_VkDisplayPowerInfoEXT(stream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo));
15022 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015023 VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0;
15024 stream->read(&vkDisplayPowerControlEXT_VkResult_return, sizeof(VkResult));
15025 return vkDisplayPowerControlEXT_VkResult_return;
15026}
15027
15028VkResult VkEncoder::vkRegisterDeviceEventEXT(
15029 VkDevice device,
15030 const VkDeviceEventInfoEXT* pDeviceEventInfo,
15031 const VkAllocationCallbacks* pAllocator,
15032 VkFence* pFence)
15033{
15034 auto stream = mImpl->stream();
15035 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015036 auto resources = mImpl->resources();
15037 auto pool = mImpl->pool();
15038 VkDevice local_device;
15039 local_device = device;
15040 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15041 VkDeviceEventInfoEXT* local_pDeviceEventInfo;
15042 local_pDeviceEventInfo = nullptr;
15043 if (pDeviceEventInfo)
15044 {
15045 local_pDeviceEventInfo = (VkDeviceEventInfoEXT*)pool->alloc(sizeof(const VkDeviceEventInfoEXT));
15046 deepcopy_VkDeviceEventInfoEXT(pool, pDeviceEventInfo, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
15047 }
15048 if (local_pDeviceEventInfo)
15049 {
15050 handlemap_VkDeviceEventInfoEXT(resources->unwrapMapping(), (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
15051 }
15052 VkAllocationCallbacks* local_pAllocator;
15053 local_pAllocator = nullptr;
15054 if (pAllocator)
15055 {
15056 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
15057 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
15058 }
15059 if (local_pAllocator)
15060 {
15061 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
15062 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015063 countingStream->rewind();
15064 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015065 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
15066 marshal_VkDeviceEventInfoEXT(countingStream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
15067 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15068 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015069 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015070 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015071 }
15072 countingStream->write((VkFence*)pFence, sizeof(VkFence));
15073 }
15074 uint32_t packetSize_vkRegisterDeviceEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15075 countingStream->rewind();
15076 uint32_t opcode_vkRegisterDeviceEventEXT = OP_vkRegisterDeviceEventEXT;
15077 stream->write(&opcode_vkRegisterDeviceEventEXT, sizeof(uint32_t));
15078 stream->write(&packetSize_vkRegisterDeviceEventEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015079 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
15080 marshal_VkDeviceEventInfoEXT(stream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo));
15081 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15082 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015083 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015084 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015085 }
15086 stream->write((VkFence*)pFence, sizeof(VkFence));
15087 stream->read((VkFence*)pFence, sizeof(VkFence));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015088 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015089 VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0;
15090 stream->read(&vkRegisterDeviceEventEXT_VkResult_return, sizeof(VkResult));
15091 return vkRegisterDeviceEventEXT_VkResult_return;
15092}
15093
15094VkResult VkEncoder::vkRegisterDisplayEventEXT(
15095 VkDevice device,
15096 VkDisplayKHR display,
15097 const VkDisplayEventInfoEXT* pDisplayEventInfo,
15098 const VkAllocationCallbacks* pAllocator,
15099 VkFence* pFence)
15100{
15101 auto stream = mImpl->stream();
15102 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015103 auto resources = mImpl->resources();
15104 auto pool = mImpl->pool();
15105 VkDevice local_device;
15106 local_device = device;
15107 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15108 VkDisplayKHR local_display;
15109 local_display = display;
15110 resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display);
15111 VkDisplayEventInfoEXT* local_pDisplayEventInfo;
15112 local_pDisplayEventInfo = nullptr;
15113 if (pDisplayEventInfo)
15114 {
15115 local_pDisplayEventInfo = (VkDisplayEventInfoEXT*)pool->alloc(sizeof(const VkDisplayEventInfoEXT));
15116 deepcopy_VkDisplayEventInfoEXT(pool, pDisplayEventInfo, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
15117 }
15118 if (local_pDisplayEventInfo)
15119 {
15120 handlemap_VkDisplayEventInfoEXT(resources->unwrapMapping(), (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
15121 }
15122 VkAllocationCallbacks* local_pAllocator;
15123 local_pAllocator = nullptr;
15124 if (pAllocator)
15125 {
15126 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
15127 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
15128 }
15129 if (local_pAllocator)
15130 {
15131 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
15132 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015133 countingStream->rewind();
15134 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015135 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
15136 countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
15137 marshal_VkDisplayEventInfoEXT(countingStream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
15138 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15139 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015140 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015141 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015142 }
15143 countingStream->write((VkFence*)pFence, sizeof(VkFence));
15144 }
15145 uint32_t packetSize_vkRegisterDisplayEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15146 countingStream->rewind();
15147 uint32_t opcode_vkRegisterDisplayEventEXT = OP_vkRegisterDisplayEventEXT;
15148 stream->write(&opcode_vkRegisterDisplayEventEXT, sizeof(uint32_t));
15149 stream->write(&packetSize_vkRegisterDisplayEventEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015150 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
15151 stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR));
15152 marshal_VkDisplayEventInfoEXT(stream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo));
15153 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15154 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015155 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015156 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015157 }
15158 stream->write((VkFence*)pFence, sizeof(VkFence));
15159 stream->read((VkFence*)pFence, sizeof(VkFence));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015160 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015161 VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0;
15162 stream->read(&vkRegisterDisplayEventEXT_VkResult_return, sizeof(VkResult));
15163 return vkRegisterDisplayEventEXT_VkResult_return;
15164}
15165
15166VkResult VkEncoder::vkGetSwapchainCounterEXT(
15167 VkDevice device,
15168 VkSwapchainKHR swapchain,
15169 VkSurfaceCounterFlagBitsEXT counter,
15170 uint64_t* pCounterValue)
15171{
15172 auto stream = mImpl->stream();
15173 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015174 auto resources = mImpl->resources();
15175 auto pool = mImpl->pool();
15176 VkDevice local_device;
15177 local_device = device;
15178 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15179 VkSwapchainKHR local_swapchain;
15180 local_swapchain = swapchain;
15181 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
15182 VkSurfaceCounterFlagBitsEXT local_counter;
15183 local_counter = counter;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015184 countingStream->rewind();
15185 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015186 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
15187 countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
15188 countingStream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015189 countingStream->write((uint64_t*)pCounterValue, sizeof(uint64_t));
15190 }
15191 uint32_t packetSize_vkGetSwapchainCounterEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15192 countingStream->rewind();
15193 uint32_t opcode_vkGetSwapchainCounterEXT = OP_vkGetSwapchainCounterEXT;
15194 stream->write(&opcode_vkGetSwapchainCounterEXT, sizeof(uint32_t));
15195 stream->write(&packetSize_vkGetSwapchainCounterEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015196 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
15197 stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
15198 stream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015199 stream->write((uint64_t*)pCounterValue, sizeof(uint64_t));
15200 stream->read((uint64_t*)pCounterValue, sizeof(uint64_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015201 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015202 VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0;
15203 stream->read(&vkGetSwapchainCounterEXT_VkResult_return, sizeof(VkResult));
15204 return vkGetSwapchainCounterEXT_VkResult_return;
15205}
15206
15207#endif
15208#ifdef VK_GOOGLE_display_timing
15209VkResult VkEncoder::vkGetRefreshCycleDurationGOOGLE(
15210 VkDevice device,
15211 VkSwapchainKHR swapchain,
15212 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties)
15213{
15214 auto stream = mImpl->stream();
15215 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015216 auto resources = mImpl->resources();
15217 auto pool = mImpl->pool();
15218 VkDevice local_device;
15219 local_device = device;
15220 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15221 VkSwapchainKHR local_swapchain;
15222 local_swapchain = swapchain;
15223 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015224 countingStream->rewind();
15225 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015226 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
15227 countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015228 marshal_VkRefreshCycleDurationGOOGLE(countingStream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
15229 }
15230 uint32_t packetSize_vkGetRefreshCycleDurationGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15231 countingStream->rewind();
15232 uint32_t opcode_vkGetRefreshCycleDurationGOOGLE = OP_vkGetRefreshCycleDurationGOOGLE;
15233 stream->write(&opcode_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t));
15234 stream->write(&packetSize_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015235 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
15236 stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015237 marshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
15238 unmarshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015239 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015240 VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0;
15241 stream->read(&vkGetRefreshCycleDurationGOOGLE_VkResult_return, sizeof(VkResult));
15242 return vkGetRefreshCycleDurationGOOGLE_VkResult_return;
15243}
15244
15245VkResult VkEncoder::vkGetPastPresentationTimingGOOGLE(
15246 VkDevice device,
15247 VkSwapchainKHR swapchain,
15248 uint32_t* pPresentationTimingCount,
15249 VkPastPresentationTimingGOOGLE* pPresentationTimings)
15250{
15251 auto stream = mImpl->stream();
15252 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015253 auto resources = mImpl->resources();
15254 auto pool = mImpl->pool();
15255 VkDevice local_device;
15256 local_device = device;
15257 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15258 VkSwapchainKHR local_swapchain;
15259 local_swapchain = swapchain;
15260 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015261 countingStream->rewind();
15262 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015263 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
15264 countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015265 countingStream->write((uint32_t**)&pPresentationTimingCount, sizeof(uint32_t*));
15266 if (pPresentationTimingCount)
15267 {
15268 countingStream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t));
15269 }
15270 countingStream->write((VkPastPresentationTimingGOOGLE**)&pPresentationTimings, sizeof(VkPastPresentationTimingGOOGLE*));
15271 if (pPresentationTimings)
15272 {
15273 for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i)
15274 {
15275 marshal_VkPastPresentationTimingGOOGLE(countingStream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i));
15276 }
15277 }
15278 }
15279 uint32_t packetSize_vkGetPastPresentationTimingGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15280 countingStream->rewind();
15281 uint32_t opcode_vkGetPastPresentationTimingGOOGLE = OP_vkGetPastPresentationTimingGOOGLE;
15282 stream->write(&opcode_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t));
15283 stream->write(&packetSize_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015284 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
15285 stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015286 stream->write((uint32_t**)&pPresentationTimingCount, sizeof(uint32_t*));
15287 if (pPresentationTimingCount)
15288 {
15289 stream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t));
15290 }
15291 stream->write((VkPastPresentationTimingGOOGLE**)&pPresentationTimings, sizeof(VkPastPresentationTimingGOOGLE*));
15292 if (pPresentationTimings)
15293 {
15294 for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i)
15295 {
15296 marshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i));
15297 }
15298 }
15299 uint32_t* check_pPresentationTimingCount;
15300 stream->read((uint32_t**)&check_pPresentationTimingCount, sizeof(uint32_t*));
15301 if (pPresentationTimingCount)
15302 {
15303 if (!(check_pPresentationTimingCount))
15304 {
15305 fprintf(stderr, "fatal: pPresentationTimingCount inconsistent between guest and host\n");
15306 }
15307 stream->read((uint32_t*)pPresentationTimingCount, sizeof(uint32_t));
15308 }
15309 VkPastPresentationTimingGOOGLE* check_pPresentationTimings;
15310 stream->read((VkPastPresentationTimingGOOGLE**)&check_pPresentationTimings, sizeof(VkPastPresentationTimingGOOGLE*));
15311 if (pPresentationTimings)
15312 {
15313 if (!(check_pPresentationTimings))
15314 {
15315 fprintf(stderr, "fatal: pPresentationTimings inconsistent between guest and host\n");
15316 }
15317 for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i)
15318 {
15319 unmarshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i));
15320 }
15321 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015322 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015323 VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0;
15324 stream->read(&vkGetPastPresentationTimingGOOGLE_VkResult_return, sizeof(VkResult));
15325 return vkGetPastPresentationTimingGOOGLE_VkResult_return;
15326}
15327
15328#endif
15329#ifdef VK_NV_sample_mask_override_coverage
15330#endif
15331#ifdef VK_NV_geometry_shader_passthrough
15332#endif
15333#ifdef VK_NV_viewport_array2
15334#endif
15335#ifdef VK_NVX_multiview_per_view_attributes
15336#endif
15337#ifdef VK_NV_viewport_swizzle
15338#endif
15339#ifdef VK_EXT_discard_rectangles
15340void VkEncoder::vkCmdSetDiscardRectangleEXT(
15341 VkCommandBuffer commandBuffer,
15342 uint32_t firstDiscardRectangle,
15343 uint32_t discardRectangleCount,
15344 const VkRect2D* pDiscardRectangles)
15345{
15346 auto stream = mImpl->stream();
15347 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015348 auto resources = mImpl->resources();
15349 auto pool = mImpl->pool();
15350 VkCommandBuffer local_commandBuffer;
15351 local_commandBuffer = commandBuffer;
15352 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
15353 uint32_t local_firstDiscardRectangle;
15354 local_firstDiscardRectangle = firstDiscardRectangle;
15355 uint32_t local_discardRectangleCount;
15356 local_discardRectangleCount = discardRectangleCount;
15357 VkRect2D* local_pDiscardRectangles;
15358 local_pDiscardRectangles = nullptr;
15359 if (pDiscardRectangles)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015360 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015361 local_pDiscardRectangles = (VkRect2D*)pool->alloc(((discardRectangleCount)) * sizeof(const VkRect2D));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015362 for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i)
15363 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015364 deepcopy_VkRect2D(pool, pDiscardRectangles + i, (VkRect2D*)(local_pDiscardRectangles + i));
15365 }
15366 }
15367 if (local_pDiscardRectangles)
15368 {
15369 for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i)
15370 {
15371 handlemap_VkRect2D(resources->unwrapMapping(), (VkRect2D*)(local_pDiscardRectangles + i));
15372 }
15373 }
15374 countingStream->rewind();
15375 {
15376 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
15377 countingStream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t));
15378 countingStream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t));
15379 for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i)
15380 {
15381 marshal_VkRect2D(countingStream, (VkRect2D*)(local_pDiscardRectangles + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015382 }
15383 }
15384 uint32_t packetSize_vkCmdSetDiscardRectangleEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15385 countingStream->rewind();
15386 uint32_t opcode_vkCmdSetDiscardRectangleEXT = OP_vkCmdSetDiscardRectangleEXT;
15387 stream->write(&opcode_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t));
15388 stream->write(&packetSize_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015389 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
15390 stream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t));
15391 stream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015392 for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i)
15393 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015394 marshal_VkRect2D(stream, (VkRect2D*)(local_pDiscardRectangles + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015395 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015396 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015397}
15398
15399#endif
15400#ifdef VK_EXT_conservative_rasterization
15401#endif
15402#ifdef VK_EXT_swapchain_colorspace
15403#endif
15404#ifdef VK_EXT_hdr_metadata
15405void VkEncoder::vkSetHdrMetadataEXT(
15406 VkDevice device,
15407 uint32_t swapchainCount,
15408 const VkSwapchainKHR* pSwapchains,
15409 const VkHdrMetadataEXT* pMetadata)
15410{
15411 auto stream = mImpl->stream();
15412 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015413 auto resources = mImpl->resources();
15414 auto pool = mImpl->pool();
15415 VkDevice local_device;
15416 local_device = device;
15417 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15418 uint32_t local_swapchainCount;
15419 local_swapchainCount = swapchainCount;
15420 VkSwapchainKHR* local_pSwapchains;
15421 local_pSwapchains = nullptr;
15422 if (pSwapchains)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015423 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015424 local_pSwapchains = (VkSwapchainKHR*)pool->dupArray(pSwapchains, ((swapchainCount)) * sizeof(const VkSwapchainKHR));
15425 }
15426 if (local_pSwapchains)
15427 {
15428 resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount)));
15429 }
15430 VkHdrMetadataEXT* local_pMetadata;
15431 local_pMetadata = nullptr;
15432 if (pMetadata)
15433 {
15434 local_pMetadata = (VkHdrMetadataEXT*)pool->alloc(((swapchainCount)) * sizeof(const VkHdrMetadataEXT));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015435 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
15436 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015437 deepcopy_VkHdrMetadataEXT(pool, pMetadata + i, (VkHdrMetadataEXT*)(local_pMetadata + i));
15438 }
15439 }
15440 if (local_pMetadata)
15441 {
15442 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
15443 {
15444 handlemap_VkHdrMetadataEXT(resources->unwrapMapping(), (VkHdrMetadataEXT*)(local_pMetadata + i));
15445 }
15446 }
15447 countingStream->rewind();
15448 {
15449 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
15450 countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
15451 countingStream->write((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
15452 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
15453 {
15454 marshal_VkHdrMetadataEXT(countingStream, (VkHdrMetadataEXT*)(local_pMetadata + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015455 }
15456 }
15457 uint32_t packetSize_vkSetHdrMetadataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15458 countingStream->rewind();
15459 uint32_t opcode_vkSetHdrMetadataEXT = OP_vkSetHdrMetadataEXT;
15460 stream->write(&opcode_vkSetHdrMetadataEXT, sizeof(uint32_t));
15461 stream->write(&packetSize_vkSetHdrMetadataEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015462 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
15463 stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t));
15464 stream->write((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015465 for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i)
15466 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015467 marshal_VkHdrMetadataEXT(stream, (VkHdrMetadataEXT*)(local_pMetadata + i));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015468 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015469 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015470}
15471
15472#endif
15473#ifdef VK_MVK_ios_surface
15474VkResult VkEncoder::vkCreateIOSSurfaceMVK(
15475 VkInstance instance,
15476 const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
15477 const VkAllocationCallbacks* pAllocator,
15478 VkSurfaceKHR* pSurface)
15479{
15480 auto stream = mImpl->stream();
15481 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015482 auto resources = mImpl->resources();
15483 auto pool = mImpl->pool();
15484 VkInstance local_instance;
15485 local_instance = instance;
15486 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
15487 VkIOSSurfaceCreateInfoMVK* local_pCreateInfo;
15488 local_pCreateInfo = nullptr;
15489 if (pCreateInfo)
15490 {
15491 local_pCreateInfo = (VkIOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkIOSSurfaceCreateInfoMVK));
15492 deepcopy_VkIOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
15493 }
15494 if (local_pCreateInfo)
15495 {
15496 handlemap_VkIOSSurfaceCreateInfoMVK(resources->unwrapMapping(), (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
15497 }
15498 VkAllocationCallbacks* local_pAllocator;
15499 local_pAllocator = nullptr;
15500 if (pAllocator)
15501 {
15502 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
15503 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
15504 }
15505 if (local_pAllocator)
15506 {
15507 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
15508 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015509 countingStream->rewind();
15510 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015511 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
15512 marshal_VkIOSSurfaceCreateInfoMVK(countingStream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
15513 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15514 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015515 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015516 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015517 }
15518 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
15519 }
15520 uint32_t packetSize_vkCreateIOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15521 countingStream->rewind();
15522 uint32_t opcode_vkCreateIOSSurfaceMVK = OP_vkCreateIOSSurfaceMVK;
15523 stream->write(&opcode_vkCreateIOSSurfaceMVK, sizeof(uint32_t));
15524 stream->write(&packetSize_vkCreateIOSSurfaceMVK, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015525 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
15526 marshal_VkIOSSurfaceCreateInfoMVK(stream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
15527 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15528 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015529 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015530 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015531 }
15532 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
15533 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015534 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015535 VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0;
15536 stream->read(&vkCreateIOSSurfaceMVK_VkResult_return, sizeof(VkResult));
15537 return vkCreateIOSSurfaceMVK_VkResult_return;
15538}
15539
15540#endif
15541#ifdef VK_MVK_macos_surface
15542VkResult VkEncoder::vkCreateMacOSSurfaceMVK(
15543 VkInstance instance,
15544 const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
15545 const VkAllocationCallbacks* pAllocator,
15546 VkSurfaceKHR* pSurface)
15547{
15548 auto stream = mImpl->stream();
15549 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015550 auto resources = mImpl->resources();
15551 auto pool = mImpl->pool();
15552 VkInstance local_instance;
15553 local_instance = instance;
15554 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
15555 VkMacOSSurfaceCreateInfoMVK* local_pCreateInfo;
15556 local_pCreateInfo = nullptr;
15557 if (pCreateInfo)
15558 {
15559 local_pCreateInfo = (VkMacOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkMacOSSurfaceCreateInfoMVK));
15560 deepcopy_VkMacOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
15561 }
15562 if (local_pCreateInfo)
15563 {
15564 handlemap_VkMacOSSurfaceCreateInfoMVK(resources->unwrapMapping(), (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
15565 }
15566 VkAllocationCallbacks* local_pAllocator;
15567 local_pAllocator = nullptr;
15568 if (pAllocator)
15569 {
15570 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
15571 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
15572 }
15573 if (local_pAllocator)
15574 {
15575 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
15576 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015577 countingStream->rewind();
15578 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015579 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
15580 marshal_VkMacOSSurfaceCreateInfoMVK(countingStream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
15581 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15582 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015583 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015584 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015585 }
15586 countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
15587 }
15588 uint32_t packetSize_vkCreateMacOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15589 countingStream->rewind();
15590 uint32_t opcode_vkCreateMacOSSurfaceMVK = OP_vkCreateMacOSSurfaceMVK;
15591 stream->write(&opcode_vkCreateMacOSSurfaceMVK, sizeof(uint32_t));
15592 stream->write(&packetSize_vkCreateMacOSSurfaceMVK, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015593 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
15594 marshal_VkMacOSSurfaceCreateInfoMVK(stream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo));
15595 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15596 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015597 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015598 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015599 }
15600 stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
15601 stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015602 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015603 VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0;
15604 stream->read(&vkCreateMacOSSurfaceMVK_VkResult_return, sizeof(VkResult));
15605 return vkCreateMacOSSurfaceMVK_VkResult_return;
15606}
15607
15608#endif
15609#ifdef VK_EXT_external_memory_dma_buf
15610#endif
15611#ifdef VK_EXT_queue_family_foreign
15612#endif
15613#ifdef VK_EXT_debug_utils
15614VkResult VkEncoder::vkSetDebugUtilsObjectNameEXT(
15615 VkDevice device,
15616 const VkDebugUtilsObjectNameInfoEXT* pNameInfo)
15617{
15618 auto stream = mImpl->stream();
15619 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015620 auto resources = mImpl->resources();
15621 auto pool = mImpl->pool();
15622 VkDevice local_device;
15623 local_device = device;
15624 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15625 VkDebugUtilsObjectNameInfoEXT* local_pNameInfo;
15626 local_pNameInfo = nullptr;
15627 if (pNameInfo)
15628 {
15629 local_pNameInfo = (VkDebugUtilsObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectNameInfoEXT));
15630 deepcopy_VkDebugUtilsObjectNameInfoEXT(pool, pNameInfo, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
15631 }
15632 if (local_pNameInfo)
15633 {
15634 handlemap_VkDebugUtilsObjectNameInfoEXT(resources->unwrapMapping(), (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
15635 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015636 countingStream->rewind();
15637 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015638 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
15639 marshal_VkDebugUtilsObjectNameInfoEXT(countingStream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015640 }
15641 uint32_t packetSize_vkSetDebugUtilsObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15642 countingStream->rewind();
15643 uint32_t opcode_vkSetDebugUtilsObjectNameEXT = OP_vkSetDebugUtilsObjectNameEXT;
15644 stream->write(&opcode_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t));
15645 stream->write(&packetSize_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015646 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
15647 marshal_VkDebugUtilsObjectNameInfoEXT(stream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo));
15648 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015649 VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0;
15650 stream->read(&vkSetDebugUtilsObjectNameEXT_VkResult_return, sizeof(VkResult));
15651 return vkSetDebugUtilsObjectNameEXT_VkResult_return;
15652}
15653
15654VkResult VkEncoder::vkSetDebugUtilsObjectTagEXT(
15655 VkDevice device,
15656 const VkDebugUtilsObjectTagInfoEXT* pTagInfo)
15657{
15658 auto stream = mImpl->stream();
15659 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015660 auto resources = mImpl->resources();
15661 auto pool = mImpl->pool();
15662 VkDevice local_device;
15663 local_device = device;
15664 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
15665 VkDebugUtilsObjectTagInfoEXT* local_pTagInfo;
15666 local_pTagInfo = nullptr;
15667 if (pTagInfo)
15668 {
15669 local_pTagInfo = (VkDebugUtilsObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectTagInfoEXT));
15670 deepcopy_VkDebugUtilsObjectTagInfoEXT(pool, pTagInfo, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
15671 }
15672 if (local_pTagInfo)
15673 {
15674 handlemap_VkDebugUtilsObjectTagInfoEXT(resources->unwrapMapping(), (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
15675 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015676 countingStream->rewind();
15677 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015678 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
15679 marshal_VkDebugUtilsObjectTagInfoEXT(countingStream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015680 }
15681 uint32_t packetSize_vkSetDebugUtilsObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15682 countingStream->rewind();
15683 uint32_t opcode_vkSetDebugUtilsObjectTagEXT = OP_vkSetDebugUtilsObjectTagEXT;
15684 stream->write(&opcode_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t));
15685 stream->write(&packetSize_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015686 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
15687 marshal_VkDebugUtilsObjectTagInfoEXT(stream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo));
15688 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015689 VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0;
15690 stream->read(&vkSetDebugUtilsObjectTagEXT_VkResult_return, sizeof(VkResult));
15691 return vkSetDebugUtilsObjectTagEXT_VkResult_return;
15692}
15693
15694void VkEncoder::vkQueueBeginDebugUtilsLabelEXT(
15695 VkQueue queue,
15696 const VkDebugUtilsLabelEXT* pLabelInfo)
15697{
15698 auto stream = mImpl->stream();
15699 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015700 auto resources = mImpl->resources();
15701 auto pool = mImpl->pool();
15702 VkQueue local_queue;
15703 local_queue = queue;
15704 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
15705 VkDebugUtilsLabelEXT* local_pLabelInfo;
15706 local_pLabelInfo = nullptr;
15707 if (pLabelInfo)
15708 {
15709 local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
15710 deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15711 }
15712 if (local_pLabelInfo)
15713 {
15714 handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15715 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015716 countingStream->rewind();
15717 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015718 countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue));
15719 marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015720 }
15721 uint32_t packetSize_vkQueueBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15722 countingStream->rewind();
15723 uint32_t opcode_vkQueueBeginDebugUtilsLabelEXT = OP_vkQueueBeginDebugUtilsLabelEXT;
15724 stream->write(&opcode_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t));
15725 stream->write(&packetSize_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015726 stream->write((VkQueue*)&local_queue, sizeof(VkQueue));
15727 marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15728 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015729}
15730
15731void VkEncoder::vkQueueEndDebugUtilsLabelEXT(
15732 VkQueue queue)
15733{
15734 auto stream = mImpl->stream();
15735 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015736 auto resources = mImpl->resources();
15737 auto pool = mImpl->pool();
15738 VkQueue local_queue;
15739 local_queue = queue;
15740 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015741 countingStream->rewind();
15742 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015743 countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015744 }
15745 uint32_t packetSize_vkQueueEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15746 countingStream->rewind();
15747 uint32_t opcode_vkQueueEndDebugUtilsLabelEXT = OP_vkQueueEndDebugUtilsLabelEXT;
15748 stream->write(&opcode_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t));
15749 stream->write(&packetSize_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015750 stream->write((VkQueue*)&local_queue, sizeof(VkQueue));
15751 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015752}
15753
15754void VkEncoder::vkQueueInsertDebugUtilsLabelEXT(
15755 VkQueue queue,
15756 const VkDebugUtilsLabelEXT* pLabelInfo)
15757{
15758 auto stream = mImpl->stream();
15759 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015760 auto resources = mImpl->resources();
15761 auto pool = mImpl->pool();
15762 VkQueue local_queue;
15763 local_queue = queue;
15764 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
15765 VkDebugUtilsLabelEXT* local_pLabelInfo;
15766 local_pLabelInfo = nullptr;
15767 if (pLabelInfo)
15768 {
15769 local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
15770 deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15771 }
15772 if (local_pLabelInfo)
15773 {
15774 handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15775 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015776 countingStream->rewind();
15777 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015778 countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue));
15779 marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015780 }
15781 uint32_t packetSize_vkQueueInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15782 countingStream->rewind();
15783 uint32_t opcode_vkQueueInsertDebugUtilsLabelEXT = OP_vkQueueInsertDebugUtilsLabelEXT;
15784 stream->write(&opcode_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t));
15785 stream->write(&packetSize_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015786 stream->write((VkQueue*)&local_queue, sizeof(VkQueue));
15787 marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15788 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015789}
15790
15791void VkEncoder::vkCmdBeginDebugUtilsLabelEXT(
15792 VkCommandBuffer commandBuffer,
15793 const VkDebugUtilsLabelEXT* pLabelInfo)
15794{
15795 auto stream = mImpl->stream();
15796 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015797 auto resources = mImpl->resources();
15798 auto pool = mImpl->pool();
15799 VkCommandBuffer local_commandBuffer;
15800 local_commandBuffer = commandBuffer;
15801 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
15802 VkDebugUtilsLabelEXT* local_pLabelInfo;
15803 local_pLabelInfo = nullptr;
15804 if (pLabelInfo)
15805 {
15806 local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
15807 deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15808 }
15809 if (local_pLabelInfo)
15810 {
15811 handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15812 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015813 countingStream->rewind();
15814 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015815 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
15816 marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015817 }
15818 uint32_t packetSize_vkCmdBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15819 countingStream->rewind();
15820 uint32_t opcode_vkCmdBeginDebugUtilsLabelEXT = OP_vkCmdBeginDebugUtilsLabelEXT;
15821 stream->write(&opcode_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t));
15822 stream->write(&packetSize_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015823 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
15824 marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15825 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015826}
15827
15828void VkEncoder::vkCmdEndDebugUtilsLabelEXT(
15829 VkCommandBuffer commandBuffer)
15830{
15831 auto stream = mImpl->stream();
15832 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015833 auto resources = mImpl->resources();
15834 auto pool = mImpl->pool();
15835 VkCommandBuffer local_commandBuffer;
15836 local_commandBuffer = commandBuffer;
15837 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015838 countingStream->rewind();
15839 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015840 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015841 }
15842 uint32_t packetSize_vkCmdEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15843 countingStream->rewind();
15844 uint32_t opcode_vkCmdEndDebugUtilsLabelEXT = OP_vkCmdEndDebugUtilsLabelEXT;
15845 stream->write(&opcode_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t));
15846 stream->write(&packetSize_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015847 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
15848 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015849}
15850
15851void VkEncoder::vkCmdInsertDebugUtilsLabelEXT(
15852 VkCommandBuffer commandBuffer,
15853 const VkDebugUtilsLabelEXT* pLabelInfo)
15854{
15855 auto stream = mImpl->stream();
15856 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015857 auto resources = mImpl->resources();
15858 auto pool = mImpl->pool();
15859 VkCommandBuffer local_commandBuffer;
15860 local_commandBuffer = commandBuffer;
15861 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
15862 VkDebugUtilsLabelEXT* local_pLabelInfo;
15863 local_pLabelInfo = nullptr;
15864 if (pLabelInfo)
15865 {
15866 local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT));
15867 deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15868 }
15869 if (local_pLabelInfo)
15870 {
15871 handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15872 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015873 countingStream->rewind();
15874 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015875 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
15876 marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015877 }
15878 uint32_t packetSize_vkCmdInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15879 countingStream->rewind();
15880 uint32_t opcode_vkCmdInsertDebugUtilsLabelEXT = OP_vkCmdInsertDebugUtilsLabelEXT;
15881 stream->write(&opcode_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t));
15882 stream->write(&packetSize_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015883 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
15884 marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo));
15885 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015886}
15887
15888VkResult VkEncoder::vkCreateDebugUtilsMessengerEXT(
15889 VkInstance instance,
15890 const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo,
15891 const VkAllocationCallbacks* pAllocator,
15892 VkDebugUtilsMessengerEXT* pMessenger)
15893{
15894 auto stream = mImpl->stream();
15895 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015896 auto resources = mImpl->resources();
15897 auto pool = mImpl->pool();
15898 VkInstance local_instance;
15899 local_instance = instance;
15900 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
15901 VkDebugUtilsMessengerCreateInfoEXT* local_pCreateInfo;
15902 local_pCreateInfo = nullptr;
15903 if (pCreateInfo)
15904 {
15905 local_pCreateInfo = (VkDebugUtilsMessengerCreateInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCreateInfoEXT));
15906 deepcopy_VkDebugUtilsMessengerCreateInfoEXT(pool, pCreateInfo, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
15907 }
15908 if (local_pCreateInfo)
15909 {
15910 handlemap_VkDebugUtilsMessengerCreateInfoEXT(resources->unwrapMapping(), (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
15911 }
15912 VkAllocationCallbacks* local_pAllocator;
15913 local_pAllocator = nullptr;
15914 if (pAllocator)
15915 {
15916 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
15917 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
15918 }
15919 if (local_pAllocator)
15920 {
15921 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
15922 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015923 countingStream->rewind();
15924 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015925 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
15926 marshal_VkDebugUtilsMessengerCreateInfoEXT(countingStream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
15927 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15928 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015929 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015930 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015931 }
15932 countingStream->write((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT));
15933 }
15934 uint32_t packetSize_vkCreateDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15935 countingStream->rewind();
15936 uint32_t opcode_vkCreateDebugUtilsMessengerEXT = OP_vkCreateDebugUtilsMessengerEXT;
15937 stream->write(&opcode_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t));
15938 stream->write(&packetSize_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015939 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
15940 marshal_VkDebugUtilsMessengerCreateInfoEXT(stream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo));
15941 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15942 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015943 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015944 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015945 }
15946 stream->write((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT));
15947 stream->read((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015948 if (pMessenger)
15949 {
15950 resources->createMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)pMessenger, 1);
15951 }
15952 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015953 VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0;
15954 stream->read(&vkCreateDebugUtilsMessengerEXT_VkResult_return, sizeof(VkResult));
15955 return vkCreateDebugUtilsMessengerEXT_VkResult_return;
15956}
15957
15958void VkEncoder::vkDestroyDebugUtilsMessengerEXT(
15959 VkInstance instance,
15960 VkDebugUtilsMessengerEXT messenger,
15961 const VkAllocationCallbacks* pAllocator)
15962{
15963 auto stream = mImpl->stream();
15964 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015965 auto resources = mImpl->resources();
15966 auto pool = mImpl->pool();
15967 VkInstance local_instance;
15968 local_instance = instance;
15969 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
15970 VkAllocationCallbacks* local_pAllocator;
15971 local_pAllocator = nullptr;
15972 if (pAllocator)
15973 {
15974 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
15975 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
15976 }
15977 if (local_pAllocator)
15978 {
15979 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
15980 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015981 countingStream->rewind();
15982 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015983 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015984 countingStream->write((VkDebugUtilsMessengerEXT*)&messenger, sizeof(VkDebugUtilsMessengerEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015985 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15986 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015987 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015988 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015989 }
15990 }
15991 uint32_t packetSize_vkDestroyDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
15992 countingStream->rewind();
15993 uint32_t opcode_vkDestroyDebugUtilsMessengerEXT = OP_vkDestroyDebugUtilsMessengerEXT;
15994 stream->write(&opcode_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t));
15995 stream->write(&packetSize_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015996 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070015997 stream->write((VkDebugUtilsMessengerEXT*)&messenger, sizeof(VkDebugUtilsMessengerEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080015998 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
15999 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016000 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016001 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016002 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016003 resources->destroyMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)&messenger);
16004 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016005}
16006
16007void VkEncoder::vkSubmitDebugUtilsMessageEXT(
16008 VkInstance instance,
16009 VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
16010 VkDebugUtilsMessageTypeFlagsEXT messageTypes,
16011 const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData)
16012{
16013 auto stream = mImpl->stream();
16014 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016015 auto resources = mImpl->resources();
16016 auto pool = mImpl->pool();
16017 VkInstance local_instance;
16018 local_instance = instance;
16019 resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance);
16020 VkDebugUtilsMessageSeverityFlagBitsEXT local_messageSeverity;
16021 local_messageSeverity = messageSeverity;
16022 VkDebugUtilsMessageTypeFlagsEXT local_messageTypes;
16023 local_messageTypes = messageTypes;
16024 VkDebugUtilsMessengerCallbackDataEXT* local_pCallbackData;
16025 local_pCallbackData = nullptr;
16026 if (pCallbackData)
16027 {
16028 local_pCallbackData = (VkDebugUtilsMessengerCallbackDataEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCallbackDataEXT));
16029 deepcopy_VkDebugUtilsMessengerCallbackDataEXT(pool, pCallbackData, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
16030 }
16031 if (local_pCallbackData)
16032 {
16033 handlemap_VkDebugUtilsMessengerCallbackDataEXT(resources->unwrapMapping(), (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
16034 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016035 countingStream->rewind();
16036 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016037 countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance));
16038 countingStream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT));
16039 countingStream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT));
16040 marshal_VkDebugUtilsMessengerCallbackDataEXT(countingStream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016041 }
16042 uint32_t packetSize_vkSubmitDebugUtilsMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16043 countingStream->rewind();
16044 uint32_t opcode_vkSubmitDebugUtilsMessageEXT = OP_vkSubmitDebugUtilsMessageEXT;
16045 stream->write(&opcode_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t));
16046 stream->write(&packetSize_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016047 stream->write((VkInstance*)&local_instance, sizeof(VkInstance));
16048 stream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT));
16049 stream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT));
16050 marshal_VkDebugUtilsMessengerCallbackDataEXT(stream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData));
16051 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016052}
16053
16054#endif
16055#ifdef VK_ANDROID_external_memory_android_hardware_buffer
16056VkResult VkEncoder::vkGetAndroidHardwareBufferPropertiesANDROID(
16057 VkDevice device,
16058 const AHardwareBuffer* buffer,
16059 VkAndroidHardwareBufferPropertiesANDROID* pProperties)
16060{
16061 auto stream = mImpl->stream();
16062 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016063 auto resources = mImpl->resources();
16064 auto pool = mImpl->pool();
16065 VkDevice local_device;
16066 local_device = device;
16067 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16068 AHardwareBuffer* local_buffer;
16069 local_buffer = nullptr;
16070 if (buffer)
16071 {
16072 local_buffer = (AHardwareBuffer*)pool->dupArray(buffer, sizeof(const AHardwareBuffer));
16073 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016074 countingStream->rewind();
16075 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016076 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
16077 countingStream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016078 marshal_VkAndroidHardwareBufferPropertiesANDROID(countingStream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
16079 }
16080 uint32_t packetSize_vkGetAndroidHardwareBufferPropertiesANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16081 countingStream->rewind();
16082 uint32_t opcode_vkGetAndroidHardwareBufferPropertiesANDROID = OP_vkGetAndroidHardwareBufferPropertiesANDROID;
16083 stream->write(&opcode_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t));
16084 stream->write(&packetSize_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016085 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
16086 stream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016087 marshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
16088 unmarshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016089 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016090 VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0;
16091 stream->read(&vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return, sizeof(VkResult));
16092 return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return;
16093}
16094
16095VkResult VkEncoder::vkGetMemoryAndroidHardwareBufferANDROID(
16096 VkDevice device,
16097 const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
16098 AHardwareBuffer** pBuffer)
16099{
16100 auto stream = mImpl->stream();
16101 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016102 auto resources = mImpl->resources();
16103 auto pool = mImpl->pool();
16104 VkDevice local_device;
16105 local_device = device;
16106 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16107 VkMemoryGetAndroidHardwareBufferInfoANDROID* local_pInfo;
16108 local_pInfo = nullptr;
16109 if (pInfo)
16110 {
16111 local_pInfo = (VkMemoryGetAndroidHardwareBufferInfoANDROID*)pool->alloc(sizeof(const VkMemoryGetAndroidHardwareBufferInfoANDROID));
16112 deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(pool, pInfo, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
16113 }
16114 if (local_pInfo)
16115 {
16116 handlemap_VkMemoryGetAndroidHardwareBufferInfoANDROID(resources->unwrapMapping(), (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
16117 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016118 countingStream->rewind();
16119 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016120 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
16121 marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(countingStream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016122 countingStream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
16123 }
16124 uint32_t packetSize_vkGetMemoryAndroidHardwareBufferANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16125 countingStream->rewind();
16126 uint32_t opcode_vkGetMemoryAndroidHardwareBufferANDROID = OP_vkGetMemoryAndroidHardwareBufferANDROID;
16127 stream->write(&opcode_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t));
16128 stream->write(&packetSize_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016129 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
16130 marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(stream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016131 stream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
16132 stream->read((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016133 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016134 VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0;
16135 stream->read(&vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return, sizeof(VkResult));
16136 return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return;
16137}
16138
16139#endif
16140#ifdef VK_EXT_sampler_filter_minmax
16141#endif
16142#ifdef VK_AMD_gpu_shader_int16
16143#endif
16144#ifdef VK_AMD_mixed_attachment_samples
16145#endif
16146#ifdef VK_AMD_shader_fragment_mask
16147#endif
16148#ifdef VK_EXT_shader_stencil_export
16149#endif
16150#ifdef VK_EXT_sample_locations
16151void VkEncoder::vkCmdSetSampleLocationsEXT(
16152 VkCommandBuffer commandBuffer,
16153 const VkSampleLocationsInfoEXT* pSampleLocationsInfo)
16154{
16155 auto stream = mImpl->stream();
16156 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016157 auto resources = mImpl->resources();
16158 auto pool = mImpl->pool();
16159 VkCommandBuffer local_commandBuffer;
16160 local_commandBuffer = commandBuffer;
16161 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
16162 VkSampleLocationsInfoEXT* local_pSampleLocationsInfo;
16163 local_pSampleLocationsInfo = nullptr;
16164 if (pSampleLocationsInfo)
16165 {
16166 local_pSampleLocationsInfo = (VkSampleLocationsInfoEXT*)pool->alloc(sizeof(const VkSampleLocationsInfoEXT));
16167 deepcopy_VkSampleLocationsInfoEXT(pool, pSampleLocationsInfo, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
16168 }
16169 if (local_pSampleLocationsInfo)
16170 {
16171 handlemap_VkSampleLocationsInfoEXT(resources->unwrapMapping(), (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
16172 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016173 countingStream->rewind();
16174 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016175 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
16176 marshal_VkSampleLocationsInfoEXT(countingStream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016177 }
16178 uint32_t packetSize_vkCmdSetSampleLocationsEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16179 countingStream->rewind();
16180 uint32_t opcode_vkCmdSetSampleLocationsEXT = OP_vkCmdSetSampleLocationsEXT;
16181 stream->write(&opcode_vkCmdSetSampleLocationsEXT, sizeof(uint32_t));
16182 stream->write(&packetSize_vkCmdSetSampleLocationsEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016183 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
16184 marshal_VkSampleLocationsInfoEXT(stream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo));
16185 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016186}
16187
16188void VkEncoder::vkGetPhysicalDeviceMultisamplePropertiesEXT(
16189 VkPhysicalDevice physicalDevice,
16190 VkSampleCountFlagBits samples,
16191 VkMultisamplePropertiesEXT* pMultisampleProperties)
16192{
16193 auto stream = mImpl->stream();
16194 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016195 auto resources = mImpl->resources();
16196 auto pool = mImpl->pool();
16197 VkPhysicalDevice local_physicalDevice;
16198 local_physicalDevice = physicalDevice;
16199 resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice);
16200 VkSampleCountFlagBits local_samples;
16201 local_samples = samples;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016202 countingStream->rewind();
16203 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016204 countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
16205 countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016206 marshal_VkMultisamplePropertiesEXT(countingStream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
16207 }
16208 uint32_t packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16209 countingStream->rewind();
16210 uint32_t opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT = OP_vkGetPhysicalDeviceMultisamplePropertiesEXT;
16211 stream->write(&opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t));
16212 stream->write(&packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016213 stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice));
16214 stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016215 marshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
16216 unmarshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016217 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016218}
16219
16220#endif
16221#ifdef VK_EXT_blend_operation_advanced
16222#endif
16223#ifdef VK_NV_fragment_coverage_to_color
16224#endif
16225#ifdef VK_NV_framebuffer_mixed_samples
16226#endif
16227#ifdef VK_NV_fill_rectangle
16228#endif
16229#ifdef VK_EXT_post_depth_coverage
16230#endif
16231#ifdef VK_EXT_validation_cache
16232VkResult VkEncoder::vkCreateValidationCacheEXT(
16233 VkDevice device,
16234 const VkValidationCacheCreateInfoEXT* pCreateInfo,
16235 const VkAllocationCallbacks* pAllocator,
16236 VkValidationCacheEXT* pValidationCache)
16237{
16238 auto stream = mImpl->stream();
16239 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016240 auto resources = mImpl->resources();
16241 auto pool = mImpl->pool();
16242 VkDevice local_device;
16243 local_device = device;
16244 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16245 VkValidationCacheCreateInfoEXT* local_pCreateInfo;
16246 local_pCreateInfo = nullptr;
16247 if (pCreateInfo)
16248 {
16249 local_pCreateInfo = (VkValidationCacheCreateInfoEXT*)pool->alloc(sizeof(const VkValidationCacheCreateInfoEXT));
16250 deepcopy_VkValidationCacheCreateInfoEXT(pool, pCreateInfo, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
16251 }
16252 if (local_pCreateInfo)
16253 {
16254 handlemap_VkValidationCacheCreateInfoEXT(resources->unwrapMapping(), (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
16255 }
16256 VkAllocationCallbacks* local_pAllocator;
16257 local_pAllocator = nullptr;
16258 if (pAllocator)
16259 {
16260 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
16261 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
16262 }
16263 if (local_pAllocator)
16264 {
16265 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
16266 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016267 countingStream->rewind();
16268 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016269 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
16270 marshal_VkValidationCacheCreateInfoEXT(countingStream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
16271 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
16272 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016273 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016274 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016275 }
16276 countingStream->write((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT));
16277 }
16278 uint32_t packetSize_vkCreateValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16279 countingStream->rewind();
16280 uint32_t opcode_vkCreateValidationCacheEXT = OP_vkCreateValidationCacheEXT;
16281 stream->write(&opcode_vkCreateValidationCacheEXT, sizeof(uint32_t));
16282 stream->write(&packetSize_vkCreateValidationCacheEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016283 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
16284 marshal_VkValidationCacheCreateInfoEXT(stream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo));
16285 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
16286 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016287 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016288 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016289 }
16290 stream->write((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT));
16291 stream->read((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016292 if (pValidationCache)
16293 {
16294 resources->createMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)pValidationCache, 1);
16295 }
16296 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016297 VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0;
16298 stream->read(&vkCreateValidationCacheEXT_VkResult_return, sizeof(VkResult));
16299 return vkCreateValidationCacheEXT_VkResult_return;
16300}
16301
16302void VkEncoder::vkDestroyValidationCacheEXT(
16303 VkDevice device,
16304 VkValidationCacheEXT validationCache,
16305 const VkAllocationCallbacks* pAllocator)
16306{
16307 auto stream = mImpl->stream();
16308 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016309 auto resources = mImpl->resources();
16310 auto pool = mImpl->pool();
16311 VkDevice local_device;
16312 local_device = device;
16313 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16314 VkAllocationCallbacks* local_pAllocator;
16315 local_pAllocator = nullptr;
16316 if (pAllocator)
16317 {
16318 local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks));
16319 deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator));
16320 }
16321 if (local_pAllocator)
16322 {
16323 handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator));
16324 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016325 countingStream->rewind();
16326 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016327 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016328 countingStream->write((VkValidationCacheEXT*)&validationCache, sizeof(VkValidationCacheEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016329 countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
16330 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016331 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016332 marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016333 }
16334 }
16335 uint32_t packetSize_vkDestroyValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16336 countingStream->rewind();
16337 uint32_t opcode_vkDestroyValidationCacheEXT = OP_vkDestroyValidationCacheEXT;
16338 stream->write(&opcode_vkDestroyValidationCacheEXT, sizeof(uint32_t));
16339 stream->write(&packetSize_vkDestroyValidationCacheEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016340 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016341 stream->write((VkValidationCacheEXT*)&validationCache, sizeof(VkValidationCacheEXT));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016342 stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*));
16343 if (local_pAllocator)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016344 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016345 marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016346 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016347 resources->destroyMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&validationCache);
16348 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016349}
16350
16351VkResult VkEncoder::vkMergeValidationCachesEXT(
16352 VkDevice device,
16353 VkValidationCacheEXT dstCache,
16354 uint32_t srcCacheCount,
16355 const VkValidationCacheEXT* pSrcCaches)
16356{
16357 auto stream = mImpl->stream();
16358 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016359 auto resources = mImpl->resources();
16360 auto pool = mImpl->pool();
16361 VkDevice local_device;
16362 local_device = device;
16363 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16364 VkValidationCacheEXT local_dstCache;
16365 local_dstCache = dstCache;
16366 resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&local_dstCache);
16367 uint32_t local_srcCacheCount;
16368 local_srcCacheCount = srcCacheCount;
16369 VkValidationCacheEXT* local_pSrcCaches;
16370 local_pSrcCaches = nullptr;
16371 if (pSrcCaches)
16372 {
16373 local_pSrcCaches = (VkValidationCacheEXT*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkValidationCacheEXT));
16374 }
16375 if (local_pSrcCaches)
16376 {
16377 resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount)));
16378 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016379 countingStream->rewind();
16380 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016381 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
16382 countingStream->write((VkValidationCacheEXT*)&local_dstCache, sizeof(VkValidationCacheEXT));
16383 countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
16384 countingStream->write((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkValidationCacheEXT));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016385 }
16386 uint32_t packetSize_vkMergeValidationCachesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16387 countingStream->rewind();
16388 uint32_t opcode_vkMergeValidationCachesEXT = OP_vkMergeValidationCachesEXT;
16389 stream->write(&opcode_vkMergeValidationCachesEXT, sizeof(uint32_t));
16390 stream->write(&packetSize_vkMergeValidationCachesEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016391 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
16392 stream->write((VkValidationCacheEXT*)&local_dstCache, sizeof(VkValidationCacheEXT));
16393 stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t));
16394 stream->write((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkValidationCacheEXT));
16395 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016396 VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0;
16397 stream->read(&vkMergeValidationCachesEXT_VkResult_return, sizeof(VkResult));
16398 return vkMergeValidationCachesEXT_VkResult_return;
16399}
16400
16401VkResult VkEncoder::vkGetValidationCacheDataEXT(
16402 VkDevice device,
16403 VkValidationCacheEXT validationCache,
16404 size_t* pDataSize,
16405 void* pData)
16406{
16407 auto stream = mImpl->stream();
16408 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016409 auto resources = mImpl->resources();
16410 auto pool = mImpl->pool();
16411 VkDevice local_device;
16412 local_device = device;
16413 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16414 VkValidationCacheEXT local_validationCache;
16415 local_validationCache = validationCache;
16416 resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&local_validationCache);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016417 countingStream->rewind();
16418 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016419 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
16420 countingStream->write((VkValidationCacheEXT*)&local_validationCache, sizeof(VkValidationCacheEXT));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016421 countingStream->write((size_t**)&pDataSize, sizeof(size_t*));
16422 if (pDataSize)
16423 {
16424 countingStream->write((size_t*)pDataSize, sizeof(size_t));
16425 }
16426 countingStream->write((void**)&pData, sizeof(void*));
16427 if (pData)
16428 {
16429 countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
16430 }
16431 }
16432 uint32_t packetSize_vkGetValidationCacheDataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16433 countingStream->rewind();
16434 uint32_t opcode_vkGetValidationCacheDataEXT = OP_vkGetValidationCacheDataEXT;
16435 stream->write(&opcode_vkGetValidationCacheDataEXT, sizeof(uint32_t));
16436 stream->write(&packetSize_vkGetValidationCacheDataEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016437 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
16438 stream->write((VkValidationCacheEXT*)&local_validationCache, sizeof(VkValidationCacheEXT));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016439 stream->write((size_t**)&pDataSize, sizeof(size_t*));
16440 if (pDataSize)
16441 {
16442 stream->write((size_t*)pDataSize, sizeof(size_t));
16443 }
16444 stream->write((void**)&pData, sizeof(void*));
16445 if (pData)
16446 {
16447 stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
16448 }
16449 size_t* check_pDataSize;
16450 stream->read((size_t**)&check_pDataSize, sizeof(size_t*));
16451 if (pDataSize)
16452 {
16453 if (!(check_pDataSize))
16454 {
16455 fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n");
16456 }
16457 stream->read((size_t*)pDataSize, sizeof(size_t));
16458 }
16459 void* check_pData;
16460 stream->read((void**)&check_pData, sizeof(void*));
16461 if (pData)
16462 {
16463 if (!(check_pData))
16464 {
16465 fprintf(stderr, "fatal: pData inconsistent between guest and host\n");
16466 }
16467 stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t));
16468 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016469 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016470 VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0;
16471 stream->read(&vkGetValidationCacheDataEXT_VkResult_return, sizeof(VkResult));
16472 return vkGetValidationCacheDataEXT_VkResult_return;
16473}
16474
16475#endif
16476#ifdef VK_EXT_descriptor_indexing
16477#endif
16478#ifdef VK_EXT_shader_viewport_index_layer
16479#endif
16480#ifdef VK_EXT_global_priority
16481#endif
16482#ifdef VK_EXT_external_memory_host
16483VkResult VkEncoder::vkGetMemoryHostPointerPropertiesEXT(
16484 VkDevice device,
16485 VkExternalMemoryHandleTypeFlagBits handleType,
16486 const void* pHostPointer,
16487 VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties)
16488{
16489 auto stream = mImpl->stream();
16490 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016491 auto resources = mImpl->resources();
16492 auto pool = mImpl->pool();
16493 VkDevice local_device;
16494 local_device = device;
16495 resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device);
16496 VkExternalMemoryHandleTypeFlagBits local_handleType;
16497 local_handleType = handleType;
16498 void* local_pHostPointer;
16499 local_pHostPointer = nullptr;
16500 if (pHostPointer)
16501 {
16502 local_pHostPointer = (void*)pool->dupArray(pHostPointer, sizeof(const uint8_t));
16503 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016504 countingStream->rewind();
16505 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016506 countingStream->write((VkDevice*)&local_device, sizeof(VkDevice));
16507 countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
16508 countingStream->write((void**)&local_pHostPointer, sizeof(void*));
16509 if (local_pHostPointer)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016510 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016511 countingStream->write((void*)local_pHostPointer, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016512 }
16513 marshal_VkMemoryHostPointerPropertiesEXT(countingStream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties));
16514 }
16515 uint32_t packetSize_vkGetMemoryHostPointerPropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16516 countingStream->rewind();
16517 uint32_t opcode_vkGetMemoryHostPointerPropertiesEXT = OP_vkGetMemoryHostPointerPropertiesEXT;
16518 stream->write(&opcode_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t));
16519 stream->write(&packetSize_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016520 stream->write((VkDevice*)&local_device, sizeof(VkDevice));
16521 stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits));
16522 stream->write((void**)&local_pHostPointer, sizeof(void*));
16523 if (local_pHostPointer)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016524 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016525 stream->write((void*)local_pHostPointer, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016526 }
16527 marshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties));
16528 unmarshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016529 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016530 VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0;
16531 stream->read(&vkGetMemoryHostPointerPropertiesEXT_VkResult_return, sizeof(VkResult));
16532 return vkGetMemoryHostPointerPropertiesEXT_VkResult_return;
16533}
16534
16535#endif
16536#ifdef VK_AMD_buffer_marker
16537void VkEncoder::vkCmdWriteBufferMarkerAMD(
16538 VkCommandBuffer commandBuffer,
16539 VkPipelineStageFlagBits pipelineStage,
16540 VkBuffer dstBuffer,
16541 VkDeviceSize dstOffset,
16542 uint32_t marker)
16543{
16544 auto stream = mImpl->stream();
16545 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016546 auto resources = mImpl->resources();
16547 auto pool = mImpl->pool();
16548 VkCommandBuffer local_commandBuffer;
16549 local_commandBuffer = commandBuffer;
16550 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
16551 VkPipelineStageFlagBits local_pipelineStage;
16552 local_pipelineStage = pipelineStage;
16553 VkBuffer local_dstBuffer;
16554 local_dstBuffer = dstBuffer;
16555 resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer);
16556 VkDeviceSize local_dstOffset;
16557 local_dstOffset = dstOffset;
16558 uint32_t local_marker;
16559 local_marker = marker;
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016560 countingStream->rewind();
16561 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016562 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
16563 countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
16564 countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
16565 countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
16566 countingStream->write((uint32_t*)&local_marker, sizeof(uint32_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016567 }
16568 uint32_t packetSize_vkCmdWriteBufferMarkerAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16569 countingStream->rewind();
16570 uint32_t opcode_vkCmdWriteBufferMarkerAMD = OP_vkCmdWriteBufferMarkerAMD;
16571 stream->write(&opcode_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t));
16572 stream->write(&packetSize_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016573 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
16574 stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits));
16575 stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer));
16576 stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize));
16577 stream->write((uint32_t*)&local_marker, sizeof(uint32_t));
16578 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016579}
16580
16581#endif
16582#ifdef VK_AMD_shader_core_properties
16583#endif
16584#ifdef VK_EXT_vertex_attribute_divisor
16585#endif
16586#ifdef VK_NV_shader_subgroup_partitioned
16587#endif
16588#ifdef VK_NV_device_diagnostic_checkpoints
16589void VkEncoder::vkCmdSetCheckpointNV(
16590 VkCommandBuffer commandBuffer,
16591 const void* pCheckpointMarker)
16592{
16593 auto stream = mImpl->stream();
16594 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016595 auto resources = mImpl->resources();
16596 auto pool = mImpl->pool();
16597 VkCommandBuffer local_commandBuffer;
16598 local_commandBuffer = commandBuffer;
16599 resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer);
16600 void* local_pCheckpointMarker;
16601 local_pCheckpointMarker = nullptr;
16602 if (pCheckpointMarker)
16603 {
16604 local_pCheckpointMarker = (void*)pool->dupArray(pCheckpointMarker, sizeof(const uint8_t));
16605 }
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016606 countingStream->rewind();
16607 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016608 countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
16609 countingStream->write((void**)&local_pCheckpointMarker, sizeof(void*));
16610 if (local_pCheckpointMarker)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016611 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016612 countingStream->write((void*)local_pCheckpointMarker, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016613 }
16614 }
16615 uint32_t packetSize_vkCmdSetCheckpointNV = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16616 countingStream->rewind();
16617 uint32_t opcode_vkCmdSetCheckpointNV = OP_vkCmdSetCheckpointNV;
16618 stream->write(&opcode_vkCmdSetCheckpointNV, sizeof(uint32_t));
16619 stream->write(&packetSize_vkCmdSetCheckpointNV, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016620 stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer));
16621 stream->write((void**)&local_pCheckpointMarker, sizeof(void*));
16622 if (local_pCheckpointMarker)
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016623 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016624 stream->write((void*)local_pCheckpointMarker, sizeof(uint8_t));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016625 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016626 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016627}
16628
16629void VkEncoder::vkGetQueueCheckpointDataNV(
16630 VkQueue queue,
16631 uint32_t* pCheckpointDataCount,
16632 VkCheckpointDataNV* pCheckpointData)
16633{
16634 auto stream = mImpl->stream();
16635 auto countingStream = mImpl->countingStream();
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016636 auto resources = mImpl->resources();
16637 auto pool = mImpl->pool();
16638 VkQueue local_queue;
16639 local_queue = queue;
16640 resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue);
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016641 countingStream->rewind();
16642 {
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016643 countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016644 countingStream->write((uint32_t**)&pCheckpointDataCount, sizeof(uint32_t*));
16645 if (pCheckpointDataCount)
16646 {
16647 countingStream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
16648 }
16649 countingStream->write((VkCheckpointDataNV**)&pCheckpointData, sizeof(VkCheckpointDataNV*));
16650 if (pCheckpointData)
16651 {
16652 for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i)
16653 {
16654 marshal_VkCheckpointDataNV(countingStream, (VkCheckpointDataNV*)(pCheckpointData + i));
16655 }
16656 }
16657 }
16658 uint32_t packetSize_vkGetQueueCheckpointDataNV = 4 + 4 + (uint32_t)countingStream->bytesWritten();
16659 countingStream->rewind();
16660 uint32_t opcode_vkGetQueueCheckpointDataNV = OP_vkGetQueueCheckpointDataNV;
16661 stream->write(&opcode_vkGetQueueCheckpointDataNV, sizeof(uint32_t));
16662 stream->write(&packetSize_vkGetQueueCheckpointDataNV, sizeof(uint32_t));
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016663 stream->write((VkQueue*)&local_queue, sizeof(VkQueue));
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016664 stream->write((uint32_t**)&pCheckpointDataCount, sizeof(uint32_t*));
16665 if (pCheckpointDataCount)
16666 {
16667 stream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
16668 }
16669 stream->write((VkCheckpointDataNV**)&pCheckpointData, sizeof(VkCheckpointDataNV*));
16670 if (pCheckpointData)
16671 {
16672 for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i)
16673 {
16674 marshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i));
16675 }
16676 }
16677 uint32_t* check_pCheckpointDataCount;
16678 stream->read((uint32_t**)&check_pCheckpointDataCount, sizeof(uint32_t*));
16679 if (pCheckpointDataCount)
16680 {
16681 if (!(check_pCheckpointDataCount))
16682 {
16683 fprintf(stderr, "fatal: pCheckpointDataCount inconsistent between guest and host\n");
16684 }
16685 stream->read((uint32_t*)pCheckpointDataCount, sizeof(uint32_t));
16686 }
16687 VkCheckpointDataNV* check_pCheckpointData;
16688 stream->read((VkCheckpointDataNV**)&check_pCheckpointData, sizeof(VkCheckpointDataNV*));
16689 if (pCheckpointData)
16690 {
16691 if (!(check_pCheckpointData))
16692 {
16693 fprintf(stderr, "fatal: pCheckpointData inconsistent between guest and host\n");
16694 }
16695 for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i)
16696 {
16697 unmarshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i));
16698 }
16699 }
Lingfeng Yang71b596b2018-11-07 18:03:25 -080016700 pool->freeAll();
Lingfeng Yangf4d77ef2018-11-02 23:21:37 -070016701}
16702
16703#endif
16704
16705