| Lingfeng Yang | 6a28367 | 2018-11-01 13:37:56 -0700 | [diff] [blame] | 1 | // Copyright (C) 2018 The Android Open Source Project |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2 | // Copyright (C) 2018 Google Inc. |
| Lingfeng Yang | 6a28367 | 2018-11-01 13:37:56 -0700 | [diff] [blame] | 3 | // |
| 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 Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15 | |
| 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 Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 25 | #include "VkEncoder.h" |
| Lingfeng Yang | 6a28367 | 2018-11-01 13:37:56 -0700 | [diff] [blame] | 26 | |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 27 | |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 28 | #include "IOStream.h" |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 29 | #include "Resources.h" |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 30 | #include "ResourceTracker.h" |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 31 | #include "VulkanStream.h" |
| 32 | |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 33 | #include "android/base/AlignedBuf.h" |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 34 | #include "android/base/Pool.h" |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 35 | |
| Lingfeng Yang | e71c642 | 2018-11-01 19:29:49 -0700 | [diff] [blame] | 36 | #include "goldfish_vk_marshaling_guest.h" |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 37 | #include "goldfish_vk_deepcopy_guest.h" |
| 38 | #include "goldfish_vk_handlemap_guest.h" |
| Lingfeng Yang | e71c642 | 2018-11-01 19:29:49 -0700 | [diff] [blame] | 39 | |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 45 | using namespace goldfish_vk; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 46 | |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 47 | using android::aligned_buf_alloc; |
| 48 | using android::aligned_buf_free; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 49 | using android::base::Pool; |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 50 | |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 51 | class VkEncoder::Impl { |
| 52 | public: |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 53 | Impl(IOStream* stream) : m_stream(stream) { } |
| 54 | VulkanCountingStream* countingStream() { return &m_countingStream; } |
| 55 | VulkanStream* stream() { return &m_stream; } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 56 | Pool* pool() { return &m_pool; } |
| 57 | ResourceTracker* resources() { return ResourceTracker::get(); } |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 58 | private: |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 59 | VulkanCountingStream m_countingStream; |
| 60 | VulkanStream m_stream; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 61 | Pool m_pool { 8, 4096, 64 }; |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 62 | }; |
| 63 | |
| 64 | VkEncoder::VkEncoder(IOStream *stream) : |
| 65 | mImpl(new VkEncoder::Impl(stream)) { } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 66 | #ifdef VK_VERSION_1_0 |
| 67 | VkResult VkEncoder::vkCreateInstance( |
| 68 | const VkInstanceCreateInfo* pCreateInfo, |
| 69 | const VkAllocationCallbacks* pAllocator, |
| 70 | VkInstance* pInstance) |
| 71 | { |
| 72 | auto stream = mImpl->stream(); |
| 73 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 74 | auto resources = mImpl->resources(); |
| 75 | auto pool = mImpl->pool(); |
| 76 | VkInstanceCreateInfo* local_pCreateInfo; |
| 77 | local_pCreateInfo = nullptr; |
| 78 | if (pCreateInfo) |
| 79 | { |
| 80 | local_pCreateInfo = (VkInstanceCreateInfo*)pool->alloc(sizeof(const VkInstanceCreateInfo)); |
| 81 | deepcopy_VkInstanceCreateInfo(pool, pCreateInfo, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| 82 | } |
| 83 | if (local_pCreateInfo) |
| 84 | { |
| 85 | handlemap_VkInstanceCreateInfo(resources->unwrapMapping(), (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| 86 | } |
| 87 | VkAllocationCallbacks* local_pAllocator; |
| 88 | local_pAllocator = nullptr; |
| 89 | if (pAllocator) |
| 90 | { |
| 91 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 92 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 93 | } |
| 94 | if (local_pAllocator) |
| 95 | { |
| 96 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 97 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 98 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 99 | countingStream->rewind(); |
| 100 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 101 | marshal_VkInstanceCreateInfo(countingStream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| 102 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 103 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 104 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 105 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 106 | } |
| 107 | countingStream->write((VkInstance*)pInstance, sizeof(VkInstance)); |
| 108 | } |
| 109 | uint32_t packetSize_vkCreateInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 110 | countingStream->rewind(); |
| 111 | uint32_t opcode_vkCreateInstance = OP_vkCreateInstance; |
| 112 | stream->write(&opcode_vkCreateInstance, sizeof(uint32_t)); |
| 113 | stream->write(&packetSize_vkCreateInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 114 | marshal_VkInstanceCreateInfo(stream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| 115 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 116 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 117 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 118 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 119 | } |
| 120 | stream->write((VkInstance*)pInstance, sizeof(VkInstance)); |
| 121 | stream->read((VkInstance*)pInstance, sizeof(VkInstance)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 122 | if (pInstance) |
| 123 | { |
| 124 | resources->createMapping()->mapHandles_VkInstance((VkInstance*)pInstance, 1); |
| 125 | } |
| 126 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 127 | VkResult vkCreateInstance_VkResult_return = (VkResult)0; |
| 128 | stream->read(&vkCreateInstance_VkResult_return, sizeof(VkResult)); |
| 129 | return vkCreateInstance_VkResult_return; |
| 130 | } |
| 131 | |
| 132 | void VkEncoder::vkDestroyInstance( |
| 133 | VkInstance instance, |
| 134 | const VkAllocationCallbacks* pAllocator) |
| 135 | { |
| 136 | auto stream = mImpl->stream(); |
| 137 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 138 | auto resources = mImpl->resources(); |
| 139 | auto pool = mImpl->pool(); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 140 | VkInstance local_instance; |
| 141 | local_instance = instance; |
| 142 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 143 | VkAllocationCallbacks* local_pAllocator; |
| 144 | local_pAllocator = nullptr; |
| 145 | if (pAllocator) |
| 146 | { |
| 147 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 148 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 149 | } |
| 150 | if (local_pAllocator) |
| 151 | { |
| 152 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 153 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 154 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 155 | countingStream->rewind(); |
| 156 | { |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 157 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 158 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 159 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 160 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 161 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 162 | } |
| 163 | } |
| 164 | uint32_t packetSize_vkDestroyInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 165 | countingStream->rewind(); |
| 166 | uint32_t opcode_vkDestroyInstance = OP_vkDestroyInstance; |
| 167 | stream->write(&opcode_vkDestroyInstance, sizeof(uint32_t)); |
| 168 | stream->write(&packetSize_vkDestroyInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 169 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 170 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 171 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 172 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 173 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 174 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 175 | resources->destroyMapping()->mapHandles_VkInstance((VkInstance*)&instance); |
| 176 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | VkResult VkEncoder::vkEnumeratePhysicalDevices( |
| 180 | VkInstance instance, |
| 181 | uint32_t* pPhysicalDeviceCount, |
| 182 | VkPhysicalDevice* pPhysicalDevices) |
| 183 | { |
| 184 | auto stream = mImpl->stream(); |
| 185 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 186 | auto resources = mImpl->resources(); |
| 187 | auto pool = mImpl->pool(); |
| 188 | VkInstance local_instance; |
| 189 | local_instance = instance; |
| 190 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 191 | countingStream->rewind(); |
| 192 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 193 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 194 | countingStream->write((uint32_t**)&pPhysicalDeviceCount, sizeof(uint32_t*)); |
| 195 | if (pPhysicalDeviceCount) |
| 196 | { |
| 197 | countingStream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 198 | } |
| 199 | countingStream->write((VkPhysicalDevice**)&pPhysicalDevices, sizeof(VkPhysicalDevice*)); |
| 200 | if (pPhysicalDevices) |
| 201 | { |
| 202 | countingStream->write((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice)); |
| 203 | } |
| 204 | } |
| 205 | uint32_t packetSize_vkEnumeratePhysicalDevices = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 206 | countingStream->rewind(); |
| 207 | uint32_t opcode_vkEnumeratePhysicalDevices = OP_vkEnumeratePhysicalDevices; |
| 208 | stream->write(&opcode_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| 209 | stream->write(&packetSize_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 210 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 211 | stream->write((uint32_t**)&pPhysicalDeviceCount, sizeof(uint32_t*)); |
| 212 | if (pPhysicalDeviceCount) |
| 213 | { |
| 214 | stream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 215 | } |
| 216 | stream->write((VkPhysicalDevice**)&pPhysicalDevices, sizeof(VkPhysicalDevice*)); |
| 217 | if (pPhysicalDevices) |
| 218 | { |
| 219 | stream->write((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice)); |
| 220 | } |
| 221 | uint32_t* check_pPhysicalDeviceCount; |
| 222 | stream->read((uint32_t**)&check_pPhysicalDeviceCount, sizeof(uint32_t*)); |
| 223 | if (pPhysicalDeviceCount) |
| 224 | { |
| 225 | if (!(check_pPhysicalDeviceCount)) |
| 226 | { |
| 227 | fprintf(stderr, "fatal: pPhysicalDeviceCount inconsistent between guest and host\n"); |
| 228 | } |
| 229 | stream->read((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 230 | } |
| 231 | VkPhysicalDevice* check_pPhysicalDevices; |
| 232 | stream->read((VkPhysicalDevice**)&check_pPhysicalDevices, sizeof(VkPhysicalDevice*)); |
| 233 | if (pPhysicalDevices) |
| 234 | { |
| 235 | if (!(check_pPhysicalDevices)) |
| 236 | { |
| 237 | fprintf(stderr, "fatal: pPhysicalDevices inconsistent between guest and host\n"); |
| 238 | } |
| 239 | stream->read((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount)) * sizeof(VkPhysicalDevice)); |
| 240 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 241 | if (pPhysicalDevices) |
| 242 | { |
| 243 | resources->createMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount))); |
| 244 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 245 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 246 | VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0; |
| 247 | stream->read(&vkEnumeratePhysicalDevices_VkResult_return, sizeof(VkResult)); |
| 248 | return vkEnumeratePhysicalDevices_VkResult_return; |
| 249 | } |
| 250 | |
| 251 | void VkEncoder::vkGetPhysicalDeviceFeatures( |
| 252 | VkPhysicalDevice physicalDevice, |
| 253 | VkPhysicalDeviceFeatures* pFeatures) |
| 254 | { |
| 255 | auto stream = mImpl->stream(); |
| 256 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 257 | auto resources = mImpl->resources(); |
| 258 | auto pool = mImpl->pool(); |
| 259 | VkPhysicalDevice local_physicalDevice; |
| 260 | local_physicalDevice = physicalDevice; |
| 261 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 262 | countingStream->rewind(); |
| 263 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 264 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 265 | marshal_VkPhysicalDeviceFeatures(countingStream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 266 | } |
| 267 | uint32_t packetSize_vkGetPhysicalDeviceFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 268 | countingStream->rewind(); |
| 269 | uint32_t opcode_vkGetPhysicalDeviceFeatures = OP_vkGetPhysicalDeviceFeatures; |
| 270 | stream->write(&opcode_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| 271 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 272 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 273 | marshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 274 | unmarshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 275 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 276 | } |
| 277 | |
| 278 | void VkEncoder::vkGetPhysicalDeviceFormatProperties( |
| 279 | VkPhysicalDevice physicalDevice, |
| 280 | VkFormat format, |
| 281 | VkFormatProperties* pFormatProperties) |
| 282 | { |
| 283 | auto stream = mImpl->stream(); |
| 284 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 285 | auto resources = mImpl->resources(); |
| 286 | auto pool = mImpl->pool(); |
| 287 | VkPhysicalDevice local_physicalDevice; |
| 288 | local_physicalDevice = physicalDevice; |
| 289 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 290 | VkFormat local_format; |
| 291 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 292 | countingStream->rewind(); |
| 293 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 294 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 295 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 296 | marshal_VkFormatProperties(countingStream, (VkFormatProperties*)(pFormatProperties)); |
| 297 | } |
| 298 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 299 | countingStream->rewind(); |
| 300 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties = OP_vkGetPhysicalDeviceFormatProperties; |
| 301 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| 302 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 303 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 304 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 305 | marshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| 306 | unmarshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 307 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 308 | } |
| 309 | |
| 310 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties( |
| 311 | VkPhysicalDevice physicalDevice, |
| 312 | VkFormat format, |
| 313 | VkImageType type, |
| 314 | VkImageTiling tiling, |
| 315 | VkImageUsageFlags usage, |
| 316 | VkImageCreateFlags flags, |
| 317 | VkImageFormatProperties* pImageFormatProperties) |
| 318 | { |
| 319 | auto stream = mImpl->stream(); |
| 320 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 321 | auto resources = mImpl->resources(); |
| 322 | auto pool = mImpl->pool(); |
| 323 | VkPhysicalDevice local_physicalDevice; |
| 324 | local_physicalDevice = physicalDevice; |
| 325 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 326 | VkFormat local_format; |
| 327 | local_format = format; |
| 328 | VkImageType local_type; |
| 329 | local_type = type; |
| 330 | VkImageTiling local_tiling; |
| 331 | local_tiling = tiling; |
| 332 | VkImageUsageFlags local_usage; |
| 333 | local_usage = usage; |
| 334 | VkImageCreateFlags local_flags; |
| 335 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 336 | countingStream->rewind(); |
| 337 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 338 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 339 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 340 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 341 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 342 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 343 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 344 | marshal_VkImageFormatProperties(countingStream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 345 | } |
| 346 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 347 | countingStream->rewind(); |
| 348 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties = OP_vkGetPhysicalDeviceImageFormatProperties; |
| 349 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| 350 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 351 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 352 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 353 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 354 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 355 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 356 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 357 | marshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 358 | unmarshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 359 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 360 | VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0; |
| 361 | stream->read(&vkGetPhysicalDeviceImageFormatProperties_VkResult_return, sizeof(VkResult)); |
| 362 | return vkGetPhysicalDeviceImageFormatProperties_VkResult_return; |
| 363 | } |
| 364 | |
| 365 | void VkEncoder::vkGetPhysicalDeviceProperties( |
| 366 | VkPhysicalDevice physicalDevice, |
| 367 | VkPhysicalDeviceProperties* pProperties) |
| 368 | { |
| 369 | auto stream = mImpl->stream(); |
| 370 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 371 | auto resources = mImpl->resources(); |
| 372 | auto pool = mImpl->pool(); |
| 373 | VkPhysicalDevice local_physicalDevice; |
| 374 | local_physicalDevice = physicalDevice; |
| 375 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 376 | countingStream->rewind(); |
| 377 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 378 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 379 | marshal_VkPhysicalDeviceProperties(countingStream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 380 | } |
| 381 | uint32_t packetSize_vkGetPhysicalDeviceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 382 | countingStream->rewind(); |
| 383 | uint32_t opcode_vkGetPhysicalDeviceProperties = OP_vkGetPhysicalDeviceProperties; |
| 384 | stream->write(&opcode_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| 385 | stream->write(&packetSize_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 386 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 387 | marshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 388 | unmarshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 389 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 390 | } |
| 391 | |
| 392 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties( |
| 393 | VkPhysicalDevice physicalDevice, |
| 394 | uint32_t* pQueueFamilyPropertyCount, |
| 395 | VkQueueFamilyProperties* pQueueFamilyProperties) |
| 396 | { |
| 397 | auto stream = mImpl->stream(); |
| 398 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 399 | auto resources = mImpl->resources(); |
| 400 | auto pool = mImpl->pool(); |
| 401 | VkPhysicalDevice local_physicalDevice; |
| 402 | local_physicalDevice = physicalDevice; |
| 403 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 404 | countingStream->rewind(); |
| 405 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 406 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 407 | countingStream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*)); |
| 408 | if (pQueueFamilyPropertyCount) |
| 409 | { |
| 410 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 411 | } |
| 412 | countingStream->write((VkQueueFamilyProperties**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties*)); |
| 413 | if (pQueueFamilyProperties) |
| 414 | { |
| 415 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 416 | { |
| 417 | marshal_VkQueueFamilyProperties(countingStream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 418 | } |
| 419 | } |
| 420 | } |
| 421 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 422 | countingStream->rewind(); |
| 423 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties = OP_vkGetPhysicalDeviceQueueFamilyProperties; |
| 424 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| 425 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 426 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 427 | stream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*)); |
| 428 | if (pQueueFamilyPropertyCount) |
| 429 | { |
| 430 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 431 | } |
| 432 | stream->write((VkQueueFamilyProperties**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties*)); |
| 433 | if (pQueueFamilyProperties) |
| 434 | { |
| 435 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 436 | { |
| 437 | marshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 438 | } |
| 439 | } |
| 440 | uint32_t* check_pQueueFamilyPropertyCount; |
| 441 | stream->read((uint32_t**)&check_pQueueFamilyPropertyCount, sizeof(uint32_t*)); |
| 442 | if (pQueueFamilyPropertyCount) |
| 443 | { |
| 444 | if (!(check_pQueueFamilyPropertyCount)) |
| 445 | { |
| 446 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 447 | } |
| 448 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 449 | } |
| 450 | VkQueueFamilyProperties* check_pQueueFamilyProperties; |
| 451 | stream->read((VkQueueFamilyProperties**)&check_pQueueFamilyProperties, sizeof(VkQueueFamilyProperties*)); |
| 452 | if (pQueueFamilyProperties) |
| 453 | { |
| 454 | if (!(check_pQueueFamilyProperties)) |
| 455 | { |
| 456 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 457 | } |
| 458 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 459 | { |
| 460 | unmarshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 461 | } |
| 462 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 463 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 464 | } |
| 465 | |
| 466 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties( |
| 467 | VkPhysicalDevice physicalDevice, |
| 468 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 469 | { |
| 470 | auto stream = mImpl->stream(); |
| 471 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 472 | auto resources = mImpl->resources(); |
| 473 | auto pool = mImpl->pool(); |
| 474 | VkPhysicalDevice local_physicalDevice; |
| 475 | local_physicalDevice = physicalDevice; |
| 476 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 477 | countingStream->rewind(); |
| 478 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 479 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 480 | marshal_VkPhysicalDeviceMemoryProperties(countingStream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 481 | } |
| 482 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 483 | countingStream->rewind(); |
| 484 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties = OP_vkGetPhysicalDeviceMemoryProperties; |
| 485 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| 486 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 487 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 488 | marshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 489 | unmarshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 490 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 491 | } |
| 492 | |
| 493 | PFN_vkVoidFunction VkEncoder::vkGetInstanceProcAddr( |
| 494 | VkInstance instance, |
| 495 | const char* pName) |
| 496 | { |
| 497 | auto stream = mImpl->stream(); |
| 498 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 499 | auto resources = mImpl->resources(); |
| 500 | auto pool = mImpl->pool(); |
| 501 | VkInstance local_instance; |
| 502 | local_instance = instance; |
| 503 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 504 | char* local_pName; |
| 505 | local_pName = nullptr; |
| 506 | if (pName) |
| 507 | { |
| 508 | local_pName = pool->strDup(pName); |
| 509 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 510 | countingStream->rewind(); |
| 511 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 512 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 513 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 514 | } |
| 515 | uint32_t packetSize_vkGetInstanceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 516 | countingStream->rewind(); |
| 517 | uint32_t opcode_vkGetInstanceProcAddr = OP_vkGetInstanceProcAddr; |
| 518 | stream->write(&opcode_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| 519 | stream->write(&packetSize_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 520 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 521 | stream->putString(local_pName); |
| 522 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 523 | PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 524 | stream->read(&vkGetInstanceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| 525 | return vkGetInstanceProcAddr_PFN_vkVoidFunction_return; |
| 526 | } |
| 527 | |
| 528 | PFN_vkVoidFunction VkEncoder::vkGetDeviceProcAddr( |
| 529 | VkDevice device, |
| 530 | const char* pName) |
| 531 | { |
| 532 | auto stream = mImpl->stream(); |
| 533 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 534 | auto resources = mImpl->resources(); |
| 535 | auto pool = mImpl->pool(); |
| 536 | VkDevice local_device; |
| 537 | local_device = device; |
| 538 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 539 | char* local_pName; |
| 540 | local_pName = nullptr; |
| 541 | if (pName) |
| 542 | { |
| 543 | local_pName = pool->strDup(pName); |
| 544 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 545 | countingStream->rewind(); |
| 546 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 547 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 548 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 549 | } |
| 550 | uint32_t packetSize_vkGetDeviceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 551 | countingStream->rewind(); |
| 552 | uint32_t opcode_vkGetDeviceProcAddr = OP_vkGetDeviceProcAddr; |
| 553 | stream->write(&opcode_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| 554 | stream->write(&packetSize_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 555 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 556 | stream->putString(local_pName); |
| 557 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 558 | PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 559 | stream->read(&vkGetDeviceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| 560 | return vkGetDeviceProcAddr_PFN_vkVoidFunction_return; |
| 561 | } |
| 562 | |
| 563 | VkResult VkEncoder::vkCreateDevice( |
| 564 | VkPhysicalDevice physicalDevice, |
| 565 | const VkDeviceCreateInfo* pCreateInfo, |
| 566 | const VkAllocationCallbacks* pAllocator, |
| 567 | VkDevice* pDevice) |
| 568 | { |
| 569 | auto stream = mImpl->stream(); |
| 570 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 571 | auto resources = mImpl->resources(); |
| 572 | auto pool = mImpl->pool(); |
| 573 | VkPhysicalDevice local_physicalDevice; |
| 574 | local_physicalDevice = physicalDevice; |
| 575 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 576 | VkDeviceCreateInfo* local_pCreateInfo; |
| 577 | local_pCreateInfo = nullptr; |
| 578 | if (pCreateInfo) |
| 579 | { |
| 580 | local_pCreateInfo = (VkDeviceCreateInfo*)pool->alloc(sizeof(const VkDeviceCreateInfo)); |
| 581 | deepcopy_VkDeviceCreateInfo(pool, pCreateInfo, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| 582 | } |
| 583 | if (local_pCreateInfo) |
| 584 | { |
| 585 | handlemap_VkDeviceCreateInfo(resources->unwrapMapping(), (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| 586 | } |
| 587 | VkAllocationCallbacks* local_pAllocator; |
| 588 | local_pAllocator = nullptr; |
| 589 | if (pAllocator) |
| 590 | { |
| 591 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 592 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 593 | } |
| 594 | if (local_pAllocator) |
| 595 | { |
| 596 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 597 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 598 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 599 | countingStream->rewind(); |
| 600 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 601 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 602 | marshal_VkDeviceCreateInfo(countingStream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| 603 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 604 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 605 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 606 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 607 | } |
| 608 | countingStream->write((VkDevice*)pDevice, sizeof(VkDevice)); |
| 609 | } |
| 610 | uint32_t packetSize_vkCreateDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 611 | countingStream->rewind(); |
| 612 | uint32_t opcode_vkCreateDevice = OP_vkCreateDevice; |
| 613 | stream->write(&opcode_vkCreateDevice, sizeof(uint32_t)); |
| 614 | stream->write(&packetSize_vkCreateDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 615 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 616 | marshal_VkDeviceCreateInfo(stream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| 617 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 618 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 619 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 620 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 621 | } |
| 622 | stream->write((VkDevice*)pDevice, sizeof(VkDevice)); |
| 623 | stream->read((VkDevice*)pDevice, sizeof(VkDevice)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 624 | if (pDevice) |
| 625 | { |
| 626 | resources->createMapping()->mapHandles_VkDevice((VkDevice*)pDevice, 1); |
| 627 | } |
| 628 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 629 | VkResult vkCreateDevice_VkResult_return = (VkResult)0; |
| 630 | stream->read(&vkCreateDevice_VkResult_return, sizeof(VkResult)); |
| 631 | return vkCreateDevice_VkResult_return; |
| 632 | } |
| 633 | |
| 634 | void VkEncoder::vkDestroyDevice( |
| 635 | VkDevice device, |
| 636 | const VkAllocationCallbacks* pAllocator) |
| 637 | { |
| 638 | auto stream = mImpl->stream(); |
| 639 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 640 | auto resources = mImpl->resources(); |
| 641 | auto pool = mImpl->pool(); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 642 | VkDevice local_device; |
| 643 | local_device = device; |
| 644 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 645 | VkAllocationCallbacks* local_pAllocator; |
| 646 | local_pAllocator = nullptr; |
| 647 | if (pAllocator) |
| 648 | { |
| 649 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 650 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 651 | } |
| 652 | if (local_pAllocator) |
| 653 | { |
| 654 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 655 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 656 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 657 | countingStream->rewind(); |
| 658 | { |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 659 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 660 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 661 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 662 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 663 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 664 | } |
| 665 | } |
| 666 | uint32_t packetSize_vkDestroyDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 667 | countingStream->rewind(); |
| 668 | uint32_t opcode_vkDestroyDevice = OP_vkDestroyDevice; |
| 669 | stream->write(&opcode_vkDestroyDevice, sizeof(uint32_t)); |
| 670 | stream->write(&packetSize_vkDestroyDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 671 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 672 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 673 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 674 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 675 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 676 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 677 | resources->destroyMapping()->mapHandles_VkDevice((VkDevice*)&device); |
| 678 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 679 | } |
| 680 | |
| 681 | VkResult VkEncoder::vkEnumerateInstanceExtensionProperties( |
| 682 | const char* pLayerName, |
| 683 | uint32_t* pPropertyCount, |
| 684 | VkExtensionProperties* pProperties) |
| 685 | { |
| 686 | auto stream = mImpl->stream(); |
| 687 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 688 | auto resources = mImpl->resources(); |
| 689 | auto pool = mImpl->pool(); |
| 690 | char* local_pLayerName; |
| 691 | local_pLayerName = nullptr; |
| 692 | if (pLayerName) |
| 693 | { |
| 694 | local_pLayerName = pool->strDup(pLayerName); |
| 695 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 696 | countingStream->rewind(); |
| 697 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 698 | countingStream->putString(local_pLayerName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 699 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 700 | if (pPropertyCount) |
| 701 | { |
| 702 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 703 | } |
| 704 | countingStream->write((VkExtensionProperties**)&pProperties, sizeof(VkExtensionProperties*)); |
| 705 | if (pProperties) |
| 706 | { |
| 707 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 708 | { |
| 709 | marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i)); |
| 710 | } |
| 711 | } |
| 712 | } |
| 713 | uint32_t packetSize_vkEnumerateInstanceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 714 | countingStream->rewind(); |
| 715 | uint32_t opcode_vkEnumerateInstanceExtensionProperties = OP_vkEnumerateInstanceExtensionProperties; |
| 716 | stream->write(&opcode_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| 717 | stream->write(&packetSize_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 718 | stream->putString(local_pLayerName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 719 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 720 | if (pPropertyCount) |
| 721 | { |
| 722 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 723 | } |
| 724 | stream->write((VkExtensionProperties**)&pProperties, sizeof(VkExtensionProperties*)); |
| 725 | if (pProperties) |
| 726 | { |
| 727 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 728 | { |
| 729 | marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 730 | } |
| 731 | } |
| 732 | uint32_t* check_pPropertyCount; |
| 733 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 734 | if (pPropertyCount) |
| 735 | { |
| 736 | if (!(check_pPropertyCount)) |
| 737 | { |
| 738 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 739 | } |
| 740 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 741 | } |
| 742 | VkExtensionProperties* check_pProperties; |
| 743 | stream->read((VkExtensionProperties**)&check_pProperties, sizeof(VkExtensionProperties*)); |
| 744 | if (pProperties) |
| 745 | { |
| 746 | if (!(check_pProperties)) |
| 747 | { |
| 748 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 749 | } |
| 750 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 751 | { |
| 752 | unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 753 | } |
| 754 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 755 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 756 | VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0; |
| 757 | stream->read(&vkEnumerateInstanceExtensionProperties_VkResult_return, sizeof(VkResult)); |
| 758 | return vkEnumerateInstanceExtensionProperties_VkResult_return; |
| 759 | } |
| 760 | |
| 761 | VkResult VkEncoder::vkEnumerateDeviceExtensionProperties( |
| 762 | VkPhysicalDevice physicalDevice, |
| 763 | const char* pLayerName, |
| 764 | uint32_t* pPropertyCount, |
| 765 | VkExtensionProperties* pProperties) |
| 766 | { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 767 | VkResult vkEnumerateDeviceExtensionProperties_VkResult_return = (VkResult)0; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 768 | vkEnumerateDeviceExtensionProperties_VkResult_return = goldfish_vkEnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pPropertyCount, pProperties); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 769 | return vkEnumerateDeviceExtensionProperties_VkResult_return; |
| 770 | } |
| 771 | |
| 772 | VkResult VkEncoder::vkEnumerateInstanceLayerProperties( |
| 773 | uint32_t* pPropertyCount, |
| 774 | VkLayerProperties* pProperties) |
| 775 | { |
| 776 | auto stream = mImpl->stream(); |
| 777 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 778 | auto resources = mImpl->resources(); |
| 779 | auto pool = mImpl->pool(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 780 | countingStream->rewind(); |
| 781 | { |
| 782 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 783 | if (pPropertyCount) |
| 784 | { |
| 785 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 786 | } |
| 787 | countingStream->write((VkLayerProperties**)&pProperties, sizeof(VkLayerProperties*)); |
| 788 | if (pProperties) |
| 789 | { |
| 790 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 791 | { |
| 792 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 793 | } |
| 794 | } |
| 795 | } |
| 796 | uint32_t packetSize_vkEnumerateInstanceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 797 | countingStream->rewind(); |
| 798 | uint32_t opcode_vkEnumerateInstanceLayerProperties = OP_vkEnumerateInstanceLayerProperties; |
| 799 | stream->write(&opcode_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| 800 | stream->write(&packetSize_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| 801 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 802 | if (pPropertyCount) |
| 803 | { |
| 804 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 805 | } |
| 806 | stream->write((VkLayerProperties**)&pProperties, sizeof(VkLayerProperties*)); |
| 807 | if (pProperties) |
| 808 | { |
| 809 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 810 | { |
| 811 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 812 | } |
| 813 | } |
| 814 | uint32_t* check_pPropertyCount; |
| 815 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 816 | if (pPropertyCount) |
| 817 | { |
| 818 | if (!(check_pPropertyCount)) |
| 819 | { |
| 820 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 821 | } |
| 822 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 823 | } |
| 824 | VkLayerProperties* check_pProperties; |
| 825 | stream->read((VkLayerProperties**)&check_pProperties, sizeof(VkLayerProperties*)); |
| 826 | if (pProperties) |
| 827 | { |
| 828 | if (!(check_pProperties)) |
| 829 | { |
| 830 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 831 | } |
| 832 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 833 | { |
| 834 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 835 | } |
| 836 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 837 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 838 | VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0; |
| 839 | stream->read(&vkEnumerateInstanceLayerProperties_VkResult_return, sizeof(VkResult)); |
| 840 | return vkEnumerateInstanceLayerProperties_VkResult_return; |
| 841 | } |
| 842 | |
| 843 | VkResult VkEncoder::vkEnumerateDeviceLayerProperties( |
| 844 | VkPhysicalDevice physicalDevice, |
| 845 | uint32_t* pPropertyCount, |
| 846 | VkLayerProperties* pProperties) |
| 847 | { |
| 848 | auto stream = mImpl->stream(); |
| 849 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 850 | auto resources = mImpl->resources(); |
| 851 | auto pool = mImpl->pool(); |
| 852 | VkPhysicalDevice local_physicalDevice; |
| 853 | local_physicalDevice = physicalDevice; |
| 854 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 855 | countingStream->rewind(); |
| 856 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 857 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 858 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 859 | if (pPropertyCount) |
| 860 | { |
| 861 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 862 | } |
| 863 | countingStream->write((VkLayerProperties**)&pProperties, sizeof(VkLayerProperties*)); |
| 864 | if (pProperties) |
| 865 | { |
| 866 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 867 | { |
| 868 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 869 | } |
| 870 | } |
| 871 | } |
| 872 | uint32_t packetSize_vkEnumerateDeviceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 873 | countingStream->rewind(); |
| 874 | uint32_t opcode_vkEnumerateDeviceLayerProperties = OP_vkEnumerateDeviceLayerProperties; |
| 875 | stream->write(&opcode_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| 876 | stream->write(&packetSize_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 877 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 878 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 879 | if (pPropertyCount) |
| 880 | { |
| 881 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 882 | } |
| 883 | stream->write((VkLayerProperties**)&pProperties, sizeof(VkLayerProperties*)); |
| 884 | if (pProperties) |
| 885 | { |
| 886 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 887 | { |
| 888 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 889 | } |
| 890 | } |
| 891 | uint32_t* check_pPropertyCount; |
| 892 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 893 | if (pPropertyCount) |
| 894 | { |
| 895 | if (!(check_pPropertyCount)) |
| 896 | { |
| 897 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 898 | } |
| 899 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 900 | } |
| 901 | VkLayerProperties* check_pProperties; |
| 902 | stream->read((VkLayerProperties**)&check_pProperties, sizeof(VkLayerProperties*)); |
| 903 | if (pProperties) |
| 904 | { |
| 905 | if (!(check_pProperties)) |
| 906 | { |
| 907 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 908 | } |
| 909 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 910 | { |
| 911 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 912 | } |
| 913 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 914 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 915 | VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0; |
| 916 | stream->read(&vkEnumerateDeviceLayerProperties_VkResult_return, sizeof(VkResult)); |
| 917 | return vkEnumerateDeviceLayerProperties_VkResult_return; |
| 918 | } |
| 919 | |
| 920 | void VkEncoder::vkGetDeviceQueue( |
| 921 | VkDevice device, |
| 922 | uint32_t queueFamilyIndex, |
| 923 | uint32_t queueIndex, |
| 924 | VkQueue* pQueue) |
| 925 | { |
| 926 | auto stream = mImpl->stream(); |
| 927 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 928 | auto resources = mImpl->resources(); |
| 929 | auto pool = mImpl->pool(); |
| 930 | VkDevice local_device; |
| 931 | local_device = device; |
| 932 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 933 | uint32_t local_queueFamilyIndex; |
| 934 | local_queueFamilyIndex = queueFamilyIndex; |
| 935 | uint32_t local_queueIndex; |
| 936 | local_queueIndex = queueIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 937 | countingStream->rewind(); |
| 938 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 939 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 940 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 941 | countingStream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 942 | countingStream->write((VkQueue*)pQueue, sizeof(VkQueue)); |
| 943 | } |
| 944 | uint32_t packetSize_vkGetDeviceQueue = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 945 | countingStream->rewind(); |
| 946 | uint32_t opcode_vkGetDeviceQueue = OP_vkGetDeviceQueue; |
| 947 | stream->write(&opcode_vkGetDeviceQueue, sizeof(uint32_t)); |
| 948 | stream->write(&packetSize_vkGetDeviceQueue, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 949 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 950 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 951 | stream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 952 | stream->write((VkQueue*)pQueue, sizeof(VkQueue)); |
| 953 | stream->read((VkQueue*)pQueue, sizeof(VkQueue)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 954 | if (pQueue) |
| 955 | { |
| 956 | resources->createMapping()->mapHandles_VkQueue((VkQueue*)pQueue, 1); |
| 957 | } |
| 958 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 959 | } |
| 960 | |
| 961 | VkResult VkEncoder::vkQueueSubmit( |
| 962 | VkQueue queue, |
| 963 | uint32_t submitCount, |
| 964 | const VkSubmitInfo* pSubmits, |
| 965 | VkFence fence) |
| 966 | { |
| 967 | auto stream = mImpl->stream(); |
| 968 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 969 | auto resources = mImpl->resources(); |
| 970 | auto pool = mImpl->pool(); |
| 971 | VkQueue local_queue; |
| 972 | local_queue = queue; |
| 973 | resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue); |
| 974 | uint32_t local_submitCount; |
| 975 | local_submitCount = submitCount; |
| 976 | VkSubmitInfo* local_pSubmits; |
| 977 | local_pSubmits = nullptr; |
| 978 | if (pSubmits) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 979 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 980 | local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 981 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 982 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 983 | deepcopy_VkSubmitInfo(pool, pSubmits + i, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 984 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 985 | } |
| 986 | if (local_pSubmits) |
| 987 | { |
| 988 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 989 | { |
| 990 | handlemap_VkSubmitInfo(resources->unwrapMapping(), (VkSubmitInfo*)(local_pSubmits + i)); |
| 991 | } |
| 992 | } |
| 993 | VkFence local_fence; |
| 994 | local_fence = fence; |
| 995 | resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence); |
| 996 | countingStream->rewind(); |
| 997 | { |
| 998 | countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 999 | countingStream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| 1000 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1001 | { |
| 1002 | marshal_VkSubmitInfo(countingStream, (VkSubmitInfo*)(local_pSubmits + i)); |
| 1003 | } |
| 1004 | countingStream->write((VkFence*)&local_fence, sizeof(VkFence)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1005 | } |
| 1006 | uint32_t packetSize_vkQueueSubmit = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1007 | countingStream->rewind(); |
| 1008 | uint32_t opcode_vkQueueSubmit = OP_vkQueueSubmit; |
| 1009 | stream->write(&opcode_vkQueueSubmit, sizeof(uint32_t)); |
| 1010 | stream->write(&packetSize_vkQueueSubmit, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1011 | stream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 1012 | stream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1013 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1014 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1015 | marshal_VkSubmitInfo(stream, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1016 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1017 | stream->write((VkFence*)&local_fence, sizeof(VkFence)); |
| 1018 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1019 | VkResult vkQueueSubmit_VkResult_return = (VkResult)0; |
| 1020 | stream->read(&vkQueueSubmit_VkResult_return, sizeof(VkResult)); |
| 1021 | return vkQueueSubmit_VkResult_return; |
| 1022 | } |
| 1023 | |
| 1024 | VkResult VkEncoder::vkQueueWaitIdle( |
| 1025 | VkQueue queue) |
| 1026 | { |
| 1027 | auto stream = mImpl->stream(); |
| 1028 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1029 | 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); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1034 | countingStream->rewind(); |
| 1035 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1036 | countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1037 | } |
| 1038 | uint32_t packetSize_vkQueueWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1039 | countingStream->rewind(); |
| 1040 | uint32_t opcode_vkQueueWaitIdle = OP_vkQueueWaitIdle; |
| 1041 | stream->write(&opcode_vkQueueWaitIdle, sizeof(uint32_t)); |
| 1042 | stream->write(&packetSize_vkQueueWaitIdle, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1043 | stream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 1044 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1045 | VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0; |
| 1046 | stream->read(&vkQueueWaitIdle_VkResult_return, sizeof(VkResult)); |
| 1047 | return vkQueueWaitIdle_VkResult_return; |
| 1048 | } |
| 1049 | |
| 1050 | VkResult VkEncoder::vkDeviceWaitIdle( |
| 1051 | VkDevice device) |
| 1052 | { |
| 1053 | auto stream = mImpl->stream(); |
| 1054 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1055 | auto resources = mImpl->resources(); |
| 1056 | auto pool = mImpl->pool(); |
| 1057 | VkDevice local_device; |
| 1058 | local_device = device; |
| 1059 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1060 | countingStream->rewind(); |
| 1061 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1062 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1063 | } |
| 1064 | uint32_t packetSize_vkDeviceWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1065 | countingStream->rewind(); |
| 1066 | uint32_t opcode_vkDeviceWaitIdle = OP_vkDeviceWaitIdle; |
| 1067 | stream->write(&opcode_vkDeviceWaitIdle, sizeof(uint32_t)); |
| 1068 | stream->write(&packetSize_vkDeviceWaitIdle, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1069 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1070 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1071 | VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0; |
| 1072 | stream->read(&vkDeviceWaitIdle_VkResult_return, sizeof(VkResult)); |
| 1073 | return vkDeviceWaitIdle_VkResult_return; |
| 1074 | } |
| 1075 | |
| 1076 | VkResult VkEncoder::vkAllocateMemory( |
| 1077 | VkDevice device, |
| 1078 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 1079 | const VkAllocationCallbacks* pAllocator, |
| 1080 | VkDeviceMemory* pMemory) |
| 1081 | { |
| 1082 | auto stream = mImpl->stream(); |
| 1083 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1084 | auto resources = mImpl->resources(); |
| 1085 | auto pool = mImpl->pool(); |
| 1086 | VkDevice local_device; |
| 1087 | local_device = device; |
| 1088 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1089 | VkMemoryAllocateInfo* local_pAllocateInfo; |
| 1090 | local_pAllocateInfo = nullptr; |
| 1091 | if (pAllocateInfo) |
| 1092 | { |
| 1093 | local_pAllocateInfo = (VkMemoryAllocateInfo*)pool->alloc(sizeof(const VkMemoryAllocateInfo)); |
| 1094 | deepcopy_VkMemoryAllocateInfo(pool, pAllocateInfo, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| 1095 | } |
| 1096 | if (local_pAllocateInfo) |
| 1097 | { |
| 1098 | handlemap_VkMemoryAllocateInfo(resources->unwrapMapping(), (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| 1099 | } |
| 1100 | VkAllocationCallbacks* local_pAllocator; |
| 1101 | local_pAllocator = nullptr; |
| 1102 | if (pAllocator) |
| 1103 | { |
| 1104 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1105 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1106 | } |
| 1107 | if (local_pAllocator) |
| 1108 | { |
| 1109 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 1110 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1111 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1112 | countingStream->rewind(); |
| 1113 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1114 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1115 | marshal_VkMemoryAllocateInfo(countingStream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| 1116 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 1117 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1118 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1119 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1120 | } |
| 1121 | countingStream->write((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory)); |
| 1122 | } |
| 1123 | uint32_t packetSize_vkAllocateMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1124 | countingStream->rewind(); |
| 1125 | uint32_t opcode_vkAllocateMemory = OP_vkAllocateMemory; |
| 1126 | stream->write(&opcode_vkAllocateMemory, sizeof(uint32_t)); |
| 1127 | stream->write(&packetSize_vkAllocateMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1128 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1129 | marshal_VkMemoryAllocateInfo(stream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| 1130 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 1131 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1132 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1133 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1134 | } |
| 1135 | stream->write((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory)); |
| 1136 | stream->read((VkDeviceMemory*)pMemory, sizeof(VkDeviceMemory)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1137 | if (pMemory) |
| 1138 | { |
| 1139 | resources->createMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)pMemory, 1); |
| 1140 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1141 | goldfish_vkAllocateMemory(device, pAllocateInfo, pAllocator, pMemory); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1142 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1143 | VkResult vkAllocateMemory_VkResult_return = (VkResult)0; |
| 1144 | stream->read(&vkAllocateMemory_VkResult_return, sizeof(VkResult)); |
| 1145 | return vkAllocateMemory_VkResult_return; |
| 1146 | } |
| 1147 | |
| 1148 | void VkEncoder::vkFreeMemory( |
| 1149 | VkDevice device, |
| 1150 | VkDeviceMemory memory, |
| 1151 | const VkAllocationCallbacks* pAllocator) |
| 1152 | { |
| 1153 | auto stream = mImpl->stream(); |
| 1154 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1155 | auto resources = mImpl->resources(); |
| 1156 | auto pool = mImpl->pool(); |
| 1157 | VkDevice local_device; |
| 1158 | local_device = device; |
| 1159 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1160 | VkDeviceMemory local_memory; |
| 1161 | local_memory = memory; |
| 1162 | resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1163 | VkAllocationCallbacks* local_pAllocator; |
| 1164 | local_pAllocator = nullptr; |
| 1165 | if (pAllocator) |
| 1166 | { |
| 1167 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1168 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1169 | } |
| 1170 | if (local_pAllocator) |
| 1171 | { |
| 1172 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 1173 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1174 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1175 | countingStream->rewind(); |
| 1176 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1177 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1178 | countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1179 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 1180 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1181 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1182 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1183 | } |
| 1184 | } |
| 1185 | uint32_t packetSize_vkFreeMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1186 | countingStream->rewind(); |
| 1187 | uint32_t opcode_vkFreeMemory = OP_vkFreeMemory; |
| 1188 | stream->write(&opcode_vkFreeMemory, sizeof(uint32_t)); |
| 1189 | stream->write(&packetSize_vkFreeMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1190 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1191 | stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1192 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 1193 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1194 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1195 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1196 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1197 | resources->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory); |
| 1198 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1199 | } |
| 1200 | |
| 1201 | VkResult VkEncoder::vkMapMemory( |
| 1202 | VkDevice device, |
| 1203 | VkDeviceMemory memory, |
| 1204 | VkDeviceSize offset, |
| 1205 | VkDeviceSize size, |
| 1206 | VkMemoryMapFlags flags, |
| 1207 | void** ppData) |
| 1208 | { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1209 | VkResult vkMapMemory_VkResult_return = (VkResult)0; |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1210 | vkMapMemory_VkResult_return = goldfish_vkMapMemory(device, memory, offset, size, flags, ppData); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1211 | return vkMapMemory_VkResult_return; |
| 1212 | } |
| 1213 | |
| 1214 | void VkEncoder::vkUnmapMemory( |
| 1215 | VkDevice device, |
| 1216 | VkDeviceMemory memory) |
| 1217 | { |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1218 | goldfish_vkUnmapMemory(device, memory); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1219 | } |
| 1220 | |
| 1221 | VkResult VkEncoder::vkFlushMappedMemoryRanges( |
| 1222 | VkDevice device, |
| 1223 | uint32_t memoryRangeCount, |
| 1224 | const VkMappedMemoryRange* pMemoryRanges) |
| 1225 | { |
| 1226 | auto stream = mImpl->stream(); |
| 1227 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1228 | auto resources = mImpl->resources(); |
| 1229 | auto pool = mImpl->pool(); |
| 1230 | VkDevice local_device; |
| 1231 | local_device = device; |
| 1232 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1233 | uint32_t local_memoryRangeCount; |
| 1234 | local_memoryRangeCount = memoryRangeCount; |
| 1235 | VkMappedMemoryRange* local_pMemoryRanges; |
| 1236 | local_pMemoryRanges = nullptr; |
| 1237 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1238 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1239 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1240 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1241 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1242 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1243 | } |
| 1244 | } |
| 1245 | if (local_pMemoryRanges) |
| 1246 | { |
| 1247 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1248 | { |
| 1249 | handlemap_VkMappedMemoryRange(resources->unwrapMapping(), (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1250 | } |
| 1251 | } |
| 1252 | countingStream->rewind(); |
| 1253 | { |
| 1254 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1255 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 1256 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1257 | { |
| 1258 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1259 | } |
| 1260 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1261 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1262 | { |
| 1263 | auto range = pMemoryRanges[i]; |
| 1264 | auto memory = pMemoryRanges[i].memory; |
| 1265 | auto size = pMemoryRanges[i].size; |
| 1266 | auto offset = pMemoryRanges[i].offset; |
| 1267 | auto goldfishMem = as_goldfish_VkDeviceMemory(memory); |
| 1268 | size_t streamSize = 0; |
| 1269 | if (!goldfishMem) { countingStream->write(&streamSize, sizeof(size_t)); continue; }; |
| 1270 | auto hostPtr = goldfishMem->ptr; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1271 | auto actualSize = size == VK_WHOLE_SIZE ? goldfishMem->size : size; |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1272 | if (!hostPtr) { countingStream->write(&streamSize, sizeof(size_t)); continue; }; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1273 | streamSize = actualSize; |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1274 | countingStream->write(&streamSize, sizeof(size_t)); |
| 1275 | uint8_t* targetRange = hostPtr + offset; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1276 | countingStream->write(targetRange, actualSize); |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1277 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1278 | uint32_t packetSize_vkFlushMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1279 | countingStream->rewind(); |
| 1280 | uint32_t opcode_vkFlushMappedMemoryRanges = OP_vkFlushMappedMemoryRanges; |
| 1281 | stream->write(&opcode_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| 1282 | stream->write(&packetSize_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1283 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1284 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1285 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1286 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1287 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1288 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1289 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1290 | { |
| 1291 | auto range = pMemoryRanges[i]; |
| 1292 | auto memory = pMemoryRanges[i].memory; |
| 1293 | auto size = pMemoryRanges[i].size; |
| 1294 | auto offset = pMemoryRanges[i].offset; |
| 1295 | auto goldfishMem = as_goldfish_VkDeviceMemory(memory); |
| 1296 | size_t streamSize = 0; |
| 1297 | if (!goldfishMem) { stream->write(&streamSize, sizeof(size_t)); continue; }; |
| 1298 | auto hostPtr = goldfishMem->ptr; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1299 | auto actualSize = size == VK_WHOLE_SIZE ? goldfishMem->size : size; |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1300 | if (!hostPtr) { stream->write(&streamSize, sizeof(size_t)); continue; }; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1301 | streamSize = actualSize; |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1302 | stream->write(&streamSize, sizeof(size_t)); |
| 1303 | uint8_t* targetRange = hostPtr + offset; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1304 | stream->write(targetRange, actualSize); |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1305 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1306 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1307 | VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 1308 | stream->read(&vkFlushMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| 1309 | return vkFlushMappedMemoryRanges_VkResult_return; |
| 1310 | } |
| 1311 | |
| 1312 | VkResult VkEncoder::vkInvalidateMappedMemoryRanges( |
| 1313 | VkDevice device, |
| 1314 | uint32_t memoryRangeCount, |
| 1315 | const VkMappedMemoryRange* pMemoryRanges) |
| 1316 | { |
| 1317 | auto stream = mImpl->stream(); |
| 1318 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1319 | auto resources = mImpl->resources(); |
| 1320 | auto pool = mImpl->pool(); |
| 1321 | VkDevice local_device; |
| 1322 | local_device = device; |
| 1323 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1324 | uint32_t local_memoryRangeCount; |
| 1325 | local_memoryRangeCount = memoryRangeCount; |
| 1326 | VkMappedMemoryRange* local_pMemoryRanges; |
| 1327 | local_pMemoryRanges = nullptr; |
| 1328 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1329 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1330 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1331 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1332 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1333 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1334 | } |
| 1335 | } |
| 1336 | if (local_pMemoryRanges) |
| 1337 | { |
| 1338 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1339 | { |
| 1340 | handlemap_VkMappedMemoryRange(resources->unwrapMapping(), (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1341 | } |
| 1342 | } |
| 1343 | countingStream->rewind(); |
| 1344 | { |
| 1345 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1346 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 1347 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1348 | { |
| 1349 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1350 | } |
| 1351 | } |
| 1352 | uint32_t packetSize_vkInvalidateMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1353 | countingStream->rewind(); |
| 1354 | uint32_t opcode_vkInvalidateMappedMemoryRanges = OP_vkInvalidateMappedMemoryRanges; |
| 1355 | stream->write(&opcode_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| 1356 | stream->write(&packetSize_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1357 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1358 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1359 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1360 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1361 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1362 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1363 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1364 | VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 1365 | stream->read(&vkInvalidateMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1366 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1367 | { |
| 1368 | auto range = pMemoryRanges[i]; |
| 1369 | auto memory = pMemoryRanges[i].memory; |
| 1370 | auto size = pMemoryRanges[i].size; |
| 1371 | auto offset = pMemoryRanges[i].offset; |
| 1372 | auto goldfishMem = as_goldfish_VkDeviceMemory(memory); |
| 1373 | size_t streamSize = 0; |
| 1374 | if (!goldfishMem) { stream->read(&streamSize, sizeof(size_t)); continue; }; |
| 1375 | auto hostPtr = goldfishMem->ptr; |
| 1376 | auto actualSize = size == VK_WHOLE_SIZE ? goldfishMem->size : size; |
| 1377 | if (!hostPtr) { stream->read(&streamSize, sizeof(size_t)); continue; }; |
| 1378 | streamSize = actualSize; |
| 1379 | stream->read(&streamSize, sizeof(size_t)); |
| 1380 | uint8_t* targetRange = hostPtr + offset; |
| 1381 | stream->read(targetRange, actualSize); |
| 1382 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1383 | return vkInvalidateMappedMemoryRanges_VkResult_return; |
| 1384 | } |
| 1385 | |
| 1386 | void VkEncoder::vkGetDeviceMemoryCommitment( |
| 1387 | VkDevice device, |
| 1388 | VkDeviceMemory memory, |
| 1389 | VkDeviceSize* pCommittedMemoryInBytes) |
| 1390 | { |
| 1391 | auto stream = mImpl->stream(); |
| 1392 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1393 | auto resources = mImpl->resources(); |
| 1394 | auto pool = mImpl->pool(); |
| 1395 | VkDevice local_device; |
| 1396 | local_device = device; |
| 1397 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1398 | VkDeviceMemory local_memory; |
| 1399 | local_memory = memory; |
| 1400 | resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1401 | countingStream->rewind(); |
| 1402 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1403 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1404 | countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1405 | countingStream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 1406 | } |
| 1407 | uint32_t packetSize_vkGetDeviceMemoryCommitment = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1408 | countingStream->rewind(); |
| 1409 | uint32_t opcode_vkGetDeviceMemoryCommitment = OP_vkGetDeviceMemoryCommitment; |
| 1410 | stream->write(&opcode_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| 1411 | stream->write(&packetSize_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1412 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1413 | stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1414 | stream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 1415 | stream->read((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1416 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1417 | } |
| 1418 | |
| 1419 | VkResult VkEncoder::vkBindBufferMemory( |
| 1420 | VkDevice device, |
| 1421 | VkBuffer buffer, |
| 1422 | VkDeviceMemory memory, |
| 1423 | VkDeviceSize memoryOffset) |
| 1424 | { |
| 1425 | auto stream = mImpl->stream(); |
| 1426 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1427 | auto resources = mImpl->resources(); |
| 1428 | auto pool = mImpl->pool(); |
| 1429 | VkDevice local_device; |
| 1430 | local_device = device; |
| 1431 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1432 | VkBuffer local_buffer; |
| 1433 | local_buffer = buffer; |
| 1434 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer); |
| 1435 | VkDeviceMemory local_memory; |
| 1436 | local_memory = memory; |
| 1437 | resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory); |
| 1438 | VkDeviceSize local_memoryOffset; |
| 1439 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1440 | countingStream->rewind(); |
| 1441 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1442 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1443 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 1444 | countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory)); |
| 1445 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1446 | } |
| 1447 | uint32_t packetSize_vkBindBufferMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1448 | countingStream->rewind(); |
| 1449 | uint32_t opcode_vkBindBufferMemory = OP_vkBindBufferMemory; |
| 1450 | stream->write(&opcode_vkBindBufferMemory, sizeof(uint32_t)); |
| 1451 | stream->write(&packetSize_vkBindBufferMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1452 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1453 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 1454 | stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory)); |
| 1455 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| 1456 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1457 | VkResult vkBindBufferMemory_VkResult_return = (VkResult)0; |
| 1458 | stream->read(&vkBindBufferMemory_VkResult_return, sizeof(VkResult)); |
| 1459 | return vkBindBufferMemory_VkResult_return; |
| 1460 | } |
| 1461 | |
| 1462 | VkResult VkEncoder::vkBindImageMemory( |
| 1463 | VkDevice device, |
| 1464 | VkImage image, |
| 1465 | VkDeviceMemory memory, |
| 1466 | VkDeviceSize memoryOffset) |
| 1467 | { |
| 1468 | auto stream = mImpl->stream(); |
| 1469 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1470 | auto resources = mImpl->resources(); |
| 1471 | auto pool = mImpl->pool(); |
| 1472 | VkDevice local_device; |
| 1473 | local_device = device; |
| 1474 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1475 | VkImage local_image; |
| 1476 | local_image = image; |
| 1477 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image); |
| 1478 | VkDeviceMemory local_memory; |
| 1479 | local_memory = memory; |
| 1480 | resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory); |
| 1481 | VkDeviceSize local_memoryOffset; |
| 1482 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1483 | countingStream->rewind(); |
| 1484 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1485 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1486 | countingStream->write((VkImage*)&local_image, sizeof(VkImage)); |
| 1487 | countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory)); |
| 1488 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1489 | } |
| 1490 | uint32_t packetSize_vkBindImageMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1491 | countingStream->rewind(); |
| 1492 | uint32_t opcode_vkBindImageMemory = OP_vkBindImageMemory; |
| 1493 | stream->write(&opcode_vkBindImageMemory, sizeof(uint32_t)); |
| 1494 | stream->write(&packetSize_vkBindImageMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1495 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1496 | stream->write((VkImage*)&local_image, sizeof(VkImage)); |
| 1497 | stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory)); |
| 1498 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| 1499 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1500 | VkResult vkBindImageMemory_VkResult_return = (VkResult)0; |
| 1501 | stream->read(&vkBindImageMemory_VkResult_return, sizeof(VkResult)); |
| 1502 | return vkBindImageMemory_VkResult_return; |
| 1503 | } |
| 1504 | |
| 1505 | void VkEncoder::vkGetBufferMemoryRequirements( |
| 1506 | VkDevice device, |
| 1507 | VkBuffer buffer, |
| 1508 | VkMemoryRequirements* pMemoryRequirements) |
| 1509 | { |
| 1510 | auto stream = mImpl->stream(); |
| 1511 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1512 | 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); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1520 | countingStream->rewind(); |
| 1521 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1522 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1523 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1524 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1525 | } |
| 1526 | uint32_t packetSize_vkGetBufferMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1527 | countingStream->rewind(); |
| 1528 | uint32_t opcode_vkGetBufferMemoryRequirements = OP_vkGetBufferMemoryRequirements; |
| 1529 | stream->write(&opcode_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| 1530 | stream->write(&packetSize_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1531 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1532 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1533 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1534 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1535 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1536 | } |
| 1537 | |
| 1538 | void VkEncoder::vkGetImageMemoryRequirements( |
| 1539 | VkDevice device, |
| 1540 | VkImage image, |
| 1541 | VkMemoryRequirements* pMemoryRequirements) |
| 1542 | { |
| 1543 | auto stream = mImpl->stream(); |
| 1544 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1545 | auto resources = mImpl->resources(); |
| 1546 | auto pool = mImpl->pool(); |
| 1547 | VkDevice local_device; |
| 1548 | local_device = device; |
| 1549 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1550 | VkImage local_image; |
| 1551 | local_image = image; |
| 1552 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1553 | countingStream->rewind(); |
| 1554 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1555 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1556 | countingStream->write((VkImage*)&local_image, sizeof(VkImage)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1557 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1558 | } |
| 1559 | uint32_t packetSize_vkGetImageMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1560 | countingStream->rewind(); |
| 1561 | uint32_t opcode_vkGetImageMemoryRequirements = OP_vkGetImageMemoryRequirements; |
| 1562 | stream->write(&opcode_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| 1563 | stream->write(&packetSize_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1564 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1565 | stream->write((VkImage*)&local_image, sizeof(VkImage)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1566 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1567 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1568 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1569 | } |
| 1570 | |
| 1571 | void VkEncoder::vkGetImageSparseMemoryRequirements( |
| 1572 | VkDevice device, |
| 1573 | VkImage image, |
| 1574 | uint32_t* pSparseMemoryRequirementCount, |
| 1575 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 1576 | { |
| 1577 | auto stream = mImpl->stream(); |
| 1578 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1579 | auto resources = mImpl->resources(); |
| 1580 | auto pool = mImpl->pool(); |
| 1581 | VkDevice local_device; |
| 1582 | local_device = device; |
| 1583 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1584 | VkImage local_image; |
| 1585 | local_image = image; |
| 1586 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1587 | countingStream->rewind(); |
| 1588 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1589 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1590 | countingStream->write((VkImage*)&local_image, sizeof(VkImage)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1591 | countingStream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*)); |
| 1592 | if (pSparseMemoryRequirementCount) |
| 1593 | { |
| 1594 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 1595 | } |
| 1596 | countingStream->write((VkSparseImageMemoryRequirements**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements*)); |
| 1597 | if (pSparseMemoryRequirements) |
| 1598 | { |
| 1599 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 1600 | { |
| 1601 | marshal_VkSparseImageMemoryRequirements(countingStream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 1602 | } |
| 1603 | } |
| 1604 | } |
| 1605 | uint32_t packetSize_vkGetImageSparseMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1606 | countingStream->rewind(); |
| 1607 | uint32_t opcode_vkGetImageSparseMemoryRequirements = OP_vkGetImageSparseMemoryRequirements; |
| 1608 | stream->write(&opcode_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| 1609 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1610 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1611 | stream->write((VkImage*)&local_image, sizeof(VkImage)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1612 | stream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*)); |
| 1613 | if (pSparseMemoryRequirementCount) |
| 1614 | { |
| 1615 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 1616 | } |
| 1617 | stream->write((VkSparseImageMemoryRequirements**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements*)); |
| 1618 | if (pSparseMemoryRequirements) |
| 1619 | { |
| 1620 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 1621 | { |
| 1622 | marshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 1623 | } |
| 1624 | } |
| 1625 | uint32_t* check_pSparseMemoryRequirementCount; |
| 1626 | stream->read((uint32_t**)&check_pSparseMemoryRequirementCount, sizeof(uint32_t*)); |
| 1627 | if (pSparseMemoryRequirementCount) |
| 1628 | { |
| 1629 | if (!(check_pSparseMemoryRequirementCount)) |
| 1630 | { |
| 1631 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 1632 | } |
| 1633 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 1634 | } |
| 1635 | VkSparseImageMemoryRequirements* check_pSparseMemoryRequirements; |
| 1636 | stream->read((VkSparseImageMemoryRequirements**)&check_pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements*)); |
| 1637 | if (pSparseMemoryRequirements) |
| 1638 | { |
| 1639 | if (!(check_pSparseMemoryRequirements)) |
| 1640 | { |
| 1641 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 1642 | } |
| 1643 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 1644 | { |
| 1645 | unmarshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 1646 | } |
| 1647 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1648 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1649 | } |
| 1650 | |
| 1651 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties( |
| 1652 | VkPhysicalDevice physicalDevice, |
| 1653 | VkFormat format, |
| 1654 | VkImageType type, |
| 1655 | VkSampleCountFlagBits samples, |
| 1656 | VkImageUsageFlags usage, |
| 1657 | VkImageTiling tiling, |
| 1658 | uint32_t* pPropertyCount, |
| 1659 | VkSparseImageFormatProperties* pProperties) |
| 1660 | { |
| 1661 | auto stream = mImpl->stream(); |
| 1662 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1663 | auto resources = mImpl->resources(); |
| 1664 | auto pool = mImpl->pool(); |
| 1665 | VkPhysicalDevice local_physicalDevice; |
| 1666 | local_physicalDevice = physicalDevice; |
| 1667 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 1668 | VkFormat local_format; |
| 1669 | local_format = format; |
| 1670 | VkImageType local_type; |
| 1671 | local_type = type; |
| 1672 | VkSampleCountFlagBits local_samples; |
| 1673 | local_samples = samples; |
| 1674 | VkImageUsageFlags local_usage; |
| 1675 | local_usage = usage; |
| 1676 | VkImageTiling local_tiling; |
| 1677 | local_tiling = tiling; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1678 | countingStream->rewind(); |
| 1679 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1680 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 1681 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 1682 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 1683 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 1684 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 1685 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1686 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 1687 | if (pPropertyCount) |
| 1688 | { |
| 1689 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1690 | } |
| 1691 | countingStream->write((VkSparseImageFormatProperties**)&pProperties, sizeof(VkSparseImageFormatProperties*)); |
| 1692 | if (pProperties) |
| 1693 | { |
| 1694 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1695 | { |
| 1696 | marshal_VkSparseImageFormatProperties(countingStream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 1697 | } |
| 1698 | } |
| 1699 | } |
| 1700 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1701 | countingStream->rewind(); |
| 1702 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties = OP_vkGetPhysicalDeviceSparseImageFormatProperties; |
| 1703 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| 1704 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1705 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 1706 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 1707 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 1708 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 1709 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 1710 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1711 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 1712 | if (pPropertyCount) |
| 1713 | { |
| 1714 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1715 | } |
| 1716 | stream->write((VkSparseImageFormatProperties**)&pProperties, sizeof(VkSparseImageFormatProperties*)); |
| 1717 | if (pProperties) |
| 1718 | { |
| 1719 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1720 | { |
| 1721 | marshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 1722 | } |
| 1723 | } |
| 1724 | uint32_t* check_pPropertyCount; |
| 1725 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 1726 | if (pPropertyCount) |
| 1727 | { |
| 1728 | if (!(check_pPropertyCount)) |
| 1729 | { |
| 1730 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1731 | } |
| 1732 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1733 | } |
| 1734 | VkSparseImageFormatProperties* check_pProperties; |
| 1735 | stream->read((VkSparseImageFormatProperties**)&check_pProperties, sizeof(VkSparseImageFormatProperties*)); |
| 1736 | if (pProperties) |
| 1737 | { |
| 1738 | if (!(check_pProperties)) |
| 1739 | { |
| 1740 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1741 | } |
| 1742 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1743 | { |
| 1744 | unmarshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 1745 | } |
| 1746 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1747 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1748 | } |
| 1749 | |
| 1750 | VkResult VkEncoder::vkQueueBindSparse( |
| 1751 | VkQueue queue, |
| 1752 | uint32_t bindInfoCount, |
| 1753 | const VkBindSparseInfo* pBindInfo, |
| 1754 | VkFence fence) |
| 1755 | { |
| 1756 | auto stream = mImpl->stream(); |
| 1757 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1758 | auto resources = mImpl->resources(); |
| 1759 | auto pool = mImpl->pool(); |
| 1760 | VkQueue local_queue; |
| 1761 | local_queue = queue; |
| 1762 | resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue); |
| 1763 | uint32_t local_bindInfoCount; |
| 1764 | local_bindInfoCount = bindInfoCount; |
| 1765 | VkBindSparseInfo* local_pBindInfo; |
| 1766 | local_pBindInfo = nullptr; |
| 1767 | if (pBindInfo) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1768 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1769 | local_pBindInfo = (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1770 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 1771 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1772 | deepcopy_VkBindSparseInfo(pool, pBindInfo + i, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1773 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1774 | } |
| 1775 | if (local_pBindInfo) |
| 1776 | { |
| 1777 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 1778 | { |
| 1779 | handlemap_VkBindSparseInfo(resources->unwrapMapping(), (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 1780 | } |
| 1781 | } |
| 1782 | VkFence local_fence; |
| 1783 | local_fence = fence; |
| 1784 | resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence); |
| 1785 | countingStream->rewind(); |
| 1786 | { |
| 1787 | countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 1788 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 1789 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 1790 | { |
| 1791 | marshal_VkBindSparseInfo(countingStream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 1792 | } |
| 1793 | countingStream->write((VkFence*)&local_fence, sizeof(VkFence)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1794 | } |
| 1795 | uint32_t packetSize_vkQueueBindSparse = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1796 | countingStream->rewind(); |
| 1797 | uint32_t opcode_vkQueueBindSparse = OP_vkQueueBindSparse; |
| 1798 | stream->write(&opcode_vkQueueBindSparse, sizeof(uint32_t)); |
| 1799 | stream->write(&packetSize_vkQueueBindSparse, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1800 | stream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 1801 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1802 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 1803 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1804 | marshal_VkBindSparseInfo(stream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1805 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1806 | stream->write((VkFence*)&local_fence, sizeof(VkFence)); |
| 1807 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1808 | VkResult vkQueueBindSparse_VkResult_return = (VkResult)0; |
| 1809 | stream->read(&vkQueueBindSparse_VkResult_return, sizeof(VkResult)); |
| 1810 | return vkQueueBindSparse_VkResult_return; |
| 1811 | } |
| 1812 | |
| 1813 | VkResult VkEncoder::vkCreateFence( |
| 1814 | VkDevice device, |
| 1815 | const VkFenceCreateInfo* pCreateInfo, |
| 1816 | const VkAllocationCallbacks* pAllocator, |
| 1817 | VkFence* pFence) |
| 1818 | { |
| 1819 | auto stream = mImpl->stream(); |
| 1820 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1821 | auto resources = mImpl->resources(); |
| 1822 | auto pool = mImpl->pool(); |
| 1823 | VkDevice local_device; |
| 1824 | local_device = device; |
| 1825 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1826 | VkFenceCreateInfo* local_pCreateInfo; |
| 1827 | local_pCreateInfo = nullptr; |
| 1828 | if (pCreateInfo) |
| 1829 | { |
| 1830 | local_pCreateInfo = (VkFenceCreateInfo*)pool->alloc(sizeof(const VkFenceCreateInfo)); |
| 1831 | deepcopy_VkFenceCreateInfo(pool, pCreateInfo, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| 1832 | } |
| 1833 | if (local_pCreateInfo) |
| 1834 | { |
| 1835 | handlemap_VkFenceCreateInfo(resources->unwrapMapping(), (VkFenceCreateInfo*)(local_pCreateInfo)); |
| 1836 | } |
| 1837 | VkAllocationCallbacks* local_pAllocator; |
| 1838 | local_pAllocator = nullptr; |
| 1839 | if (pAllocator) |
| 1840 | { |
| 1841 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1842 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1843 | } |
| 1844 | if (local_pAllocator) |
| 1845 | { |
| 1846 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 1847 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1848 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1849 | countingStream->rewind(); |
| 1850 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1851 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1852 | marshal_VkFenceCreateInfo(countingStream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| 1853 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 1854 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1855 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1856 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1857 | } |
| 1858 | countingStream->write((VkFence*)pFence, sizeof(VkFence)); |
| 1859 | } |
| 1860 | uint32_t packetSize_vkCreateFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1861 | countingStream->rewind(); |
| 1862 | uint32_t opcode_vkCreateFence = OP_vkCreateFence; |
| 1863 | stream->write(&opcode_vkCreateFence, sizeof(uint32_t)); |
| 1864 | stream->write(&packetSize_vkCreateFence, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1865 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1866 | marshal_VkFenceCreateInfo(stream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| 1867 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 1868 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1869 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1870 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1871 | } |
| 1872 | stream->write((VkFence*)pFence, sizeof(VkFence)); |
| 1873 | stream->read((VkFence*)pFence, sizeof(VkFence)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1874 | if (pFence) |
| 1875 | { |
| 1876 | resources->createMapping()->mapHandles_VkFence((VkFence*)pFence, 1); |
| 1877 | } |
| 1878 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1879 | VkResult vkCreateFence_VkResult_return = (VkResult)0; |
| 1880 | stream->read(&vkCreateFence_VkResult_return, sizeof(VkResult)); |
| 1881 | return vkCreateFence_VkResult_return; |
| 1882 | } |
| 1883 | |
| 1884 | void VkEncoder::vkDestroyFence( |
| 1885 | VkDevice device, |
| 1886 | VkFence fence, |
| 1887 | const VkAllocationCallbacks* pAllocator) |
| 1888 | { |
| 1889 | auto stream = mImpl->stream(); |
| 1890 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1891 | auto resources = mImpl->resources(); |
| 1892 | auto pool = mImpl->pool(); |
| 1893 | VkDevice local_device; |
| 1894 | local_device = device; |
| 1895 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1896 | VkFence local_fence; |
| 1897 | local_fence = fence; |
| 1898 | resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1899 | VkAllocationCallbacks* local_pAllocator; |
| 1900 | local_pAllocator = nullptr; |
| 1901 | if (pAllocator) |
| 1902 | { |
| 1903 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1904 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1905 | } |
| 1906 | if (local_pAllocator) |
| 1907 | { |
| 1908 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 1909 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1910 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1911 | countingStream->rewind(); |
| 1912 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1913 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1914 | countingStream->write((VkFence*)&local_fence, sizeof(VkFence)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1915 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 1916 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1917 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1918 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1919 | } |
| 1920 | } |
| 1921 | uint32_t packetSize_vkDestroyFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1922 | countingStream->rewind(); |
| 1923 | uint32_t opcode_vkDestroyFence = OP_vkDestroyFence; |
| 1924 | stream->write(&opcode_vkDestroyFence, sizeof(uint32_t)); |
| 1925 | stream->write(&packetSize_vkDestroyFence, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1926 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 1927 | stream->write((VkFence*)&local_fence, sizeof(VkFence)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1928 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 1929 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1930 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1931 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1932 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1933 | resources->destroyMapping()->mapHandles_VkFence((VkFence*)&fence); |
| 1934 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1935 | } |
| 1936 | |
| 1937 | VkResult VkEncoder::vkResetFences( |
| 1938 | VkDevice device, |
| 1939 | uint32_t fenceCount, |
| 1940 | const VkFence* pFences) |
| 1941 | { |
| 1942 | auto stream = mImpl->stream(); |
| 1943 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1944 | auto resources = mImpl->resources(); |
| 1945 | auto pool = mImpl->pool(); |
| 1946 | VkDevice local_device; |
| 1947 | local_device = device; |
| 1948 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1949 | uint32_t local_fenceCount; |
| 1950 | local_fenceCount = fenceCount; |
| 1951 | VkFence* local_pFences; |
| 1952 | local_pFences = nullptr; |
| 1953 | if (pFences) |
| 1954 | { |
| 1955 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 1956 | } |
| 1957 | if (local_pFences) |
| 1958 | { |
| 1959 | resources->unwrapMapping()->mapHandles_VkFence((VkFence*)local_pFences, ((fenceCount))); |
| 1960 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1961 | countingStream->rewind(); |
| 1962 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1963 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1964 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| 1965 | countingStream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1966 | } |
| 1967 | uint32_t packetSize_vkResetFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1968 | countingStream->rewind(); |
| 1969 | uint32_t opcode_vkResetFences = OP_vkResetFences; |
| 1970 | stream->write(&opcode_vkResetFences, sizeof(uint32_t)); |
| 1971 | stream->write(&packetSize_vkResetFences, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1972 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1973 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| 1974 | stream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence)); |
| 1975 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1976 | VkResult vkResetFences_VkResult_return = (VkResult)0; |
| 1977 | stream->read(&vkResetFences_VkResult_return, sizeof(VkResult)); |
| 1978 | return vkResetFences_VkResult_return; |
| 1979 | } |
| 1980 | |
| 1981 | VkResult VkEncoder::vkGetFenceStatus( |
| 1982 | VkDevice device, |
| 1983 | VkFence fence) |
| 1984 | { |
| 1985 | auto stream = mImpl->stream(); |
| 1986 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1987 | auto resources = mImpl->resources(); |
| 1988 | auto pool = mImpl->pool(); |
| 1989 | VkDevice local_device; |
| 1990 | local_device = device; |
| 1991 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 1992 | VkFence local_fence; |
| 1993 | local_fence = fence; |
| 1994 | resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1995 | countingStream->rewind(); |
| 1996 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1997 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 1998 | countingStream->write((VkFence*)&local_fence, sizeof(VkFence)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1999 | } |
| 2000 | uint32_t packetSize_vkGetFenceStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2001 | countingStream->rewind(); |
| 2002 | uint32_t opcode_vkGetFenceStatus = OP_vkGetFenceStatus; |
| 2003 | stream->write(&opcode_vkGetFenceStatus, sizeof(uint32_t)); |
| 2004 | stream->write(&packetSize_vkGetFenceStatus, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2005 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2006 | stream->write((VkFence*)&local_fence, sizeof(VkFence)); |
| 2007 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2008 | VkResult vkGetFenceStatus_VkResult_return = (VkResult)0; |
| 2009 | stream->read(&vkGetFenceStatus_VkResult_return, sizeof(VkResult)); |
| 2010 | return vkGetFenceStatus_VkResult_return; |
| 2011 | } |
| 2012 | |
| 2013 | VkResult VkEncoder::vkWaitForFences( |
| 2014 | VkDevice device, |
| 2015 | uint32_t fenceCount, |
| 2016 | const VkFence* pFences, |
| 2017 | VkBool32 waitAll, |
| 2018 | uint64_t timeout) |
| 2019 | { |
| 2020 | auto stream = mImpl->stream(); |
| 2021 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2022 | auto resources = mImpl->resources(); |
| 2023 | auto pool = mImpl->pool(); |
| 2024 | VkDevice local_device; |
| 2025 | local_device = device; |
| 2026 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2027 | uint32_t local_fenceCount; |
| 2028 | local_fenceCount = fenceCount; |
| 2029 | VkFence* local_pFences; |
| 2030 | local_pFences = nullptr; |
| 2031 | if (pFences) |
| 2032 | { |
| 2033 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2034 | } |
| 2035 | if (local_pFences) |
| 2036 | { |
| 2037 | resources->unwrapMapping()->mapHandles_VkFence((VkFence*)local_pFences, ((fenceCount))); |
| 2038 | } |
| 2039 | VkBool32 local_waitAll; |
| 2040 | local_waitAll = waitAll; |
| 2041 | uint64_t local_timeout; |
| 2042 | local_timeout = timeout; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2043 | countingStream->rewind(); |
| 2044 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2045 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2046 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| 2047 | countingStream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence)); |
| 2048 | countingStream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2049 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2050 | } |
| 2051 | uint32_t packetSize_vkWaitForFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2052 | countingStream->rewind(); |
| 2053 | uint32_t opcode_vkWaitForFences = OP_vkWaitForFences; |
| 2054 | stream->write(&opcode_vkWaitForFences, sizeof(uint32_t)); |
| 2055 | stream->write(&packetSize_vkWaitForFences, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2056 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2057 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| 2058 | stream->write((VkFence*)local_pFences, ((fenceCount)) * sizeof(VkFence)); |
| 2059 | stream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2060 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| 2061 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2062 | VkResult vkWaitForFences_VkResult_return = (VkResult)0; |
| 2063 | stream->read(&vkWaitForFences_VkResult_return, sizeof(VkResult)); |
| 2064 | return vkWaitForFences_VkResult_return; |
| 2065 | } |
| 2066 | |
| 2067 | VkResult VkEncoder::vkCreateSemaphore( |
| 2068 | VkDevice device, |
| 2069 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 2070 | const VkAllocationCallbacks* pAllocator, |
| 2071 | VkSemaphore* pSemaphore) |
| 2072 | { |
| 2073 | auto stream = mImpl->stream(); |
| 2074 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2075 | auto resources = mImpl->resources(); |
| 2076 | auto pool = mImpl->pool(); |
| 2077 | VkDevice local_device; |
| 2078 | local_device = device; |
| 2079 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2080 | VkSemaphoreCreateInfo* local_pCreateInfo; |
| 2081 | local_pCreateInfo = nullptr; |
| 2082 | if (pCreateInfo) |
| 2083 | { |
| 2084 | local_pCreateInfo = (VkSemaphoreCreateInfo*)pool->alloc(sizeof(const VkSemaphoreCreateInfo)); |
| 2085 | deepcopy_VkSemaphoreCreateInfo(pool, pCreateInfo, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| 2086 | } |
| 2087 | if (local_pCreateInfo) |
| 2088 | { |
| 2089 | handlemap_VkSemaphoreCreateInfo(resources->unwrapMapping(), (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| 2090 | } |
| 2091 | VkAllocationCallbacks* local_pAllocator; |
| 2092 | local_pAllocator = nullptr; |
| 2093 | if (pAllocator) |
| 2094 | { |
| 2095 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2096 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2097 | } |
| 2098 | if (local_pAllocator) |
| 2099 | { |
| 2100 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2101 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2102 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2103 | countingStream->rewind(); |
| 2104 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2105 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2106 | marshal_VkSemaphoreCreateInfo(countingStream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| 2107 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2108 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2109 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2110 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2111 | } |
| 2112 | countingStream->write((VkSemaphore*)pSemaphore, sizeof(VkSemaphore)); |
| 2113 | } |
| 2114 | uint32_t packetSize_vkCreateSemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2115 | countingStream->rewind(); |
| 2116 | uint32_t opcode_vkCreateSemaphore = OP_vkCreateSemaphore; |
| 2117 | stream->write(&opcode_vkCreateSemaphore, sizeof(uint32_t)); |
| 2118 | stream->write(&packetSize_vkCreateSemaphore, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2119 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2120 | marshal_VkSemaphoreCreateInfo(stream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| 2121 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2122 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2123 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2124 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2125 | } |
| 2126 | stream->write((VkSemaphore*)pSemaphore, sizeof(VkSemaphore)); |
| 2127 | stream->read((VkSemaphore*)pSemaphore, sizeof(VkSemaphore)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2128 | if (pSemaphore) |
| 2129 | { |
| 2130 | resources->createMapping()->mapHandles_VkSemaphore((VkSemaphore*)pSemaphore, 1); |
| 2131 | } |
| 2132 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2133 | VkResult vkCreateSemaphore_VkResult_return = (VkResult)0; |
| 2134 | stream->read(&vkCreateSemaphore_VkResult_return, sizeof(VkResult)); |
| 2135 | return vkCreateSemaphore_VkResult_return; |
| 2136 | } |
| 2137 | |
| 2138 | void VkEncoder::vkDestroySemaphore( |
| 2139 | VkDevice device, |
| 2140 | VkSemaphore semaphore, |
| 2141 | const VkAllocationCallbacks* pAllocator) |
| 2142 | { |
| 2143 | auto stream = mImpl->stream(); |
| 2144 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2145 | auto resources = mImpl->resources(); |
| 2146 | auto pool = mImpl->pool(); |
| 2147 | VkDevice local_device; |
| 2148 | local_device = device; |
| 2149 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2150 | VkSemaphore local_semaphore; |
| 2151 | local_semaphore = semaphore; |
| 2152 | resources->unwrapMapping()->mapHandles_VkSemaphore((VkSemaphore*)&local_semaphore); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2153 | VkAllocationCallbacks* local_pAllocator; |
| 2154 | local_pAllocator = nullptr; |
| 2155 | if (pAllocator) |
| 2156 | { |
| 2157 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2158 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2159 | } |
| 2160 | if (local_pAllocator) |
| 2161 | { |
| 2162 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2163 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2164 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2165 | countingStream->rewind(); |
| 2166 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2167 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2168 | countingStream->write((VkSemaphore*)&local_semaphore, sizeof(VkSemaphore)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2169 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2170 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2171 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2172 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2173 | } |
| 2174 | } |
| 2175 | uint32_t packetSize_vkDestroySemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2176 | countingStream->rewind(); |
| 2177 | uint32_t opcode_vkDestroySemaphore = OP_vkDestroySemaphore; |
| 2178 | stream->write(&opcode_vkDestroySemaphore, sizeof(uint32_t)); |
| 2179 | stream->write(&packetSize_vkDestroySemaphore, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2180 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2181 | stream->write((VkSemaphore*)&local_semaphore, sizeof(VkSemaphore)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2182 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2183 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2184 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2185 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2186 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2187 | resources->destroyMapping()->mapHandles_VkSemaphore((VkSemaphore*)&semaphore); |
| 2188 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2189 | } |
| 2190 | |
| 2191 | VkResult VkEncoder::vkCreateEvent( |
| 2192 | VkDevice device, |
| 2193 | const VkEventCreateInfo* pCreateInfo, |
| 2194 | const VkAllocationCallbacks* pAllocator, |
| 2195 | VkEvent* pEvent) |
| 2196 | { |
| 2197 | auto stream = mImpl->stream(); |
| 2198 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2199 | auto resources = mImpl->resources(); |
| 2200 | auto pool = mImpl->pool(); |
| 2201 | VkDevice local_device; |
| 2202 | local_device = device; |
| 2203 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2204 | VkEventCreateInfo* local_pCreateInfo; |
| 2205 | local_pCreateInfo = nullptr; |
| 2206 | if (pCreateInfo) |
| 2207 | { |
| 2208 | local_pCreateInfo = (VkEventCreateInfo*)pool->alloc(sizeof(const VkEventCreateInfo)); |
| 2209 | deepcopy_VkEventCreateInfo(pool, pCreateInfo, (VkEventCreateInfo*)(local_pCreateInfo)); |
| 2210 | } |
| 2211 | if (local_pCreateInfo) |
| 2212 | { |
| 2213 | handlemap_VkEventCreateInfo(resources->unwrapMapping(), (VkEventCreateInfo*)(local_pCreateInfo)); |
| 2214 | } |
| 2215 | VkAllocationCallbacks* local_pAllocator; |
| 2216 | local_pAllocator = nullptr; |
| 2217 | if (pAllocator) |
| 2218 | { |
| 2219 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2220 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2221 | } |
| 2222 | if (local_pAllocator) |
| 2223 | { |
| 2224 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2225 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2226 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2227 | countingStream->rewind(); |
| 2228 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2229 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2230 | marshal_VkEventCreateInfo(countingStream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| 2231 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2232 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2233 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2234 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2235 | } |
| 2236 | countingStream->write((VkEvent*)pEvent, sizeof(VkEvent)); |
| 2237 | } |
| 2238 | uint32_t packetSize_vkCreateEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2239 | countingStream->rewind(); |
| 2240 | uint32_t opcode_vkCreateEvent = OP_vkCreateEvent; |
| 2241 | stream->write(&opcode_vkCreateEvent, sizeof(uint32_t)); |
| 2242 | stream->write(&packetSize_vkCreateEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2243 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2244 | marshal_VkEventCreateInfo(stream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| 2245 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2246 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2247 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2248 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2249 | } |
| 2250 | stream->write((VkEvent*)pEvent, sizeof(VkEvent)); |
| 2251 | stream->read((VkEvent*)pEvent, sizeof(VkEvent)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2252 | if (pEvent) |
| 2253 | { |
| 2254 | resources->createMapping()->mapHandles_VkEvent((VkEvent*)pEvent, 1); |
| 2255 | } |
| 2256 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2257 | VkResult vkCreateEvent_VkResult_return = (VkResult)0; |
| 2258 | stream->read(&vkCreateEvent_VkResult_return, sizeof(VkResult)); |
| 2259 | return vkCreateEvent_VkResult_return; |
| 2260 | } |
| 2261 | |
| 2262 | void VkEncoder::vkDestroyEvent( |
| 2263 | VkDevice device, |
| 2264 | VkEvent event, |
| 2265 | const VkAllocationCallbacks* pAllocator) |
| 2266 | { |
| 2267 | auto stream = mImpl->stream(); |
| 2268 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2269 | auto resources = mImpl->resources(); |
| 2270 | auto pool = mImpl->pool(); |
| 2271 | VkDevice local_device; |
| 2272 | local_device = device; |
| 2273 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2274 | VkEvent local_event; |
| 2275 | local_event = event; |
| 2276 | resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2277 | VkAllocationCallbacks* local_pAllocator; |
| 2278 | local_pAllocator = nullptr; |
| 2279 | if (pAllocator) |
| 2280 | { |
| 2281 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2282 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2283 | } |
| 2284 | if (local_pAllocator) |
| 2285 | { |
| 2286 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2287 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2288 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2289 | countingStream->rewind(); |
| 2290 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2291 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2292 | countingStream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2293 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2294 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2295 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2296 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2297 | } |
| 2298 | } |
| 2299 | uint32_t packetSize_vkDestroyEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2300 | countingStream->rewind(); |
| 2301 | uint32_t opcode_vkDestroyEvent = OP_vkDestroyEvent; |
| 2302 | stream->write(&opcode_vkDestroyEvent, sizeof(uint32_t)); |
| 2303 | stream->write(&packetSize_vkDestroyEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2304 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2305 | stream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2306 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2307 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2308 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2309 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2310 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2311 | resources->destroyMapping()->mapHandles_VkEvent((VkEvent*)&event); |
| 2312 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2313 | } |
| 2314 | |
| 2315 | VkResult VkEncoder::vkGetEventStatus( |
| 2316 | VkDevice device, |
| 2317 | VkEvent event) |
| 2318 | { |
| 2319 | auto stream = mImpl->stream(); |
| 2320 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2321 | auto resources = mImpl->resources(); |
| 2322 | auto pool = mImpl->pool(); |
| 2323 | VkDevice local_device; |
| 2324 | local_device = device; |
| 2325 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2326 | VkEvent local_event; |
| 2327 | local_event = event; |
| 2328 | resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2329 | countingStream->rewind(); |
| 2330 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2331 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2332 | countingStream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2333 | } |
| 2334 | uint32_t packetSize_vkGetEventStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2335 | countingStream->rewind(); |
| 2336 | uint32_t opcode_vkGetEventStatus = OP_vkGetEventStatus; |
| 2337 | stream->write(&opcode_vkGetEventStatus, sizeof(uint32_t)); |
| 2338 | stream->write(&packetSize_vkGetEventStatus, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2339 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2340 | stream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| 2341 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2342 | VkResult vkGetEventStatus_VkResult_return = (VkResult)0; |
| 2343 | stream->read(&vkGetEventStatus_VkResult_return, sizeof(VkResult)); |
| 2344 | return vkGetEventStatus_VkResult_return; |
| 2345 | } |
| 2346 | |
| 2347 | VkResult VkEncoder::vkSetEvent( |
| 2348 | VkDevice device, |
| 2349 | VkEvent event) |
| 2350 | { |
| 2351 | auto stream = mImpl->stream(); |
| 2352 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2353 | auto resources = mImpl->resources(); |
| 2354 | auto pool = mImpl->pool(); |
| 2355 | VkDevice local_device; |
| 2356 | local_device = device; |
| 2357 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2358 | VkEvent local_event; |
| 2359 | local_event = event; |
| 2360 | resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2361 | countingStream->rewind(); |
| 2362 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2363 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2364 | countingStream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2365 | } |
| 2366 | uint32_t packetSize_vkSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2367 | countingStream->rewind(); |
| 2368 | uint32_t opcode_vkSetEvent = OP_vkSetEvent; |
| 2369 | stream->write(&opcode_vkSetEvent, sizeof(uint32_t)); |
| 2370 | stream->write(&packetSize_vkSetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2371 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2372 | stream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| 2373 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2374 | VkResult vkSetEvent_VkResult_return = (VkResult)0; |
| 2375 | stream->read(&vkSetEvent_VkResult_return, sizeof(VkResult)); |
| 2376 | return vkSetEvent_VkResult_return; |
| 2377 | } |
| 2378 | |
| 2379 | VkResult VkEncoder::vkResetEvent( |
| 2380 | VkDevice device, |
| 2381 | VkEvent event) |
| 2382 | { |
| 2383 | auto stream = mImpl->stream(); |
| 2384 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2385 | auto resources = mImpl->resources(); |
| 2386 | auto pool = mImpl->pool(); |
| 2387 | VkDevice local_device; |
| 2388 | local_device = device; |
| 2389 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2390 | VkEvent local_event; |
| 2391 | local_event = event; |
| 2392 | resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2393 | countingStream->rewind(); |
| 2394 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2395 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2396 | countingStream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2397 | } |
| 2398 | uint32_t packetSize_vkResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2399 | countingStream->rewind(); |
| 2400 | uint32_t opcode_vkResetEvent = OP_vkResetEvent; |
| 2401 | stream->write(&opcode_vkResetEvent, sizeof(uint32_t)); |
| 2402 | stream->write(&packetSize_vkResetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2403 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2404 | stream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| 2405 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2406 | VkResult vkResetEvent_VkResult_return = (VkResult)0; |
| 2407 | stream->read(&vkResetEvent_VkResult_return, sizeof(VkResult)); |
| 2408 | return vkResetEvent_VkResult_return; |
| 2409 | } |
| 2410 | |
| 2411 | VkResult VkEncoder::vkCreateQueryPool( |
| 2412 | VkDevice device, |
| 2413 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 2414 | const VkAllocationCallbacks* pAllocator, |
| 2415 | VkQueryPool* pQueryPool) |
| 2416 | { |
| 2417 | auto stream = mImpl->stream(); |
| 2418 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2419 | auto resources = mImpl->resources(); |
| 2420 | auto pool = mImpl->pool(); |
| 2421 | VkDevice local_device; |
| 2422 | local_device = device; |
| 2423 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2424 | VkQueryPoolCreateInfo* local_pCreateInfo; |
| 2425 | local_pCreateInfo = nullptr; |
| 2426 | if (pCreateInfo) |
| 2427 | { |
| 2428 | local_pCreateInfo = (VkQueryPoolCreateInfo*)pool->alloc(sizeof(const VkQueryPoolCreateInfo)); |
| 2429 | deepcopy_VkQueryPoolCreateInfo(pool, pCreateInfo, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| 2430 | } |
| 2431 | if (local_pCreateInfo) |
| 2432 | { |
| 2433 | handlemap_VkQueryPoolCreateInfo(resources->unwrapMapping(), (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| 2434 | } |
| 2435 | VkAllocationCallbacks* local_pAllocator; |
| 2436 | local_pAllocator = nullptr; |
| 2437 | if (pAllocator) |
| 2438 | { |
| 2439 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2440 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2441 | } |
| 2442 | if (local_pAllocator) |
| 2443 | { |
| 2444 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2445 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2446 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2447 | countingStream->rewind(); |
| 2448 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2449 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2450 | marshal_VkQueryPoolCreateInfo(countingStream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| 2451 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2452 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2453 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2454 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2455 | } |
| 2456 | countingStream->write((VkQueryPool*)pQueryPool, sizeof(VkQueryPool)); |
| 2457 | } |
| 2458 | uint32_t packetSize_vkCreateQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2459 | countingStream->rewind(); |
| 2460 | uint32_t opcode_vkCreateQueryPool = OP_vkCreateQueryPool; |
| 2461 | stream->write(&opcode_vkCreateQueryPool, sizeof(uint32_t)); |
| 2462 | stream->write(&packetSize_vkCreateQueryPool, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2463 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2464 | marshal_VkQueryPoolCreateInfo(stream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| 2465 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2466 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2467 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2468 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2469 | } |
| 2470 | stream->write((VkQueryPool*)pQueryPool, sizeof(VkQueryPool)); |
| 2471 | stream->read((VkQueryPool*)pQueryPool, sizeof(VkQueryPool)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2472 | if (pQueryPool) |
| 2473 | { |
| 2474 | resources->createMapping()->mapHandles_VkQueryPool((VkQueryPool*)pQueryPool, 1); |
| 2475 | } |
| 2476 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2477 | VkResult vkCreateQueryPool_VkResult_return = (VkResult)0; |
| 2478 | stream->read(&vkCreateQueryPool_VkResult_return, sizeof(VkResult)); |
| 2479 | return vkCreateQueryPool_VkResult_return; |
| 2480 | } |
| 2481 | |
| 2482 | void VkEncoder::vkDestroyQueryPool( |
| 2483 | VkDevice device, |
| 2484 | VkQueryPool queryPool, |
| 2485 | const VkAllocationCallbacks* pAllocator) |
| 2486 | { |
| 2487 | auto stream = mImpl->stream(); |
| 2488 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2489 | 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); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2494 | VkQueryPool local_queryPool; |
| 2495 | local_queryPool = queryPool; |
| 2496 | resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2497 | VkAllocationCallbacks* local_pAllocator; |
| 2498 | local_pAllocator = nullptr; |
| 2499 | if (pAllocator) |
| 2500 | { |
| 2501 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2502 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2503 | } |
| 2504 | if (local_pAllocator) |
| 2505 | { |
| 2506 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2507 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2508 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2509 | countingStream->rewind(); |
| 2510 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2511 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2512 | countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2513 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2514 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2515 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2516 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2517 | } |
| 2518 | } |
| 2519 | uint32_t packetSize_vkDestroyQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2520 | countingStream->rewind(); |
| 2521 | uint32_t opcode_vkDestroyQueryPool = OP_vkDestroyQueryPool; |
| 2522 | stream->write(&opcode_vkDestroyQueryPool, sizeof(uint32_t)); |
| 2523 | stream->write(&packetSize_vkDestroyQueryPool, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2524 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2525 | stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2526 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2527 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2528 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2529 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2530 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2531 | resources->destroyMapping()->mapHandles_VkQueryPool((VkQueryPool*)&queryPool); |
| 2532 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2533 | } |
| 2534 | |
| 2535 | VkResult VkEncoder::vkGetQueryPoolResults( |
| 2536 | VkDevice device, |
| 2537 | VkQueryPool queryPool, |
| 2538 | uint32_t firstQuery, |
| 2539 | uint32_t queryCount, |
| 2540 | size_t dataSize, |
| 2541 | void* pData, |
| 2542 | VkDeviceSize stride, |
| 2543 | VkQueryResultFlags flags) |
| 2544 | { |
| 2545 | auto stream = mImpl->stream(); |
| 2546 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2547 | auto resources = mImpl->resources(); |
| 2548 | auto pool = mImpl->pool(); |
| 2549 | VkDevice local_device; |
| 2550 | local_device = device; |
| 2551 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2552 | VkQueryPool local_queryPool; |
| 2553 | local_queryPool = queryPool; |
| 2554 | resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool); |
| 2555 | uint32_t local_firstQuery; |
| 2556 | local_firstQuery = firstQuery; |
| 2557 | uint32_t local_queryCount; |
| 2558 | local_queryCount = queryCount; |
| 2559 | size_t local_dataSize; |
| 2560 | local_dataSize = dataSize; |
| 2561 | VkDeviceSize local_stride; |
| 2562 | local_stride = stride; |
| 2563 | VkQueryResultFlags local_flags; |
| 2564 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2565 | countingStream->rewind(); |
| 2566 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2567 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2568 | countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 2569 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 2570 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| 2571 | countingStream->write((size_t*)&local_dataSize, sizeof(size_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2572 | countingStream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2573 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 2574 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2575 | } |
| 2576 | uint32_t packetSize_vkGetQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2577 | countingStream->rewind(); |
| 2578 | uint32_t opcode_vkGetQueryPoolResults = OP_vkGetQueryPoolResults; |
| 2579 | stream->write(&opcode_vkGetQueryPoolResults, sizeof(uint32_t)); |
| 2580 | stream->write(&packetSize_vkGetQueryPoolResults, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2581 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2582 | stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 2583 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 2584 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| 2585 | stream->write((size_t*)&local_dataSize, sizeof(size_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2586 | stream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2587 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 2588 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2589 | stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2590 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2591 | VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0; |
| 2592 | stream->read(&vkGetQueryPoolResults_VkResult_return, sizeof(VkResult)); |
| 2593 | return vkGetQueryPoolResults_VkResult_return; |
| 2594 | } |
| 2595 | |
| 2596 | VkResult VkEncoder::vkCreateBuffer( |
| 2597 | VkDevice device, |
| 2598 | const VkBufferCreateInfo* pCreateInfo, |
| 2599 | const VkAllocationCallbacks* pAllocator, |
| 2600 | VkBuffer* pBuffer) |
| 2601 | { |
| 2602 | auto stream = mImpl->stream(); |
| 2603 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2604 | auto resources = mImpl->resources(); |
| 2605 | auto pool = mImpl->pool(); |
| 2606 | VkDevice local_device; |
| 2607 | local_device = device; |
| 2608 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2609 | VkBufferCreateInfo* local_pCreateInfo; |
| 2610 | local_pCreateInfo = nullptr; |
| 2611 | if (pCreateInfo) |
| 2612 | { |
| 2613 | local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo)); |
| 2614 | deepcopy_VkBufferCreateInfo(pool, pCreateInfo, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 2615 | } |
| 2616 | if (local_pCreateInfo) |
| 2617 | { |
| 2618 | handlemap_VkBufferCreateInfo(resources->unwrapMapping(), (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 2619 | } |
| 2620 | VkAllocationCallbacks* local_pAllocator; |
| 2621 | local_pAllocator = nullptr; |
| 2622 | if (pAllocator) |
| 2623 | { |
| 2624 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2625 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2626 | } |
| 2627 | if (local_pAllocator) |
| 2628 | { |
| 2629 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2630 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2631 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2632 | countingStream->rewind(); |
| 2633 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2634 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2635 | marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 2636 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2637 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2638 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2639 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2640 | } |
| 2641 | countingStream->write((VkBuffer*)pBuffer, sizeof(VkBuffer)); |
| 2642 | } |
| 2643 | uint32_t packetSize_vkCreateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2644 | countingStream->rewind(); |
| 2645 | uint32_t opcode_vkCreateBuffer = OP_vkCreateBuffer; |
| 2646 | stream->write(&opcode_vkCreateBuffer, sizeof(uint32_t)); |
| 2647 | stream->write(&packetSize_vkCreateBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2648 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2649 | marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 2650 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2651 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2652 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2653 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2654 | } |
| 2655 | stream->write((VkBuffer*)pBuffer, sizeof(VkBuffer)); |
| 2656 | stream->read((VkBuffer*)pBuffer, sizeof(VkBuffer)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2657 | if (pBuffer) |
| 2658 | { |
| 2659 | resources->createMapping()->mapHandles_VkBuffer((VkBuffer*)pBuffer, 1); |
| 2660 | } |
| 2661 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2662 | VkResult vkCreateBuffer_VkResult_return = (VkResult)0; |
| 2663 | stream->read(&vkCreateBuffer_VkResult_return, sizeof(VkResult)); |
| 2664 | return vkCreateBuffer_VkResult_return; |
| 2665 | } |
| 2666 | |
| 2667 | void VkEncoder::vkDestroyBuffer( |
| 2668 | VkDevice device, |
| 2669 | VkBuffer buffer, |
| 2670 | const VkAllocationCallbacks* pAllocator) |
| 2671 | { |
| 2672 | auto stream = mImpl->stream(); |
| 2673 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2674 | auto resources = mImpl->resources(); |
| 2675 | auto pool = mImpl->pool(); |
| 2676 | VkDevice local_device; |
| 2677 | local_device = device; |
| 2678 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2679 | VkBuffer local_buffer; |
| 2680 | local_buffer = buffer; |
| 2681 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2682 | VkAllocationCallbacks* local_pAllocator; |
| 2683 | local_pAllocator = nullptr; |
| 2684 | if (pAllocator) |
| 2685 | { |
| 2686 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2687 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2688 | } |
| 2689 | if (local_pAllocator) |
| 2690 | { |
| 2691 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2692 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2693 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2694 | countingStream->rewind(); |
| 2695 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2696 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2697 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2698 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2699 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2700 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2701 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2702 | } |
| 2703 | } |
| 2704 | uint32_t packetSize_vkDestroyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2705 | countingStream->rewind(); |
| 2706 | uint32_t opcode_vkDestroyBuffer = OP_vkDestroyBuffer; |
| 2707 | stream->write(&opcode_vkDestroyBuffer, sizeof(uint32_t)); |
| 2708 | stream->write(&packetSize_vkDestroyBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2709 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2710 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2711 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2712 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2713 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2714 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2715 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2716 | resources->destroyMapping()->mapHandles_VkBuffer((VkBuffer*)&buffer); |
| 2717 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2718 | } |
| 2719 | |
| 2720 | VkResult VkEncoder::vkCreateBufferView( |
| 2721 | VkDevice device, |
| 2722 | const VkBufferViewCreateInfo* pCreateInfo, |
| 2723 | const VkAllocationCallbacks* pAllocator, |
| 2724 | VkBufferView* pView) |
| 2725 | { |
| 2726 | auto stream = mImpl->stream(); |
| 2727 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2728 | auto resources = mImpl->resources(); |
| 2729 | auto pool = mImpl->pool(); |
| 2730 | VkDevice local_device; |
| 2731 | local_device = device; |
| 2732 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2733 | VkBufferViewCreateInfo* local_pCreateInfo; |
| 2734 | local_pCreateInfo = nullptr; |
| 2735 | if (pCreateInfo) |
| 2736 | { |
| 2737 | local_pCreateInfo = (VkBufferViewCreateInfo*)pool->alloc(sizeof(const VkBufferViewCreateInfo)); |
| 2738 | deepcopy_VkBufferViewCreateInfo(pool, pCreateInfo, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| 2739 | } |
| 2740 | if (local_pCreateInfo) |
| 2741 | { |
| 2742 | handlemap_VkBufferViewCreateInfo(resources->unwrapMapping(), (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| 2743 | } |
| 2744 | VkAllocationCallbacks* local_pAllocator; |
| 2745 | local_pAllocator = nullptr; |
| 2746 | if (pAllocator) |
| 2747 | { |
| 2748 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2749 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2750 | } |
| 2751 | if (local_pAllocator) |
| 2752 | { |
| 2753 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2754 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2755 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2756 | countingStream->rewind(); |
| 2757 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2758 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2759 | marshal_VkBufferViewCreateInfo(countingStream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| 2760 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2761 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2762 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2763 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2764 | } |
| 2765 | countingStream->write((VkBufferView*)pView, sizeof(VkBufferView)); |
| 2766 | } |
| 2767 | uint32_t packetSize_vkCreateBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2768 | countingStream->rewind(); |
| 2769 | uint32_t opcode_vkCreateBufferView = OP_vkCreateBufferView; |
| 2770 | stream->write(&opcode_vkCreateBufferView, sizeof(uint32_t)); |
| 2771 | stream->write(&packetSize_vkCreateBufferView, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2772 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2773 | marshal_VkBufferViewCreateInfo(stream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| 2774 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2775 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2776 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2777 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2778 | } |
| 2779 | stream->write((VkBufferView*)pView, sizeof(VkBufferView)); |
| 2780 | stream->read((VkBufferView*)pView, sizeof(VkBufferView)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2781 | if (pView) |
| 2782 | { |
| 2783 | resources->createMapping()->mapHandles_VkBufferView((VkBufferView*)pView, 1); |
| 2784 | } |
| 2785 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2786 | VkResult vkCreateBufferView_VkResult_return = (VkResult)0; |
| 2787 | stream->read(&vkCreateBufferView_VkResult_return, sizeof(VkResult)); |
| 2788 | return vkCreateBufferView_VkResult_return; |
| 2789 | } |
| 2790 | |
| 2791 | void VkEncoder::vkDestroyBufferView( |
| 2792 | VkDevice device, |
| 2793 | VkBufferView bufferView, |
| 2794 | const VkAllocationCallbacks* pAllocator) |
| 2795 | { |
| 2796 | auto stream = mImpl->stream(); |
| 2797 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2798 | auto resources = mImpl->resources(); |
| 2799 | auto pool = mImpl->pool(); |
| 2800 | VkDevice local_device; |
| 2801 | local_device = device; |
| 2802 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2803 | VkBufferView local_bufferView; |
| 2804 | local_bufferView = bufferView; |
| 2805 | resources->unwrapMapping()->mapHandles_VkBufferView((VkBufferView*)&local_bufferView); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2806 | VkAllocationCallbacks* local_pAllocator; |
| 2807 | local_pAllocator = nullptr; |
| 2808 | if (pAllocator) |
| 2809 | { |
| 2810 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2811 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2812 | } |
| 2813 | if (local_pAllocator) |
| 2814 | { |
| 2815 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2816 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2817 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2818 | countingStream->rewind(); |
| 2819 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2820 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2821 | countingStream->write((VkBufferView*)&local_bufferView, sizeof(VkBufferView)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2822 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2823 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2824 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2825 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2826 | } |
| 2827 | } |
| 2828 | uint32_t packetSize_vkDestroyBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2829 | countingStream->rewind(); |
| 2830 | uint32_t opcode_vkDestroyBufferView = OP_vkDestroyBufferView; |
| 2831 | stream->write(&opcode_vkDestroyBufferView, sizeof(uint32_t)); |
| 2832 | stream->write(&packetSize_vkDestroyBufferView, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2833 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2834 | stream->write((VkBufferView*)&local_bufferView, sizeof(VkBufferView)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2835 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2836 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2837 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2838 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2839 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2840 | resources->destroyMapping()->mapHandles_VkBufferView((VkBufferView*)&bufferView); |
| 2841 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2842 | } |
| 2843 | |
| 2844 | VkResult VkEncoder::vkCreateImage( |
| 2845 | VkDevice device, |
| 2846 | const VkImageCreateInfo* pCreateInfo, |
| 2847 | const VkAllocationCallbacks* pAllocator, |
| 2848 | VkImage* pImage) |
| 2849 | { |
| 2850 | auto stream = mImpl->stream(); |
| 2851 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2852 | auto resources = mImpl->resources(); |
| 2853 | auto pool = mImpl->pool(); |
| 2854 | VkDevice local_device; |
| 2855 | local_device = device; |
| 2856 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 2857 | VkImageCreateInfo* local_pCreateInfo; |
| 2858 | local_pCreateInfo = nullptr; |
| 2859 | if (pCreateInfo) |
| 2860 | { |
| 2861 | local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo)); |
| 2862 | deepcopy_VkImageCreateInfo(pool, pCreateInfo, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 2863 | } |
| 2864 | if (local_pCreateInfo) |
| 2865 | { |
| 2866 | handlemap_VkImageCreateInfo(resources->unwrapMapping(), (VkImageCreateInfo*)(local_pCreateInfo)); |
| 2867 | } |
| 2868 | VkAllocationCallbacks* local_pAllocator; |
| 2869 | local_pAllocator = nullptr; |
| 2870 | if (pAllocator) |
| 2871 | { |
| 2872 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2873 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2874 | } |
| 2875 | if (local_pAllocator) |
| 2876 | { |
| 2877 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2878 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2879 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2880 | countingStream->rewind(); |
| 2881 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2882 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2883 | marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 2884 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2885 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2886 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2887 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2888 | } |
| 2889 | countingStream->write((VkImage*)pImage, sizeof(VkImage)); |
| 2890 | } |
| 2891 | uint32_t packetSize_vkCreateImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2892 | countingStream->rewind(); |
| 2893 | uint32_t opcode_vkCreateImage = OP_vkCreateImage; |
| 2894 | stream->write(&opcode_vkCreateImage, sizeof(uint32_t)); |
| 2895 | stream->write(&packetSize_vkCreateImage, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2896 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2897 | marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 2898 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2899 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2900 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2901 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2902 | } |
| 2903 | stream->write((VkImage*)pImage, sizeof(VkImage)); |
| 2904 | stream->read((VkImage*)pImage, sizeof(VkImage)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2905 | if (pImage) |
| 2906 | { |
| 2907 | resources->createMapping()->mapHandles_VkImage((VkImage*)pImage, 1); |
| 2908 | } |
| 2909 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2910 | VkResult vkCreateImage_VkResult_return = (VkResult)0; |
| 2911 | stream->read(&vkCreateImage_VkResult_return, sizeof(VkResult)); |
| 2912 | return vkCreateImage_VkResult_return; |
| 2913 | } |
| 2914 | |
| 2915 | void VkEncoder::vkDestroyImage( |
| 2916 | VkDevice device, |
| 2917 | VkImage image, |
| 2918 | const VkAllocationCallbacks* pAllocator) |
| 2919 | { |
| 2920 | auto stream = mImpl->stream(); |
| 2921 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2922 | auto resources = mImpl->resources(); |
| 2923 | auto pool = mImpl->pool(); |
| 2924 | VkDevice local_device; |
| 2925 | local_device = device; |
| 2926 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2927 | VkImage local_image; |
| 2928 | local_image = image; |
| 2929 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2930 | VkAllocationCallbacks* local_pAllocator; |
| 2931 | local_pAllocator = nullptr; |
| 2932 | if (pAllocator) |
| 2933 | { |
| 2934 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2935 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2936 | } |
| 2937 | if (local_pAllocator) |
| 2938 | { |
| 2939 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 2940 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2941 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2942 | countingStream->rewind(); |
| 2943 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2944 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2945 | countingStream->write((VkImage*)&local_image, sizeof(VkImage)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2946 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2947 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2948 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2949 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2950 | } |
| 2951 | } |
| 2952 | uint32_t packetSize_vkDestroyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2953 | countingStream->rewind(); |
| 2954 | uint32_t opcode_vkDestroyImage = OP_vkDestroyImage; |
| 2955 | stream->write(&opcode_vkDestroyImage, sizeof(uint32_t)); |
| 2956 | stream->write(&packetSize_vkDestroyImage, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2957 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 2958 | stream->write((VkImage*)&local_image, sizeof(VkImage)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2959 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 2960 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2961 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2962 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2963 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2964 | resources->destroyMapping()->mapHandles_VkImage((VkImage*)&image); |
| 2965 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2966 | } |
| 2967 | |
| 2968 | void VkEncoder::vkGetImageSubresourceLayout( |
| 2969 | VkDevice device, |
| 2970 | VkImage image, |
| 2971 | const VkImageSubresource* pSubresource, |
| 2972 | VkSubresourceLayout* pLayout) |
| 2973 | { |
| 2974 | auto stream = mImpl->stream(); |
| 2975 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2976 | 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 | VkImage local_image; |
| 2982 | local_image = image; |
| 2983 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image); |
| 2984 | VkImageSubresource* local_pSubresource; |
| 2985 | local_pSubresource = nullptr; |
| 2986 | if (pSubresource) |
| 2987 | { |
| 2988 | local_pSubresource = (VkImageSubresource*)pool->alloc(sizeof(const VkImageSubresource)); |
| 2989 | deepcopy_VkImageSubresource(pool, pSubresource, (VkImageSubresource*)(local_pSubresource)); |
| 2990 | } |
| 2991 | if (local_pSubresource) |
| 2992 | { |
| 2993 | handlemap_VkImageSubresource(resources->unwrapMapping(), (VkImageSubresource*)(local_pSubresource)); |
| 2994 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2995 | countingStream->rewind(); |
| 2996 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2997 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 2998 | countingStream->write((VkImage*)&local_image, sizeof(VkImage)); |
| 2999 | marshal_VkImageSubresource(countingStream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3000 | marshal_VkSubresourceLayout(countingStream, (VkSubresourceLayout*)(pLayout)); |
| 3001 | } |
| 3002 | uint32_t packetSize_vkGetImageSubresourceLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3003 | countingStream->rewind(); |
| 3004 | uint32_t opcode_vkGetImageSubresourceLayout = OP_vkGetImageSubresourceLayout; |
| 3005 | stream->write(&opcode_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| 3006 | stream->write(&packetSize_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3007 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3008 | stream->write((VkImage*)&local_image, sizeof(VkImage)); |
| 3009 | marshal_VkImageSubresource(stream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3010 | marshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| 3011 | unmarshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3012 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3013 | } |
| 3014 | |
| 3015 | VkResult VkEncoder::vkCreateImageView( |
| 3016 | VkDevice device, |
| 3017 | const VkImageViewCreateInfo* pCreateInfo, |
| 3018 | const VkAllocationCallbacks* pAllocator, |
| 3019 | VkImageView* pView) |
| 3020 | { |
| 3021 | auto stream = mImpl->stream(); |
| 3022 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3023 | auto resources = mImpl->resources(); |
| 3024 | auto pool = mImpl->pool(); |
| 3025 | VkDevice local_device; |
| 3026 | local_device = device; |
| 3027 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 3028 | VkImageViewCreateInfo* local_pCreateInfo; |
| 3029 | local_pCreateInfo = nullptr; |
| 3030 | if (pCreateInfo) |
| 3031 | { |
| 3032 | local_pCreateInfo = (VkImageViewCreateInfo*)pool->alloc(sizeof(const VkImageViewCreateInfo)); |
| 3033 | deepcopy_VkImageViewCreateInfo(pool, pCreateInfo, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| 3034 | } |
| 3035 | if (local_pCreateInfo) |
| 3036 | { |
| 3037 | handlemap_VkImageViewCreateInfo(resources->unwrapMapping(), (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| 3038 | } |
| 3039 | VkAllocationCallbacks* local_pAllocator; |
| 3040 | local_pAllocator = nullptr; |
| 3041 | if (pAllocator) |
| 3042 | { |
| 3043 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3044 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3045 | } |
| 3046 | if (local_pAllocator) |
| 3047 | { |
| 3048 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3049 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3050 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3051 | countingStream->rewind(); |
| 3052 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3053 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3054 | marshal_VkImageViewCreateInfo(countingStream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| 3055 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3056 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3057 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3058 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3059 | } |
| 3060 | countingStream->write((VkImageView*)pView, sizeof(VkImageView)); |
| 3061 | } |
| 3062 | uint32_t packetSize_vkCreateImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3063 | countingStream->rewind(); |
| 3064 | uint32_t opcode_vkCreateImageView = OP_vkCreateImageView; |
| 3065 | stream->write(&opcode_vkCreateImageView, sizeof(uint32_t)); |
| 3066 | stream->write(&packetSize_vkCreateImageView, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3067 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3068 | marshal_VkImageViewCreateInfo(stream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| 3069 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3070 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3071 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3072 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3073 | } |
| 3074 | stream->write((VkImageView*)pView, sizeof(VkImageView)); |
| 3075 | stream->read((VkImageView*)pView, sizeof(VkImageView)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3076 | if (pView) |
| 3077 | { |
| 3078 | resources->createMapping()->mapHandles_VkImageView((VkImageView*)pView, 1); |
| 3079 | } |
| 3080 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3081 | VkResult vkCreateImageView_VkResult_return = (VkResult)0; |
| 3082 | stream->read(&vkCreateImageView_VkResult_return, sizeof(VkResult)); |
| 3083 | return vkCreateImageView_VkResult_return; |
| 3084 | } |
| 3085 | |
| 3086 | void VkEncoder::vkDestroyImageView( |
| 3087 | VkDevice device, |
| 3088 | VkImageView imageView, |
| 3089 | const VkAllocationCallbacks* pAllocator) |
| 3090 | { |
| 3091 | auto stream = mImpl->stream(); |
| 3092 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3093 | auto resources = mImpl->resources(); |
| 3094 | auto pool = mImpl->pool(); |
| 3095 | VkDevice local_device; |
| 3096 | local_device = device; |
| 3097 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3098 | VkImageView local_imageView; |
| 3099 | local_imageView = imageView; |
| 3100 | resources->unwrapMapping()->mapHandles_VkImageView((VkImageView*)&local_imageView); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3101 | VkAllocationCallbacks* local_pAllocator; |
| 3102 | local_pAllocator = nullptr; |
| 3103 | if (pAllocator) |
| 3104 | { |
| 3105 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3106 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3107 | } |
| 3108 | if (local_pAllocator) |
| 3109 | { |
| 3110 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3111 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3112 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3113 | countingStream->rewind(); |
| 3114 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3115 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3116 | countingStream->write((VkImageView*)&local_imageView, sizeof(VkImageView)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3117 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3118 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3119 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3120 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3121 | } |
| 3122 | } |
| 3123 | uint32_t packetSize_vkDestroyImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3124 | countingStream->rewind(); |
| 3125 | uint32_t opcode_vkDestroyImageView = OP_vkDestroyImageView; |
| 3126 | stream->write(&opcode_vkDestroyImageView, sizeof(uint32_t)); |
| 3127 | stream->write(&packetSize_vkDestroyImageView, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3128 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3129 | stream->write((VkImageView*)&local_imageView, sizeof(VkImageView)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3130 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3131 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3132 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3133 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3134 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3135 | resources->destroyMapping()->mapHandles_VkImageView((VkImageView*)&imageView); |
| 3136 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3137 | } |
| 3138 | |
| 3139 | VkResult VkEncoder::vkCreateShaderModule( |
| 3140 | VkDevice device, |
| 3141 | const VkShaderModuleCreateInfo* pCreateInfo, |
| 3142 | const VkAllocationCallbacks* pAllocator, |
| 3143 | VkShaderModule* pShaderModule) |
| 3144 | { |
| 3145 | auto stream = mImpl->stream(); |
| 3146 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3147 | auto resources = mImpl->resources(); |
| 3148 | auto pool = mImpl->pool(); |
| 3149 | VkDevice local_device; |
| 3150 | local_device = device; |
| 3151 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 3152 | VkShaderModuleCreateInfo* local_pCreateInfo; |
| 3153 | local_pCreateInfo = nullptr; |
| 3154 | if (pCreateInfo) |
| 3155 | { |
| 3156 | local_pCreateInfo = (VkShaderModuleCreateInfo*)pool->alloc(sizeof(const VkShaderModuleCreateInfo)); |
| 3157 | deepcopy_VkShaderModuleCreateInfo(pool, pCreateInfo, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| 3158 | } |
| 3159 | if (local_pCreateInfo) |
| 3160 | { |
| 3161 | handlemap_VkShaderModuleCreateInfo(resources->unwrapMapping(), (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| 3162 | } |
| 3163 | VkAllocationCallbacks* local_pAllocator; |
| 3164 | local_pAllocator = nullptr; |
| 3165 | if (pAllocator) |
| 3166 | { |
| 3167 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3168 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3169 | } |
| 3170 | if (local_pAllocator) |
| 3171 | { |
| 3172 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3173 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3174 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3175 | countingStream->rewind(); |
| 3176 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3177 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3178 | marshal_VkShaderModuleCreateInfo(countingStream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| 3179 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3180 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3181 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3182 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3183 | } |
| 3184 | countingStream->write((VkShaderModule*)pShaderModule, sizeof(VkShaderModule)); |
| 3185 | } |
| 3186 | uint32_t packetSize_vkCreateShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3187 | countingStream->rewind(); |
| 3188 | uint32_t opcode_vkCreateShaderModule = OP_vkCreateShaderModule; |
| 3189 | stream->write(&opcode_vkCreateShaderModule, sizeof(uint32_t)); |
| 3190 | stream->write(&packetSize_vkCreateShaderModule, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3191 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3192 | marshal_VkShaderModuleCreateInfo(stream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| 3193 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3194 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3195 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3196 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3197 | } |
| 3198 | stream->write((VkShaderModule*)pShaderModule, sizeof(VkShaderModule)); |
| 3199 | stream->read((VkShaderModule*)pShaderModule, sizeof(VkShaderModule)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3200 | if (pShaderModule) |
| 3201 | { |
| 3202 | resources->createMapping()->mapHandles_VkShaderModule((VkShaderModule*)pShaderModule, 1); |
| 3203 | } |
| 3204 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3205 | VkResult vkCreateShaderModule_VkResult_return = (VkResult)0; |
| 3206 | stream->read(&vkCreateShaderModule_VkResult_return, sizeof(VkResult)); |
| 3207 | return vkCreateShaderModule_VkResult_return; |
| 3208 | } |
| 3209 | |
| 3210 | void VkEncoder::vkDestroyShaderModule( |
| 3211 | VkDevice device, |
| 3212 | VkShaderModule shaderModule, |
| 3213 | const VkAllocationCallbacks* pAllocator) |
| 3214 | { |
| 3215 | auto stream = mImpl->stream(); |
| 3216 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3217 | auto resources = mImpl->resources(); |
| 3218 | auto pool = mImpl->pool(); |
| 3219 | VkDevice local_device; |
| 3220 | local_device = device; |
| 3221 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3222 | VkShaderModule local_shaderModule; |
| 3223 | local_shaderModule = shaderModule; |
| 3224 | resources->unwrapMapping()->mapHandles_VkShaderModule((VkShaderModule*)&local_shaderModule); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3225 | VkAllocationCallbacks* local_pAllocator; |
| 3226 | local_pAllocator = nullptr; |
| 3227 | if (pAllocator) |
| 3228 | { |
| 3229 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3230 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3231 | } |
| 3232 | if (local_pAllocator) |
| 3233 | { |
| 3234 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3235 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3236 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3237 | countingStream->rewind(); |
| 3238 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3239 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3240 | countingStream->write((VkShaderModule*)&local_shaderModule, sizeof(VkShaderModule)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3241 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3242 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3243 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3244 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3245 | } |
| 3246 | } |
| 3247 | uint32_t packetSize_vkDestroyShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3248 | countingStream->rewind(); |
| 3249 | uint32_t opcode_vkDestroyShaderModule = OP_vkDestroyShaderModule; |
| 3250 | stream->write(&opcode_vkDestroyShaderModule, sizeof(uint32_t)); |
| 3251 | stream->write(&packetSize_vkDestroyShaderModule, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3252 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3253 | stream->write((VkShaderModule*)&local_shaderModule, sizeof(VkShaderModule)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3254 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3255 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3256 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3257 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3258 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3259 | resources->destroyMapping()->mapHandles_VkShaderModule((VkShaderModule*)&shaderModule); |
| 3260 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3261 | } |
| 3262 | |
| 3263 | VkResult VkEncoder::vkCreatePipelineCache( |
| 3264 | VkDevice device, |
| 3265 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 3266 | const VkAllocationCallbacks* pAllocator, |
| 3267 | VkPipelineCache* pPipelineCache) |
| 3268 | { |
| 3269 | auto stream = mImpl->stream(); |
| 3270 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3271 | auto resources = mImpl->resources(); |
| 3272 | auto pool = mImpl->pool(); |
| 3273 | VkDevice local_device; |
| 3274 | local_device = device; |
| 3275 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 3276 | VkPipelineCacheCreateInfo* local_pCreateInfo; |
| 3277 | local_pCreateInfo = nullptr; |
| 3278 | if (pCreateInfo) |
| 3279 | { |
| 3280 | local_pCreateInfo = (VkPipelineCacheCreateInfo*)pool->alloc(sizeof(const VkPipelineCacheCreateInfo)); |
| 3281 | deepcopy_VkPipelineCacheCreateInfo(pool, pCreateInfo, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| 3282 | } |
| 3283 | if (local_pCreateInfo) |
| 3284 | { |
| 3285 | handlemap_VkPipelineCacheCreateInfo(resources->unwrapMapping(), (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| 3286 | } |
| 3287 | VkAllocationCallbacks* local_pAllocator; |
| 3288 | local_pAllocator = nullptr; |
| 3289 | if (pAllocator) |
| 3290 | { |
| 3291 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3292 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3293 | } |
| 3294 | if (local_pAllocator) |
| 3295 | { |
| 3296 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3297 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3298 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3299 | countingStream->rewind(); |
| 3300 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3301 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3302 | marshal_VkPipelineCacheCreateInfo(countingStream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| 3303 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3304 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3305 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3306 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3307 | } |
| 3308 | countingStream->write((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache)); |
| 3309 | } |
| 3310 | uint32_t packetSize_vkCreatePipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3311 | countingStream->rewind(); |
| 3312 | uint32_t opcode_vkCreatePipelineCache = OP_vkCreatePipelineCache; |
| 3313 | stream->write(&opcode_vkCreatePipelineCache, sizeof(uint32_t)); |
| 3314 | stream->write(&packetSize_vkCreatePipelineCache, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3315 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3316 | marshal_VkPipelineCacheCreateInfo(stream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| 3317 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3318 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3319 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3320 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3321 | } |
| 3322 | stream->write((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache)); |
| 3323 | stream->read((VkPipelineCache*)pPipelineCache, sizeof(VkPipelineCache)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3324 | if (pPipelineCache) |
| 3325 | { |
| 3326 | resources->createMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)pPipelineCache, 1); |
| 3327 | } |
| 3328 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3329 | VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0; |
| 3330 | stream->read(&vkCreatePipelineCache_VkResult_return, sizeof(VkResult)); |
| 3331 | return vkCreatePipelineCache_VkResult_return; |
| 3332 | } |
| 3333 | |
| 3334 | void VkEncoder::vkDestroyPipelineCache( |
| 3335 | VkDevice device, |
| 3336 | VkPipelineCache pipelineCache, |
| 3337 | const VkAllocationCallbacks* pAllocator) |
| 3338 | { |
| 3339 | auto stream = mImpl->stream(); |
| 3340 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3341 | auto resources = mImpl->resources(); |
| 3342 | auto pool = mImpl->pool(); |
| 3343 | VkDevice local_device; |
| 3344 | local_device = device; |
| 3345 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3346 | VkPipelineCache local_pipelineCache; |
| 3347 | local_pipelineCache = pipelineCache; |
| 3348 | resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3349 | VkAllocationCallbacks* local_pAllocator; |
| 3350 | local_pAllocator = nullptr; |
| 3351 | if (pAllocator) |
| 3352 | { |
| 3353 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3354 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3355 | } |
| 3356 | if (local_pAllocator) |
| 3357 | { |
| 3358 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3359 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3360 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3361 | countingStream->rewind(); |
| 3362 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3363 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3364 | countingStream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3365 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3366 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3367 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3368 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3369 | } |
| 3370 | } |
| 3371 | uint32_t packetSize_vkDestroyPipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3372 | countingStream->rewind(); |
| 3373 | uint32_t opcode_vkDestroyPipelineCache = OP_vkDestroyPipelineCache; |
| 3374 | stream->write(&opcode_vkDestroyPipelineCache, sizeof(uint32_t)); |
| 3375 | stream->write(&packetSize_vkDestroyPipelineCache, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3376 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3377 | stream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3378 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3379 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3380 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3381 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3382 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3383 | resources->destroyMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&pipelineCache); |
| 3384 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3385 | } |
| 3386 | |
| 3387 | VkResult VkEncoder::vkGetPipelineCacheData( |
| 3388 | VkDevice device, |
| 3389 | VkPipelineCache pipelineCache, |
| 3390 | size_t* pDataSize, |
| 3391 | void* pData) |
| 3392 | { |
| 3393 | auto stream = mImpl->stream(); |
| 3394 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3395 | auto resources = mImpl->resources(); |
| 3396 | auto pool = mImpl->pool(); |
| 3397 | VkDevice local_device; |
| 3398 | local_device = device; |
| 3399 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 3400 | VkPipelineCache local_pipelineCache; |
| 3401 | local_pipelineCache = pipelineCache; |
| 3402 | resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3403 | countingStream->rewind(); |
| 3404 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3405 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3406 | countingStream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3407 | countingStream->write((size_t**)&pDataSize, sizeof(size_t*)); |
| 3408 | if (pDataSize) |
| 3409 | { |
| 3410 | countingStream->write((size_t*)pDataSize, sizeof(size_t)); |
| 3411 | } |
| 3412 | countingStream->write((void**)&pData, sizeof(void*)); |
| 3413 | if (pData) |
| 3414 | { |
| 3415 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 3416 | } |
| 3417 | } |
| 3418 | uint32_t packetSize_vkGetPipelineCacheData = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3419 | countingStream->rewind(); |
| 3420 | uint32_t opcode_vkGetPipelineCacheData = OP_vkGetPipelineCacheData; |
| 3421 | stream->write(&opcode_vkGetPipelineCacheData, sizeof(uint32_t)); |
| 3422 | stream->write(&packetSize_vkGetPipelineCacheData, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3423 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3424 | stream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3425 | stream->write((size_t**)&pDataSize, sizeof(size_t*)); |
| 3426 | if (pDataSize) |
| 3427 | { |
| 3428 | stream->write((size_t*)pDataSize, sizeof(size_t)); |
| 3429 | } |
| 3430 | stream->write((void**)&pData, sizeof(void*)); |
| 3431 | if (pData) |
| 3432 | { |
| 3433 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 3434 | } |
| 3435 | size_t* check_pDataSize; |
| 3436 | stream->read((size_t**)&check_pDataSize, sizeof(size_t*)); |
| 3437 | if (pDataSize) |
| 3438 | { |
| 3439 | if (!(check_pDataSize)) |
| 3440 | { |
| 3441 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 3442 | } |
| 3443 | stream->read((size_t*)pDataSize, sizeof(size_t)); |
| 3444 | } |
| 3445 | void* check_pData; |
| 3446 | stream->read((void**)&check_pData, sizeof(void*)); |
| 3447 | if (pData) |
| 3448 | { |
| 3449 | if (!(check_pData)) |
| 3450 | { |
| 3451 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 3452 | } |
| 3453 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 3454 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3455 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3456 | VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0; |
| 3457 | stream->read(&vkGetPipelineCacheData_VkResult_return, sizeof(VkResult)); |
| 3458 | return vkGetPipelineCacheData_VkResult_return; |
| 3459 | } |
| 3460 | |
| 3461 | VkResult VkEncoder::vkMergePipelineCaches( |
| 3462 | VkDevice device, |
| 3463 | VkPipelineCache dstCache, |
| 3464 | uint32_t srcCacheCount, |
| 3465 | const VkPipelineCache* pSrcCaches) |
| 3466 | { |
| 3467 | auto stream = mImpl->stream(); |
| 3468 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3469 | auto resources = mImpl->resources(); |
| 3470 | auto pool = mImpl->pool(); |
| 3471 | VkDevice local_device; |
| 3472 | local_device = device; |
| 3473 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 3474 | VkPipelineCache local_dstCache; |
| 3475 | local_dstCache = dstCache; |
| 3476 | resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_dstCache); |
| 3477 | uint32_t local_srcCacheCount; |
| 3478 | local_srcCacheCount = srcCacheCount; |
| 3479 | VkPipelineCache* local_pSrcCaches; |
| 3480 | local_pSrcCaches = nullptr; |
| 3481 | if (pSrcCaches) |
| 3482 | { |
| 3483 | local_pSrcCaches = (VkPipelineCache*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkPipelineCache)); |
| 3484 | } |
| 3485 | if (local_pSrcCaches) |
| 3486 | { |
| 3487 | resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount))); |
| 3488 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3489 | countingStream->rewind(); |
| 3490 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3491 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3492 | countingStream->write((VkPipelineCache*)&local_dstCache, sizeof(VkPipelineCache)); |
| 3493 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| 3494 | countingStream->write((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkPipelineCache)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3495 | } |
| 3496 | uint32_t packetSize_vkMergePipelineCaches = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3497 | countingStream->rewind(); |
| 3498 | uint32_t opcode_vkMergePipelineCaches = OP_vkMergePipelineCaches; |
| 3499 | stream->write(&opcode_vkMergePipelineCaches, sizeof(uint32_t)); |
| 3500 | stream->write(&packetSize_vkMergePipelineCaches, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3501 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3502 | stream->write((VkPipelineCache*)&local_dstCache, sizeof(VkPipelineCache)); |
| 3503 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| 3504 | stream->write((VkPipelineCache*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkPipelineCache)); |
| 3505 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3506 | VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0; |
| 3507 | stream->read(&vkMergePipelineCaches_VkResult_return, sizeof(VkResult)); |
| 3508 | return vkMergePipelineCaches_VkResult_return; |
| 3509 | } |
| 3510 | |
| 3511 | VkResult VkEncoder::vkCreateGraphicsPipelines( |
| 3512 | VkDevice device, |
| 3513 | VkPipelineCache pipelineCache, |
| 3514 | uint32_t createInfoCount, |
| 3515 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 3516 | const VkAllocationCallbacks* pAllocator, |
| 3517 | VkPipeline* pPipelines) |
| 3518 | { |
| 3519 | auto stream = mImpl->stream(); |
| 3520 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3521 | auto resources = mImpl->resources(); |
| 3522 | auto pool = mImpl->pool(); |
| 3523 | VkDevice local_device; |
| 3524 | local_device = device; |
| 3525 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 3526 | VkPipelineCache local_pipelineCache; |
| 3527 | local_pipelineCache = pipelineCache; |
| 3528 | resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache); |
| 3529 | uint32_t local_createInfoCount; |
| 3530 | local_createInfoCount = createInfoCount; |
| 3531 | VkGraphicsPipelineCreateInfo* local_pCreateInfos; |
| 3532 | local_pCreateInfos = nullptr; |
| 3533 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3534 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3535 | local_pCreateInfos = (VkGraphicsPipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkGraphicsPipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3536 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 3537 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3538 | deepcopy_VkGraphicsPipelineCreateInfo(pool, pCreateInfos + i, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3539 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3540 | } |
| 3541 | if (local_pCreateInfos) |
| 3542 | { |
| 3543 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3544 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3545 | handlemap_VkGraphicsPipelineCreateInfo(resources->unwrapMapping(), (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| 3546 | } |
| 3547 | } |
| 3548 | VkAllocationCallbacks* local_pAllocator; |
| 3549 | local_pAllocator = nullptr; |
| 3550 | if (pAllocator) |
| 3551 | { |
| 3552 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3553 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3554 | } |
| 3555 | if (local_pAllocator) |
| 3556 | { |
| 3557 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3558 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3559 | local_pAllocator = nullptr; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3560 | countingStream->rewind(); |
| 3561 | { |
| 3562 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3563 | countingStream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache)); |
| 3564 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 3565 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 3566 | { |
| 3567 | marshal_VkGraphicsPipelineCreateInfo(countingStream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| 3568 | } |
| 3569 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3570 | if (local_pAllocator) |
| 3571 | { |
| 3572 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3573 | } |
| 3574 | countingStream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline)); |
| 3575 | } |
| 3576 | uint32_t packetSize_vkCreateGraphicsPipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3577 | countingStream->rewind(); |
| 3578 | uint32_t opcode_vkCreateGraphicsPipelines = OP_vkCreateGraphicsPipelines; |
| 3579 | stream->write(&opcode_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| 3580 | stream->write(&packetSize_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3581 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3582 | stream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache)); |
| 3583 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3584 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 3585 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3586 | marshal_VkGraphicsPipelineCreateInfo(stream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3587 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3588 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3589 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3590 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3591 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3592 | } |
| 3593 | stream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline)); |
| 3594 | stream->read((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3595 | if (pPipelines) |
| 3596 | { |
| 3597 | resources->createMapping()->mapHandles_VkPipeline((VkPipeline*)pPipelines, ((createInfoCount))); |
| 3598 | } |
| 3599 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3600 | VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0; |
| 3601 | stream->read(&vkCreateGraphicsPipelines_VkResult_return, sizeof(VkResult)); |
| 3602 | return vkCreateGraphicsPipelines_VkResult_return; |
| 3603 | } |
| 3604 | |
| 3605 | VkResult VkEncoder::vkCreateComputePipelines( |
| 3606 | VkDevice device, |
| 3607 | VkPipelineCache pipelineCache, |
| 3608 | uint32_t createInfoCount, |
| 3609 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 3610 | const VkAllocationCallbacks* pAllocator, |
| 3611 | VkPipeline* pPipelines) |
| 3612 | { |
| 3613 | auto stream = mImpl->stream(); |
| 3614 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3615 | auto resources = mImpl->resources(); |
| 3616 | auto pool = mImpl->pool(); |
| 3617 | VkDevice local_device; |
| 3618 | local_device = device; |
| 3619 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 3620 | VkPipelineCache local_pipelineCache; |
| 3621 | local_pipelineCache = pipelineCache; |
| 3622 | resources->unwrapMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&local_pipelineCache); |
| 3623 | uint32_t local_createInfoCount; |
| 3624 | local_createInfoCount = createInfoCount; |
| 3625 | VkComputePipelineCreateInfo* local_pCreateInfos; |
| 3626 | local_pCreateInfos = nullptr; |
| 3627 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3628 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3629 | local_pCreateInfos = (VkComputePipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkComputePipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3630 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 3631 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3632 | deepcopy_VkComputePipelineCreateInfo(pool, pCreateInfos + i, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3633 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3634 | } |
| 3635 | if (local_pCreateInfos) |
| 3636 | { |
| 3637 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3638 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3639 | handlemap_VkComputePipelineCreateInfo(resources->unwrapMapping(), (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| 3640 | } |
| 3641 | } |
| 3642 | VkAllocationCallbacks* local_pAllocator; |
| 3643 | local_pAllocator = nullptr; |
| 3644 | if (pAllocator) |
| 3645 | { |
| 3646 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3647 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3648 | } |
| 3649 | if (local_pAllocator) |
| 3650 | { |
| 3651 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3652 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3653 | local_pAllocator = nullptr; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3654 | countingStream->rewind(); |
| 3655 | { |
| 3656 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3657 | countingStream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache)); |
| 3658 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 3659 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 3660 | { |
| 3661 | marshal_VkComputePipelineCreateInfo(countingStream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| 3662 | } |
| 3663 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3664 | if (local_pAllocator) |
| 3665 | { |
| 3666 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3667 | } |
| 3668 | countingStream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline)); |
| 3669 | } |
| 3670 | uint32_t packetSize_vkCreateComputePipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3671 | countingStream->rewind(); |
| 3672 | uint32_t opcode_vkCreateComputePipelines = OP_vkCreateComputePipelines; |
| 3673 | stream->write(&opcode_vkCreateComputePipelines, sizeof(uint32_t)); |
| 3674 | stream->write(&packetSize_vkCreateComputePipelines, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3675 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3676 | stream->write((VkPipelineCache*)&local_pipelineCache, sizeof(VkPipelineCache)); |
| 3677 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3678 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 3679 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3680 | marshal_VkComputePipelineCreateInfo(stream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3681 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3682 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3683 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3684 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3685 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3686 | } |
| 3687 | stream->write((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline)); |
| 3688 | stream->read((VkPipeline*)pPipelines, ((createInfoCount)) * sizeof(VkPipeline)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3689 | if (pPipelines) |
| 3690 | { |
| 3691 | resources->createMapping()->mapHandles_VkPipeline((VkPipeline*)pPipelines, ((createInfoCount))); |
| 3692 | } |
| 3693 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3694 | VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0; |
| 3695 | stream->read(&vkCreateComputePipelines_VkResult_return, sizeof(VkResult)); |
| 3696 | return vkCreateComputePipelines_VkResult_return; |
| 3697 | } |
| 3698 | |
| 3699 | void VkEncoder::vkDestroyPipeline( |
| 3700 | VkDevice device, |
| 3701 | VkPipeline pipeline, |
| 3702 | const VkAllocationCallbacks* pAllocator) |
| 3703 | { |
| 3704 | auto stream = mImpl->stream(); |
| 3705 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3706 | auto resources = mImpl->resources(); |
| 3707 | auto pool = mImpl->pool(); |
| 3708 | VkDevice local_device; |
| 3709 | local_device = device; |
| 3710 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3711 | VkPipeline local_pipeline; |
| 3712 | local_pipeline = pipeline; |
| 3713 | resources->unwrapMapping()->mapHandles_VkPipeline((VkPipeline*)&local_pipeline); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3714 | VkAllocationCallbacks* local_pAllocator; |
| 3715 | local_pAllocator = nullptr; |
| 3716 | if (pAllocator) |
| 3717 | { |
| 3718 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3719 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3720 | } |
| 3721 | if (local_pAllocator) |
| 3722 | { |
| 3723 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3724 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3725 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3726 | countingStream->rewind(); |
| 3727 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3728 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3729 | countingStream->write((VkPipeline*)&local_pipeline, sizeof(VkPipeline)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3730 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3731 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3732 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3733 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3734 | } |
| 3735 | } |
| 3736 | uint32_t packetSize_vkDestroyPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3737 | countingStream->rewind(); |
| 3738 | uint32_t opcode_vkDestroyPipeline = OP_vkDestroyPipeline; |
| 3739 | stream->write(&opcode_vkDestroyPipeline, sizeof(uint32_t)); |
| 3740 | stream->write(&packetSize_vkDestroyPipeline, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3741 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3742 | stream->write((VkPipeline*)&local_pipeline, sizeof(VkPipeline)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3743 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3744 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3745 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3746 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3747 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3748 | resources->destroyMapping()->mapHandles_VkPipeline((VkPipeline*)&pipeline); |
| 3749 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3750 | } |
| 3751 | |
| 3752 | VkResult VkEncoder::vkCreatePipelineLayout( |
| 3753 | VkDevice device, |
| 3754 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 3755 | const VkAllocationCallbacks* pAllocator, |
| 3756 | VkPipelineLayout* pPipelineLayout) |
| 3757 | { |
| 3758 | auto stream = mImpl->stream(); |
| 3759 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3760 | auto resources = mImpl->resources(); |
| 3761 | auto pool = mImpl->pool(); |
| 3762 | VkDevice local_device; |
| 3763 | local_device = device; |
| 3764 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 3765 | VkPipelineLayoutCreateInfo* local_pCreateInfo; |
| 3766 | local_pCreateInfo = nullptr; |
| 3767 | if (pCreateInfo) |
| 3768 | { |
| 3769 | local_pCreateInfo = (VkPipelineLayoutCreateInfo*)pool->alloc(sizeof(const VkPipelineLayoutCreateInfo)); |
| 3770 | deepcopy_VkPipelineLayoutCreateInfo(pool, pCreateInfo, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| 3771 | } |
| 3772 | if (local_pCreateInfo) |
| 3773 | { |
| 3774 | handlemap_VkPipelineLayoutCreateInfo(resources->unwrapMapping(), (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| 3775 | } |
| 3776 | VkAllocationCallbacks* local_pAllocator; |
| 3777 | local_pAllocator = nullptr; |
| 3778 | if (pAllocator) |
| 3779 | { |
| 3780 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3781 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3782 | } |
| 3783 | if (local_pAllocator) |
| 3784 | { |
| 3785 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3786 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3787 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3788 | countingStream->rewind(); |
| 3789 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3790 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3791 | marshal_VkPipelineLayoutCreateInfo(countingStream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| 3792 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3793 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3794 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3795 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3796 | } |
| 3797 | countingStream->write((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout)); |
| 3798 | } |
| 3799 | uint32_t packetSize_vkCreatePipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3800 | countingStream->rewind(); |
| 3801 | uint32_t opcode_vkCreatePipelineLayout = OP_vkCreatePipelineLayout; |
| 3802 | stream->write(&opcode_vkCreatePipelineLayout, sizeof(uint32_t)); |
| 3803 | stream->write(&packetSize_vkCreatePipelineLayout, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3804 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3805 | marshal_VkPipelineLayoutCreateInfo(stream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| 3806 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3807 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3808 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3809 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3810 | } |
| 3811 | stream->write((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout)); |
| 3812 | stream->read((VkPipelineLayout*)pPipelineLayout, sizeof(VkPipelineLayout)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3813 | if (pPipelineLayout) |
| 3814 | { |
| 3815 | resources->createMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)pPipelineLayout, 1); |
| 3816 | } |
| 3817 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3818 | VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0; |
| 3819 | stream->read(&vkCreatePipelineLayout_VkResult_return, sizeof(VkResult)); |
| 3820 | return vkCreatePipelineLayout_VkResult_return; |
| 3821 | } |
| 3822 | |
| 3823 | void VkEncoder::vkDestroyPipelineLayout( |
| 3824 | VkDevice device, |
| 3825 | VkPipelineLayout pipelineLayout, |
| 3826 | const VkAllocationCallbacks* pAllocator) |
| 3827 | { |
| 3828 | auto stream = mImpl->stream(); |
| 3829 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3830 | auto resources = mImpl->resources(); |
| 3831 | auto pool = mImpl->pool(); |
| 3832 | VkDevice local_device; |
| 3833 | local_device = device; |
| 3834 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3835 | VkPipelineLayout local_pipelineLayout; |
| 3836 | local_pipelineLayout = pipelineLayout; |
| 3837 | resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_pipelineLayout); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3838 | VkAllocationCallbacks* local_pAllocator; |
| 3839 | local_pAllocator = nullptr; |
| 3840 | if (pAllocator) |
| 3841 | { |
| 3842 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3843 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3844 | } |
| 3845 | if (local_pAllocator) |
| 3846 | { |
| 3847 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3848 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3849 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3850 | countingStream->rewind(); |
| 3851 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3852 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3853 | countingStream->write((VkPipelineLayout*)&local_pipelineLayout, sizeof(VkPipelineLayout)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3854 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3855 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3856 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3857 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3858 | } |
| 3859 | } |
| 3860 | uint32_t packetSize_vkDestroyPipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3861 | countingStream->rewind(); |
| 3862 | uint32_t opcode_vkDestroyPipelineLayout = OP_vkDestroyPipelineLayout; |
| 3863 | stream->write(&opcode_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| 3864 | stream->write(&packetSize_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3865 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3866 | stream->write((VkPipelineLayout*)&local_pipelineLayout, sizeof(VkPipelineLayout)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3867 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3868 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3869 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3870 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3871 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3872 | resources->destroyMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&pipelineLayout); |
| 3873 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3874 | } |
| 3875 | |
| 3876 | VkResult VkEncoder::vkCreateSampler( |
| 3877 | VkDevice device, |
| 3878 | const VkSamplerCreateInfo* pCreateInfo, |
| 3879 | const VkAllocationCallbacks* pAllocator, |
| 3880 | VkSampler* pSampler) |
| 3881 | { |
| 3882 | auto stream = mImpl->stream(); |
| 3883 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3884 | auto resources = mImpl->resources(); |
| 3885 | auto pool = mImpl->pool(); |
| 3886 | VkDevice local_device; |
| 3887 | local_device = device; |
| 3888 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 3889 | VkSamplerCreateInfo* local_pCreateInfo; |
| 3890 | local_pCreateInfo = nullptr; |
| 3891 | if (pCreateInfo) |
| 3892 | { |
| 3893 | local_pCreateInfo = (VkSamplerCreateInfo*)pool->alloc(sizeof(const VkSamplerCreateInfo)); |
| 3894 | deepcopy_VkSamplerCreateInfo(pool, pCreateInfo, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| 3895 | } |
| 3896 | if (local_pCreateInfo) |
| 3897 | { |
| 3898 | handlemap_VkSamplerCreateInfo(resources->unwrapMapping(), (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| 3899 | } |
| 3900 | VkAllocationCallbacks* local_pAllocator; |
| 3901 | local_pAllocator = nullptr; |
| 3902 | if (pAllocator) |
| 3903 | { |
| 3904 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3905 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3906 | } |
| 3907 | if (local_pAllocator) |
| 3908 | { |
| 3909 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3910 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3911 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3912 | countingStream->rewind(); |
| 3913 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3914 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3915 | marshal_VkSamplerCreateInfo(countingStream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| 3916 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3917 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3918 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3919 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3920 | } |
| 3921 | countingStream->write((VkSampler*)pSampler, sizeof(VkSampler)); |
| 3922 | } |
| 3923 | uint32_t packetSize_vkCreateSampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3924 | countingStream->rewind(); |
| 3925 | uint32_t opcode_vkCreateSampler = OP_vkCreateSampler; |
| 3926 | stream->write(&opcode_vkCreateSampler, sizeof(uint32_t)); |
| 3927 | stream->write(&packetSize_vkCreateSampler, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3928 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 3929 | marshal_VkSamplerCreateInfo(stream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| 3930 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3931 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3932 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3933 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3934 | } |
| 3935 | stream->write((VkSampler*)pSampler, sizeof(VkSampler)); |
| 3936 | stream->read((VkSampler*)pSampler, sizeof(VkSampler)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3937 | if (pSampler) |
| 3938 | { |
| 3939 | resources->createMapping()->mapHandles_VkSampler((VkSampler*)pSampler, 1); |
| 3940 | } |
| 3941 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3942 | VkResult vkCreateSampler_VkResult_return = (VkResult)0; |
| 3943 | stream->read(&vkCreateSampler_VkResult_return, sizeof(VkResult)); |
| 3944 | return vkCreateSampler_VkResult_return; |
| 3945 | } |
| 3946 | |
| 3947 | void VkEncoder::vkDestroySampler( |
| 3948 | VkDevice device, |
| 3949 | VkSampler sampler, |
| 3950 | const VkAllocationCallbacks* pAllocator) |
| 3951 | { |
| 3952 | auto stream = mImpl->stream(); |
| 3953 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3954 | auto resources = mImpl->resources(); |
| 3955 | auto pool = mImpl->pool(); |
| 3956 | VkDevice local_device; |
| 3957 | local_device = device; |
| 3958 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3959 | VkSampler local_sampler; |
| 3960 | local_sampler = sampler; |
| 3961 | resources->unwrapMapping()->mapHandles_VkSampler((VkSampler*)&local_sampler); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3962 | VkAllocationCallbacks* local_pAllocator; |
| 3963 | local_pAllocator = nullptr; |
| 3964 | if (pAllocator) |
| 3965 | { |
| 3966 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3967 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3968 | } |
| 3969 | if (local_pAllocator) |
| 3970 | { |
| 3971 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 3972 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3973 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3974 | countingStream->rewind(); |
| 3975 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3976 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3977 | countingStream->write((VkSampler*)&local_sampler, sizeof(VkSampler)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3978 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3979 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3980 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3981 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3982 | } |
| 3983 | } |
| 3984 | uint32_t packetSize_vkDestroySampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3985 | countingStream->rewind(); |
| 3986 | uint32_t opcode_vkDestroySampler = OP_vkDestroySampler; |
| 3987 | stream->write(&opcode_vkDestroySampler, sizeof(uint32_t)); |
| 3988 | stream->write(&packetSize_vkDestroySampler, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3989 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 3990 | stream->write((VkSampler*)&local_sampler, sizeof(VkSampler)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3991 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 3992 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3993 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3994 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3995 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3996 | resources->destroyMapping()->mapHandles_VkSampler((VkSampler*)&sampler); |
| 3997 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3998 | } |
| 3999 | |
| 4000 | VkResult VkEncoder::vkCreateDescriptorSetLayout( |
| 4001 | VkDevice device, |
| 4002 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 4003 | const VkAllocationCallbacks* pAllocator, |
| 4004 | VkDescriptorSetLayout* pSetLayout) |
| 4005 | { |
| 4006 | auto stream = mImpl->stream(); |
| 4007 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4008 | auto resources = mImpl->resources(); |
| 4009 | auto pool = mImpl->pool(); |
| 4010 | VkDevice local_device; |
| 4011 | local_device = device; |
| 4012 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4013 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| 4014 | local_pCreateInfo = nullptr; |
| 4015 | if (pCreateInfo) |
| 4016 | { |
| 4017 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 4018 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 4019 | } |
| 4020 | if (local_pCreateInfo) |
| 4021 | { |
| 4022 | handlemap_VkDescriptorSetLayoutCreateInfo(resources->unwrapMapping(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 4023 | } |
| 4024 | VkAllocationCallbacks* local_pAllocator; |
| 4025 | local_pAllocator = nullptr; |
| 4026 | if (pAllocator) |
| 4027 | { |
| 4028 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4029 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4030 | } |
| 4031 | if (local_pAllocator) |
| 4032 | { |
| 4033 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 4034 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4035 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4036 | countingStream->rewind(); |
| 4037 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4038 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4039 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 4040 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4041 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4042 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4043 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4044 | } |
| 4045 | countingStream->write((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout)); |
| 4046 | } |
| 4047 | uint32_t packetSize_vkCreateDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4048 | countingStream->rewind(); |
| 4049 | uint32_t opcode_vkCreateDescriptorSetLayout = OP_vkCreateDescriptorSetLayout; |
| 4050 | stream->write(&opcode_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| 4051 | stream->write(&packetSize_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4052 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4053 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 4054 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4055 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4056 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4057 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4058 | } |
| 4059 | stream->write((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout)); |
| 4060 | stream->read((VkDescriptorSetLayout*)pSetLayout, sizeof(VkDescriptorSetLayout)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4061 | if (pSetLayout) |
| 4062 | { |
| 4063 | resources->createMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)pSetLayout, 1); |
| 4064 | } |
| 4065 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4066 | VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0; |
| 4067 | stream->read(&vkCreateDescriptorSetLayout_VkResult_return, sizeof(VkResult)); |
| 4068 | return vkCreateDescriptorSetLayout_VkResult_return; |
| 4069 | } |
| 4070 | |
| 4071 | void VkEncoder::vkDestroyDescriptorSetLayout( |
| 4072 | VkDevice device, |
| 4073 | VkDescriptorSetLayout descriptorSetLayout, |
| 4074 | const VkAllocationCallbacks* pAllocator) |
| 4075 | { |
| 4076 | auto stream = mImpl->stream(); |
| 4077 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4078 | auto resources = mImpl->resources(); |
| 4079 | auto pool = mImpl->pool(); |
| 4080 | VkDevice local_device; |
| 4081 | local_device = device; |
| 4082 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4083 | VkDescriptorSetLayout local_descriptorSetLayout; |
| 4084 | local_descriptorSetLayout = descriptorSetLayout; |
| 4085 | resources->unwrapMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)&local_descriptorSetLayout); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4086 | VkAllocationCallbacks* local_pAllocator; |
| 4087 | local_pAllocator = nullptr; |
| 4088 | if (pAllocator) |
| 4089 | { |
| 4090 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4091 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4092 | } |
| 4093 | if (local_pAllocator) |
| 4094 | { |
| 4095 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 4096 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4097 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4098 | countingStream->rewind(); |
| 4099 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4100 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4101 | countingStream->write((VkDescriptorSetLayout*)&local_descriptorSetLayout, sizeof(VkDescriptorSetLayout)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4102 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4103 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4104 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4105 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4106 | } |
| 4107 | } |
| 4108 | uint32_t packetSize_vkDestroyDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4109 | countingStream->rewind(); |
| 4110 | uint32_t opcode_vkDestroyDescriptorSetLayout = OP_vkDestroyDescriptorSetLayout; |
| 4111 | stream->write(&opcode_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| 4112 | stream->write(&packetSize_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4113 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4114 | stream->write((VkDescriptorSetLayout*)&local_descriptorSetLayout, sizeof(VkDescriptorSetLayout)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4115 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4116 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4117 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4118 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4119 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4120 | resources->destroyMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)&descriptorSetLayout); |
| 4121 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4122 | } |
| 4123 | |
| 4124 | VkResult VkEncoder::vkCreateDescriptorPool( |
| 4125 | VkDevice device, |
| 4126 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 4127 | const VkAllocationCallbacks* pAllocator, |
| 4128 | VkDescriptorPool* pDescriptorPool) |
| 4129 | { |
| 4130 | auto stream = mImpl->stream(); |
| 4131 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4132 | auto resources = mImpl->resources(); |
| 4133 | auto pool = mImpl->pool(); |
| 4134 | VkDevice local_device; |
| 4135 | local_device = device; |
| 4136 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4137 | VkDescriptorPoolCreateInfo* local_pCreateInfo; |
| 4138 | local_pCreateInfo = nullptr; |
| 4139 | if (pCreateInfo) |
| 4140 | { |
| 4141 | local_pCreateInfo = (VkDescriptorPoolCreateInfo*)pool->alloc(sizeof(const VkDescriptorPoolCreateInfo)); |
| 4142 | deepcopy_VkDescriptorPoolCreateInfo(pool, pCreateInfo, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| 4143 | } |
| 4144 | if (local_pCreateInfo) |
| 4145 | { |
| 4146 | handlemap_VkDescriptorPoolCreateInfo(resources->unwrapMapping(), (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| 4147 | } |
| 4148 | VkAllocationCallbacks* local_pAllocator; |
| 4149 | local_pAllocator = nullptr; |
| 4150 | if (pAllocator) |
| 4151 | { |
| 4152 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4153 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4154 | } |
| 4155 | if (local_pAllocator) |
| 4156 | { |
| 4157 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 4158 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4159 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4160 | countingStream->rewind(); |
| 4161 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4162 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4163 | marshal_VkDescriptorPoolCreateInfo(countingStream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| 4164 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4165 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4166 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4167 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4168 | } |
| 4169 | countingStream->write((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool)); |
| 4170 | } |
| 4171 | uint32_t packetSize_vkCreateDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4172 | countingStream->rewind(); |
| 4173 | uint32_t opcode_vkCreateDescriptorPool = OP_vkCreateDescriptorPool; |
| 4174 | stream->write(&opcode_vkCreateDescriptorPool, sizeof(uint32_t)); |
| 4175 | stream->write(&packetSize_vkCreateDescriptorPool, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4176 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4177 | marshal_VkDescriptorPoolCreateInfo(stream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| 4178 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4179 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4180 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4181 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4182 | } |
| 4183 | stream->write((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool)); |
| 4184 | stream->read((VkDescriptorPool*)pDescriptorPool, sizeof(VkDescriptorPool)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4185 | if (pDescriptorPool) |
| 4186 | { |
| 4187 | resources->createMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)pDescriptorPool, 1); |
| 4188 | } |
| 4189 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4190 | VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0; |
| 4191 | stream->read(&vkCreateDescriptorPool_VkResult_return, sizeof(VkResult)); |
| 4192 | return vkCreateDescriptorPool_VkResult_return; |
| 4193 | } |
| 4194 | |
| 4195 | void VkEncoder::vkDestroyDescriptorPool( |
| 4196 | VkDevice device, |
| 4197 | VkDescriptorPool descriptorPool, |
| 4198 | const VkAllocationCallbacks* pAllocator) |
| 4199 | { |
| 4200 | auto stream = mImpl->stream(); |
| 4201 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4202 | auto resources = mImpl->resources(); |
| 4203 | auto pool = mImpl->pool(); |
| 4204 | VkDevice local_device; |
| 4205 | local_device = device; |
| 4206 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4207 | VkDescriptorPool local_descriptorPool; |
| 4208 | local_descriptorPool = descriptorPool; |
| 4209 | resources->unwrapMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&local_descriptorPool); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4210 | VkAllocationCallbacks* local_pAllocator; |
| 4211 | local_pAllocator = nullptr; |
| 4212 | if (pAllocator) |
| 4213 | { |
| 4214 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4215 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4216 | } |
| 4217 | if (local_pAllocator) |
| 4218 | { |
| 4219 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 4220 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4221 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4222 | countingStream->rewind(); |
| 4223 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4224 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4225 | countingStream->write((VkDescriptorPool*)&local_descriptorPool, sizeof(VkDescriptorPool)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4226 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4227 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4228 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4229 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4230 | } |
| 4231 | } |
| 4232 | uint32_t packetSize_vkDestroyDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4233 | countingStream->rewind(); |
| 4234 | uint32_t opcode_vkDestroyDescriptorPool = OP_vkDestroyDescriptorPool; |
| 4235 | stream->write(&opcode_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| 4236 | stream->write(&packetSize_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4237 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4238 | stream->write((VkDescriptorPool*)&local_descriptorPool, sizeof(VkDescriptorPool)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4239 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4240 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4241 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4242 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4243 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4244 | resources->destroyMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&descriptorPool); |
| 4245 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4246 | } |
| 4247 | |
| 4248 | VkResult VkEncoder::vkResetDescriptorPool( |
| 4249 | VkDevice device, |
| 4250 | VkDescriptorPool descriptorPool, |
| 4251 | VkDescriptorPoolResetFlags flags) |
| 4252 | { |
| 4253 | auto stream = mImpl->stream(); |
| 4254 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4255 | auto resources = mImpl->resources(); |
| 4256 | auto pool = mImpl->pool(); |
| 4257 | VkDevice local_device; |
| 4258 | local_device = device; |
| 4259 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4260 | VkDescriptorPool local_descriptorPool; |
| 4261 | local_descriptorPool = descriptorPool; |
| 4262 | resources->unwrapMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&local_descriptorPool); |
| 4263 | VkDescriptorPoolResetFlags local_flags; |
| 4264 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4265 | countingStream->rewind(); |
| 4266 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4267 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4268 | countingStream->write((VkDescriptorPool*)&local_descriptorPool, sizeof(VkDescriptorPool)); |
| 4269 | countingStream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4270 | } |
| 4271 | uint32_t packetSize_vkResetDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4272 | countingStream->rewind(); |
| 4273 | uint32_t opcode_vkResetDescriptorPool = OP_vkResetDescriptorPool; |
| 4274 | stream->write(&opcode_vkResetDescriptorPool, sizeof(uint32_t)); |
| 4275 | stream->write(&packetSize_vkResetDescriptorPool, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4276 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4277 | stream->write((VkDescriptorPool*)&local_descriptorPool, sizeof(VkDescriptorPool)); |
| 4278 | stream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| 4279 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4280 | VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0; |
| 4281 | stream->read(&vkResetDescriptorPool_VkResult_return, sizeof(VkResult)); |
| 4282 | return vkResetDescriptorPool_VkResult_return; |
| 4283 | } |
| 4284 | |
| 4285 | VkResult VkEncoder::vkAllocateDescriptorSets( |
| 4286 | VkDevice device, |
| 4287 | const VkDescriptorSetAllocateInfo* pAllocateInfo, |
| 4288 | VkDescriptorSet* pDescriptorSets) |
| 4289 | { |
| 4290 | auto stream = mImpl->stream(); |
| 4291 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4292 | auto resources = mImpl->resources(); |
| 4293 | auto pool = mImpl->pool(); |
| 4294 | VkDevice local_device; |
| 4295 | local_device = device; |
| 4296 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4297 | VkDescriptorSetAllocateInfo* local_pAllocateInfo; |
| 4298 | local_pAllocateInfo = nullptr; |
| 4299 | if (pAllocateInfo) |
| 4300 | { |
| 4301 | local_pAllocateInfo = (VkDescriptorSetAllocateInfo*)pool->alloc(sizeof(const VkDescriptorSetAllocateInfo)); |
| 4302 | deepcopy_VkDescriptorSetAllocateInfo(pool, pAllocateInfo, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| 4303 | } |
| 4304 | if (local_pAllocateInfo) |
| 4305 | { |
| 4306 | handlemap_VkDescriptorSetAllocateInfo(resources->unwrapMapping(), (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| 4307 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4308 | countingStream->rewind(); |
| 4309 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4310 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4311 | marshal_VkDescriptorSetAllocateInfo(countingStream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4312 | countingStream->write((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet)); |
| 4313 | } |
| 4314 | uint32_t packetSize_vkAllocateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4315 | countingStream->rewind(); |
| 4316 | uint32_t opcode_vkAllocateDescriptorSets = OP_vkAllocateDescriptorSets; |
| 4317 | stream->write(&opcode_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| 4318 | stream->write(&packetSize_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4319 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4320 | marshal_VkDescriptorSetAllocateInfo(stream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4321 | stream->write((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet)); |
| 4322 | stream->read((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount * sizeof(VkDescriptorSet)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4323 | if (pDescriptorSets) |
| 4324 | { |
| 4325 | resources->createMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount); |
| 4326 | } |
| 4327 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4328 | VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0; |
| 4329 | stream->read(&vkAllocateDescriptorSets_VkResult_return, sizeof(VkResult)); |
| 4330 | return vkAllocateDescriptorSets_VkResult_return; |
| 4331 | } |
| 4332 | |
| 4333 | VkResult VkEncoder::vkFreeDescriptorSets( |
| 4334 | VkDevice device, |
| 4335 | VkDescriptorPool descriptorPool, |
| 4336 | uint32_t descriptorSetCount, |
| 4337 | const VkDescriptorSet* pDescriptorSets) |
| 4338 | { |
| 4339 | auto stream = mImpl->stream(); |
| 4340 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4341 | auto resources = mImpl->resources(); |
| 4342 | auto pool = mImpl->pool(); |
| 4343 | VkDevice local_device; |
| 4344 | local_device = device; |
| 4345 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4346 | VkDescriptorPool local_descriptorPool; |
| 4347 | local_descriptorPool = descriptorPool; |
| 4348 | resources->unwrapMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&local_descriptorPool); |
| 4349 | uint32_t local_descriptorSetCount; |
| 4350 | local_descriptorSetCount = descriptorSetCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4351 | VkDescriptorSet* local_pDescriptorSets; |
| 4352 | local_pDescriptorSets = nullptr; |
| 4353 | if (pDescriptorSets) |
| 4354 | { |
| 4355 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 4356 | } |
| 4357 | if (local_pDescriptorSets) |
| 4358 | { |
| 4359 | resources->unwrapMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount))); |
| 4360 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4361 | countingStream->rewind(); |
| 4362 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4363 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4364 | countingStream->write((VkDescriptorPool*)&local_descriptorPool, sizeof(VkDescriptorPool)); |
| 4365 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4366 | countingStream->write((VkDescriptorSet**)&local_pDescriptorSets, sizeof(VkDescriptorSet*)); |
| 4367 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4368 | { |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4369 | countingStream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4370 | } |
| 4371 | } |
| 4372 | uint32_t packetSize_vkFreeDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4373 | countingStream->rewind(); |
| 4374 | uint32_t opcode_vkFreeDescriptorSets = OP_vkFreeDescriptorSets; |
| 4375 | stream->write(&opcode_vkFreeDescriptorSets, sizeof(uint32_t)); |
| 4376 | stream->write(&packetSize_vkFreeDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4377 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4378 | stream->write((VkDescriptorPool*)&local_descriptorPool, sizeof(VkDescriptorPool)); |
| 4379 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4380 | stream->write((VkDescriptorSet**)&local_pDescriptorSets, sizeof(VkDescriptorSet*)); |
| 4381 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4382 | { |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4383 | stream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4384 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4385 | if (pDescriptorSets) |
| 4386 | { |
| 4387 | resources->destroyMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount))); |
| 4388 | } |
| 4389 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4390 | VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0; |
| 4391 | stream->read(&vkFreeDescriptorSets_VkResult_return, sizeof(VkResult)); |
| 4392 | return vkFreeDescriptorSets_VkResult_return; |
| 4393 | } |
| 4394 | |
| 4395 | void VkEncoder::vkUpdateDescriptorSets( |
| 4396 | VkDevice device, |
| 4397 | uint32_t descriptorWriteCount, |
| 4398 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 4399 | uint32_t descriptorCopyCount, |
| 4400 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 4401 | { |
| 4402 | auto stream = mImpl->stream(); |
| 4403 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4404 | auto resources = mImpl->resources(); |
| 4405 | auto pool = mImpl->pool(); |
| 4406 | VkDevice local_device; |
| 4407 | local_device = device; |
| 4408 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4409 | uint32_t local_descriptorWriteCount; |
| 4410 | local_descriptorWriteCount = descriptorWriteCount; |
| 4411 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| 4412 | local_pDescriptorWrites = nullptr; |
| 4413 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4414 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4415 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4416 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 4417 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4418 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4419 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4420 | } |
| 4421 | if (local_pDescriptorWrites) |
| 4422 | { |
| 4423 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 4424 | { |
| 4425 | handlemap_VkWriteDescriptorSet(resources->unwrapMapping(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 4426 | } |
| 4427 | } |
| 4428 | uint32_t local_descriptorCopyCount; |
| 4429 | local_descriptorCopyCount = descriptorCopyCount; |
| 4430 | VkCopyDescriptorSet* local_pDescriptorCopies; |
| 4431 | local_pDescriptorCopies = nullptr; |
| 4432 | if (pDescriptorCopies) |
| 4433 | { |
| 4434 | local_pDescriptorCopies = (VkCopyDescriptorSet*)pool->alloc(((descriptorCopyCount)) * sizeof(const VkCopyDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4435 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 4436 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4437 | deepcopy_VkCopyDescriptorSet(pool, pDescriptorCopies + i, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| 4438 | } |
| 4439 | } |
| 4440 | if (local_pDescriptorCopies) |
| 4441 | { |
| 4442 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 4443 | { |
| 4444 | handlemap_VkCopyDescriptorSet(resources->unwrapMapping(), (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| 4445 | } |
| 4446 | } |
| 4447 | countingStream->rewind(); |
| 4448 | { |
| 4449 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4450 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 4451 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 4452 | { |
| 4453 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 4454 | } |
| 4455 | countingStream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| 4456 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 4457 | { |
| 4458 | marshal_VkCopyDescriptorSet(countingStream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4459 | } |
| 4460 | } |
| 4461 | uint32_t packetSize_vkUpdateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4462 | countingStream->rewind(); |
| 4463 | uint32_t opcode_vkUpdateDescriptorSets = OP_vkUpdateDescriptorSets; |
| 4464 | stream->write(&opcode_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| 4465 | stream->write(&packetSize_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4466 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4467 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4468 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 4469 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4470 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4471 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4472 | stream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4473 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 4474 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4475 | marshal_VkCopyDescriptorSet(stream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4476 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4477 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4478 | } |
| 4479 | |
| 4480 | VkResult VkEncoder::vkCreateFramebuffer( |
| 4481 | VkDevice device, |
| 4482 | const VkFramebufferCreateInfo* pCreateInfo, |
| 4483 | const VkAllocationCallbacks* pAllocator, |
| 4484 | VkFramebuffer* pFramebuffer) |
| 4485 | { |
| 4486 | auto stream = mImpl->stream(); |
| 4487 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4488 | auto resources = mImpl->resources(); |
| 4489 | auto pool = mImpl->pool(); |
| 4490 | VkDevice local_device; |
| 4491 | local_device = device; |
| 4492 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4493 | VkFramebufferCreateInfo* local_pCreateInfo; |
| 4494 | local_pCreateInfo = nullptr; |
| 4495 | if (pCreateInfo) |
| 4496 | { |
| 4497 | local_pCreateInfo = (VkFramebufferCreateInfo*)pool->alloc(sizeof(const VkFramebufferCreateInfo)); |
| 4498 | deepcopy_VkFramebufferCreateInfo(pool, pCreateInfo, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| 4499 | } |
| 4500 | if (local_pCreateInfo) |
| 4501 | { |
| 4502 | handlemap_VkFramebufferCreateInfo(resources->unwrapMapping(), (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| 4503 | } |
| 4504 | VkAllocationCallbacks* local_pAllocator; |
| 4505 | local_pAllocator = nullptr; |
| 4506 | if (pAllocator) |
| 4507 | { |
| 4508 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4509 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4510 | } |
| 4511 | if (local_pAllocator) |
| 4512 | { |
| 4513 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 4514 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4515 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4516 | countingStream->rewind(); |
| 4517 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4518 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4519 | marshal_VkFramebufferCreateInfo(countingStream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| 4520 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4521 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4522 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4523 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4524 | } |
| 4525 | countingStream->write((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer)); |
| 4526 | } |
| 4527 | uint32_t packetSize_vkCreateFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4528 | countingStream->rewind(); |
| 4529 | uint32_t opcode_vkCreateFramebuffer = OP_vkCreateFramebuffer; |
| 4530 | stream->write(&opcode_vkCreateFramebuffer, sizeof(uint32_t)); |
| 4531 | stream->write(&packetSize_vkCreateFramebuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4532 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4533 | marshal_VkFramebufferCreateInfo(stream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| 4534 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4535 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4536 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4537 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4538 | } |
| 4539 | stream->write((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer)); |
| 4540 | stream->read((VkFramebuffer*)pFramebuffer, sizeof(VkFramebuffer)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4541 | if (pFramebuffer) |
| 4542 | { |
| 4543 | resources->createMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)pFramebuffer, 1); |
| 4544 | } |
| 4545 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4546 | VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0; |
| 4547 | stream->read(&vkCreateFramebuffer_VkResult_return, sizeof(VkResult)); |
| 4548 | return vkCreateFramebuffer_VkResult_return; |
| 4549 | } |
| 4550 | |
| 4551 | void VkEncoder::vkDestroyFramebuffer( |
| 4552 | VkDevice device, |
| 4553 | VkFramebuffer framebuffer, |
| 4554 | const VkAllocationCallbacks* pAllocator) |
| 4555 | { |
| 4556 | auto stream = mImpl->stream(); |
| 4557 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4558 | auto resources = mImpl->resources(); |
| 4559 | auto pool = mImpl->pool(); |
| 4560 | VkDevice local_device; |
| 4561 | local_device = device; |
| 4562 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4563 | VkFramebuffer local_framebuffer; |
| 4564 | local_framebuffer = framebuffer; |
| 4565 | resources->unwrapMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&local_framebuffer); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4566 | VkAllocationCallbacks* local_pAllocator; |
| 4567 | local_pAllocator = nullptr; |
| 4568 | if (pAllocator) |
| 4569 | { |
| 4570 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4571 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4572 | } |
| 4573 | if (local_pAllocator) |
| 4574 | { |
| 4575 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 4576 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4577 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4578 | countingStream->rewind(); |
| 4579 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4580 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4581 | countingStream->write((VkFramebuffer*)&local_framebuffer, sizeof(VkFramebuffer)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4582 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4583 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4584 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4585 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4586 | } |
| 4587 | } |
| 4588 | uint32_t packetSize_vkDestroyFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4589 | countingStream->rewind(); |
| 4590 | uint32_t opcode_vkDestroyFramebuffer = OP_vkDestroyFramebuffer; |
| 4591 | stream->write(&opcode_vkDestroyFramebuffer, sizeof(uint32_t)); |
| 4592 | stream->write(&packetSize_vkDestroyFramebuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4593 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4594 | stream->write((VkFramebuffer*)&local_framebuffer, sizeof(VkFramebuffer)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4595 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4596 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4597 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4598 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4599 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4600 | resources->destroyMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&framebuffer); |
| 4601 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4602 | } |
| 4603 | |
| 4604 | VkResult VkEncoder::vkCreateRenderPass( |
| 4605 | VkDevice device, |
| 4606 | const VkRenderPassCreateInfo* pCreateInfo, |
| 4607 | const VkAllocationCallbacks* pAllocator, |
| 4608 | VkRenderPass* pRenderPass) |
| 4609 | { |
| 4610 | auto stream = mImpl->stream(); |
| 4611 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4612 | auto resources = mImpl->resources(); |
| 4613 | auto pool = mImpl->pool(); |
| 4614 | VkDevice local_device; |
| 4615 | local_device = device; |
| 4616 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4617 | VkRenderPassCreateInfo* local_pCreateInfo; |
| 4618 | local_pCreateInfo = nullptr; |
| 4619 | if (pCreateInfo) |
| 4620 | { |
| 4621 | local_pCreateInfo = (VkRenderPassCreateInfo*)pool->alloc(sizeof(const VkRenderPassCreateInfo)); |
| 4622 | deepcopy_VkRenderPassCreateInfo(pool, pCreateInfo, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| 4623 | } |
| 4624 | if (local_pCreateInfo) |
| 4625 | { |
| 4626 | handlemap_VkRenderPassCreateInfo(resources->unwrapMapping(), (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| 4627 | } |
| 4628 | VkAllocationCallbacks* local_pAllocator; |
| 4629 | local_pAllocator = nullptr; |
| 4630 | if (pAllocator) |
| 4631 | { |
| 4632 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4633 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4634 | } |
| 4635 | if (local_pAllocator) |
| 4636 | { |
| 4637 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 4638 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4639 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4640 | countingStream->rewind(); |
| 4641 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4642 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4643 | marshal_VkRenderPassCreateInfo(countingStream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| 4644 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4645 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4646 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4647 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4648 | } |
| 4649 | countingStream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass)); |
| 4650 | } |
| 4651 | uint32_t packetSize_vkCreateRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4652 | countingStream->rewind(); |
| 4653 | uint32_t opcode_vkCreateRenderPass = OP_vkCreateRenderPass; |
| 4654 | stream->write(&opcode_vkCreateRenderPass, sizeof(uint32_t)); |
| 4655 | stream->write(&packetSize_vkCreateRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4656 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4657 | marshal_VkRenderPassCreateInfo(stream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| 4658 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4659 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4660 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4661 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4662 | } |
| 4663 | stream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass)); |
| 4664 | stream->read((VkRenderPass*)pRenderPass, sizeof(VkRenderPass)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4665 | if (pRenderPass) |
| 4666 | { |
| 4667 | resources->createMapping()->mapHandles_VkRenderPass((VkRenderPass*)pRenderPass, 1); |
| 4668 | } |
| 4669 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4670 | VkResult vkCreateRenderPass_VkResult_return = (VkResult)0; |
| 4671 | stream->read(&vkCreateRenderPass_VkResult_return, sizeof(VkResult)); |
| 4672 | return vkCreateRenderPass_VkResult_return; |
| 4673 | } |
| 4674 | |
| 4675 | void VkEncoder::vkDestroyRenderPass( |
| 4676 | VkDevice device, |
| 4677 | VkRenderPass renderPass, |
| 4678 | const VkAllocationCallbacks* pAllocator) |
| 4679 | { |
| 4680 | auto stream = mImpl->stream(); |
| 4681 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4682 | auto resources = mImpl->resources(); |
| 4683 | auto pool = mImpl->pool(); |
| 4684 | VkDevice local_device; |
| 4685 | local_device = device; |
| 4686 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4687 | VkRenderPass local_renderPass; |
| 4688 | local_renderPass = renderPass; |
| 4689 | resources->unwrapMapping()->mapHandles_VkRenderPass((VkRenderPass*)&local_renderPass); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4690 | VkAllocationCallbacks* local_pAllocator; |
| 4691 | local_pAllocator = nullptr; |
| 4692 | if (pAllocator) |
| 4693 | { |
| 4694 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4695 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4696 | } |
| 4697 | if (local_pAllocator) |
| 4698 | { |
| 4699 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 4700 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4701 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4702 | countingStream->rewind(); |
| 4703 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4704 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4705 | countingStream->write((VkRenderPass*)&local_renderPass, sizeof(VkRenderPass)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4706 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4707 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4708 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4709 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4710 | } |
| 4711 | } |
| 4712 | uint32_t packetSize_vkDestroyRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4713 | countingStream->rewind(); |
| 4714 | uint32_t opcode_vkDestroyRenderPass = OP_vkDestroyRenderPass; |
| 4715 | stream->write(&opcode_vkDestroyRenderPass, sizeof(uint32_t)); |
| 4716 | stream->write(&packetSize_vkDestroyRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4717 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4718 | stream->write((VkRenderPass*)&local_renderPass, sizeof(VkRenderPass)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4719 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4720 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4721 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4722 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4723 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4724 | resources->destroyMapping()->mapHandles_VkRenderPass((VkRenderPass*)&renderPass); |
| 4725 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4726 | } |
| 4727 | |
| 4728 | void VkEncoder::vkGetRenderAreaGranularity( |
| 4729 | VkDevice device, |
| 4730 | VkRenderPass renderPass, |
| 4731 | VkExtent2D* pGranularity) |
| 4732 | { |
| 4733 | auto stream = mImpl->stream(); |
| 4734 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4735 | auto resources = mImpl->resources(); |
| 4736 | auto pool = mImpl->pool(); |
| 4737 | VkDevice local_device; |
| 4738 | local_device = device; |
| 4739 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4740 | VkRenderPass local_renderPass; |
| 4741 | local_renderPass = renderPass; |
| 4742 | resources->unwrapMapping()->mapHandles_VkRenderPass((VkRenderPass*)&local_renderPass); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4743 | countingStream->rewind(); |
| 4744 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4745 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4746 | countingStream->write((VkRenderPass*)&local_renderPass, sizeof(VkRenderPass)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4747 | marshal_VkExtent2D(countingStream, (VkExtent2D*)(pGranularity)); |
| 4748 | } |
| 4749 | uint32_t packetSize_vkGetRenderAreaGranularity = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4750 | countingStream->rewind(); |
| 4751 | uint32_t opcode_vkGetRenderAreaGranularity = OP_vkGetRenderAreaGranularity; |
| 4752 | stream->write(&opcode_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| 4753 | stream->write(&packetSize_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4754 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4755 | stream->write((VkRenderPass*)&local_renderPass, sizeof(VkRenderPass)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4756 | marshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| 4757 | unmarshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4758 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4759 | } |
| 4760 | |
| 4761 | VkResult VkEncoder::vkCreateCommandPool( |
| 4762 | VkDevice device, |
| 4763 | const VkCommandPoolCreateInfo* pCreateInfo, |
| 4764 | const VkAllocationCallbacks* pAllocator, |
| 4765 | VkCommandPool* pCommandPool) |
| 4766 | { |
| 4767 | auto stream = mImpl->stream(); |
| 4768 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4769 | auto resources = mImpl->resources(); |
| 4770 | auto pool = mImpl->pool(); |
| 4771 | VkDevice local_device; |
| 4772 | local_device = device; |
| 4773 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4774 | VkCommandPoolCreateInfo* local_pCreateInfo; |
| 4775 | local_pCreateInfo = nullptr; |
| 4776 | if (pCreateInfo) |
| 4777 | { |
| 4778 | local_pCreateInfo = (VkCommandPoolCreateInfo*)pool->alloc(sizeof(const VkCommandPoolCreateInfo)); |
| 4779 | deepcopy_VkCommandPoolCreateInfo(pool, pCreateInfo, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| 4780 | } |
| 4781 | if (local_pCreateInfo) |
| 4782 | { |
| 4783 | handlemap_VkCommandPoolCreateInfo(resources->unwrapMapping(), (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| 4784 | } |
| 4785 | VkAllocationCallbacks* local_pAllocator; |
| 4786 | local_pAllocator = nullptr; |
| 4787 | if (pAllocator) |
| 4788 | { |
| 4789 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4790 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4791 | } |
| 4792 | if (local_pAllocator) |
| 4793 | { |
| 4794 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 4795 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4796 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4797 | countingStream->rewind(); |
| 4798 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4799 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4800 | marshal_VkCommandPoolCreateInfo(countingStream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| 4801 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4802 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4803 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4804 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4805 | } |
| 4806 | countingStream->write((VkCommandPool*)pCommandPool, sizeof(VkCommandPool)); |
| 4807 | } |
| 4808 | uint32_t packetSize_vkCreateCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4809 | countingStream->rewind(); |
| 4810 | uint32_t opcode_vkCreateCommandPool = OP_vkCreateCommandPool; |
| 4811 | stream->write(&opcode_vkCreateCommandPool, sizeof(uint32_t)); |
| 4812 | stream->write(&packetSize_vkCreateCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4813 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4814 | marshal_VkCommandPoolCreateInfo(stream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| 4815 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4816 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4817 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4818 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4819 | } |
| 4820 | stream->write((VkCommandPool*)pCommandPool, sizeof(VkCommandPool)); |
| 4821 | stream->read((VkCommandPool*)pCommandPool, sizeof(VkCommandPool)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4822 | if (pCommandPool) |
| 4823 | { |
| 4824 | resources->createMapping()->mapHandles_VkCommandPool((VkCommandPool*)pCommandPool, 1); |
| 4825 | } |
| 4826 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4827 | VkResult vkCreateCommandPool_VkResult_return = (VkResult)0; |
| 4828 | stream->read(&vkCreateCommandPool_VkResult_return, sizeof(VkResult)); |
| 4829 | return vkCreateCommandPool_VkResult_return; |
| 4830 | } |
| 4831 | |
| 4832 | void VkEncoder::vkDestroyCommandPool( |
| 4833 | VkDevice device, |
| 4834 | VkCommandPool commandPool, |
| 4835 | const VkAllocationCallbacks* pAllocator) |
| 4836 | { |
| 4837 | auto stream = mImpl->stream(); |
| 4838 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4839 | auto resources = mImpl->resources(); |
| 4840 | auto pool = mImpl->pool(); |
| 4841 | VkDevice local_device; |
| 4842 | local_device = device; |
| 4843 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4844 | VkCommandPool local_commandPool; |
| 4845 | local_commandPool = commandPool; |
| 4846 | resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4847 | VkAllocationCallbacks* local_pAllocator; |
| 4848 | local_pAllocator = nullptr; |
| 4849 | if (pAllocator) |
| 4850 | { |
| 4851 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4852 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4853 | } |
| 4854 | if (local_pAllocator) |
| 4855 | { |
| 4856 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 4857 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4858 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4859 | countingStream->rewind(); |
| 4860 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4861 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4862 | countingStream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4863 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4864 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4865 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4866 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4867 | } |
| 4868 | } |
| 4869 | uint32_t packetSize_vkDestroyCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4870 | countingStream->rewind(); |
| 4871 | uint32_t opcode_vkDestroyCommandPool = OP_vkDestroyCommandPool; |
| 4872 | stream->write(&opcode_vkDestroyCommandPool, sizeof(uint32_t)); |
| 4873 | stream->write(&packetSize_vkDestroyCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4874 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4875 | stream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4876 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 4877 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4878 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4879 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4880 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4881 | resources->destroyMapping()->mapHandles_VkCommandPool((VkCommandPool*)&commandPool); |
| 4882 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4883 | } |
| 4884 | |
| 4885 | VkResult VkEncoder::vkResetCommandPool( |
| 4886 | VkDevice device, |
| 4887 | VkCommandPool commandPool, |
| 4888 | VkCommandPoolResetFlags flags) |
| 4889 | { |
| 4890 | auto stream = mImpl->stream(); |
| 4891 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4892 | auto resources = mImpl->resources(); |
| 4893 | auto pool = mImpl->pool(); |
| 4894 | VkDevice local_device; |
| 4895 | local_device = device; |
| 4896 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4897 | VkCommandPool local_commandPool; |
| 4898 | local_commandPool = commandPool; |
| 4899 | resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool); |
| 4900 | VkCommandPoolResetFlags local_flags; |
| 4901 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4902 | countingStream->rewind(); |
| 4903 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4904 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4905 | countingStream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool)); |
| 4906 | countingStream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4907 | } |
| 4908 | uint32_t packetSize_vkResetCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4909 | countingStream->rewind(); |
| 4910 | uint32_t opcode_vkResetCommandPool = OP_vkResetCommandPool; |
| 4911 | stream->write(&opcode_vkResetCommandPool, sizeof(uint32_t)); |
| 4912 | stream->write(&packetSize_vkResetCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4913 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4914 | stream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool)); |
| 4915 | stream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| 4916 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4917 | VkResult vkResetCommandPool_VkResult_return = (VkResult)0; |
| 4918 | stream->read(&vkResetCommandPool_VkResult_return, sizeof(VkResult)); |
| 4919 | return vkResetCommandPool_VkResult_return; |
| 4920 | } |
| 4921 | |
| 4922 | VkResult VkEncoder::vkAllocateCommandBuffers( |
| 4923 | VkDevice device, |
| 4924 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 4925 | VkCommandBuffer* pCommandBuffers) |
| 4926 | { |
| 4927 | auto stream = mImpl->stream(); |
| 4928 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4929 | auto resources = mImpl->resources(); |
| 4930 | auto pool = mImpl->pool(); |
| 4931 | VkDevice local_device; |
| 4932 | local_device = device; |
| 4933 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4934 | VkCommandBufferAllocateInfo* local_pAllocateInfo; |
| 4935 | local_pAllocateInfo = nullptr; |
| 4936 | if (pAllocateInfo) |
| 4937 | { |
| 4938 | local_pAllocateInfo = (VkCommandBufferAllocateInfo*)pool->alloc(sizeof(const VkCommandBufferAllocateInfo)); |
| 4939 | deepcopy_VkCommandBufferAllocateInfo(pool, pAllocateInfo, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| 4940 | } |
| 4941 | if (local_pAllocateInfo) |
| 4942 | { |
| 4943 | handlemap_VkCommandBufferAllocateInfo(resources->unwrapMapping(), (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| 4944 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4945 | countingStream->rewind(); |
| 4946 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4947 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4948 | marshal_VkCommandBufferAllocateInfo(countingStream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4949 | countingStream->write((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer)); |
| 4950 | } |
| 4951 | uint32_t packetSize_vkAllocateCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4952 | countingStream->rewind(); |
| 4953 | uint32_t opcode_vkAllocateCommandBuffers = OP_vkAllocateCommandBuffers; |
| 4954 | stream->write(&opcode_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| 4955 | stream->write(&packetSize_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4956 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 4957 | marshal_VkCommandBufferAllocateInfo(stream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4958 | stream->write((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer)); |
| 4959 | stream->read((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount * sizeof(VkCommandBuffer)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4960 | if (pCommandBuffers) |
| 4961 | { |
| 4962 | resources->createMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount); |
| 4963 | } |
| 4964 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4965 | VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0; |
| 4966 | stream->read(&vkAllocateCommandBuffers_VkResult_return, sizeof(VkResult)); |
| 4967 | return vkAllocateCommandBuffers_VkResult_return; |
| 4968 | } |
| 4969 | |
| 4970 | void VkEncoder::vkFreeCommandBuffers( |
| 4971 | VkDevice device, |
| 4972 | VkCommandPool commandPool, |
| 4973 | uint32_t commandBufferCount, |
| 4974 | const VkCommandBuffer* pCommandBuffers) |
| 4975 | { |
| 4976 | auto stream = mImpl->stream(); |
| 4977 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4978 | auto resources = mImpl->resources(); |
| 4979 | auto pool = mImpl->pool(); |
| 4980 | VkDevice local_device; |
| 4981 | local_device = device; |
| 4982 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 4983 | VkCommandPool local_commandPool; |
| 4984 | local_commandPool = commandPool; |
| 4985 | resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool); |
| 4986 | uint32_t local_commandBufferCount; |
| 4987 | local_commandBufferCount = commandBufferCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 4988 | VkCommandBuffer* local_pCommandBuffers; |
| 4989 | local_pCommandBuffers = nullptr; |
| 4990 | if (pCommandBuffers) |
| 4991 | { |
| 4992 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 4993 | } |
| 4994 | if (local_pCommandBuffers) |
| 4995 | { |
| 4996 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount))); |
| 4997 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4998 | countingStream->rewind(); |
| 4999 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5000 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 5001 | countingStream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool)); |
| 5002 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 5003 | countingStream->write((VkCommandBuffer**)&local_pCommandBuffers, sizeof(VkCommandBuffer*)); |
| 5004 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5005 | { |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 5006 | countingStream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5007 | } |
| 5008 | } |
| 5009 | uint32_t packetSize_vkFreeCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5010 | countingStream->rewind(); |
| 5011 | uint32_t opcode_vkFreeCommandBuffers = OP_vkFreeCommandBuffers; |
| 5012 | stream->write(&opcode_vkFreeCommandBuffers, sizeof(uint32_t)); |
| 5013 | stream->write(&packetSize_vkFreeCommandBuffers, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5014 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 5015 | stream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool)); |
| 5016 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 5017 | stream->write((VkCommandBuffer**)&local_pCommandBuffers, sizeof(VkCommandBuffer*)); |
| 5018 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5019 | { |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 5020 | stream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5021 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5022 | if (pCommandBuffers) |
| 5023 | { |
| 5024 | resources->destroyMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, ((commandBufferCount))); |
| 5025 | } |
| 5026 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5027 | } |
| 5028 | |
| 5029 | VkResult VkEncoder::vkBeginCommandBuffer( |
| 5030 | VkCommandBuffer commandBuffer, |
| 5031 | const VkCommandBufferBeginInfo* pBeginInfo) |
| 5032 | { |
| 5033 | auto stream = mImpl->stream(); |
| 5034 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5035 | auto resources = mImpl->resources(); |
| 5036 | auto pool = mImpl->pool(); |
| 5037 | VkCommandBuffer local_commandBuffer; |
| 5038 | local_commandBuffer = commandBuffer; |
| 5039 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5040 | VkCommandBufferBeginInfo* local_pBeginInfo; |
| 5041 | local_pBeginInfo = nullptr; |
| 5042 | if (pBeginInfo) |
| 5043 | { |
| 5044 | local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo)); |
| 5045 | deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 5046 | } |
| 5047 | if (local_pBeginInfo) |
| 5048 | { |
| 5049 | handlemap_VkCommandBufferBeginInfo(resources->unwrapMapping(), (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 5050 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5051 | countingStream->rewind(); |
| 5052 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5053 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5054 | marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5055 | } |
| 5056 | uint32_t packetSize_vkBeginCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5057 | countingStream->rewind(); |
| 5058 | uint32_t opcode_vkBeginCommandBuffer = OP_vkBeginCommandBuffer; |
| 5059 | stream->write(&opcode_vkBeginCommandBuffer, sizeof(uint32_t)); |
| 5060 | stream->write(&packetSize_vkBeginCommandBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5061 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5062 | marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 5063 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5064 | VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0; |
| 5065 | stream->read(&vkBeginCommandBuffer_VkResult_return, sizeof(VkResult)); |
| 5066 | return vkBeginCommandBuffer_VkResult_return; |
| 5067 | } |
| 5068 | |
| 5069 | VkResult VkEncoder::vkEndCommandBuffer( |
| 5070 | VkCommandBuffer commandBuffer) |
| 5071 | { |
| 5072 | auto stream = mImpl->stream(); |
| 5073 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5074 | auto resources = mImpl->resources(); |
| 5075 | auto pool = mImpl->pool(); |
| 5076 | VkCommandBuffer local_commandBuffer; |
| 5077 | local_commandBuffer = commandBuffer; |
| 5078 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5079 | countingStream->rewind(); |
| 5080 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5081 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5082 | } |
| 5083 | uint32_t packetSize_vkEndCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5084 | countingStream->rewind(); |
| 5085 | uint32_t opcode_vkEndCommandBuffer = OP_vkEndCommandBuffer; |
| 5086 | stream->write(&opcode_vkEndCommandBuffer, sizeof(uint32_t)); |
| 5087 | stream->write(&packetSize_vkEndCommandBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5088 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5089 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5090 | VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0; |
| 5091 | stream->read(&vkEndCommandBuffer_VkResult_return, sizeof(VkResult)); |
| 5092 | return vkEndCommandBuffer_VkResult_return; |
| 5093 | } |
| 5094 | |
| 5095 | VkResult VkEncoder::vkResetCommandBuffer( |
| 5096 | VkCommandBuffer commandBuffer, |
| 5097 | VkCommandBufferResetFlags flags) |
| 5098 | { |
| 5099 | auto stream = mImpl->stream(); |
| 5100 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5101 | auto resources = mImpl->resources(); |
| 5102 | auto pool = mImpl->pool(); |
| 5103 | VkCommandBuffer local_commandBuffer; |
| 5104 | local_commandBuffer = commandBuffer; |
| 5105 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5106 | VkCommandBufferResetFlags local_flags; |
| 5107 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5108 | countingStream->rewind(); |
| 5109 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5110 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5111 | countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5112 | } |
| 5113 | uint32_t packetSize_vkResetCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5114 | countingStream->rewind(); |
| 5115 | uint32_t opcode_vkResetCommandBuffer = OP_vkResetCommandBuffer; |
| 5116 | stream->write(&opcode_vkResetCommandBuffer, sizeof(uint32_t)); |
| 5117 | stream->write(&packetSize_vkResetCommandBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5118 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5119 | stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| 5120 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5121 | VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0; |
| 5122 | stream->read(&vkResetCommandBuffer_VkResult_return, sizeof(VkResult)); |
| 5123 | return vkResetCommandBuffer_VkResult_return; |
| 5124 | } |
| 5125 | |
| 5126 | void VkEncoder::vkCmdBindPipeline( |
| 5127 | VkCommandBuffer commandBuffer, |
| 5128 | VkPipelineBindPoint pipelineBindPoint, |
| 5129 | VkPipeline pipeline) |
| 5130 | { |
| 5131 | auto stream = mImpl->stream(); |
| 5132 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5133 | auto resources = mImpl->resources(); |
| 5134 | auto pool = mImpl->pool(); |
| 5135 | VkCommandBuffer local_commandBuffer; |
| 5136 | local_commandBuffer = commandBuffer; |
| 5137 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5138 | VkPipelineBindPoint local_pipelineBindPoint; |
| 5139 | local_pipelineBindPoint = pipelineBindPoint; |
| 5140 | VkPipeline local_pipeline; |
| 5141 | local_pipeline = pipeline; |
| 5142 | resources->unwrapMapping()->mapHandles_VkPipeline((VkPipeline*)&local_pipeline); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5143 | countingStream->rewind(); |
| 5144 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5145 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5146 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| 5147 | countingStream->write((VkPipeline*)&local_pipeline, sizeof(VkPipeline)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5148 | } |
| 5149 | uint32_t packetSize_vkCmdBindPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5150 | countingStream->rewind(); |
| 5151 | uint32_t opcode_vkCmdBindPipeline = OP_vkCmdBindPipeline; |
| 5152 | stream->write(&opcode_vkCmdBindPipeline, sizeof(uint32_t)); |
| 5153 | stream->write(&packetSize_vkCmdBindPipeline, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5154 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5155 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| 5156 | stream->write((VkPipeline*)&local_pipeline, sizeof(VkPipeline)); |
| 5157 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5158 | } |
| 5159 | |
| 5160 | void VkEncoder::vkCmdSetViewport( |
| 5161 | VkCommandBuffer commandBuffer, |
| 5162 | uint32_t firstViewport, |
| 5163 | uint32_t viewportCount, |
| 5164 | const VkViewport* pViewports) |
| 5165 | { |
| 5166 | auto stream = mImpl->stream(); |
| 5167 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5168 | auto resources = mImpl->resources(); |
| 5169 | auto pool = mImpl->pool(); |
| 5170 | VkCommandBuffer local_commandBuffer; |
| 5171 | local_commandBuffer = commandBuffer; |
| 5172 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5173 | uint32_t local_firstViewport; |
| 5174 | local_firstViewport = firstViewport; |
| 5175 | uint32_t local_viewportCount; |
| 5176 | local_viewportCount = viewportCount; |
| 5177 | VkViewport* local_pViewports; |
| 5178 | local_pViewports = nullptr; |
| 5179 | if (pViewports) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5180 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5181 | local_pViewports = (VkViewport*)pool->alloc(((viewportCount)) * sizeof(const VkViewport)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5182 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 5183 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5184 | deepcopy_VkViewport(pool, pViewports + i, (VkViewport*)(local_pViewports + i)); |
| 5185 | } |
| 5186 | } |
| 5187 | if (local_pViewports) |
| 5188 | { |
| 5189 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 5190 | { |
| 5191 | handlemap_VkViewport(resources->unwrapMapping(), (VkViewport*)(local_pViewports + i)); |
| 5192 | } |
| 5193 | } |
| 5194 | countingStream->rewind(); |
| 5195 | { |
| 5196 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5197 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 5198 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 5199 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 5200 | { |
| 5201 | marshal_VkViewport(countingStream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5202 | } |
| 5203 | } |
| 5204 | uint32_t packetSize_vkCmdSetViewport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5205 | countingStream->rewind(); |
| 5206 | uint32_t opcode_vkCmdSetViewport = OP_vkCmdSetViewport; |
| 5207 | stream->write(&opcode_vkCmdSetViewport, sizeof(uint32_t)); |
| 5208 | stream->write(&packetSize_vkCmdSetViewport, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5209 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5210 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 5211 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5212 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 5213 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5214 | marshal_VkViewport(stream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5215 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5216 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5217 | } |
| 5218 | |
| 5219 | void VkEncoder::vkCmdSetScissor( |
| 5220 | VkCommandBuffer commandBuffer, |
| 5221 | uint32_t firstScissor, |
| 5222 | uint32_t scissorCount, |
| 5223 | const VkRect2D* pScissors) |
| 5224 | { |
| 5225 | auto stream = mImpl->stream(); |
| 5226 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5227 | auto resources = mImpl->resources(); |
| 5228 | auto pool = mImpl->pool(); |
| 5229 | VkCommandBuffer local_commandBuffer; |
| 5230 | local_commandBuffer = commandBuffer; |
| 5231 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5232 | uint32_t local_firstScissor; |
| 5233 | local_firstScissor = firstScissor; |
| 5234 | uint32_t local_scissorCount; |
| 5235 | local_scissorCount = scissorCount; |
| 5236 | VkRect2D* local_pScissors; |
| 5237 | local_pScissors = nullptr; |
| 5238 | if (pScissors) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5239 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5240 | local_pScissors = (VkRect2D*)pool->alloc(((scissorCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5241 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 5242 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5243 | deepcopy_VkRect2D(pool, pScissors + i, (VkRect2D*)(local_pScissors + i)); |
| 5244 | } |
| 5245 | } |
| 5246 | if (local_pScissors) |
| 5247 | { |
| 5248 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 5249 | { |
| 5250 | handlemap_VkRect2D(resources->unwrapMapping(), (VkRect2D*)(local_pScissors + i)); |
| 5251 | } |
| 5252 | } |
| 5253 | countingStream->rewind(); |
| 5254 | { |
| 5255 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5256 | countingStream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 5257 | countingStream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| 5258 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 5259 | { |
| 5260 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5261 | } |
| 5262 | } |
| 5263 | uint32_t packetSize_vkCmdSetScissor = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5264 | countingStream->rewind(); |
| 5265 | uint32_t opcode_vkCmdSetScissor = OP_vkCmdSetScissor; |
| 5266 | stream->write(&opcode_vkCmdSetScissor, sizeof(uint32_t)); |
| 5267 | stream->write(&packetSize_vkCmdSetScissor, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5268 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5269 | stream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 5270 | stream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5271 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 5272 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5273 | marshal_VkRect2D(stream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5274 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5275 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5276 | } |
| 5277 | |
| 5278 | void VkEncoder::vkCmdSetLineWidth( |
| 5279 | VkCommandBuffer commandBuffer, |
| 5280 | float lineWidth) |
| 5281 | { |
| 5282 | auto stream = mImpl->stream(); |
| 5283 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5284 | auto resources = mImpl->resources(); |
| 5285 | auto pool = mImpl->pool(); |
| 5286 | VkCommandBuffer local_commandBuffer; |
| 5287 | local_commandBuffer = commandBuffer; |
| 5288 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5289 | float local_lineWidth; |
| 5290 | local_lineWidth = lineWidth; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5291 | countingStream->rewind(); |
| 5292 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5293 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5294 | countingStream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5295 | } |
| 5296 | uint32_t packetSize_vkCmdSetLineWidth = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5297 | countingStream->rewind(); |
| 5298 | uint32_t opcode_vkCmdSetLineWidth = OP_vkCmdSetLineWidth; |
| 5299 | stream->write(&opcode_vkCmdSetLineWidth, sizeof(uint32_t)); |
| 5300 | stream->write(&packetSize_vkCmdSetLineWidth, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5301 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5302 | stream->write((float*)&local_lineWidth, sizeof(float)); |
| 5303 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5304 | } |
| 5305 | |
| 5306 | void VkEncoder::vkCmdSetDepthBias( |
| 5307 | VkCommandBuffer commandBuffer, |
| 5308 | float depthBiasConstantFactor, |
| 5309 | float depthBiasClamp, |
| 5310 | float depthBiasSlopeFactor) |
| 5311 | { |
| 5312 | auto stream = mImpl->stream(); |
| 5313 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5314 | auto resources = mImpl->resources(); |
| 5315 | auto pool = mImpl->pool(); |
| 5316 | VkCommandBuffer local_commandBuffer; |
| 5317 | local_commandBuffer = commandBuffer; |
| 5318 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5319 | float local_depthBiasConstantFactor; |
| 5320 | local_depthBiasConstantFactor = depthBiasConstantFactor; |
| 5321 | float local_depthBiasClamp; |
| 5322 | local_depthBiasClamp = depthBiasClamp; |
| 5323 | float local_depthBiasSlopeFactor; |
| 5324 | local_depthBiasSlopeFactor = depthBiasSlopeFactor; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5325 | countingStream->rewind(); |
| 5326 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5327 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5328 | countingStream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 5329 | countingStream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 5330 | countingStream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5331 | } |
| 5332 | uint32_t packetSize_vkCmdSetDepthBias = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5333 | countingStream->rewind(); |
| 5334 | uint32_t opcode_vkCmdSetDepthBias = OP_vkCmdSetDepthBias; |
| 5335 | stream->write(&opcode_vkCmdSetDepthBias, sizeof(uint32_t)); |
| 5336 | stream->write(&packetSize_vkCmdSetDepthBias, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5337 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5338 | stream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 5339 | stream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 5340 | stream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| 5341 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5342 | } |
| 5343 | |
| 5344 | void VkEncoder::vkCmdSetBlendConstants( |
| 5345 | VkCommandBuffer commandBuffer, |
| 5346 | const float blendConstants) |
| 5347 | { |
| 5348 | auto stream = mImpl->stream(); |
| 5349 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5350 | auto resources = mImpl->resources(); |
| 5351 | auto pool = mImpl->pool(); |
| 5352 | VkCommandBuffer local_commandBuffer; |
| 5353 | local_commandBuffer = commandBuffer; |
| 5354 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5355 | float local_blendConstants[4]; |
| 5356 | memcpy(&local_blendConstants, &blendConstants, 4 * sizeof(const float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5357 | countingStream->rewind(); |
| 5358 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5359 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5360 | countingStream->write((float*)&local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5361 | } |
| 5362 | uint32_t packetSize_vkCmdSetBlendConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5363 | countingStream->rewind(); |
| 5364 | uint32_t opcode_vkCmdSetBlendConstants = OP_vkCmdSetBlendConstants; |
| 5365 | stream->write(&opcode_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| 5366 | stream->write(&packetSize_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5367 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5368 | stream->write((float*)&local_blendConstants, 4 * sizeof(float)); |
| 5369 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5370 | } |
| 5371 | |
| 5372 | void VkEncoder::vkCmdSetDepthBounds( |
| 5373 | VkCommandBuffer commandBuffer, |
| 5374 | float minDepthBounds, |
| 5375 | float maxDepthBounds) |
| 5376 | { |
| 5377 | auto stream = mImpl->stream(); |
| 5378 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5379 | auto resources = mImpl->resources(); |
| 5380 | auto pool = mImpl->pool(); |
| 5381 | VkCommandBuffer local_commandBuffer; |
| 5382 | local_commandBuffer = commandBuffer; |
| 5383 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5384 | float local_minDepthBounds; |
| 5385 | local_minDepthBounds = minDepthBounds; |
| 5386 | float local_maxDepthBounds; |
| 5387 | local_maxDepthBounds = maxDepthBounds; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5388 | countingStream->rewind(); |
| 5389 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5390 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5391 | countingStream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 5392 | countingStream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5393 | } |
| 5394 | uint32_t packetSize_vkCmdSetDepthBounds = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5395 | countingStream->rewind(); |
| 5396 | uint32_t opcode_vkCmdSetDepthBounds = OP_vkCmdSetDepthBounds; |
| 5397 | stream->write(&opcode_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| 5398 | stream->write(&packetSize_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5399 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5400 | stream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 5401 | stream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| 5402 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5403 | } |
| 5404 | |
| 5405 | void VkEncoder::vkCmdSetStencilCompareMask( |
| 5406 | VkCommandBuffer commandBuffer, |
| 5407 | VkStencilFaceFlags faceMask, |
| 5408 | uint32_t compareMask) |
| 5409 | { |
| 5410 | auto stream = mImpl->stream(); |
| 5411 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5412 | auto resources = mImpl->resources(); |
| 5413 | auto pool = mImpl->pool(); |
| 5414 | VkCommandBuffer local_commandBuffer; |
| 5415 | local_commandBuffer = commandBuffer; |
| 5416 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5417 | VkStencilFaceFlags local_faceMask; |
| 5418 | local_faceMask = faceMask; |
| 5419 | uint32_t local_compareMask; |
| 5420 | local_compareMask = compareMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5421 | countingStream->rewind(); |
| 5422 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5423 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5424 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 5425 | countingStream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5426 | } |
| 5427 | uint32_t packetSize_vkCmdSetStencilCompareMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5428 | countingStream->rewind(); |
| 5429 | uint32_t opcode_vkCmdSetStencilCompareMask = OP_vkCmdSetStencilCompareMask; |
| 5430 | stream->write(&opcode_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| 5431 | stream->write(&packetSize_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5432 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5433 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 5434 | stream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| 5435 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5436 | } |
| 5437 | |
| 5438 | void VkEncoder::vkCmdSetStencilWriteMask( |
| 5439 | VkCommandBuffer commandBuffer, |
| 5440 | VkStencilFaceFlags faceMask, |
| 5441 | uint32_t writeMask) |
| 5442 | { |
| 5443 | auto stream = mImpl->stream(); |
| 5444 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5445 | auto resources = mImpl->resources(); |
| 5446 | auto pool = mImpl->pool(); |
| 5447 | VkCommandBuffer local_commandBuffer; |
| 5448 | local_commandBuffer = commandBuffer; |
| 5449 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5450 | VkStencilFaceFlags local_faceMask; |
| 5451 | local_faceMask = faceMask; |
| 5452 | uint32_t local_writeMask; |
| 5453 | local_writeMask = writeMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5454 | countingStream->rewind(); |
| 5455 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5456 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5457 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 5458 | countingStream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5459 | } |
| 5460 | uint32_t packetSize_vkCmdSetStencilWriteMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5461 | countingStream->rewind(); |
| 5462 | uint32_t opcode_vkCmdSetStencilWriteMask = OP_vkCmdSetStencilWriteMask; |
| 5463 | stream->write(&opcode_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| 5464 | stream->write(&packetSize_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5465 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5466 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 5467 | stream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| 5468 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5469 | } |
| 5470 | |
| 5471 | void VkEncoder::vkCmdSetStencilReference( |
| 5472 | VkCommandBuffer commandBuffer, |
| 5473 | VkStencilFaceFlags faceMask, |
| 5474 | uint32_t reference) |
| 5475 | { |
| 5476 | auto stream = mImpl->stream(); |
| 5477 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5478 | auto resources = mImpl->resources(); |
| 5479 | auto pool = mImpl->pool(); |
| 5480 | VkCommandBuffer local_commandBuffer; |
| 5481 | local_commandBuffer = commandBuffer; |
| 5482 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5483 | VkStencilFaceFlags local_faceMask; |
| 5484 | local_faceMask = faceMask; |
| 5485 | uint32_t local_reference; |
| 5486 | local_reference = reference; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5487 | countingStream->rewind(); |
| 5488 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5489 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5490 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 5491 | countingStream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5492 | } |
| 5493 | uint32_t packetSize_vkCmdSetStencilReference = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5494 | countingStream->rewind(); |
| 5495 | uint32_t opcode_vkCmdSetStencilReference = OP_vkCmdSetStencilReference; |
| 5496 | stream->write(&opcode_vkCmdSetStencilReference, sizeof(uint32_t)); |
| 5497 | stream->write(&packetSize_vkCmdSetStencilReference, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5498 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5499 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 5500 | stream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| 5501 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5502 | } |
| 5503 | |
| 5504 | void VkEncoder::vkCmdBindDescriptorSets( |
| 5505 | VkCommandBuffer commandBuffer, |
| 5506 | VkPipelineBindPoint pipelineBindPoint, |
| 5507 | VkPipelineLayout layout, |
| 5508 | uint32_t firstSet, |
| 5509 | uint32_t descriptorSetCount, |
| 5510 | const VkDescriptorSet* pDescriptorSets, |
| 5511 | uint32_t dynamicOffsetCount, |
| 5512 | const uint32_t* pDynamicOffsets) |
| 5513 | { |
| 5514 | auto stream = mImpl->stream(); |
| 5515 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5516 | auto resources = mImpl->resources(); |
| 5517 | auto pool = mImpl->pool(); |
| 5518 | VkCommandBuffer local_commandBuffer; |
| 5519 | local_commandBuffer = commandBuffer; |
| 5520 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5521 | VkPipelineBindPoint local_pipelineBindPoint; |
| 5522 | local_pipelineBindPoint = pipelineBindPoint; |
| 5523 | VkPipelineLayout local_layout; |
| 5524 | local_layout = layout; |
| 5525 | resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout); |
| 5526 | uint32_t local_firstSet; |
| 5527 | local_firstSet = firstSet; |
| 5528 | uint32_t local_descriptorSetCount; |
| 5529 | local_descriptorSetCount = descriptorSetCount; |
| 5530 | VkDescriptorSet* local_pDescriptorSets; |
| 5531 | local_pDescriptorSets = nullptr; |
| 5532 | if (pDescriptorSets) |
| 5533 | { |
| 5534 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 5535 | } |
| 5536 | if (local_pDescriptorSets) |
| 5537 | { |
| 5538 | resources->unwrapMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount))); |
| 5539 | } |
| 5540 | uint32_t local_dynamicOffsetCount; |
| 5541 | local_dynamicOffsetCount = dynamicOffsetCount; |
| 5542 | uint32_t* local_pDynamicOffsets; |
| 5543 | local_pDynamicOffsets = nullptr; |
| 5544 | if (pDynamicOffsets) |
| 5545 | { |
| 5546 | local_pDynamicOffsets = (uint32_t*)pool->dupArray(pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(const uint32_t)); |
| 5547 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5548 | countingStream->rewind(); |
| 5549 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5550 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5551 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| 5552 | countingStream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout)); |
| 5553 | countingStream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 5554 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| 5555 | countingStream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet)); |
| 5556 | countingStream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 5557 | countingStream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5558 | } |
| 5559 | uint32_t packetSize_vkCmdBindDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5560 | countingStream->rewind(); |
| 5561 | uint32_t opcode_vkCmdBindDescriptorSets = OP_vkCmdBindDescriptorSets; |
| 5562 | stream->write(&opcode_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| 5563 | stream->write(&packetSize_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5564 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5565 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| 5566 | stream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout)); |
| 5567 | stream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 5568 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| 5569 | stream->write((VkDescriptorSet*)local_pDescriptorSets, ((descriptorSetCount)) * sizeof(VkDescriptorSet)); |
| 5570 | stream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 5571 | stream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| 5572 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5573 | } |
| 5574 | |
| 5575 | void VkEncoder::vkCmdBindIndexBuffer( |
| 5576 | VkCommandBuffer commandBuffer, |
| 5577 | VkBuffer buffer, |
| 5578 | VkDeviceSize offset, |
| 5579 | VkIndexType indexType) |
| 5580 | { |
| 5581 | auto stream = mImpl->stream(); |
| 5582 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5583 | auto resources = mImpl->resources(); |
| 5584 | auto pool = mImpl->pool(); |
| 5585 | VkCommandBuffer local_commandBuffer; |
| 5586 | local_commandBuffer = commandBuffer; |
| 5587 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5588 | VkBuffer local_buffer; |
| 5589 | local_buffer = buffer; |
| 5590 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer); |
| 5591 | VkDeviceSize local_offset; |
| 5592 | local_offset = offset; |
| 5593 | VkIndexType local_indexType; |
| 5594 | local_indexType = indexType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5595 | countingStream->rewind(); |
| 5596 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5597 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5598 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 5599 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 5600 | countingStream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5601 | } |
| 5602 | uint32_t packetSize_vkCmdBindIndexBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5603 | countingStream->rewind(); |
| 5604 | uint32_t opcode_vkCmdBindIndexBuffer = OP_vkCmdBindIndexBuffer; |
| 5605 | stream->write(&opcode_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| 5606 | stream->write(&packetSize_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5607 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5608 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 5609 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 5610 | stream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| 5611 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5612 | } |
| 5613 | |
| 5614 | void VkEncoder::vkCmdBindVertexBuffers( |
| 5615 | VkCommandBuffer commandBuffer, |
| 5616 | uint32_t firstBinding, |
| 5617 | uint32_t bindingCount, |
| 5618 | const VkBuffer* pBuffers, |
| 5619 | const VkDeviceSize* pOffsets) |
| 5620 | { |
| 5621 | auto stream = mImpl->stream(); |
| 5622 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5623 | auto resources = mImpl->resources(); |
| 5624 | auto pool = mImpl->pool(); |
| 5625 | VkCommandBuffer local_commandBuffer; |
| 5626 | local_commandBuffer = commandBuffer; |
| 5627 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5628 | uint32_t local_firstBinding; |
| 5629 | local_firstBinding = firstBinding; |
| 5630 | uint32_t local_bindingCount; |
| 5631 | local_bindingCount = bindingCount; |
| 5632 | VkBuffer* local_pBuffers; |
| 5633 | local_pBuffers = nullptr; |
| 5634 | if (pBuffers) |
| 5635 | { |
| 5636 | local_pBuffers = (VkBuffer*)pool->dupArray(pBuffers, ((bindingCount)) * sizeof(const VkBuffer)); |
| 5637 | } |
| 5638 | if (local_pBuffers) |
| 5639 | { |
| 5640 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)local_pBuffers, ((bindingCount))); |
| 5641 | } |
| 5642 | VkDeviceSize* local_pOffsets; |
| 5643 | local_pOffsets = nullptr; |
| 5644 | if (pOffsets) |
| 5645 | { |
| 5646 | local_pOffsets = (VkDeviceSize*)pool->dupArray(pOffsets, ((bindingCount)) * sizeof(const VkDeviceSize)); |
| 5647 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5648 | countingStream->rewind(); |
| 5649 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5650 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5651 | countingStream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 5652 | countingStream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| 5653 | countingStream->write((VkBuffer*)local_pBuffers, ((bindingCount)) * sizeof(VkBuffer)); |
| 5654 | countingStream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5655 | } |
| 5656 | uint32_t packetSize_vkCmdBindVertexBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5657 | countingStream->rewind(); |
| 5658 | uint32_t opcode_vkCmdBindVertexBuffers = OP_vkCmdBindVertexBuffers; |
| 5659 | stream->write(&opcode_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| 5660 | stream->write(&packetSize_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5661 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5662 | stream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 5663 | stream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| 5664 | stream->write((VkBuffer*)local_pBuffers, ((bindingCount)) * sizeof(VkBuffer)); |
| 5665 | stream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| 5666 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5667 | } |
| 5668 | |
| 5669 | void VkEncoder::vkCmdDraw( |
| 5670 | VkCommandBuffer commandBuffer, |
| 5671 | uint32_t vertexCount, |
| 5672 | uint32_t instanceCount, |
| 5673 | uint32_t firstVertex, |
| 5674 | uint32_t firstInstance) |
| 5675 | { |
| 5676 | auto stream = mImpl->stream(); |
| 5677 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5678 | auto resources = mImpl->resources(); |
| 5679 | auto pool = mImpl->pool(); |
| 5680 | VkCommandBuffer local_commandBuffer; |
| 5681 | local_commandBuffer = commandBuffer; |
| 5682 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5683 | uint32_t local_vertexCount; |
| 5684 | local_vertexCount = vertexCount; |
| 5685 | uint32_t local_instanceCount; |
| 5686 | local_instanceCount = instanceCount; |
| 5687 | uint32_t local_firstVertex; |
| 5688 | local_firstVertex = firstVertex; |
| 5689 | uint32_t local_firstInstance; |
| 5690 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5691 | countingStream->rewind(); |
| 5692 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5693 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5694 | countingStream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 5695 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 5696 | countingStream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 5697 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5698 | } |
| 5699 | uint32_t packetSize_vkCmdDraw = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5700 | countingStream->rewind(); |
| 5701 | uint32_t opcode_vkCmdDraw = OP_vkCmdDraw; |
| 5702 | stream->write(&opcode_vkCmdDraw, sizeof(uint32_t)); |
| 5703 | stream->write(&packetSize_vkCmdDraw, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5704 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5705 | stream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 5706 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 5707 | stream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 5708 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| 5709 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5710 | } |
| 5711 | |
| 5712 | void VkEncoder::vkCmdDrawIndexed( |
| 5713 | VkCommandBuffer commandBuffer, |
| 5714 | uint32_t indexCount, |
| 5715 | uint32_t instanceCount, |
| 5716 | uint32_t firstIndex, |
| 5717 | int32_t vertexOffset, |
| 5718 | uint32_t firstInstance) |
| 5719 | { |
| 5720 | auto stream = mImpl->stream(); |
| 5721 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5722 | auto resources = mImpl->resources(); |
| 5723 | auto pool = mImpl->pool(); |
| 5724 | VkCommandBuffer local_commandBuffer; |
| 5725 | local_commandBuffer = commandBuffer; |
| 5726 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5727 | uint32_t local_indexCount; |
| 5728 | local_indexCount = indexCount; |
| 5729 | uint32_t local_instanceCount; |
| 5730 | local_instanceCount = instanceCount; |
| 5731 | uint32_t local_firstIndex; |
| 5732 | local_firstIndex = firstIndex; |
| 5733 | int32_t local_vertexOffset; |
| 5734 | local_vertexOffset = vertexOffset; |
| 5735 | uint32_t local_firstInstance; |
| 5736 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5737 | countingStream->rewind(); |
| 5738 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5739 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5740 | countingStream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 5741 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 5742 | countingStream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 5743 | countingStream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 5744 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5745 | } |
| 5746 | uint32_t packetSize_vkCmdDrawIndexed = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5747 | countingStream->rewind(); |
| 5748 | uint32_t opcode_vkCmdDrawIndexed = OP_vkCmdDrawIndexed; |
| 5749 | stream->write(&opcode_vkCmdDrawIndexed, sizeof(uint32_t)); |
| 5750 | stream->write(&packetSize_vkCmdDrawIndexed, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5751 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5752 | stream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 5753 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 5754 | stream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 5755 | stream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 5756 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| 5757 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5758 | } |
| 5759 | |
| 5760 | void VkEncoder::vkCmdDrawIndirect( |
| 5761 | VkCommandBuffer commandBuffer, |
| 5762 | VkBuffer buffer, |
| 5763 | VkDeviceSize offset, |
| 5764 | uint32_t drawCount, |
| 5765 | uint32_t stride) |
| 5766 | { |
| 5767 | auto stream = mImpl->stream(); |
| 5768 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5769 | auto resources = mImpl->resources(); |
| 5770 | auto pool = mImpl->pool(); |
| 5771 | VkCommandBuffer local_commandBuffer; |
| 5772 | local_commandBuffer = commandBuffer; |
| 5773 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5774 | VkBuffer local_buffer; |
| 5775 | local_buffer = buffer; |
| 5776 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer); |
| 5777 | VkDeviceSize local_offset; |
| 5778 | local_offset = offset; |
| 5779 | uint32_t local_drawCount; |
| 5780 | local_drawCount = drawCount; |
| 5781 | uint32_t local_stride; |
| 5782 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5783 | countingStream->rewind(); |
| 5784 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5785 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5786 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 5787 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 5788 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 5789 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5790 | } |
| 5791 | uint32_t packetSize_vkCmdDrawIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5792 | countingStream->rewind(); |
| 5793 | uint32_t opcode_vkCmdDrawIndirect = OP_vkCmdDrawIndirect; |
| 5794 | stream->write(&opcode_vkCmdDrawIndirect, sizeof(uint32_t)); |
| 5795 | stream->write(&packetSize_vkCmdDrawIndirect, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5796 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5797 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 5798 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 5799 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 5800 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| 5801 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5802 | } |
| 5803 | |
| 5804 | void VkEncoder::vkCmdDrawIndexedIndirect( |
| 5805 | VkCommandBuffer commandBuffer, |
| 5806 | VkBuffer buffer, |
| 5807 | VkDeviceSize offset, |
| 5808 | uint32_t drawCount, |
| 5809 | uint32_t stride) |
| 5810 | { |
| 5811 | auto stream = mImpl->stream(); |
| 5812 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5813 | auto resources = mImpl->resources(); |
| 5814 | auto pool = mImpl->pool(); |
| 5815 | VkCommandBuffer local_commandBuffer; |
| 5816 | local_commandBuffer = commandBuffer; |
| 5817 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5818 | VkBuffer local_buffer; |
| 5819 | local_buffer = buffer; |
| 5820 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer); |
| 5821 | VkDeviceSize local_offset; |
| 5822 | local_offset = offset; |
| 5823 | uint32_t local_drawCount; |
| 5824 | local_drawCount = drawCount; |
| 5825 | uint32_t local_stride; |
| 5826 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5827 | countingStream->rewind(); |
| 5828 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5829 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5830 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 5831 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 5832 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 5833 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5834 | } |
| 5835 | uint32_t packetSize_vkCmdDrawIndexedIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5836 | countingStream->rewind(); |
| 5837 | uint32_t opcode_vkCmdDrawIndexedIndirect = OP_vkCmdDrawIndexedIndirect; |
| 5838 | stream->write(&opcode_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| 5839 | stream->write(&packetSize_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5840 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5841 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 5842 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 5843 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 5844 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| 5845 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5846 | } |
| 5847 | |
| 5848 | void VkEncoder::vkCmdDispatch( |
| 5849 | VkCommandBuffer commandBuffer, |
| 5850 | uint32_t groupCountX, |
| 5851 | uint32_t groupCountY, |
| 5852 | uint32_t groupCountZ) |
| 5853 | { |
| 5854 | auto stream = mImpl->stream(); |
| 5855 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5856 | auto resources = mImpl->resources(); |
| 5857 | auto pool = mImpl->pool(); |
| 5858 | VkCommandBuffer local_commandBuffer; |
| 5859 | local_commandBuffer = commandBuffer; |
| 5860 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5861 | uint32_t local_groupCountX; |
| 5862 | local_groupCountX = groupCountX; |
| 5863 | uint32_t local_groupCountY; |
| 5864 | local_groupCountY = groupCountY; |
| 5865 | uint32_t local_groupCountZ; |
| 5866 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5867 | countingStream->rewind(); |
| 5868 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5869 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5870 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 5871 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 5872 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5873 | } |
| 5874 | uint32_t packetSize_vkCmdDispatch = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5875 | countingStream->rewind(); |
| 5876 | uint32_t opcode_vkCmdDispatch = OP_vkCmdDispatch; |
| 5877 | stream->write(&opcode_vkCmdDispatch, sizeof(uint32_t)); |
| 5878 | stream->write(&packetSize_vkCmdDispatch, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5879 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5880 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 5881 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 5882 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| 5883 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5884 | } |
| 5885 | |
| 5886 | void VkEncoder::vkCmdDispatchIndirect( |
| 5887 | VkCommandBuffer commandBuffer, |
| 5888 | VkBuffer buffer, |
| 5889 | VkDeviceSize offset) |
| 5890 | { |
| 5891 | auto stream = mImpl->stream(); |
| 5892 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5893 | auto resources = mImpl->resources(); |
| 5894 | auto pool = mImpl->pool(); |
| 5895 | VkCommandBuffer local_commandBuffer; |
| 5896 | local_commandBuffer = commandBuffer; |
| 5897 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5898 | VkBuffer local_buffer; |
| 5899 | local_buffer = buffer; |
| 5900 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer); |
| 5901 | VkDeviceSize local_offset; |
| 5902 | local_offset = offset; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5903 | countingStream->rewind(); |
| 5904 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5905 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5906 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 5907 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5908 | } |
| 5909 | uint32_t packetSize_vkCmdDispatchIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5910 | countingStream->rewind(); |
| 5911 | uint32_t opcode_vkCmdDispatchIndirect = OP_vkCmdDispatchIndirect; |
| 5912 | stream->write(&opcode_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| 5913 | stream->write(&packetSize_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5914 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5915 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 5916 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 5917 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5918 | } |
| 5919 | |
| 5920 | void VkEncoder::vkCmdCopyBuffer( |
| 5921 | VkCommandBuffer commandBuffer, |
| 5922 | VkBuffer srcBuffer, |
| 5923 | VkBuffer dstBuffer, |
| 5924 | uint32_t regionCount, |
| 5925 | const VkBufferCopy* pRegions) |
| 5926 | { |
| 5927 | auto stream = mImpl->stream(); |
| 5928 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5929 | auto resources = mImpl->resources(); |
| 5930 | auto pool = mImpl->pool(); |
| 5931 | VkCommandBuffer local_commandBuffer; |
| 5932 | local_commandBuffer = commandBuffer; |
| 5933 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 5934 | VkBuffer local_srcBuffer; |
| 5935 | local_srcBuffer = srcBuffer; |
| 5936 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_srcBuffer); |
| 5937 | VkBuffer local_dstBuffer; |
| 5938 | local_dstBuffer = dstBuffer; |
| 5939 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer); |
| 5940 | uint32_t local_regionCount; |
| 5941 | local_regionCount = regionCount; |
| 5942 | VkBufferCopy* local_pRegions; |
| 5943 | local_pRegions = nullptr; |
| 5944 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5945 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5946 | local_pRegions = (VkBufferCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5947 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 5948 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5949 | deepcopy_VkBufferCopy(pool, pRegions + i, (VkBufferCopy*)(local_pRegions + i)); |
| 5950 | } |
| 5951 | } |
| 5952 | if (local_pRegions) |
| 5953 | { |
| 5954 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 5955 | { |
| 5956 | handlemap_VkBufferCopy(resources->unwrapMapping(), (VkBufferCopy*)(local_pRegions + i)); |
| 5957 | } |
| 5958 | } |
| 5959 | countingStream->rewind(); |
| 5960 | { |
| 5961 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5962 | countingStream->write((VkBuffer*)&local_srcBuffer, sizeof(VkBuffer)); |
| 5963 | countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 5964 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 5965 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 5966 | { |
| 5967 | marshal_VkBufferCopy(countingStream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5968 | } |
| 5969 | } |
| 5970 | uint32_t packetSize_vkCmdCopyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5971 | countingStream->rewind(); |
| 5972 | uint32_t opcode_vkCmdCopyBuffer = OP_vkCmdCopyBuffer; |
| 5973 | stream->write(&opcode_vkCmdCopyBuffer, sizeof(uint32_t)); |
| 5974 | stream->write(&packetSize_vkCmdCopyBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5975 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 5976 | stream->write((VkBuffer*)&local_srcBuffer, sizeof(VkBuffer)); |
| 5977 | stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 5978 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5979 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 5980 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5981 | marshal_VkBufferCopy(stream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5982 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5983 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5984 | } |
| 5985 | |
| 5986 | void VkEncoder::vkCmdCopyImage( |
| 5987 | VkCommandBuffer commandBuffer, |
| 5988 | VkImage srcImage, |
| 5989 | VkImageLayout srcImageLayout, |
| 5990 | VkImage dstImage, |
| 5991 | VkImageLayout dstImageLayout, |
| 5992 | uint32_t regionCount, |
| 5993 | const VkImageCopy* pRegions) |
| 5994 | { |
| 5995 | auto stream = mImpl->stream(); |
| 5996 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5997 | auto resources = mImpl->resources(); |
| 5998 | auto pool = mImpl->pool(); |
| 5999 | VkCommandBuffer local_commandBuffer; |
| 6000 | local_commandBuffer = commandBuffer; |
| 6001 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6002 | VkImage local_srcImage; |
| 6003 | local_srcImage = srcImage; |
| 6004 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage); |
| 6005 | VkImageLayout local_srcImageLayout; |
| 6006 | local_srcImageLayout = srcImageLayout; |
| 6007 | VkImage local_dstImage; |
| 6008 | local_dstImage = dstImage; |
| 6009 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage); |
| 6010 | VkImageLayout local_dstImageLayout; |
| 6011 | local_dstImageLayout = dstImageLayout; |
| 6012 | uint32_t local_regionCount; |
| 6013 | local_regionCount = regionCount; |
| 6014 | VkImageCopy* local_pRegions; |
| 6015 | local_pRegions = nullptr; |
| 6016 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6017 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6018 | local_pRegions = (VkImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6019 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6020 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6021 | deepcopy_VkImageCopy(pool, pRegions + i, (VkImageCopy*)(local_pRegions + i)); |
| 6022 | } |
| 6023 | } |
| 6024 | if (local_pRegions) |
| 6025 | { |
| 6026 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6027 | { |
| 6028 | handlemap_VkImageCopy(resources->unwrapMapping(), (VkImageCopy*)(local_pRegions + i)); |
| 6029 | } |
| 6030 | } |
| 6031 | countingStream->rewind(); |
| 6032 | { |
| 6033 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6034 | countingStream->write((VkImage*)&local_srcImage, sizeof(VkImage)); |
| 6035 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| 6036 | countingStream->write((VkImage*)&local_dstImage, sizeof(VkImage)); |
| 6037 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6038 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 6039 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6040 | { |
| 6041 | marshal_VkImageCopy(countingStream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6042 | } |
| 6043 | } |
| 6044 | uint32_t packetSize_vkCmdCopyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6045 | countingStream->rewind(); |
| 6046 | uint32_t opcode_vkCmdCopyImage = OP_vkCmdCopyImage; |
| 6047 | stream->write(&opcode_vkCmdCopyImage, sizeof(uint32_t)); |
| 6048 | stream->write(&packetSize_vkCmdCopyImage, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6049 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6050 | stream->write((VkImage*)&local_srcImage, sizeof(VkImage)); |
| 6051 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| 6052 | stream->write((VkImage*)&local_dstImage, sizeof(VkImage)); |
| 6053 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6054 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6055 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6056 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6057 | marshal_VkImageCopy(stream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6058 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6059 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6060 | } |
| 6061 | |
| 6062 | void VkEncoder::vkCmdBlitImage( |
| 6063 | VkCommandBuffer commandBuffer, |
| 6064 | VkImage srcImage, |
| 6065 | VkImageLayout srcImageLayout, |
| 6066 | VkImage dstImage, |
| 6067 | VkImageLayout dstImageLayout, |
| 6068 | uint32_t regionCount, |
| 6069 | const VkImageBlit* pRegions, |
| 6070 | VkFilter filter) |
| 6071 | { |
| 6072 | auto stream = mImpl->stream(); |
| 6073 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6074 | auto resources = mImpl->resources(); |
| 6075 | auto pool = mImpl->pool(); |
| 6076 | VkCommandBuffer local_commandBuffer; |
| 6077 | local_commandBuffer = commandBuffer; |
| 6078 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6079 | VkImage local_srcImage; |
| 6080 | local_srcImage = srcImage; |
| 6081 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage); |
| 6082 | VkImageLayout local_srcImageLayout; |
| 6083 | local_srcImageLayout = srcImageLayout; |
| 6084 | VkImage local_dstImage; |
| 6085 | local_dstImage = dstImage; |
| 6086 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage); |
| 6087 | VkImageLayout local_dstImageLayout; |
| 6088 | local_dstImageLayout = dstImageLayout; |
| 6089 | uint32_t local_regionCount; |
| 6090 | local_regionCount = regionCount; |
| 6091 | VkImageBlit* local_pRegions; |
| 6092 | local_pRegions = nullptr; |
| 6093 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6094 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6095 | local_pRegions = (VkImageBlit*)pool->alloc(((regionCount)) * sizeof(const VkImageBlit)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6096 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6097 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6098 | deepcopy_VkImageBlit(pool, pRegions + i, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6099 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6100 | } |
| 6101 | if (local_pRegions) |
| 6102 | { |
| 6103 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6104 | { |
| 6105 | handlemap_VkImageBlit(resources->unwrapMapping(), (VkImageBlit*)(local_pRegions + i)); |
| 6106 | } |
| 6107 | } |
| 6108 | VkFilter local_filter; |
| 6109 | local_filter = filter; |
| 6110 | countingStream->rewind(); |
| 6111 | { |
| 6112 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6113 | countingStream->write((VkImage*)&local_srcImage, sizeof(VkImage)); |
| 6114 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| 6115 | countingStream->write((VkImage*)&local_dstImage, sizeof(VkImage)); |
| 6116 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6117 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 6118 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6119 | { |
| 6120 | marshal_VkImageBlit(countingStream, (VkImageBlit*)(local_pRegions + i)); |
| 6121 | } |
| 6122 | countingStream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6123 | } |
| 6124 | uint32_t packetSize_vkCmdBlitImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6125 | countingStream->rewind(); |
| 6126 | uint32_t opcode_vkCmdBlitImage = OP_vkCmdBlitImage; |
| 6127 | stream->write(&opcode_vkCmdBlitImage, sizeof(uint32_t)); |
| 6128 | stream->write(&packetSize_vkCmdBlitImage, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6129 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6130 | stream->write((VkImage*)&local_srcImage, sizeof(VkImage)); |
| 6131 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| 6132 | stream->write((VkImage*)&local_dstImage, sizeof(VkImage)); |
| 6133 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6134 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6135 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6136 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6137 | marshal_VkImageBlit(stream, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6138 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6139 | stream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| 6140 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6141 | } |
| 6142 | |
| 6143 | void VkEncoder::vkCmdCopyBufferToImage( |
| 6144 | VkCommandBuffer commandBuffer, |
| 6145 | VkBuffer srcBuffer, |
| 6146 | VkImage dstImage, |
| 6147 | VkImageLayout dstImageLayout, |
| 6148 | uint32_t regionCount, |
| 6149 | const VkBufferImageCopy* pRegions) |
| 6150 | { |
| 6151 | auto stream = mImpl->stream(); |
| 6152 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6153 | auto resources = mImpl->resources(); |
| 6154 | auto pool = mImpl->pool(); |
| 6155 | VkCommandBuffer local_commandBuffer; |
| 6156 | local_commandBuffer = commandBuffer; |
| 6157 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6158 | VkBuffer local_srcBuffer; |
| 6159 | local_srcBuffer = srcBuffer; |
| 6160 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_srcBuffer); |
| 6161 | VkImage local_dstImage; |
| 6162 | local_dstImage = dstImage; |
| 6163 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage); |
| 6164 | VkImageLayout local_dstImageLayout; |
| 6165 | local_dstImageLayout = dstImageLayout; |
| 6166 | uint32_t local_regionCount; |
| 6167 | local_regionCount = regionCount; |
| 6168 | VkBufferImageCopy* local_pRegions; |
| 6169 | local_pRegions = nullptr; |
| 6170 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6171 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6172 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6173 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6174 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6175 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 6176 | } |
| 6177 | } |
| 6178 | if (local_pRegions) |
| 6179 | { |
| 6180 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6181 | { |
| 6182 | handlemap_VkBufferImageCopy(resources->unwrapMapping(), (VkBufferImageCopy*)(local_pRegions + i)); |
| 6183 | } |
| 6184 | } |
| 6185 | countingStream->rewind(); |
| 6186 | { |
| 6187 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6188 | countingStream->write((VkBuffer*)&local_srcBuffer, sizeof(VkBuffer)); |
| 6189 | countingStream->write((VkImage*)&local_dstImage, sizeof(VkImage)); |
| 6190 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6191 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 6192 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6193 | { |
| 6194 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6195 | } |
| 6196 | } |
| 6197 | uint32_t packetSize_vkCmdCopyBufferToImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6198 | countingStream->rewind(); |
| 6199 | uint32_t opcode_vkCmdCopyBufferToImage = OP_vkCmdCopyBufferToImage; |
| 6200 | stream->write(&opcode_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| 6201 | stream->write(&packetSize_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6202 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6203 | stream->write((VkBuffer*)&local_srcBuffer, sizeof(VkBuffer)); |
| 6204 | stream->write((VkImage*)&local_dstImage, sizeof(VkImage)); |
| 6205 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6206 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6207 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6208 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6209 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6210 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6211 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6212 | } |
| 6213 | |
| 6214 | void VkEncoder::vkCmdCopyImageToBuffer( |
| 6215 | VkCommandBuffer commandBuffer, |
| 6216 | VkImage srcImage, |
| 6217 | VkImageLayout srcImageLayout, |
| 6218 | VkBuffer dstBuffer, |
| 6219 | uint32_t regionCount, |
| 6220 | const VkBufferImageCopy* pRegions) |
| 6221 | { |
| 6222 | auto stream = mImpl->stream(); |
| 6223 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6224 | auto resources = mImpl->resources(); |
| 6225 | auto pool = mImpl->pool(); |
| 6226 | VkCommandBuffer local_commandBuffer; |
| 6227 | local_commandBuffer = commandBuffer; |
| 6228 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6229 | VkImage local_srcImage; |
| 6230 | local_srcImage = srcImage; |
| 6231 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage); |
| 6232 | VkImageLayout local_srcImageLayout; |
| 6233 | local_srcImageLayout = srcImageLayout; |
| 6234 | VkBuffer local_dstBuffer; |
| 6235 | local_dstBuffer = dstBuffer; |
| 6236 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer); |
| 6237 | uint32_t local_regionCount; |
| 6238 | local_regionCount = regionCount; |
| 6239 | VkBufferImageCopy* local_pRegions; |
| 6240 | local_pRegions = nullptr; |
| 6241 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6242 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6243 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6244 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6245 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6246 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 6247 | } |
| 6248 | } |
| 6249 | if (local_pRegions) |
| 6250 | { |
| 6251 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6252 | { |
| 6253 | handlemap_VkBufferImageCopy(resources->unwrapMapping(), (VkBufferImageCopy*)(local_pRegions + i)); |
| 6254 | } |
| 6255 | } |
| 6256 | countingStream->rewind(); |
| 6257 | { |
| 6258 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6259 | countingStream->write((VkImage*)&local_srcImage, sizeof(VkImage)); |
| 6260 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| 6261 | countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 6262 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 6263 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6264 | { |
| 6265 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6266 | } |
| 6267 | } |
| 6268 | uint32_t packetSize_vkCmdCopyImageToBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6269 | countingStream->rewind(); |
| 6270 | uint32_t opcode_vkCmdCopyImageToBuffer = OP_vkCmdCopyImageToBuffer; |
| 6271 | stream->write(&opcode_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| 6272 | stream->write(&packetSize_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6273 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6274 | stream->write((VkImage*)&local_srcImage, sizeof(VkImage)); |
| 6275 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| 6276 | stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 6277 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6278 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6279 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6280 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6281 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6282 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6283 | } |
| 6284 | |
| 6285 | void VkEncoder::vkCmdUpdateBuffer( |
| 6286 | VkCommandBuffer commandBuffer, |
| 6287 | VkBuffer dstBuffer, |
| 6288 | VkDeviceSize dstOffset, |
| 6289 | VkDeviceSize dataSize, |
| 6290 | const void* pData) |
| 6291 | { |
| 6292 | auto stream = mImpl->stream(); |
| 6293 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6294 | auto resources = mImpl->resources(); |
| 6295 | auto pool = mImpl->pool(); |
| 6296 | VkCommandBuffer local_commandBuffer; |
| 6297 | local_commandBuffer = commandBuffer; |
| 6298 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6299 | VkBuffer local_dstBuffer; |
| 6300 | local_dstBuffer = dstBuffer; |
| 6301 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer); |
| 6302 | VkDeviceSize local_dstOffset; |
| 6303 | local_dstOffset = dstOffset; |
| 6304 | VkDeviceSize local_dataSize; |
| 6305 | local_dataSize = dataSize; |
| 6306 | void* local_pData; |
| 6307 | local_pData = nullptr; |
| 6308 | if (pData) |
| 6309 | { |
| 6310 | local_pData = (void*)pool->dupArray(pData, ((dataSize)) * sizeof(const uint8_t)); |
| 6311 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6312 | countingStream->rewind(); |
| 6313 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6314 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6315 | countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 6316 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 6317 | countingStream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 6318 | countingStream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6319 | } |
| 6320 | uint32_t packetSize_vkCmdUpdateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6321 | countingStream->rewind(); |
| 6322 | uint32_t opcode_vkCmdUpdateBuffer = OP_vkCmdUpdateBuffer; |
| 6323 | stream->write(&opcode_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| 6324 | stream->write(&packetSize_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6325 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6326 | stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 6327 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 6328 | stream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 6329 | stream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| 6330 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6331 | } |
| 6332 | |
| 6333 | void VkEncoder::vkCmdFillBuffer( |
| 6334 | VkCommandBuffer commandBuffer, |
| 6335 | VkBuffer dstBuffer, |
| 6336 | VkDeviceSize dstOffset, |
| 6337 | VkDeviceSize size, |
| 6338 | uint32_t data) |
| 6339 | { |
| 6340 | auto stream = mImpl->stream(); |
| 6341 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6342 | auto resources = mImpl->resources(); |
| 6343 | auto pool = mImpl->pool(); |
| 6344 | VkCommandBuffer local_commandBuffer; |
| 6345 | local_commandBuffer = commandBuffer; |
| 6346 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6347 | VkBuffer local_dstBuffer; |
| 6348 | local_dstBuffer = dstBuffer; |
| 6349 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer); |
| 6350 | VkDeviceSize local_dstOffset; |
| 6351 | local_dstOffset = dstOffset; |
| 6352 | VkDeviceSize local_size; |
| 6353 | local_size = size; |
| 6354 | uint32_t local_data; |
| 6355 | local_data = data; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6356 | countingStream->rewind(); |
| 6357 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6358 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6359 | countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 6360 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 6361 | countingStream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 6362 | countingStream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6363 | } |
| 6364 | uint32_t packetSize_vkCmdFillBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6365 | countingStream->rewind(); |
| 6366 | uint32_t opcode_vkCmdFillBuffer = OP_vkCmdFillBuffer; |
| 6367 | stream->write(&opcode_vkCmdFillBuffer, sizeof(uint32_t)); |
| 6368 | stream->write(&packetSize_vkCmdFillBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6369 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6370 | stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 6371 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 6372 | stream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 6373 | stream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| 6374 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6375 | } |
| 6376 | |
| 6377 | void VkEncoder::vkCmdClearColorImage( |
| 6378 | VkCommandBuffer commandBuffer, |
| 6379 | VkImage image, |
| 6380 | VkImageLayout imageLayout, |
| 6381 | const VkClearColorValue* pColor, |
| 6382 | uint32_t rangeCount, |
| 6383 | const VkImageSubresourceRange* pRanges) |
| 6384 | { |
| 6385 | auto stream = mImpl->stream(); |
| 6386 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6387 | auto resources = mImpl->resources(); |
| 6388 | auto pool = mImpl->pool(); |
| 6389 | VkCommandBuffer local_commandBuffer; |
| 6390 | local_commandBuffer = commandBuffer; |
| 6391 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6392 | VkImage local_image; |
| 6393 | local_image = image; |
| 6394 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image); |
| 6395 | VkImageLayout local_imageLayout; |
| 6396 | local_imageLayout = imageLayout; |
| 6397 | VkClearColorValue* local_pColor; |
| 6398 | local_pColor = nullptr; |
| 6399 | if (pColor) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6400 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6401 | local_pColor = (VkClearColorValue*)pool->alloc(sizeof(const VkClearColorValue)); |
| 6402 | deepcopy_VkClearColorValue(pool, pColor, (VkClearColorValue*)(local_pColor)); |
| 6403 | } |
| 6404 | if (local_pColor) |
| 6405 | { |
| 6406 | handlemap_VkClearColorValue(resources->unwrapMapping(), (VkClearColorValue*)(local_pColor)); |
| 6407 | } |
| 6408 | uint32_t local_rangeCount; |
| 6409 | local_rangeCount = rangeCount; |
| 6410 | VkImageSubresourceRange* local_pRanges; |
| 6411 | local_pRanges = nullptr; |
| 6412 | if (pRanges) |
| 6413 | { |
| 6414 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6415 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 6416 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6417 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 6418 | } |
| 6419 | } |
| 6420 | if (local_pRanges) |
| 6421 | { |
| 6422 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 6423 | { |
| 6424 | handlemap_VkImageSubresourceRange(resources->unwrapMapping(), (VkImageSubresourceRange*)(local_pRanges + i)); |
| 6425 | } |
| 6426 | } |
| 6427 | countingStream->rewind(); |
| 6428 | { |
| 6429 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6430 | countingStream->write((VkImage*)&local_image, sizeof(VkImage)); |
| 6431 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 6432 | marshal_VkClearColorValue(countingStream, (VkClearColorValue*)(local_pColor)); |
| 6433 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 6434 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 6435 | { |
| 6436 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6437 | } |
| 6438 | } |
| 6439 | uint32_t packetSize_vkCmdClearColorImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6440 | countingStream->rewind(); |
| 6441 | uint32_t opcode_vkCmdClearColorImage = OP_vkCmdClearColorImage; |
| 6442 | stream->write(&opcode_vkCmdClearColorImage, sizeof(uint32_t)); |
| 6443 | stream->write(&packetSize_vkCmdClearColorImage, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6444 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6445 | stream->write((VkImage*)&local_image, sizeof(VkImage)); |
| 6446 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 6447 | marshal_VkClearColorValue(stream, (VkClearColorValue*)(local_pColor)); |
| 6448 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6449 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 6450 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6451 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6452 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6453 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6454 | } |
| 6455 | |
| 6456 | void VkEncoder::vkCmdClearDepthStencilImage( |
| 6457 | VkCommandBuffer commandBuffer, |
| 6458 | VkImage image, |
| 6459 | VkImageLayout imageLayout, |
| 6460 | const VkClearDepthStencilValue* pDepthStencil, |
| 6461 | uint32_t rangeCount, |
| 6462 | const VkImageSubresourceRange* pRanges) |
| 6463 | { |
| 6464 | auto stream = mImpl->stream(); |
| 6465 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6466 | auto resources = mImpl->resources(); |
| 6467 | auto pool = mImpl->pool(); |
| 6468 | VkCommandBuffer local_commandBuffer; |
| 6469 | local_commandBuffer = commandBuffer; |
| 6470 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6471 | VkImage local_image; |
| 6472 | local_image = image; |
| 6473 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_image); |
| 6474 | VkImageLayout local_imageLayout; |
| 6475 | local_imageLayout = imageLayout; |
| 6476 | VkClearDepthStencilValue* local_pDepthStencil; |
| 6477 | local_pDepthStencil = nullptr; |
| 6478 | if (pDepthStencil) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6479 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6480 | local_pDepthStencil = (VkClearDepthStencilValue*)pool->alloc(sizeof(const VkClearDepthStencilValue)); |
| 6481 | deepcopy_VkClearDepthStencilValue(pool, pDepthStencil, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 6482 | } |
| 6483 | if (local_pDepthStencil) |
| 6484 | { |
| 6485 | handlemap_VkClearDepthStencilValue(resources->unwrapMapping(), (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 6486 | } |
| 6487 | uint32_t local_rangeCount; |
| 6488 | local_rangeCount = rangeCount; |
| 6489 | VkImageSubresourceRange* local_pRanges; |
| 6490 | local_pRanges = nullptr; |
| 6491 | if (pRanges) |
| 6492 | { |
| 6493 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6494 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 6495 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6496 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 6497 | } |
| 6498 | } |
| 6499 | if (local_pRanges) |
| 6500 | { |
| 6501 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 6502 | { |
| 6503 | handlemap_VkImageSubresourceRange(resources->unwrapMapping(), (VkImageSubresourceRange*)(local_pRanges + i)); |
| 6504 | } |
| 6505 | } |
| 6506 | countingStream->rewind(); |
| 6507 | { |
| 6508 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6509 | countingStream->write((VkImage*)&local_image, sizeof(VkImage)); |
| 6510 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 6511 | marshal_VkClearDepthStencilValue(countingStream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 6512 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 6513 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 6514 | { |
| 6515 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6516 | } |
| 6517 | } |
| 6518 | uint32_t packetSize_vkCmdClearDepthStencilImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6519 | countingStream->rewind(); |
| 6520 | uint32_t opcode_vkCmdClearDepthStencilImage = OP_vkCmdClearDepthStencilImage; |
| 6521 | stream->write(&opcode_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| 6522 | stream->write(&packetSize_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6523 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6524 | stream->write((VkImage*)&local_image, sizeof(VkImage)); |
| 6525 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 6526 | marshal_VkClearDepthStencilValue(stream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 6527 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6528 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 6529 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6530 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6531 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6532 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6533 | } |
| 6534 | |
| 6535 | void VkEncoder::vkCmdClearAttachments( |
| 6536 | VkCommandBuffer commandBuffer, |
| 6537 | uint32_t attachmentCount, |
| 6538 | const VkClearAttachment* pAttachments, |
| 6539 | uint32_t rectCount, |
| 6540 | const VkClearRect* pRects) |
| 6541 | { |
| 6542 | auto stream = mImpl->stream(); |
| 6543 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6544 | auto resources = mImpl->resources(); |
| 6545 | auto pool = mImpl->pool(); |
| 6546 | VkCommandBuffer local_commandBuffer; |
| 6547 | local_commandBuffer = commandBuffer; |
| 6548 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6549 | uint32_t local_attachmentCount; |
| 6550 | local_attachmentCount = attachmentCount; |
| 6551 | VkClearAttachment* local_pAttachments; |
| 6552 | local_pAttachments = nullptr; |
| 6553 | if (pAttachments) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6554 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6555 | local_pAttachments = (VkClearAttachment*)pool->alloc(((attachmentCount)) * sizeof(const VkClearAttachment)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6556 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 6557 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6558 | deepcopy_VkClearAttachment(pool, pAttachments + i, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6559 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6560 | } |
| 6561 | if (local_pAttachments) |
| 6562 | { |
| 6563 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 6564 | { |
| 6565 | handlemap_VkClearAttachment(resources->unwrapMapping(), (VkClearAttachment*)(local_pAttachments + i)); |
| 6566 | } |
| 6567 | } |
| 6568 | uint32_t local_rectCount; |
| 6569 | local_rectCount = rectCount; |
| 6570 | VkClearRect* local_pRects; |
| 6571 | local_pRects = nullptr; |
| 6572 | if (pRects) |
| 6573 | { |
| 6574 | local_pRects = (VkClearRect*)pool->alloc(((rectCount)) * sizeof(const VkClearRect)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6575 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 6576 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6577 | deepcopy_VkClearRect(pool, pRects + i, (VkClearRect*)(local_pRects + i)); |
| 6578 | } |
| 6579 | } |
| 6580 | if (local_pRects) |
| 6581 | { |
| 6582 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 6583 | { |
| 6584 | handlemap_VkClearRect(resources->unwrapMapping(), (VkClearRect*)(local_pRects + i)); |
| 6585 | } |
| 6586 | } |
| 6587 | countingStream->rewind(); |
| 6588 | { |
| 6589 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6590 | countingStream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| 6591 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 6592 | { |
| 6593 | marshal_VkClearAttachment(countingStream, (VkClearAttachment*)(local_pAttachments + i)); |
| 6594 | } |
| 6595 | countingStream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| 6596 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 6597 | { |
| 6598 | marshal_VkClearRect(countingStream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6599 | } |
| 6600 | } |
| 6601 | uint32_t packetSize_vkCmdClearAttachments = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6602 | countingStream->rewind(); |
| 6603 | uint32_t opcode_vkCmdClearAttachments = OP_vkCmdClearAttachments; |
| 6604 | stream->write(&opcode_vkCmdClearAttachments, sizeof(uint32_t)); |
| 6605 | stream->write(&packetSize_vkCmdClearAttachments, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6606 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6607 | stream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6608 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 6609 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6610 | marshal_VkClearAttachment(stream, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6611 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6612 | stream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6613 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 6614 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6615 | marshal_VkClearRect(stream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6616 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6617 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6618 | } |
| 6619 | |
| 6620 | void VkEncoder::vkCmdResolveImage( |
| 6621 | VkCommandBuffer commandBuffer, |
| 6622 | VkImage srcImage, |
| 6623 | VkImageLayout srcImageLayout, |
| 6624 | VkImage dstImage, |
| 6625 | VkImageLayout dstImageLayout, |
| 6626 | uint32_t regionCount, |
| 6627 | const VkImageResolve* pRegions) |
| 6628 | { |
| 6629 | auto stream = mImpl->stream(); |
| 6630 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6631 | auto resources = mImpl->resources(); |
| 6632 | auto pool = mImpl->pool(); |
| 6633 | VkCommandBuffer local_commandBuffer; |
| 6634 | local_commandBuffer = commandBuffer; |
| 6635 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6636 | VkImage local_srcImage; |
| 6637 | local_srcImage = srcImage; |
| 6638 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_srcImage); |
| 6639 | VkImageLayout local_srcImageLayout; |
| 6640 | local_srcImageLayout = srcImageLayout; |
| 6641 | VkImage local_dstImage; |
| 6642 | local_dstImage = dstImage; |
| 6643 | resources->unwrapMapping()->mapHandles_VkImage((VkImage*)&local_dstImage); |
| 6644 | VkImageLayout local_dstImageLayout; |
| 6645 | local_dstImageLayout = dstImageLayout; |
| 6646 | uint32_t local_regionCount; |
| 6647 | local_regionCount = regionCount; |
| 6648 | VkImageResolve* local_pRegions; |
| 6649 | local_pRegions = nullptr; |
| 6650 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6651 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6652 | local_pRegions = (VkImageResolve*)pool->alloc(((regionCount)) * sizeof(const VkImageResolve)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6653 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6654 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6655 | deepcopy_VkImageResolve(pool, pRegions + i, (VkImageResolve*)(local_pRegions + i)); |
| 6656 | } |
| 6657 | } |
| 6658 | if (local_pRegions) |
| 6659 | { |
| 6660 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6661 | { |
| 6662 | handlemap_VkImageResolve(resources->unwrapMapping(), (VkImageResolve*)(local_pRegions + i)); |
| 6663 | } |
| 6664 | } |
| 6665 | countingStream->rewind(); |
| 6666 | { |
| 6667 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6668 | countingStream->write((VkImage*)&local_srcImage, sizeof(VkImage)); |
| 6669 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| 6670 | countingStream->write((VkImage*)&local_dstImage, sizeof(VkImage)); |
| 6671 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6672 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 6673 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6674 | { |
| 6675 | marshal_VkImageResolve(countingStream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6676 | } |
| 6677 | } |
| 6678 | uint32_t packetSize_vkCmdResolveImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6679 | countingStream->rewind(); |
| 6680 | uint32_t opcode_vkCmdResolveImage = OP_vkCmdResolveImage; |
| 6681 | stream->write(&opcode_vkCmdResolveImage, sizeof(uint32_t)); |
| 6682 | stream->write(&packetSize_vkCmdResolveImage, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6683 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6684 | stream->write((VkImage*)&local_srcImage, sizeof(VkImage)); |
| 6685 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| 6686 | stream->write((VkImage*)&local_dstImage, sizeof(VkImage)); |
| 6687 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6688 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6689 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6690 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6691 | marshal_VkImageResolve(stream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6692 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6693 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6694 | } |
| 6695 | |
| 6696 | void VkEncoder::vkCmdSetEvent( |
| 6697 | VkCommandBuffer commandBuffer, |
| 6698 | VkEvent event, |
| 6699 | VkPipelineStageFlags stageMask) |
| 6700 | { |
| 6701 | auto stream = mImpl->stream(); |
| 6702 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6703 | auto resources = mImpl->resources(); |
| 6704 | auto pool = mImpl->pool(); |
| 6705 | VkCommandBuffer local_commandBuffer; |
| 6706 | local_commandBuffer = commandBuffer; |
| 6707 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6708 | VkEvent local_event; |
| 6709 | local_event = event; |
| 6710 | resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event); |
| 6711 | VkPipelineStageFlags local_stageMask; |
| 6712 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6713 | countingStream->rewind(); |
| 6714 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6715 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6716 | countingStream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| 6717 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6718 | } |
| 6719 | uint32_t packetSize_vkCmdSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6720 | countingStream->rewind(); |
| 6721 | uint32_t opcode_vkCmdSetEvent = OP_vkCmdSetEvent; |
| 6722 | stream->write(&opcode_vkCmdSetEvent, sizeof(uint32_t)); |
| 6723 | stream->write(&packetSize_vkCmdSetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6724 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6725 | stream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| 6726 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| 6727 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6728 | } |
| 6729 | |
| 6730 | void VkEncoder::vkCmdResetEvent( |
| 6731 | VkCommandBuffer commandBuffer, |
| 6732 | VkEvent event, |
| 6733 | VkPipelineStageFlags stageMask) |
| 6734 | { |
| 6735 | auto stream = mImpl->stream(); |
| 6736 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6737 | auto resources = mImpl->resources(); |
| 6738 | auto pool = mImpl->pool(); |
| 6739 | VkCommandBuffer local_commandBuffer; |
| 6740 | local_commandBuffer = commandBuffer; |
| 6741 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6742 | VkEvent local_event; |
| 6743 | local_event = event; |
| 6744 | resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)&local_event); |
| 6745 | VkPipelineStageFlags local_stageMask; |
| 6746 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6747 | countingStream->rewind(); |
| 6748 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6749 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6750 | countingStream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| 6751 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6752 | } |
| 6753 | uint32_t packetSize_vkCmdResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6754 | countingStream->rewind(); |
| 6755 | uint32_t opcode_vkCmdResetEvent = OP_vkCmdResetEvent; |
| 6756 | stream->write(&opcode_vkCmdResetEvent, sizeof(uint32_t)); |
| 6757 | stream->write(&packetSize_vkCmdResetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6758 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6759 | stream->write((VkEvent*)&local_event, sizeof(VkEvent)); |
| 6760 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| 6761 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6762 | } |
| 6763 | |
| 6764 | void VkEncoder::vkCmdWaitEvents( |
| 6765 | VkCommandBuffer commandBuffer, |
| 6766 | uint32_t eventCount, |
| 6767 | const VkEvent* pEvents, |
| 6768 | VkPipelineStageFlags srcStageMask, |
| 6769 | VkPipelineStageFlags dstStageMask, |
| 6770 | uint32_t memoryBarrierCount, |
| 6771 | const VkMemoryBarrier* pMemoryBarriers, |
| 6772 | uint32_t bufferMemoryBarrierCount, |
| 6773 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 6774 | uint32_t imageMemoryBarrierCount, |
| 6775 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 6776 | { |
| 6777 | auto stream = mImpl->stream(); |
| 6778 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6779 | auto resources = mImpl->resources(); |
| 6780 | auto pool = mImpl->pool(); |
| 6781 | VkCommandBuffer local_commandBuffer; |
| 6782 | local_commandBuffer = commandBuffer; |
| 6783 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6784 | uint32_t local_eventCount; |
| 6785 | local_eventCount = eventCount; |
| 6786 | VkEvent* local_pEvents; |
| 6787 | local_pEvents = nullptr; |
| 6788 | if (pEvents) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6789 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6790 | local_pEvents = (VkEvent*)pool->dupArray(pEvents, ((eventCount)) * sizeof(const VkEvent)); |
| 6791 | } |
| 6792 | if (local_pEvents) |
| 6793 | { |
| 6794 | resources->unwrapMapping()->mapHandles_VkEvent((VkEvent*)local_pEvents, ((eventCount))); |
| 6795 | } |
| 6796 | VkPipelineStageFlags local_srcStageMask; |
| 6797 | local_srcStageMask = srcStageMask; |
| 6798 | VkPipelineStageFlags local_dstStageMask; |
| 6799 | local_dstStageMask = dstStageMask; |
| 6800 | uint32_t local_memoryBarrierCount; |
| 6801 | local_memoryBarrierCount = memoryBarrierCount; |
| 6802 | VkMemoryBarrier* local_pMemoryBarriers; |
| 6803 | local_pMemoryBarriers = nullptr; |
| 6804 | if (pMemoryBarriers) |
| 6805 | { |
| 6806 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6807 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 6808 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6809 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6810 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6811 | } |
| 6812 | if (local_pMemoryBarriers) |
| 6813 | { |
| 6814 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 6815 | { |
| 6816 | handlemap_VkMemoryBarrier(resources->unwrapMapping(), (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 6817 | } |
| 6818 | } |
| 6819 | uint32_t local_bufferMemoryBarrierCount; |
| 6820 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| 6821 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 6822 | local_pBufferMemoryBarriers = nullptr; |
| 6823 | if (pBufferMemoryBarriers) |
| 6824 | { |
| 6825 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6826 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 6827 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6828 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6829 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6830 | } |
| 6831 | if (local_pBufferMemoryBarriers) |
| 6832 | { |
| 6833 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 6834 | { |
| 6835 | handlemap_VkBufferMemoryBarrier(resources->unwrapMapping(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 6836 | } |
| 6837 | } |
| 6838 | uint32_t local_imageMemoryBarrierCount; |
| 6839 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| 6840 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 6841 | local_pImageMemoryBarriers = nullptr; |
| 6842 | if (pImageMemoryBarriers) |
| 6843 | { |
| 6844 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6845 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 6846 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6847 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 6848 | } |
| 6849 | } |
| 6850 | if (local_pImageMemoryBarriers) |
| 6851 | { |
| 6852 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 6853 | { |
| 6854 | handlemap_VkImageMemoryBarrier(resources->unwrapMapping(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 6855 | } |
| 6856 | } |
| 6857 | countingStream->rewind(); |
| 6858 | { |
| 6859 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6860 | countingStream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| 6861 | countingStream->write((VkEvent*)local_pEvents, ((eventCount)) * sizeof(VkEvent)); |
| 6862 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 6863 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 6864 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 6865 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 6866 | { |
| 6867 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 6868 | } |
| 6869 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 6870 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 6871 | { |
| 6872 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 6873 | } |
| 6874 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 6875 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 6876 | { |
| 6877 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6878 | } |
| 6879 | } |
| 6880 | uint32_t packetSize_vkCmdWaitEvents = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6881 | countingStream->rewind(); |
| 6882 | uint32_t opcode_vkCmdWaitEvents = OP_vkCmdWaitEvents; |
| 6883 | stream->write(&opcode_vkCmdWaitEvents, sizeof(uint32_t)); |
| 6884 | stream->write(&packetSize_vkCmdWaitEvents, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6885 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6886 | stream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| 6887 | stream->write((VkEvent*)local_pEvents, ((eventCount)) * sizeof(VkEvent)); |
| 6888 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 6889 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 6890 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6891 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 6892 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6893 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6894 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6895 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6896 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 6897 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6898 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6899 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6900 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6901 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 6902 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6903 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6904 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6905 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6906 | } |
| 6907 | |
| 6908 | void VkEncoder::vkCmdPipelineBarrier( |
| 6909 | VkCommandBuffer commandBuffer, |
| 6910 | VkPipelineStageFlags srcStageMask, |
| 6911 | VkPipelineStageFlags dstStageMask, |
| 6912 | VkDependencyFlags dependencyFlags, |
| 6913 | uint32_t memoryBarrierCount, |
| 6914 | const VkMemoryBarrier* pMemoryBarriers, |
| 6915 | uint32_t bufferMemoryBarrierCount, |
| 6916 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 6917 | uint32_t imageMemoryBarrierCount, |
| 6918 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 6919 | { |
| 6920 | auto stream = mImpl->stream(); |
| 6921 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6922 | auto resources = mImpl->resources(); |
| 6923 | auto pool = mImpl->pool(); |
| 6924 | VkCommandBuffer local_commandBuffer; |
| 6925 | local_commandBuffer = commandBuffer; |
| 6926 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 6927 | VkPipelineStageFlags local_srcStageMask; |
| 6928 | local_srcStageMask = srcStageMask; |
| 6929 | VkPipelineStageFlags local_dstStageMask; |
| 6930 | local_dstStageMask = dstStageMask; |
| 6931 | VkDependencyFlags local_dependencyFlags; |
| 6932 | local_dependencyFlags = dependencyFlags; |
| 6933 | uint32_t local_memoryBarrierCount; |
| 6934 | local_memoryBarrierCount = memoryBarrierCount; |
| 6935 | VkMemoryBarrier* local_pMemoryBarriers; |
| 6936 | local_pMemoryBarriers = nullptr; |
| 6937 | if (pMemoryBarriers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6938 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6939 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6940 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 6941 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6942 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6943 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6944 | } |
| 6945 | if (local_pMemoryBarriers) |
| 6946 | { |
| 6947 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 6948 | { |
| 6949 | handlemap_VkMemoryBarrier(resources->unwrapMapping(), (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 6950 | } |
| 6951 | } |
| 6952 | uint32_t local_bufferMemoryBarrierCount; |
| 6953 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| 6954 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 6955 | local_pBufferMemoryBarriers = nullptr; |
| 6956 | if (pBufferMemoryBarriers) |
| 6957 | { |
| 6958 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6959 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 6960 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6961 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6962 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6963 | } |
| 6964 | if (local_pBufferMemoryBarriers) |
| 6965 | { |
| 6966 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 6967 | { |
| 6968 | handlemap_VkBufferMemoryBarrier(resources->unwrapMapping(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 6969 | } |
| 6970 | } |
| 6971 | uint32_t local_imageMemoryBarrierCount; |
| 6972 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| 6973 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 6974 | local_pImageMemoryBarriers = nullptr; |
| 6975 | if (pImageMemoryBarriers) |
| 6976 | { |
| 6977 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6978 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 6979 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6980 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 6981 | } |
| 6982 | } |
| 6983 | if (local_pImageMemoryBarriers) |
| 6984 | { |
| 6985 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 6986 | { |
| 6987 | handlemap_VkImageMemoryBarrier(resources->unwrapMapping(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 6988 | } |
| 6989 | } |
| 6990 | countingStream->rewind(); |
| 6991 | { |
| 6992 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 6993 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 6994 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 6995 | countingStream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 6996 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 6997 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 6998 | { |
| 6999 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 7000 | } |
| 7001 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 7002 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 7003 | { |
| 7004 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 7005 | } |
| 7006 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 7007 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 7008 | { |
| 7009 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7010 | } |
| 7011 | } |
| 7012 | uint32_t packetSize_vkCmdPipelineBarrier = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7013 | countingStream->rewind(); |
| 7014 | uint32_t opcode_vkCmdPipelineBarrier = OP_vkCmdPipelineBarrier; |
| 7015 | stream->write(&opcode_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| 7016 | stream->write(&packetSize_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7017 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7018 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 7019 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 7020 | stream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 7021 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7022 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 7023 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7024 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7025 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7026 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7027 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 7028 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7029 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7030 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7031 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7032 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 7033 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7034 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7035 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7036 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7037 | } |
| 7038 | |
| 7039 | void VkEncoder::vkCmdBeginQuery( |
| 7040 | VkCommandBuffer commandBuffer, |
| 7041 | VkQueryPool queryPool, |
| 7042 | uint32_t query, |
| 7043 | VkQueryControlFlags flags) |
| 7044 | { |
| 7045 | auto stream = mImpl->stream(); |
| 7046 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7047 | auto resources = mImpl->resources(); |
| 7048 | auto pool = mImpl->pool(); |
| 7049 | VkCommandBuffer local_commandBuffer; |
| 7050 | local_commandBuffer = commandBuffer; |
| 7051 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7052 | VkQueryPool local_queryPool; |
| 7053 | local_queryPool = queryPool; |
| 7054 | resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool); |
| 7055 | uint32_t local_query; |
| 7056 | local_query = query; |
| 7057 | VkQueryControlFlags local_flags; |
| 7058 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7059 | countingStream->rewind(); |
| 7060 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7061 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7062 | countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 7063 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 7064 | countingStream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7065 | } |
| 7066 | uint32_t packetSize_vkCmdBeginQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7067 | countingStream->rewind(); |
| 7068 | uint32_t opcode_vkCmdBeginQuery = OP_vkCmdBeginQuery; |
| 7069 | stream->write(&opcode_vkCmdBeginQuery, sizeof(uint32_t)); |
| 7070 | stream->write(&packetSize_vkCmdBeginQuery, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7071 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7072 | stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 7073 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 7074 | stream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| 7075 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7076 | } |
| 7077 | |
| 7078 | void VkEncoder::vkCmdEndQuery( |
| 7079 | VkCommandBuffer commandBuffer, |
| 7080 | VkQueryPool queryPool, |
| 7081 | uint32_t query) |
| 7082 | { |
| 7083 | auto stream = mImpl->stream(); |
| 7084 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7085 | auto resources = mImpl->resources(); |
| 7086 | auto pool = mImpl->pool(); |
| 7087 | VkCommandBuffer local_commandBuffer; |
| 7088 | local_commandBuffer = commandBuffer; |
| 7089 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7090 | VkQueryPool local_queryPool; |
| 7091 | local_queryPool = queryPool; |
| 7092 | resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool); |
| 7093 | uint32_t local_query; |
| 7094 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7095 | countingStream->rewind(); |
| 7096 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7097 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7098 | countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 7099 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7100 | } |
| 7101 | uint32_t packetSize_vkCmdEndQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7102 | countingStream->rewind(); |
| 7103 | uint32_t opcode_vkCmdEndQuery = OP_vkCmdEndQuery; |
| 7104 | stream->write(&opcode_vkCmdEndQuery, sizeof(uint32_t)); |
| 7105 | stream->write(&packetSize_vkCmdEndQuery, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7106 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7107 | stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 7108 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 7109 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7110 | } |
| 7111 | |
| 7112 | void VkEncoder::vkCmdResetQueryPool( |
| 7113 | VkCommandBuffer commandBuffer, |
| 7114 | VkQueryPool queryPool, |
| 7115 | uint32_t firstQuery, |
| 7116 | uint32_t queryCount) |
| 7117 | { |
| 7118 | auto stream = mImpl->stream(); |
| 7119 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7120 | auto resources = mImpl->resources(); |
| 7121 | auto pool = mImpl->pool(); |
| 7122 | VkCommandBuffer local_commandBuffer; |
| 7123 | local_commandBuffer = commandBuffer; |
| 7124 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7125 | VkQueryPool local_queryPool; |
| 7126 | local_queryPool = queryPool; |
| 7127 | resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool); |
| 7128 | uint32_t local_firstQuery; |
| 7129 | local_firstQuery = firstQuery; |
| 7130 | uint32_t local_queryCount; |
| 7131 | local_queryCount = queryCount; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7132 | countingStream->rewind(); |
| 7133 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7134 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7135 | countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 7136 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 7137 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7138 | } |
| 7139 | uint32_t packetSize_vkCmdResetQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7140 | countingStream->rewind(); |
| 7141 | uint32_t opcode_vkCmdResetQueryPool = OP_vkCmdResetQueryPool; |
| 7142 | stream->write(&opcode_vkCmdResetQueryPool, sizeof(uint32_t)); |
| 7143 | stream->write(&packetSize_vkCmdResetQueryPool, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7144 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7145 | stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 7146 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 7147 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| 7148 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7149 | } |
| 7150 | |
| 7151 | void VkEncoder::vkCmdWriteTimestamp( |
| 7152 | VkCommandBuffer commandBuffer, |
| 7153 | VkPipelineStageFlagBits pipelineStage, |
| 7154 | VkQueryPool queryPool, |
| 7155 | uint32_t query) |
| 7156 | { |
| 7157 | auto stream = mImpl->stream(); |
| 7158 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7159 | auto resources = mImpl->resources(); |
| 7160 | auto pool = mImpl->pool(); |
| 7161 | VkCommandBuffer local_commandBuffer; |
| 7162 | local_commandBuffer = commandBuffer; |
| 7163 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7164 | VkPipelineStageFlagBits local_pipelineStage; |
| 7165 | local_pipelineStage = pipelineStage; |
| 7166 | VkQueryPool local_queryPool; |
| 7167 | local_queryPool = queryPool; |
| 7168 | resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool); |
| 7169 | uint32_t local_query; |
| 7170 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7171 | countingStream->rewind(); |
| 7172 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7173 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7174 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| 7175 | countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 7176 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7177 | } |
| 7178 | uint32_t packetSize_vkCmdWriteTimestamp = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7179 | countingStream->rewind(); |
| 7180 | uint32_t opcode_vkCmdWriteTimestamp = OP_vkCmdWriteTimestamp; |
| 7181 | stream->write(&opcode_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| 7182 | stream->write(&packetSize_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7183 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7184 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| 7185 | stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 7186 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 7187 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7188 | } |
| 7189 | |
| 7190 | void VkEncoder::vkCmdCopyQueryPoolResults( |
| 7191 | VkCommandBuffer commandBuffer, |
| 7192 | VkQueryPool queryPool, |
| 7193 | uint32_t firstQuery, |
| 7194 | uint32_t queryCount, |
| 7195 | VkBuffer dstBuffer, |
| 7196 | VkDeviceSize dstOffset, |
| 7197 | VkDeviceSize stride, |
| 7198 | VkQueryResultFlags flags) |
| 7199 | { |
| 7200 | auto stream = mImpl->stream(); |
| 7201 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7202 | auto resources = mImpl->resources(); |
| 7203 | auto pool = mImpl->pool(); |
| 7204 | VkCommandBuffer local_commandBuffer; |
| 7205 | local_commandBuffer = commandBuffer; |
| 7206 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7207 | VkQueryPool local_queryPool; |
| 7208 | local_queryPool = queryPool; |
| 7209 | resources->unwrapMapping()->mapHandles_VkQueryPool((VkQueryPool*)&local_queryPool); |
| 7210 | uint32_t local_firstQuery; |
| 7211 | local_firstQuery = firstQuery; |
| 7212 | uint32_t local_queryCount; |
| 7213 | local_queryCount = queryCount; |
| 7214 | VkBuffer local_dstBuffer; |
| 7215 | local_dstBuffer = dstBuffer; |
| 7216 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer); |
| 7217 | VkDeviceSize local_dstOffset; |
| 7218 | local_dstOffset = dstOffset; |
| 7219 | VkDeviceSize local_stride; |
| 7220 | local_stride = stride; |
| 7221 | VkQueryResultFlags local_flags; |
| 7222 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7223 | countingStream->rewind(); |
| 7224 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7225 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7226 | countingStream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 7227 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 7228 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| 7229 | countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 7230 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 7231 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 7232 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7233 | } |
| 7234 | uint32_t packetSize_vkCmdCopyQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7235 | countingStream->rewind(); |
| 7236 | uint32_t opcode_vkCmdCopyQueryPoolResults = OP_vkCmdCopyQueryPoolResults; |
| 7237 | stream->write(&opcode_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| 7238 | stream->write(&packetSize_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7239 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7240 | stream->write((VkQueryPool*)&local_queryPool, sizeof(VkQueryPool)); |
| 7241 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 7242 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| 7243 | stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 7244 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 7245 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 7246 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| 7247 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7248 | } |
| 7249 | |
| 7250 | void VkEncoder::vkCmdPushConstants( |
| 7251 | VkCommandBuffer commandBuffer, |
| 7252 | VkPipelineLayout layout, |
| 7253 | VkShaderStageFlags stageFlags, |
| 7254 | uint32_t offset, |
| 7255 | uint32_t size, |
| 7256 | const void* pValues) |
| 7257 | { |
| 7258 | auto stream = mImpl->stream(); |
| 7259 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7260 | auto resources = mImpl->resources(); |
| 7261 | auto pool = mImpl->pool(); |
| 7262 | VkCommandBuffer local_commandBuffer; |
| 7263 | local_commandBuffer = commandBuffer; |
| 7264 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7265 | VkPipelineLayout local_layout; |
| 7266 | local_layout = layout; |
| 7267 | resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout); |
| 7268 | VkShaderStageFlags local_stageFlags; |
| 7269 | local_stageFlags = stageFlags; |
| 7270 | uint32_t local_offset; |
| 7271 | local_offset = offset; |
| 7272 | uint32_t local_size; |
| 7273 | local_size = size; |
| 7274 | void* local_pValues; |
| 7275 | local_pValues = nullptr; |
| 7276 | if (pValues) |
| 7277 | { |
| 7278 | local_pValues = (void*)pool->dupArray(pValues, ((size)) * sizeof(const uint8_t)); |
| 7279 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7280 | countingStream->rewind(); |
| 7281 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7282 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7283 | countingStream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout)); |
| 7284 | countingStream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 7285 | countingStream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 7286 | countingStream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 7287 | countingStream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7288 | } |
| 7289 | uint32_t packetSize_vkCmdPushConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7290 | countingStream->rewind(); |
| 7291 | uint32_t opcode_vkCmdPushConstants = OP_vkCmdPushConstants; |
| 7292 | stream->write(&opcode_vkCmdPushConstants, sizeof(uint32_t)); |
| 7293 | stream->write(&packetSize_vkCmdPushConstants, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7294 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7295 | stream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout)); |
| 7296 | stream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 7297 | stream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 7298 | stream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 7299 | stream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| 7300 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7301 | } |
| 7302 | |
| 7303 | void VkEncoder::vkCmdBeginRenderPass( |
| 7304 | VkCommandBuffer commandBuffer, |
| 7305 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 7306 | VkSubpassContents contents) |
| 7307 | { |
| 7308 | auto stream = mImpl->stream(); |
| 7309 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7310 | auto resources = mImpl->resources(); |
| 7311 | auto pool = mImpl->pool(); |
| 7312 | VkCommandBuffer local_commandBuffer; |
| 7313 | local_commandBuffer = commandBuffer; |
| 7314 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7315 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| 7316 | local_pRenderPassBegin = nullptr; |
| 7317 | if (pRenderPassBegin) |
| 7318 | { |
| 7319 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 7320 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 7321 | } |
| 7322 | if (local_pRenderPassBegin) |
| 7323 | { |
| 7324 | handlemap_VkRenderPassBeginInfo(resources->unwrapMapping(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 7325 | } |
| 7326 | VkSubpassContents local_contents; |
| 7327 | local_contents = contents; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7328 | countingStream->rewind(); |
| 7329 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7330 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7331 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 7332 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7333 | } |
| 7334 | uint32_t packetSize_vkCmdBeginRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7335 | countingStream->rewind(); |
| 7336 | uint32_t opcode_vkCmdBeginRenderPass = OP_vkCmdBeginRenderPass; |
| 7337 | stream->write(&opcode_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| 7338 | stream->write(&packetSize_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7339 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7340 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 7341 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| 7342 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7343 | } |
| 7344 | |
| 7345 | void VkEncoder::vkCmdNextSubpass( |
| 7346 | VkCommandBuffer commandBuffer, |
| 7347 | VkSubpassContents contents) |
| 7348 | { |
| 7349 | auto stream = mImpl->stream(); |
| 7350 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7351 | auto resources = mImpl->resources(); |
| 7352 | auto pool = mImpl->pool(); |
| 7353 | VkCommandBuffer local_commandBuffer; |
| 7354 | local_commandBuffer = commandBuffer; |
| 7355 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7356 | VkSubpassContents local_contents; |
| 7357 | local_contents = contents; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7358 | countingStream->rewind(); |
| 7359 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7360 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7361 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7362 | } |
| 7363 | uint32_t packetSize_vkCmdNextSubpass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7364 | countingStream->rewind(); |
| 7365 | uint32_t opcode_vkCmdNextSubpass = OP_vkCmdNextSubpass; |
| 7366 | stream->write(&opcode_vkCmdNextSubpass, sizeof(uint32_t)); |
| 7367 | stream->write(&packetSize_vkCmdNextSubpass, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7368 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7369 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| 7370 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7371 | } |
| 7372 | |
| 7373 | void VkEncoder::vkCmdEndRenderPass( |
| 7374 | VkCommandBuffer commandBuffer) |
| 7375 | { |
| 7376 | auto stream = mImpl->stream(); |
| 7377 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7378 | auto resources = mImpl->resources(); |
| 7379 | auto pool = mImpl->pool(); |
| 7380 | VkCommandBuffer local_commandBuffer; |
| 7381 | local_commandBuffer = commandBuffer; |
| 7382 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7383 | countingStream->rewind(); |
| 7384 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7385 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7386 | } |
| 7387 | uint32_t packetSize_vkCmdEndRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7388 | countingStream->rewind(); |
| 7389 | uint32_t opcode_vkCmdEndRenderPass = OP_vkCmdEndRenderPass; |
| 7390 | stream->write(&opcode_vkCmdEndRenderPass, sizeof(uint32_t)); |
| 7391 | stream->write(&packetSize_vkCmdEndRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7392 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7393 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7394 | } |
| 7395 | |
| 7396 | void VkEncoder::vkCmdExecuteCommands( |
| 7397 | VkCommandBuffer commandBuffer, |
| 7398 | uint32_t commandBufferCount, |
| 7399 | const VkCommandBuffer* pCommandBuffers) |
| 7400 | { |
| 7401 | auto stream = mImpl->stream(); |
| 7402 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7403 | auto resources = mImpl->resources(); |
| 7404 | auto pool = mImpl->pool(); |
| 7405 | VkCommandBuffer local_commandBuffer; |
| 7406 | local_commandBuffer = commandBuffer; |
| 7407 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7408 | uint32_t local_commandBufferCount; |
| 7409 | local_commandBufferCount = commandBufferCount; |
| 7410 | VkCommandBuffer* local_pCommandBuffers; |
| 7411 | local_pCommandBuffers = nullptr; |
| 7412 | if (pCommandBuffers) |
| 7413 | { |
| 7414 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 7415 | } |
| 7416 | if (local_pCommandBuffers) |
| 7417 | { |
| 7418 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount))); |
| 7419 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7420 | countingStream->rewind(); |
| 7421 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7422 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7423 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| 7424 | countingStream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7425 | } |
| 7426 | uint32_t packetSize_vkCmdExecuteCommands = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7427 | countingStream->rewind(); |
| 7428 | uint32_t opcode_vkCmdExecuteCommands = OP_vkCmdExecuteCommands; |
| 7429 | stream->write(&opcode_vkCmdExecuteCommands, sizeof(uint32_t)); |
| 7430 | stream->write(&packetSize_vkCmdExecuteCommands, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7431 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7432 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| 7433 | stream->write((VkCommandBuffer*)local_pCommandBuffers, ((commandBufferCount)) * sizeof(VkCommandBuffer)); |
| 7434 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7435 | } |
| 7436 | |
| 7437 | #endif |
| 7438 | #ifdef VK_VERSION_1_1 |
| 7439 | VkResult VkEncoder::vkEnumerateInstanceVersion( |
| 7440 | uint32_t* pApiVersion) |
| 7441 | { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7442 | VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 7443 | vkEnumerateInstanceVersion_VkResult_return = goldfish_vkEnumerateInstanceVersion(pApiVersion); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7444 | return vkEnumerateInstanceVersion_VkResult_return; |
| 7445 | } |
| 7446 | |
| 7447 | VkResult VkEncoder::vkBindBufferMemory2( |
| 7448 | VkDevice device, |
| 7449 | uint32_t bindInfoCount, |
| 7450 | const VkBindBufferMemoryInfo* pBindInfos) |
| 7451 | { |
| 7452 | auto stream = mImpl->stream(); |
| 7453 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7454 | auto resources = mImpl->resources(); |
| 7455 | auto pool = mImpl->pool(); |
| 7456 | VkDevice local_device; |
| 7457 | local_device = device; |
| 7458 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 7459 | uint32_t local_bindInfoCount; |
| 7460 | local_bindInfoCount = bindInfoCount; |
| 7461 | VkBindBufferMemoryInfo* local_pBindInfos; |
| 7462 | local_pBindInfos = nullptr; |
| 7463 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7464 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7465 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7466 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 7467 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7468 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 7469 | } |
| 7470 | } |
| 7471 | if (local_pBindInfos) |
| 7472 | { |
| 7473 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 7474 | { |
| 7475 | handlemap_VkBindBufferMemoryInfo(resources->unwrapMapping(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 7476 | } |
| 7477 | } |
| 7478 | countingStream->rewind(); |
| 7479 | { |
| 7480 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7481 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 7482 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 7483 | { |
| 7484 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7485 | } |
| 7486 | } |
| 7487 | uint32_t packetSize_vkBindBufferMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7488 | countingStream->rewind(); |
| 7489 | uint32_t opcode_vkBindBufferMemory2 = OP_vkBindBufferMemory2; |
| 7490 | stream->write(&opcode_vkBindBufferMemory2, sizeof(uint32_t)); |
| 7491 | stream->write(&packetSize_vkBindBufferMemory2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7492 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7493 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7494 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 7495 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7496 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7497 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7498 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7499 | VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0; |
| 7500 | stream->read(&vkBindBufferMemory2_VkResult_return, sizeof(VkResult)); |
| 7501 | return vkBindBufferMemory2_VkResult_return; |
| 7502 | } |
| 7503 | |
| 7504 | VkResult VkEncoder::vkBindImageMemory2( |
| 7505 | VkDevice device, |
| 7506 | uint32_t bindInfoCount, |
| 7507 | const VkBindImageMemoryInfo* pBindInfos) |
| 7508 | { |
| 7509 | auto stream = mImpl->stream(); |
| 7510 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7511 | auto resources = mImpl->resources(); |
| 7512 | auto pool = mImpl->pool(); |
| 7513 | VkDevice local_device; |
| 7514 | local_device = device; |
| 7515 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 7516 | uint32_t local_bindInfoCount; |
| 7517 | local_bindInfoCount = bindInfoCount; |
| 7518 | VkBindImageMemoryInfo* local_pBindInfos; |
| 7519 | local_pBindInfos = nullptr; |
| 7520 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7521 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7522 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7523 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 7524 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7525 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 7526 | } |
| 7527 | } |
| 7528 | if (local_pBindInfos) |
| 7529 | { |
| 7530 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 7531 | { |
| 7532 | handlemap_VkBindImageMemoryInfo(resources->unwrapMapping(), (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 7533 | } |
| 7534 | } |
| 7535 | countingStream->rewind(); |
| 7536 | { |
| 7537 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7538 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 7539 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 7540 | { |
| 7541 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7542 | } |
| 7543 | } |
| 7544 | uint32_t packetSize_vkBindImageMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7545 | countingStream->rewind(); |
| 7546 | uint32_t opcode_vkBindImageMemory2 = OP_vkBindImageMemory2; |
| 7547 | stream->write(&opcode_vkBindImageMemory2, sizeof(uint32_t)); |
| 7548 | stream->write(&packetSize_vkBindImageMemory2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7549 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7550 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7551 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 7552 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7553 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7554 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7555 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7556 | VkResult vkBindImageMemory2_VkResult_return = (VkResult)0; |
| 7557 | stream->read(&vkBindImageMemory2_VkResult_return, sizeof(VkResult)); |
| 7558 | return vkBindImageMemory2_VkResult_return; |
| 7559 | } |
| 7560 | |
| 7561 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeatures( |
| 7562 | VkDevice device, |
| 7563 | uint32_t heapIndex, |
| 7564 | uint32_t localDeviceIndex, |
| 7565 | uint32_t remoteDeviceIndex, |
| 7566 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 7567 | { |
| 7568 | auto stream = mImpl->stream(); |
| 7569 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7570 | auto resources = mImpl->resources(); |
| 7571 | auto pool = mImpl->pool(); |
| 7572 | VkDevice local_device; |
| 7573 | local_device = device; |
| 7574 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 7575 | uint32_t local_heapIndex; |
| 7576 | local_heapIndex = heapIndex; |
| 7577 | uint32_t local_localDeviceIndex; |
| 7578 | local_localDeviceIndex = localDeviceIndex; |
| 7579 | uint32_t local_remoteDeviceIndex; |
| 7580 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7581 | countingStream->rewind(); |
| 7582 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7583 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7584 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 7585 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 7586 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7587 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 7588 | } |
| 7589 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7590 | countingStream->rewind(); |
| 7591 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeatures = OP_vkGetDeviceGroupPeerMemoryFeatures; |
| 7592 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| 7593 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7594 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7595 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 7596 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 7597 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7598 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 7599 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7600 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7601 | } |
| 7602 | |
| 7603 | void VkEncoder::vkCmdSetDeviceMask( |
| 7604 | VkCommandBuffer commandBuffer, |
| 7605 | uint32_t deviceMask) |
| 7606 | { |
| 7607 | auto stream = mImpl->stream(); |
| 7608 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7609 | auto resources = mImpl->resources(); |
| 7610 | auto pool = mImpl->pool(); |
| 7611 | VkCommandBuffer local_commandBuffer; |
| 7612 | local_commandBuffer = commandBuffer; |
| 7613 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7614 | uint32_t local_deviceMask; |
| 7615 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7616 | countingStream->rewind(); |
| 7617 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7618 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7619 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7620 | } |
| 7621 | uint32_t packetSize_vkCmdSetDeviceMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7622 | countingStream->rewind(); |
| 7623 | uint32_t opcode_vkCmdSetDeviceMask = OP_vkCmdSetDeviceMask; |
| 7624 | stream->write(&opcode_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| 7625 | stream->write(&packetSize_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7626 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7627 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| 7628 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7629 | } |
| 7630 | |
| 7631 | void VkEncoder::vkCmdDispatchBase( |
| 7632 | VkCommandBuffer commandBuffer, |
| 7633 | uint32_t baseGroupX, |
| 7634 | uint32_t baseGroupY, |
| 7635 | uint32_t baseGroupZ, |
| 7636 | uint32_t groupCountX, |
| 7637 | uint32_t groupCountY, |
| 7638 | uint32_t groupCountZ) |
| 7639 | { |
| 7640 | auto stream = mImpl->stream(); |
| 7641 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7642 | auto resources = mImpl->resources(); |
| 7643 | auto pool = mImpl->pool(); |
| 7644 | VkCommandBuffer local_commandBuffer; |
| 7645 | local_commandBuffer = commandBuffer; |
| 7646 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 7647 | uint32_t local_baseGroupX; |
| 7648 | local_baseGroupX = baseGroupX; |
| 7649 | uint32_t local_baseGroupY; |
| 7650 | local_baseGroupY = baseGroupY; |
| 7651 | uint32_t local_baseGroupZ; |
| 7652 | local_baseGroupZ = baseGroupZ; |
| 7653 | uint32_t local_groupCountX; |
| 7654 | local_groupCountX = groupCountX; |
| 7655 | uint32_t local_groupCountY; |
| 7656 | local_groupCountY = groupCountY; |
| 7657 | uint32_t local_groupCountZ; |
| 7658 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7659 | countingStream->rewind(); |
| 7660 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7661 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7662 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 7663 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 7664 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 7665 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 7666 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 7667 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7668 | } |
| 7669 | uint32_t packetSize_vkCmdDispatchBase = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7670 | countingStream->rewind(); |
| 7671 | uint32_t opcode_vkCmdDispatchBase = OP_vkCmdDispatchBase; |
| 7672 | stream->write(&opcode_vkCmdDispatchBase, sizeof(uint32_t)); |
| 7673 | stream->write(&packetSize_vkCmdDispatchBase, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7674 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 7675 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 7676 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 7677 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 7678 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 7679 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 7680 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| 7681 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7682 | } |
| 7683 | |
| 7684 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroups( |
| 7685 | VkInstance instance, |
| 7686 | uint32_t* pPhysicalDeviceGroupCount, |
| 7687 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 7688 | { |
| 7689 | auto stream = mImpl->stream(); |
| 7690 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7691 | auto resources = mImpl->resources(); |
| 7692 | auto pool = mImpl->pool(); |
| 7693 | VkInstance local_instance; |
| 7694 | local_instance = instance; |
| 7695 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7696 | countingStream->rewind(); |
| 7697 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7698 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7699 | countingStream->write((uint32_t**)&pPhysicalDeviceGroupCount, sizeof(uint32_t*)); |
| 7700 | if (pPhysicalDeviceGroupCount) |
| 7701 | { |
| 7702 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 7703 | } |
| 7704 | countingStream->write((VkPhysicalDeviceGroupProperties**)&pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*)); |
| 7705 | if (pPhysicalDeviceGroupProperties) |
| 7706 | { |
| 7707 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 7708 | { |
| 7709 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 7710 | } |
| 7711 | } |
| 7712 | } |
| 7713 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroups = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7714 | countingStream->rewind(); |
| 7715 | uint32_t opcode_vkEnumeratePhysicalDeviceGroups = OP_vkEnumeratePhysicalDeviceGroups; |
| 7716 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| 7717 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7718 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7719 | stream->write((uint32_t**)&pPhysicalDeviceGroupCount, sizeof(uint32_t*)); |
| 7720 | if (pPhysicalDeviceGroupCount) |
| 7721 | { |
| 7722 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 7723 | } |
| 7724 | stream->write((VkPhysicalDeviceGroupProperties**)&pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*)); |
| 7725 | if (pPhysicalDeviceGroupProperties) |
| 7726 | { |
| 7727 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 7728 | { |
| 7729 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 7730 | } |
| 7731 | } |
| 7732 | uint32_t* check_pPhysicalDeviceGroupCount; |
| 7733 | stream->read((uint32_t**)&check_pPhysicalDeviceGroupCount, sizeof(uint32_t*)); |
| 7734 | if (pPhysicalDeviceGroupCount) |
| 7735 | { |
| 7736 | if (!(check_pPhysicalDeviceGroupCount)) |
| 7737 | { |
| 7738 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 7739 | } |
| 7740 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 7741 | } |
| 7742 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| 7743 | stream->read((VkPhysicalDeviceGroupProperties**)&check_pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*)); |
| 7744 | if (pPhysicalDeviceGroupProperties) |
| 7745 | { |
| 7746 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 7747 | { |
| 7748 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 7749 | } |
| 7750 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 7751 | { |
| 7752 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 7753 | } |
| 7754 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7755 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7756 | VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0; |
| 7757 | stream->read(&vkEnumeratePhysicalDeviceGroups_VkResult_return, sizeof(VkResult)); |
| 7758 | return vkEnumeratePhysicalDeviceGroups_VkResult_return; |
| 7759 | } |
| 7760 | |
| 7761 | void VkEncoder::vkGetImageMemoryRequirements2( |
| 7762 | VkDevice device, |
| 7763 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 7764 | VkMemoryRequirements2* pMemoryRequirements) |
| 7765 | { |
| 7766 | auto stream = mImpl->stream(); |
| 7767 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7768 | auto resources = mImpl->resources(); |
| 7769 | auto pool = mImpl->pool(); |
| 7770 | VkDevice local_device; |
| 7771 | local_device = device; |
| 7772 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 7773 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| 7774 | local_pInfo = nullptr; |
| 7775 | if (pInfo) |
| 7776 | { |
| 7777 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 7778 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 7779 | } |
| 7780 | if (local_pInfo) |
| 7781 | { |
| 7782 | handlemap_VkImageMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 7783 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7784 | countingStream->rewind(); |
| 7785 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7786 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7787 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7788 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 7789 | } |
| 7790 | uint32_t packetSize_vkGetImageMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7791 | countingStream->rewind(); |
| 7792 | uint32_t opcode_vkGetImageMemoryRequirements2 = OP_vkGetImageMemoryRequirements2; |
| 7793 | stream->write(&opcode_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| 7794 | stream->write(&packetSize_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7795 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7796 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7797 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 7798 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7799 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7800 | } |
| 7801 | |
| 7802 | void VkEncoder::vkGetBufferMemoryRequirements2( |
| 7803 | VkDevice device, |
| 7804 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 7805 | VkMemoryRequirements2* pMemoryRequirements) |
| 7806 | { |
| 7807 | auto stream = mImpl->stream(); |
| 7808 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7809 | auto resources = mImpl->resources(); |
| 7810 | auto pool = mImpl->pool(); |
| 7811 | VkDevice local_device; |
| 7812 | local_device = device; |
| 7813 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 7814 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| 7815 | local_pInfo = nullptr; |
| 7816 | if (pInfo) |
| 7817 | { |
| 7818 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 7819 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 7820 | } |
| 7821 | if (local_pInfo) |
| 7822 | { |
| 7823 | handlemap_VkBufferMemoryRequirementsInfo2(resources->unwrapMapping(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 7824 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7825 | countingStream->rewind(); |
| 7826 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7827 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7828 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7829 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 7830 | } |
| 7831 | uint32_t packetSize_vkGetBufferMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7832 | countingStream->rewind(); |
| 7833 | uint32_t opcode_vkGetBufferMemoryRequirements2 = OP_vkGetBufferMemoryRequirements2; |
| 7834 | stream->write(&opcode_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| 7835 | stream->write(&packetSize_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7836 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7837 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7838 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 7839 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7840 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7841 | } |
| 7842 | |
| 7843 | void VkEncoder::vkGetImageSparseMemoryRequirements2( |
| 7844 | VkDevice device, |
| 7845 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 7846 | uint32_t* pSparseMemoryRequirementCount, |
| 7847 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 7848 | { |
| 7849 | auto stream = mImpl->stream(); |
| 7850 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7851 | auto resources = mImpl->resources(); |
| 7852 | auto pool = mImpl->pool(); |
| 7853 | VkDevice local_device; |
| 7854 | local_device = device; |
| 7855 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 7856 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| 7857 | local_pInfo = nullptr; |
| 7858 | if (pInfo) |
| 7859 | { |
| 7860 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 7861 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 7862 | } |
| 7863 | if (local_pInfo) |
| 7864 | { |
| 7865 | handlemap_VkImageSparseMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 7866 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7867 | countingStream->rewind(); |
| 7868 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7869 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7870 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7871 | countingStream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*)); |
| 7872 | if (pSparseMemoryRequirementCount) |
| 7873 | { |
| 7874 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 7875 | } |
| 7876 | countingStream->write((VkSparseImageMemoryRequirements2**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*)); |
| 7877 | if (pSparseMemoryRequirements) |
| 7878 | { |
| 7879 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 7880 | { |
| 7881 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 7882 | } |
| 7883 | } |
| 7884 | } |
| 7885 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7886 | countingStream->rewind(); |
| 7887 | uint32_t opcode_vkGetImageSparseMemoryRequirements2 = OP_vkGetImageSparseMemoryRequirements2; |
| 7888 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| 7889 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7890 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 7891 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7892 | stream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*)); |
| 7893 | if (pSparseMemoryRequirementCount) |
| 7894 | { |
| 7895 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 7896 | } |
| 7897 | stream->write((VkSparseImageMemoryRequirements2**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*)); |
| 7898 | if (pSparseMemoryRequirements) |
| 7899 | { |
| 7900 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 7901 | { |
| 7902 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 7903 | } |
| 7904 | } |
| 7905 | uint32_t* check_pSparseMemoryRequirementCount; |
| 7906 | stream->read((uint32_t**)&check_pSparseMemoryRequirementCount, sizeof(uint32_t*)); |
| 7907 | if (pSparseMemoryRequirementCount) |
| 7908 | { |
| 7909 | if (!(check_pSparseMemoryRequirementCount)) |
| 7910 | { |
| 7911 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 7912 | } |
| 7913 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 7914 | } |
| 7915 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| 7916 | stream->read((VkSparseImageMemoryRequirements2**)&check_pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*)); |
| 7917 | if (pSparseMemoryRequirements) |
| 7918 | { |
| 7919 | if (!(check_pSparseMemoryRequirements)) |
| 7920 | { |
| 7921 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 7922 | } |
| 7923 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 7924 | { |
| 7925 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 7926 | } |
| 7927 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7928 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7929 | } |
| 7930 | |
| 7931 | void VkEncoder::vkGetPhysicalDeviceFeatures2( |
| 7932 | VkPhysicalDevice physicalDevice, |
| 7933 | VkPhysicalDeviceFeatures2* pFeatures) |
| 7934 | { |
| 7935 | auto stream = mImpl->stream(); |
| 7936 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7937 | auto resources = mImpl->resources(); |
| 7938 | auto pool = mImpl->pool(); |
| 7939 | VkPhysicalDevice local_physicalDevice; |
| 7940 | local_physicalDevice = physicalDevice; |
| 7941 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7942 | countingStream->rewind(); |
| 7943 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7944 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7945 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 7946 | } |
| 7947 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7948 | countingStream->rewind(); |
| 7949 | uint32_t opcode_vkGetPhysicalDeviceFeatures2 = OP_vkGetPhysicalDeviceFeatures2; |
| 7950 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| 7951 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7952 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7953 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 7954 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7955 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7956 | } |
| 7957 | |
| 7958 | void VkEncoder::vkGetPhysicalDeviceProperties2( |
| 7959 | VkPhysicalDevice physicalDevice, |
| 7960 | VkPhysicalDeviceProperties2* pProperties) |
| 7961 | { |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 7962 | goldfish_vkGetPhysicalDeviceProperties2(physicalDevice, pProperties); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7963 | } |
| 7964 | |
| 7965 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2( |
| 7966 | VkPhysicalDevice physicalDevice, |
| 7967 | VkFormat format, |
| 7968 | VkFormatProperties2* pFormatProperties) |
| 7969 | { |
| 7970 | auto stream = mImpl->stream(); |
| 7971 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7972 | auto resources = mImpl->resources(); |
| 7973 | auto pool = mImpl->pool(); |
| 7974 | VkPhysicalDevice local_physicalDevice; |
| 7975 | local_physicalDevice = physicalDevice; |
| 7976 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 7977 | VkFormat local_format; |
| 7978 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7979 | countingStream->rewind(); |
| 7980 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7981 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 7982 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7983 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 7984 | } |
| 7985 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7986 | countingStream->rewind(); |
| 7987 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2 = OP_vkGetPhysicalDeviceFormatProperties2; |
| 7988 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| 7989 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7990 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 7991 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7992 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| 7993 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7994 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7995 | } |
| 7996 | |
| 7997 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2( |
| 7998 | VkPhysicalDevice physicalDevice, |
| 7999 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 8000 | VkImageFormatProperties2* pImageFormatProperties) |
| 8001 | { |
| 8002 | auto stream = mImpl->stream(); |
| 8003 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8004 | auto resources = mImpl->resources(); |
| 8005 | auto pool = mImpl->pool(); |
| 8006 | VkPhysicalDevice local_physicalDevice; |
| 8007 | local_physicalDevice = physicalDevice; |
| 8008 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 8009 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| 8010 | local_pImageFormatInfo = nullptr; |
| 8011 | if (pImageFormatInfo) |
| 8012 | { |
| 8013 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 8014 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 8015 | } |
| 8016 | if (local_pImageFormatInfo) |
| 8017 | { |
| 8018 | handlemap_VkPhysicalDeviceImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 8019 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8020 | countingStream->rewind(); |
| 8021 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8022 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8023 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8024 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 8025 | } |
| 8026 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8027 | countingStream->rewind(); |
| 8028 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2 = OP_vkGetPhysicalDeviceImageFormatProperties2; |
| 8029 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| 8030 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8031 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8032 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8033 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 8034 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8035 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8036 | VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0; |
| 8037 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2_VkResult_return, sizeof(VkResult)); |
| 8038 | return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return; |
| 8039 | } |
| 8040 | |
| 8041 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2( |
| 8042 | VkPhysicalDevice physicalDevice, |
| 8043 | uint32_t* pQueueFamilyPropertyCount, |
| 8044 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 8045 | { |
| 8046 | auto stream = mImpl->stream(); |
| 8047 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8048 | auto resources = mImpl->resources(); |
| 8049 | auto pool = mImpl->pool(); |
| 8050 | VkPhysicalDevice local_physicalDevice; |
| 8051 | local_physicalDevice = physicalDevice; |
| 8052 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8053 | countingStream->rewind(); |
| 8054 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8055 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8056 | countingStream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*)); |
| 8057 | if (pQueueFamilyPropertyCount) |
| 8058 | { |
| 8059 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 8060 | } |
| 8061 | countingStream->write((VkQueueFamilyProperties2**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*)); |
| 8062 | if (pQueueFamilyProperties) |
| 8063 | { |
| 8064 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 8065 | { |
| 8066 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 8067 | } |
| 8068 | } |
| 8069 | } |
| 8070 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8071 | countingStream->rewind(); |
| 8072 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2 = OP_vkGetPhysicalDeviceQueueFamilyProperties2; |
| 8073 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| 8074 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8075 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8076 | stream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*)); |
| 8077 | if (pQueueFamilyPropertyCount) |
| 8078 | { |
| 8079 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 8080 | } |
| 8081 | stream->write((VkQueueFamilyProperties2**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*)); |
| 8082 | if (pQueueFamilyProperties) |
| 8083 | { |
| 8084 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 8085 | { |
| 8086 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 8087 | } |
| 8088 | } |
| 8089 | uint32_t* check_pQueueFamilyPropertyCount; |
| 8090 | stream->read((uint32_t**)&check_pQueueFamilyPropertyCount, sizeof(uint32_t*)); |
| 8091 | if (pQueueFamilyPropertyCount) |
| 8092 | { |
| 8093 | if (!(check_pQueueFamilyPropertyCount)) |
| 8094 | { |
| 8095 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 8096 | } |
| 8097 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 8098 | } |
| 8099 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| 8100 | stream->read((VkQueueFamilyProperties2**)&check_pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*)); |
| 8101 | if (pQueueFamilyProperties) |
| 8102 | { |
| 8103 | if (!(check_pQueueFamilyProperties)) |
| 8104 | { |
| 8105 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 8106 | } |
| 8107 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 8108 | { |
| 8109 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 8110 | } |
| 8111 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8112 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8113 | } |
| 8114 | |
| 8115 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2( |
| 8116 | VkPhysicalDevice physicalDevice, |
| 8117 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 8118 | { |
| 8119 | auto stream = mImpl->stream(); |
| 8120 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8121 | auto resources = mImpl->resources(); |
| 8122 | auto pool = mImpl->pool(); |
| 8123 | VkPhysicalDevice local_physicalDevice; |
| 8124 | local_physicalDevice = physicalDevice; |
| 8125 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8126 | countingStream->rewind(); |
| 8127 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8128 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8129 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 8130 | } |
| 8131 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8132 | countingStream->rewind(); |
| 8133 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2 = OP_vkGetPhysicalDeviceMemoryProperties2; |
| 8134 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| 8135 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8136 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8137 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 8138 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8139 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8140 | } |
| 8141 | |
| 8142 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2( |
| 8143 | VkPhysicalDevice physicalDevice, |
| 8144 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 8145 | uint32_t* pPropertyCount, |
| 8146 | VkSparseImageFormatProperties2* pProperties) |
| 8147 | { |
| 8148 | auto stream = mImpl->stream(); |
| 8149 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8150 | auto resources = mImpl->resources(); |
| 8151 | auto pool = mImpl->pool(); |
| 8152 | VkPhysicalDevice local_physicalDevice; |
| 8153 | local_physicalDevice = physicalDevice; |
| 8154 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 8155 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| 8156 | local_pFormatInfo = nullptr; |
| 8157 | if (pFormatInfo) |
| 8158 | { |
| 8159 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 8160 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 8161 | } |
| 8162 | if (local_pFormatInfo) |
| 8163 | { |
| 8164 | handlemap_VkPhysicalDeviceSparseImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 8165 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8166 | countingStream->rewind(); |
| 8167 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8168 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8169 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8170 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 8171 | if (pPropertyCount) |
| 8172 | { |
| 8173 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 8174 | } |
| 8175 | countingStream->write((VkSparseImageFormatProperties2**)&pProperties, sizeof(VkSparseImageFormatProperties2*)); |
| 8176 | if (pProperties) |
| 8177 | { |
| 8178 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 8179 | { |
| 8180 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 8181 | } |
| 8182 | } |
| 8183 | } |
| 8184 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8185 | countingStream->rewind(); |
| 8186 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2 = OP_vkGetPhysicalDeviceSparseImageFormatProperties2; |
| 8187 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| 8188 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8189 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8190 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8191 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 8192 | if (pPropertyCount) |
| 8193 | { |
| 8194 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 8195 | } |
| 8196 | stream->write((VkSparseImageFormatProperties2**)&pProperties, sizeof(VkSparseImageFormatProperties2*)); |
| 8197 | if (pProperties) |
| 8198 | { |
| 8199 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 8200 | { |
| 8201 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 8202 | } |
| 8203 | } |
| 8204 | uint32_t* check_pPropertyCount; |
| 8205 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 8206 | if (pPropertyCount) |
| 8207 | { |
| 8208 | if (!(check_pPropertyCount)) |
| 8209 | { |
| 8210 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 8211 | } |
| 8212 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 8213 | } |
| 8214 | VkSparseImageFormatProperties2* check_pProperties; |
| 8215 | stream->read((VkSparseImageFormatProperties2**)&check_pProperties, sizeof(VkSparseImageFormatProperties2*)); |
| 8216 | if (pProperties) |
| 8217 | { |
| 8218 | if (!(check_pProperties)) |
| 8219 | { |
| 8220 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 8221 | } |
| 8222 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 8223 | { |
| 8224 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 8225 | } |
| 8226 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8227 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8228 | } |
| 8229 | |
| 8230 | void VkEncoder::vkTrimCommandPool( |
| 8231 | VkDevice device, |
| 8232 | VkCommandPool commandPool, |
| 8233 | VkCommandPoolTrimFlags flags) |
| 8234 | { |
| 8235 | auto stream = mImpl->stream(); |
| 8236 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8237 | auto resources = mImpl->resources(); |
| 8238 | auto pool = mImpl->pool(); |
| 8239 | VkDevice local_device; |
| 8240 | local_device = device; |
| 8241 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 8242 | VkCommandPool local_commandPool; |
| 8243 | local_commandPool = commandPool; |
| 8244 | resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool); |
| 8245 | VkCommandPoolTrimFlags local_flags; |
| 8246 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8247 | countingStream->rewind(); |
| 8248 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8249 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 8250 | countingStream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool)); |
| 8251 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8252 | } |
| 8253 | uint32_t packetSize_vkTrimCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8254 | countingStream->rewind(); |
| 8255 | uint32_t opcode_vkTrimCommandPool = OP_vkTrimCommandPool; |
| 8256 | stream->write(&opcode_vkTrimCommandPool, sizeof(uint32_t)); |
| 8257 | stream->write(&packetSize_vkTrimCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8258 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 8259 | stream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool)); |
| 8260 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| 8261 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8262 | } |
| 8263 | |
| 8264 | void VkEncoder::vkGetDeviceQueue2( |
| 8265 | VkDevice device, |
| 8266 | const VkDeviceQueueInfo2* pQueueInfo, |
| 8267 | VkQueue* pQueue) |
| 8268 | { |
| 8269 | auto stream = mImpl->stream(); |
| 8270 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8271 | auto resources = mImpl->resources(); |
| 8272 | auto pool = mImpl->pool(); |
| 8273 | VkDevice local_device; |
| 8274 | local_device = device; |
| 8275 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 8276 | VkDeviceQueueInfo2* local_pQueueInfo; |
| 8277 | local_pQueueInfo = nullptr; |
| 8278 | if (pQueueInfo) |
| 8279 | { |
| 8280 | local_pQueueInfo = (VkDeviceQueueInfo2*)pool->alloc(sizeof(const VkDeviceQueueInfo2)); |
| 8281 | deepcopy_VkDeviceQueueInfo2(pool, pQueueInfo, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| 8282 | } |
| 8283 | if (local_pQueueInfo) |
| 8284 | { |
| 8285 | handlemap_VkDeviceQueueInfo2(resources->unwrapMapping(), (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| 8286 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8287 | countingStream->rewind(); |
| 8288 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8289 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 8290 | marshal_VkDeviceQueueInfo2(countingStream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8291 | countingStream->write((VkQueue*)pQueue, sizeof(VkQueue)); |
| 8292 | } |
| 8293 | uint32_t packetSize_vkGetDeviceQueue2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8294 | countingStream->rewind(); |
| 8295 | uint32_t opcode_vkGetDeviceQueue2 = OP_vkGetDeviceQueue2; |
| 8296 | stream->write(&opcode_vkGetDeviceQueue2, sizeof(uint32_t)); |
| 8297 | stream->write(&packetSize_vkGetDeviceQueue2, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8298 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 8299 | marshal_VkDeviceQueueInfo2(stream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8300 | stream->write((VkQueue*)pQueue, sizeof(VkQueue)); |
| 8301 | stream->read((VkQueue*)pQueue, sizeof(VkQueue)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8302 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8303 | } |
| 8304 | |
| 8305 | VkResult VkEncoder::vkCreateSamplerYcbcrConversion( |
| 8306 | VkDevice device, |
| 8307 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 8308 | const VkAllocationCallbacks* pAllocator, |
| 8309 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 8310 | { |
| 8311 | auto stream = mImpl->stream(); |
| 8312 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8313 | auto resources = mImpl->resources(); |
| 8314 | auto pool = mImpl->pool(); |
| 8315 | VkDevice local_device; |
| 8316 | local_device = device; |
| 8317 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 8318 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| 8319 | local_pCreateInfo = nullptr; |
| 8320 | if (pCreateInfo) |
| 8321 | { |
| 8322 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 8323 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 8324 | } |
| 8325 | if (local_pCreateInfo) |
| 8326 | { |
| 8327 | handlemap_VkSamplerYcbcrConversionCreateInfo(resources->unwrapMapping(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 8328 | } |
| 8329 | VkAllocationCallbacks* local_pAllocator; |
| 8330 | local_pAllocator = nullptr; |
| 8331 | if (pAllocator) |
| 8332 | { |
| 8333 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 8334 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 8335 | } |
| 8336 | if (local_pAllocator) |
| 8337 | { |
| 8338 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 8339 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8340 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8341 | countingStream->rewind(); |
| 8342 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8343 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 8344 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 8345 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 8346 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8347 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8348 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8349 | } |
| 8350 | countingStream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion)); |
| 8351 | } |
| 8352 | uint32_t packetSize_vkCreateSamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8353 | countingStream->rewind(); |
| 8354 | uint32_t opcode_vkCreateSamplerYcbcrConversion = OP_vkCreateSamplerYcbcrConversion; |
| 8355 | stream->write(&opcode_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| 8356 | stream->write(&packetSize_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8357 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 8358 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 8359 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 8360 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8361 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8362 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8363 | } |
| 8364 | stream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion)); |
| 8365 | stream->read((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8366 | if (pYcbcrConversion) |
| 8367 | { |
| 8368 | resources->createMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| 8369 | } |
| 8370 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8371 | VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0; |
| 8372 | stream->read(&vkCreateSamplerYcbcrConversion_VkResult_return, sizeof(VkResult)); |
| 8373 | return vkCreateSamplerYcbcrConversion_VkResult_return; |
| 8374 | } |
| 8375 | |
| 8376 | void VkEncoder::vkDestroySamplerYcbcrConversion( |
| 8377 | VkDevice device, |
| 8378 | VkSamplerYcbcrConversion ycbcrConversion, |
| 8379 | const VkAllocationCallbacks* pAllocator) |
| 8380 | { |
| 8381 | auto stream = mImpl->stream(); |
| 8382 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8383 | auto resources = mImpl->resources(); |
| 8384 | auto pool = mImpl->pool(); |
| 8385 | VkDevice local_device; |
| 8386 | local_device = device; |
| 8387 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8388 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| 8389 | local_ycbcrConversion = ycbcrConversion; |
| 8390 | resources->unwrapMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&local_ycbcrConversion); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8391 | VkAllocationCallbacks* local_pAllocator; |
| 8392 | local_pAllocator = nullptr; |
| 8393 | if (pAllocator) |
| 8394 | { |
| 8395 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 8396 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 8397 | } |
| 8398 | if (local_pAllocator) |
| 8399 | { |
| 8400 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 8401 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8402 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8403 | countingStream->rewind(); |
| 8404 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8405 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8406 | countingStream->write((VkSamplerYcbcrConversion*)&local_ycbcrConversion, sizeof(VkSamplerYcbcrConversion)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8407 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 8408 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8409 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8410 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8411 | } |
| 8412 | } |
| 8413 | uint32_t packetSize_vkDestroySamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8414 | countingStream->rewind(); |
| 8415 | uint32_t opcode_vkDestroySamplerYcbcrConversion = OP_vkDestroySamplerYcbcrConversion; |
| 8416 | stream->write(&opcode_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| 8417 | stream->write(&packetSize_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8418 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8419 | stream->write((VkSamplerYcbcrConversion*)&local_ycbcrConversion, sizeof(VkSamplerYcbcrConversion)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8420 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 8421 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8422 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8423 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8424 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8425 | resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion); |
| 8426 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8427 | } |
| 8428 | |
| 8429 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplate( |
| 8430 | VkDevice device, |
| 8431 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 8432 | const VkAllocationCallbacks* pAllocator, |
| 8433 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 8434 | { |
| 8435 | auto stream = mImpl->stream(); |
| 8436 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8437 | auto resources = mImpl->resources(); |
| 8438 | auto pool = mImpl->pool(); |
| 8439 | VkDevice local_device; |
| 8440 | local_device = device; |
| 8441 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 8442 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| 8443 | local_pCreateInfo = nullptr; |
| 8444 | if (pCreateInfo) |
| 8445 | { |
| 8446 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 8447 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 8448 | } |
| 8449 | if (local_pCreateInfo) |
| 8450 | { |
| 8451 | handlemap_VkDescriptorUpdateTemplateCreateInfo(resources->unwrapMapping(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 8452 | } |
| 8453 | VkAllocationCallbacks* local_pAllocator; |
| 8454 | local_pAllocator = nullptr; |
| 8455 | if (pAllocator) |
| 8456 | { |
| 8457 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 8458 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 8459 | } |
| 8460 | if (local_pAllocator) |
| 8461 | { |
| 8462 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 8463 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8464 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8465 | countingStream->rewind(); |
| 8466 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8467 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 8468 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 8469 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 8470 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8471 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8472 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8473 | } |
| 8474 | countingStream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| 8475 | } |
| 8476 | uint32_t packetSize_vkCreateDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8477 | countingStream->rewind(); |
| 8478 | uint32_t opcode_vkCreateDescriptorUpdateTemplate = OP_vkCreateDescriptorUpdateTemplate; |
| 8479 | stream->write(&opcode_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 8480 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8481 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 8482 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 8483 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 8484 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8485 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8486 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8487 | } |
| 8488 | stream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| 8489 | stream->read((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8490 | if (pDescriptorUpdateTemplate) |
| 8491 | { |
| 8492 | resources->createMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| 8493 | } |
| 8494 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8495 | VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0; |
| 8496 | stream->read(&vkCreateDescriptorUpdateTemplate_VkResult_return, sizeof(VkResult)); |
| 8497 | return vkCreateDescriptorUpdateTemplate_VkResult_return; |
| 8498 | } |
| 8499 | |
| 8500 | void VkEncoder::vkDestroyDescriptorUpdateTemplate( |
| 8501 | VkDevice device, |
| 8502 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 8503 | const VkAllocationCallbacks* pAllocator) |
| 8504 | { |
| 8505 | auto stream = mImpl->stream(); |
| 8506 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8507 | auto resources = mImpl->resources(); |
| 8508 | auto pool = mImpl->pool(); |
| 8509 | VkDevice local_device; |
| 8510 | local_device = device; |
| 8511 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8512 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 8513 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 8514 | resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8515 | VkAllocationCallbacks* local_pAllocator; |
| 8516 | local_pAllocator = nullptr; |
| 8517 | if (pAllocator) |
| 8518 | { |
| 8519 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 8520 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 8521 | } |
| 8522 | if (local_pAllocator) |
| 8523 | { |
| 8524 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 8525 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8526 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8527 | countingStream->rewind(); |
| 8528 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8529 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8530 | countingStream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8531 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 8532 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8533 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8534 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8535 | } |
| 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 Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8542 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8543 | stream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8544 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 8545 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8546 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8547 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8548 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8549 | resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate); |
| 8550 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8551 | } |
| 8552 | |
| 8553 | void 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 Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8561 | 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 Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8578 | countingStream->rewind(); |
| 8579 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8580 | 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 Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8585 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8586 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8587 | } |
| 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 Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8594 | 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 Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8599 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8600 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8601 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8602 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8603 | } |
| 8604 | |
| 8605 | void VkEncoder::vkGetPhysicalDeviceExternalBufferProperties( |
| 8606 | VkPhysicalDevice physicalDevice, |
| 8607 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 8608 | VkExternalBufferProperties* pExternalBufferProperties) |
| 8609 | { |
| 8610 | auto stream = mImpl->stream(); |
| 8611 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8612 | 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 Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8628 | countingStream->rewind(); |
| 8629 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8630 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8631 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8632 | 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 Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8639 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8640 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8641 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 8642 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8643 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8644 | } |
| 8645 | |
| 8646 | void VkEncoder::vkGetPhysicalDeviceExternalFenceProperties( |
| 8647 | VkPhysicalDevice physicalDevice, |
| 8648 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 8649 | VkExternalFenceProperties* pExternalFenceProperties) |
| 8650 | { |
| 8651 | auto stream = mImpl->stream(); |
| 8652 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8653 | 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 Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8669 | countingStream->rewind(); |
| 8670 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8671 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8672 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8673 | 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 Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8680 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8681 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8682 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 8683 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8684 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8685 | } |
| 8686 | |
| 8687 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphoreProperties( |
| 8688 | VkPhysicalDevice physicalDevice, |
| 8689 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 8690 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 8691 | { |
| 8692 | auto stream = mImpl->stream(); |
| 8693 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8694 | 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 Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8710 | countingStream->rewind(); |
| 8711 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8712 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8713 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8714 | 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 Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8721 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8722 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8723 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 8724 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8725 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8726 | } |
| 8727 | |
| 8728 | void VkEncoder::vkGetDescriptorSetLayoutSupport( |
| 8729 | VkDevice device, |
| 8730 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 8731 | VkDescriptorSetLayoutSupport* pSupport) |
| 8732 | { |
| 8733 | auto stream = mImpl->stream(); |
| 8734 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8735 | 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 Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8751 | countingStream->rewind(); |
| 8752 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8753 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 8754 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8755 | 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 Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8762 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 8763 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8764 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 8765 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8766 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8767 | } |
| 8768 | |
| 8769 | #endif |
| 8770 | #ifdef VK_KHR_surface |
| 8771 | void VkEncoder::vkDestroySurfaceKHR( |
| 8772 | VkInstance instance, |
| 8773 | VkSurfaceKHR surface, |
| 8774 | const VkAllocationCallbacks* pAllocator) |
| 8775 | { |
| 8776 | auto stream = mImpl->stream(); |
| 8777 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8778 | 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); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8783 | VkSurfaceKHR local_surface; |
| 8784 | local_surface = surface; |
| 8785 | resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8786 | VkAllocationCallbacks* local_pAllocator; |
| 8787 | local_pAllocator = nullptr; |
| 8788 | if (pAllocator) |
| 8789 | { |
| 8790 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 8791 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 8792 | } |
| 8793 | if (local_pAllocator) |
| 8794 | { |
| 8795 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 8796 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8797 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8798 | countingStream->rewind(); |
| 8799 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8800 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8801 | countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8802 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 8803 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8804 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8805 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8806 | } |
| 8807 | } |
| 8808 | uint32_t packetSize_vkDestroySurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8809 | countingStream->rewind(); |
| 8810 | uint32_t opcode_vkDestroySurfaceKHR = OP_vkDestroySurfaceKHR; |
| 8811 | stream->write(&opcode_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| 8812 | stream->write(&packetSize_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8813 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 8814 | stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8815 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 8816 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8817 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8818 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8819 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8820 | resources->destroyMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&surface); |
| 8821 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8822 | } |
| 8823 | |
| 8824 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceSupportKHR( |
| 8825 | VkPhysicalDevice physicalDevice, |
| 8826 | uint32_t queueFamilyIndex, |
| 8827 | VkSurfaceKHR surface, |
| 8828 | VkBool32* pSupported) |
| 8829 | { |
| 8830 | auto stream = mImpl->stream(); |
| 8831 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8832 | auto resources = mImpl->resources(); |
| 8833 | auto pool = mImpl->pool(); |
| 8834 | VkPhysicalDevice local_physicalDevice; |
| 8835 | local_physicalDevice = physicalDevice; |
| 8836 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 8837 | uint32_t local_queueFamilyIndex; |
| 8838 | local_queueFamilyIndex = queueFamilyIndex; |
| 8839 | VkSurfaceKHR local_surface; |
| 8840 | local_surface = surface; |
| 8841 | resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8842 | countingStream->rewind(); |
| 8843 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8844 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8845 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 8846 | countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8847 | countingStream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| 8848 | } |
| 8849 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8850 | countingStream->rewind(); |
| 8851 | uint32_t opcode_vkGetPhysicalDeviceSurfaceSupportKHR = OP_vkGetPhysicalDeviceSurfaceSupportKHR; |
| 8852 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| 8853 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8854 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8855 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 8856 | stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8857 | stream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| 8858 | stream->read((VkBool32*)pSupported, sizeof(VkBool32)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8859 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8860 | VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0; |
| 8861 | stream->read(&vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return, sizeof(VkResult)); |
| 8862 | return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return; |
| 8863 | } |
| 8864 | |
| 8865 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilitiesKHR( |
| 8866 | VkPhysicalDevice physicalDevice, |
| 8867 | VkSurfaceKHR surface, |
| 8868 | VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) |
| 8869 | { |
| 8870 | auto stream = mImpl->stream(); |
| 8871 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8872 | auto resources = mImpl->resources(); |
| 8873 | auto pool = mImpl->pool(); |
| 8874 | VkPhysicalDevice local_physicalDevice; |
| 8875 | local_physicalDevice = physicalDevice; |
| 8876 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 8877 | VkSurfaceKHR local_surface; |
| 8878 | local_surface = surface; |
| 8879 | resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8880 | countingStream->rewind(); |
| 8881 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8882 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8883 | countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8884 | marshal_VkSurfaceCapabilitiesKHR(countingStream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 8885 | } |
| 8886 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8887 | countingStream->rewind(); |
| 8888 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR; |
| 8889 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| 8890 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8891 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8892 | stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8893 | marshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 8894 | unmarshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8895 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8896 | VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 8897 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| 8898 | return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return; |
| 8899 | } |
| 8900 | |
| 8901 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormatsKHR( |
| 8902 | VkPhysicalDevice physicalDevice, |
| 8903 | VkSurfaceKHR surface, |
| 8904 | uint32_t* pSurfaceFormatCount, |
| 8905 | VkSurfaceFormatKHR* pSurfaceFormats) |
| 8906 | { |
| 8907 | auto stream = mImpl->stream(); |
| 8908 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8909 | auto resources = mImpl->resources(); |
| 8910 | auto pool = mImpl->pool(); |
| 8911 | VkPhysicalDevice local_physicalDevice; |
| 8912 | local_physicalDevice = physicalDevice; |
| 8913 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 8914 | VkSurfaceKHR local_surface; |
| 8915 | local_surface = surface; |
| 8916 | resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8917 | countingStream->rewind(); |
| 8918 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8919 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8920 | countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8921 | countingStream->write((uint32_t**)&pSurfaceFormatCount, sizeof(uint32_t*)); |
| 8922 | if (pSurfaceFormatCount) |
| 8923 | { |
| 8924 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 8925 | } |
| 8926 | countingStream->write((VkSurfaceFormatKHR**)&pSurfaceFormats, sizeof(VkSurfaceFormatKHR*)); |
| 8927 | if (pSurfaceFormats) |
| 8928 | { |
| 8929 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 8930 | { |
| 8931 | marshal_VkSurfaceFormatKHR(countingStream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 8932 | } |
| 8933 | } |
| 8934 | } |
| 8935 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8936 | countingStream->rewind(); |
| 8937 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormatsKHR = OP_vkGetPhysicalDeviceSurfaceFormatsKHR; |
| 8938 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| 8939 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8940 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 8941 | stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8942 | stream->write((uint32_t**)&pSurfaceFormatCount, sizeof(uint32_t*)); |
| 8943 | if (pSurfaceFormatCount) |
| 8944 | { |
| 8945 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 8946 | } |
| 8947 | stream->write((VkSurfaceFormatKHR**)&pSurfaceFormats, sizeof(VkSurfaceFormatKHR*)); |
| 8948 | if (pSurfaceFormats) |
| 8949 | { |
| 8950 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 8951 | { |
| 8952 | marshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 8953 | } |
| 8954 | } |
| 8955 | uint32_t* check_pSurfaceFormatCount; |
| 8956 | stream->read((uint32_t**)&check_pSurfaceFormatCount, sizeof(uint32_t*)); |
| 8957 | if (pSurfaceFormatCount) |
| 8958 | { |
| 8959 | if (!(check_pSurfaceFormatCount)) |
| 8960 | { |
| 8961 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 8962 | } |
| 8963 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 8964 | } |
| 8965 | VkSurfaceFormatKHR* check_pSurfaceFormats; |
| 8966 | stream->read((VkSurfaceFormatKHR**)&check_pSurfaceFormats, sizeof(VkSurfaceFormatKHR*)); |
| 8967 | if (pSurfaceFormats) |
| 8968 | { |
| 8969 | if (!(check_pSurfaceFormats)) |
| 8970 | { |
| 8971 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 8972 | } |
| 8973 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 8974 | { |
| 8975 | unmarshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 8976 | } |
| 8977 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8978 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8979 | VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0; |
| 8980 | stream->read(&vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return, sizeof(VkResult)); |
| 8981 | return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return; |
| 8982 | } |
| 8983 | |
| 8984 | VkResult VkEncoder::vkGetPhysicalDeviceSurfacePresentModesKHR( |
| 8985 | VkPhysicalDevice physicalDevice, |
| 8986 | VkSurfaceKHR surface, |
| 8987 | uint32_t* pPresentModeCount, |
| 8988 | VkPresentModeKHR* pPresentModes) |
| 8989 | { |
| 8990 | auto stream = mImpl->stream(); |
| 8991 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8992 | auto resources = mImpl->resources(); |
| 8993 | auto pool = mImpl->pool(); |
| 8994 | VkPhysicalDevice local_physicalDevice; |
| 8995 | local_physicalDevice = physicalDevice; |
| 8996 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 8997 | VkSurfaceKHR local_surface; |
| 8998 | local_surface = surface; |
| 8999 | resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9000 | countingStream->rewind(); |
| 9001 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9002 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9003 | countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9004 | countingStream->write((uint32_t**)&pPresentModeCount, sizeof(uint32_t*)); |
| 9005 | if (pPresentModeCount) |
| 9006 | { |
| 9007 | countingStream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 9008 | } |
| 9009 | countingStream->write((VkPresentModeKHR**)&pPresentModes, sizeof(VkPresentModeKHR*)); |
| 9010 | if (pPresentModes) |
| 9011 | { |
| 9012 | countingStream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 9013 | } |
| 9014 | } |
| 9015 | uint32_t packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9016 | countingStream->rewind(); |
| 9017 | uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModesKHR = OP_vkGetPhysicalDeviceSurfacePresentModesKHR; |
| 9018 | stream->write(&opcode_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| 9019 | stream->write(&packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9020 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9021 | stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9022 | stream->write((uint32_t**)&pPresentModeCount, sizeof(uint32_t*)); |
| 9023 | if (pPresentModeCount) |
| 9024 | { |
| 9025 | stream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 9026 | } |
| 9027 | stream->write((VkPresentModeKHR**)&pPresentModes, sizeof(VkPresentModeKHR*)); |
| 9028 | if (pPresentModes) |
| 9029 | { |
| 9030 | stream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 9031 | } |
| 9032 | uint32_t* check_pPresentModeCount; |
| 9033 | stream->read((uint32_t**)&check_pPresentModeCount, sizeof(uint32_t*)); |
| 9034 | if (pPresentModeCount) |
| 9035 | { |
| 9036 | if (!(check_pPresentModeCount)) |
| 9037 | { |
| 9038 | fprintf(stderr, "fatal: pPresentModeCount inconsistent between guest and host\n"); |
| 9039 | } |
| 9040 | stream->read((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 9041 | } |
| 9042 | VkPresentModeKHR* check_pPresentModes; |
| 9043 | stream->read((VkPresentModeKHR**)&check_pPresentModes, sizeof(VkPresentModeKHR*)); |
| 9044 | if (pPresentModes) |
| 9045 | { |
| 9046 | if (!(check_pPresentModes)) |
| 9047 | { |
| 9048 | fprintf(stderr, "fatal: pPresentModes inconsistent between guest and host\n"); |
| 9049 | } |
| 9050 | stream->read((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 9051 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9052 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9053 | VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 9054 | stream->read(&vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| 9055 | return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return; |
| 9056 | } |
| 9057 | |
| 9058 | #endif |
| 9059 | #ifdef VK_KHR_swapchain |
| 9060 | VkResult VkEncoder::vkCreateSwapchainKHR( |
| 9061 | VkDevice device, |
| 9062 | const VkSwapchainCreateInfoKHR* pCreateInfo, |
| 9063 | const VkAllocationCallbacks* pAllocator, |
| 9064 | VkSwapchainKHR* pSwapchain) |
| 9065 | { |
| 9066 | auto stream = mImpl->stream(); |
| 9067 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9068 | auto resources = mImpl->resources(); |
| 9069 | auto pool = mImpl->pool(); |
| 9070 | VkDevice local_device; |
| 9071 | local_device = device; |
| 9072 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 9073 | VkSwapchainCreateInfoKHR* local_pCreateInfo; |
| 9074 | local_pCreateInfo = nullptr; |
| 9075 | if (pCreateInfo) |
| 9076 | { |
| 9077 | local_pCreateInfo = (VkSwapchainCreateInfoKHR*)pool->alloc(sizeof(const VkSwapchainCreateInfoKHR)); |
| 9078 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfo, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| 9079 | } |
| 9080 | if (local_pCreateInfo) |
| 9081 | { |
| 9082 | handlemap_VkSwapchainCreateInfoKHR(resources->unwrapMapping(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| 9083 | } |
| 9084 | VkAllocationCallbacks* local_pAllocator; |
| 9085 | local_pAllocator = nullptr; |
| 9086 | if (pAllocator) |
| 9087 | { |
| 9088 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 9089 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 9090 | } |
| 9091 | if (local_pAllocator) |
| 9092 | { |
| 9093 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 9094 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 9095 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9096 | countingStream->rewind(); |
| 9097 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9098 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 9099 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| 9100 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 9101 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9102 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9103 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9104 | } |
| 9105 | countingStream->write((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR)); |
| 9106 | } |
| 9107 | uint32_t packetSize_vkCreateSwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9108 | countingStream->rewind(); |
| 9109 | uint32_t opcode_vkCreateSwapchainKHR = OP_vkCreateSwapchainKHR; |
| 9110 | stream->write(&opcode_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| 9111 | stream->write(&packetSize_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9112 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 9113 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| 9114 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 9115 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9116 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9117 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9118 | } |
| 9119 | stream->write((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR)); |
| 9120 | stream->read((VkSwapchainKHR*)pSwapchain, sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9121 | if (pSwapchain) |
| 9122 | { |
| 9123 | resources->createMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)pSwapchain, 1); |
| 9124 | } |
| 9125 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9126 | VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0; |
| 9127 | stream->read(&vkCreateSwapchainKHR_VkResult_return, sizeof(VkResult)); |
| 9128 | return vkCreateSwapchainKHR_VkResult_return; |
| 9129 | } |
| 9130 | |
| 9131 | void VkEncoder::vkDestroySwapchainKHR( |
| 9132 | VkDevice device, |
| 9133 | VkSwapchainKHR swapchain, |
| 9134 | const VkAllocationCallbacks* pAllocator) |
| 9135 | { |
| 9136 | auto stream = mImpl->stream(); |
| 9137 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9138 | auto resources = mImpl->resources(); |
| 9139 | auto pool = mImpl->pool(); |
| 9140 | VkDevice local_device; |
| 9141 | local_device = device; |
| 9142 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 9143 | VkSwapchainKHR local_swapchain; |
| 9144 | local_swapchain = swapchain; |
| 9145 | resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9146 | VkAllocationCallbacks* local_pAllocator; |
| 9147 | local_pAllocator = nullptr; |
| 9148 | if (pAllocator) |
| 9149 | { |
| 9150 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 9151 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 9152 | } |
| 9153 | if (local_pAllocator) |
| 9154 | { |
| 9155 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 9156 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 9157 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9158 | countingStream->rewind(); |
| 9159 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9160 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 9161 | countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9162 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 9163 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9164 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9165 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9166 | } |
| 9167 | } |
| 9168 | uint32_t packetSize_vkDestroySwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9169 | countingStream->rewind(); |
| 9170 | uint32_t opcode_vkDestroySwapchainKHR = OP_vkDestroySwapchainKHR; |
| 9171 | stream->write(&opcode_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| 9172 | stream->write(&packetSize_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9173 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 9174 | stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9175 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 9176 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9177 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9178 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9179 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9180 | resources->destroyMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&swapchain); |
| 9181 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9182 | } |
| 9183 | |
| 9184 | VkResult VkEncoder::vkGetSwapchainImagesKHR( |
| 9185 | VkDevice device, |
| 9186 | VkSwapchainKHR swapchain, |
| 9187 | uint32_t* pSwapchainImageCount, |
| 9188 | VkImage* pSwapchainImages) |
| 9189 | { |
| 9190 | auto stream = mImpl->stream(); |
| 9191 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9192 | auto resources = mImpl->resources(); |
| 9193 | auto pool = mImpl->pool(); |
| 9194 | VkDevice local_device; |
| 9195 | local_device = device; |
| 9196 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 9197 | VkSwapchainKHR local_swapchain; |
| 9198 | local_swapchain = swapchain; |
| 9199 | resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9200 | countingStream->rewind(); |
| 9201 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9202 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 9203 | countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9204 | countingStream->write((uint32_t**)&pSwapchainImageCount, sizeof(uint32_t*)); |
| 9205 | if (pSwapchainImageCount) |
| 9206 | { |
| 9207 | countingStream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 9208 | } |
| 9209 | countingStream->write((VkImage**)&pSwapchainImages, sizeof(VkImage*)); |
| 9210 | if (pSwapchainImages) |
| 9211 | { |
| 9212 | countingStream->write((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage)); |
| 9213 | } |
| 9214 | } |
| 9215 | uint32_t packetSize_vkGetSwapchainImagesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9216 | countingStream->rewind(); |
| 9217 | uint32_t opcode_vkGetSwapchainImagesKHR = OP_vkGetSwapchainImagesKHR; |
| 9218 | stream->write(&opcode_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| 9219 | stream->write(&packetSize_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9220 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 9221 | stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9222 | stream->write((uint32_t**)&pSwapchainImageCount, sizeof(uint32_t*)); |
| 9223 | if (pSwapchainImageCount) |
| 9224 | { |
| 9225 | stream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 9226 | } |
| 9227 | stream->write((VkImage**)&pSwapchainImages, sizeof(VkImage*)); |
| 9228 | if (pSwapchainImages) |
| 9229 | { |
| 9230 | stream->write((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage)); |
| 9231 | } |
| 9232 | uint32_t* check_pSwapchainImageCount; |
| 9233 | stream->read((uint32_t**)&check_pSwapchainImageCount, sizeof(uint32_t*)); |
| 9234 | if (pSwapchainImageCount) |
| 9235 | { |
| 9236 | if (!(check_pSwapchainImageCount)) |
| 9237 | { |
| 9238 | fprintf(stderr, "fatal: pSwapchainImageCount inconsistent between guest and host\n"); |
| 9239 | } |
| 9240 | stream->read((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 9241 | } |
| 9242 | VkImage* check_pSwapchainImages; |
| 9243 | stream->read((VkImage**)&check_pSwapchainImages, sizeof(VkImage*)); |
| 9244 | if (pSwapchainImages) |
| 9245 | { |
| 9246 | if (!(check_pSwapchainImages)) |
| 9247 | { |
| 9248 | fprintf(stderr, "fatal: pSwapchainImages inconsistent between guest and host\n"); |
| 9249 | } |
| 9250 | stream->read((VkImage*)pSwapchainImages, (*(pSwapchainImageCount)) * sizeof(VkImage)); |
| 9251 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9252 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9253 | VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0; |
| 9254 | stream->read(&vkGetSwapchainImagesKHR_VkResult_return, sizeof(VkResult)); |
| 9255 | return vkGetSwapchainImagesKHR_VkResult_return; |
| 9256 | } |
| 9257 | |
| 9258 | VkResult VkEncoder::vkAcquireNextImageKHR( |
| 9259 | VkDevice device, |
| 9260 | VkSwapchainKHR swapchain, |
| 9261 | uint64_t timeout, |
| 9262 | VkSemaphore semaphore, |
| 9263 | VkFence fence, |
| 9264 | uint32_t* pImageIndex) |
| 9265 | { |
| 9266 | auto stream = mImpl->stream(); |
| 9267 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9268 | auto resources = mImpl->resources(); |
| 9269 | auto pool = mImpl->pool(); |
| 9270 | VkDevice local_device; |
| 9271 | local_device = device; |
| 9272 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 9273 | VkSwapchainKHR local_swapchain; |
| 9274 | local_swapchain = swapchain; |
| 9275 | resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain); |
| 9276 | uint64_t local_timeout; |
| 9277 | local_timeout = timeout; |
| 9278 | VkSemaphore local_semaphore; |
| 9279 | local_semaphore = semaphore; |
| 9280 | resources->unwrapMapping()->mapHandles_VkSemaphore((VkSemaphore*)&local_semaphore); |
| 9281 | VkFence local_fence; |
| 9282 | local_fence = fence; |
| 9283 | resources->unwrapMapping()->mapHandles_VkFence((VkFence*)&local_fence); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9284 | countingStream->rewind(); |
| 9285 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9286 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 9287 | countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| 9288 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| 9289 | countingStream->write((VkSemaphore*)&local_semaphore, sizeof(VkSemaphore)); |
| 9290 | countingStream->write((VkFence*)&local_fence, sizeof(VkFence)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9291 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 9292 | } |
| 9293 | uint32_t packetSize_vkAcquireNextImageKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9294 | countingStream->rewind(); |
| 9295 | uint32_t opcode_vkAcquireNextImageKHR = OP_vkAcquireNextImageKHR; |
| 9296 | stream->write(&opcode_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| 9297 | stream->write(&packetSize_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9298 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 9299 | stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| 9300 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| 9301 | stream->write((VkSemaphore*)&local_semaphore, sizeof(VkSemaphore)); |
| 9302 | stream->write((VkFence*)&local_fence, sizeof(VkFence)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9303 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 9304 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9305 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9306 | VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0; |
| 9307 | stream->read(&vkAcquireNextImageKHR_VkResult_return, sizeof(VkResult)); |
| 9308 | return vkAcquireNextImageKHR_VkResult_return; |
| 9309 | } |
| 9310 | |
| 9311 | VkResult VkEncoder::vkQueuePresentKHR( |
| 9312 | VkQueue queue, |
| 9313 | const VkPresentInfoKHR* pPresentInfo) |
| 9314 | { |
| 9315 | auto stream = mImpl->stream(); |
| 9316 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9317 | auto resources = mImpl->resources(); |
| 9318 | auto pool = mImpl->pool(); |
| 9319 | VkQueue local_queue; |
| 9320 | local_queue = queue; |
| 9321 | resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue); |
| 9322 | VkPresentInfoKHR* local_pPresentInfo; |
| 9323 | local_pPresentInfo = nullptr; |
| 9324 | if (pPresentInfo) |
| 9325 | { |
| 9326 | local_pPresentInfo = (VkPresentInfoKHR*)pool->alloc(sizeof(const VkPresentInfoKHR)); |
| 9327 | deepcopy_VkPresentInfoKHR(pool, pPresentInfo, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| 9328 | } |
| 9329 | if (local_pPresentInfo) |
| 9330 | { |
| 9331 | handlemap_VkPresentInfoKHR(resources->unwrapMapping(), (VkPresentInfoKHR*)(local_pPresentInfo)); |
| 9332 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9333 | countingStream->rewind(); |
| 9334 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9335 | countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 9336 | marshal_VkPresentInfoKHR(countingStream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9337 | } |
| 9338 | uint32_t packetSize_vkQueuePresentKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9339 | countingStream->rewind(); |
| 9340 | uint32_t opcode_vkQueuePresentKHR = OP_vkQueuePresentKHR; |
| 9341 | stream->write(&opcode_vkQueuePresentKHR, sizeof(uint32_t)); |
| 9342 | stream->write(&packetSize_vkQueuePresentKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9343 | stream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 9344 | marshal_VkPresentInfoKHR(stream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| 9345 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9346 | VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0; |
| 9347 | stream->read(&vkQueuePresentKHR_VkResult_return, sizeof(VkResult)); |
| 9348 | return vkQueuePresentKHR_VkResult_return; |
| 9349 | } |
| 9350 | |
| 9351 | VkResult VkEncoder::vkGetDeviceGroupPresentCapabilitiesKHR( |
| 9352 | VkDevice device, |
| 9353 | VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) |
| 9354 | { |
| 9355 | auto stream = mImpl->stream(); |
| 9356 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9357 | auto resources = mImpl->resources(); |
| 9358 | auto pool = mImpl->pool(); |
| 9359 | VkDevice local_device; |
| 9360 | local_device = device; |
| 9361 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9362 | countingStream->rewind(); |
| 9363 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9364 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9365 | marshal_VkDeviceGroupPresentCapabilitiesKHR(countingStream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 9366 | } |
| 9367 | uint32_t packetSize_vkGetDeviceGroupPresentCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9368 | countingStream->rewind(); |
| 9369 | uint32_t opcode_vkGetDeviceGroupPresentCapabilitiesKHR = OP_vkGetDeviceGroupPresentCapabilitiesKHR; |
| 9370 | stream->write(&opcode_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| 9371 | stream->write(&packetSize_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9372 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9373 | marshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 9374 | unmarshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9375 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9376 | VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 9377 | stream->read(&vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| 9378 | return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return; |
| 9379 | } |
| 9380 | |
| 9381 | VkResult VkEncoder::vkGetDeviceGroupSurfacePresentModesKHR( |
| 9382 | VkDevice device, |
| 9383 | VkSurfaceKHR surface, |
| 9384 | VkDeviceGroupPresentModeFlagsKHR* pModes) |
| 9385 | { |
| 9386 | auto stream = mImpl->stream(); |
| 9387 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9388 | auto resources = mImpl->resources(); |
| 9389 | auto pool = mImpl->pool(); |
| 9390 | VkDevice local_device; |
| 9391 | local_device = device; |
| 9392 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 9393 | VkSurfaceKHR local_surface; |
| 9394 | local_surface = surface; |
| 9395 | resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9396 | countingStream->rewind(); |
| 9397 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9398 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 9399 | countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9400 | countingStream->write((VkDeviceGroupPresentModeFlagsKHR**)&pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR*)); |
| 9401 | if (pModes) |
| 9402 | { |
| 9403 | countingStream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 9404 | } |
| 9405 | } |
| 9406 | uint32_t packetSize_vkGetDeviceGroupSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9407 | countingStream->rewind(); |
| 9408 | uint32_t opcode_vkGetDeviceGroupSurfacePresentModesKHR = OP_vkGetDeviceGroupSurfacePresentModesKHR; |
| 9409 | stream->write(&opcode_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| 9410 | stream->write(&packetSize_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9411 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 9412 | stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9413 | stream->write((VkDeviceGroupPresentModeFlagsKHR**)&pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR*)); |
| 9414 | if (pModes) |
| 9415 | { |
| 9416 | stream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 9417 | } |
| 9418 | VkDeviceGroupPresentModeFlagsKHR* check_pModes; |
| 9419 | stream->read((VkDeviceGroupPresentModeFlagsKHR**)&check_pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR*)); |
| 9420 | if (pModes) |
| 9421 | { |
| 9422 | if (!(check_pModes)) |
| 9423 | { |
| 9424 | fprintf(stderr, "fatal: pModes inconsistent between guest and host\n"); |
| 9425 | } |
| 9426 | stream->read((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 9427 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9428 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9429 | VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 9430 | stream->read(&vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| 9431 | return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return; |
| 9432 | } |
| 9433 | |
| 9434 | VkResult VkEncoder::vkGetPhysicalDevicePresentRectanglesKHR( |
| 9435 | VkPhysicalDevice physicalDevice, |
| 9436 | VkSurfaceKHR surface, |
| 9437 | uint32_t* pRectCount, |
| 9438 | VkRect2D* pRects) |
| 9439 | { |
| 9440 | auto stream = mImpl->stream(); |
| 9441 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9442 | auto resources = mImpl->resources(); |
| 9443 | auto pool = mImpl->pool(); |
| 9444 | VkPhysicalDevice local_physicalDevice; |
| 9445 | local_physicalDevice = physicalDevice; |
| 9446 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 9447 | VkSurfaceKHR local_surface; |
| 9448 | local_surface = surface; |
| 9449 | resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9450 | countingStream->rewind(); |
| 9451 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9452 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9453 | countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9454 | countingStream->write((uint32_t**)&pRectCount, sizeof(uint32_t*)); |
| 9455 | if (pRectCount) |
| 9456 | { |
| 9457 | countingStream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 9458 | } |
| 9459 | countingStream->write((VkRect2D**)&pRects, sizeof(VkRect2D*)); |
| 9460 | if (pRects) |
| 9461 | { |
| 9462 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 9463 | { |
| 9464 | marshal_VkRect2D(countingStream, (VkRect2D*)(pRects + i)); |
| 9465 | } |
| 9466 | } |
| 9467 | } |
| 9468 | uint32_t packetSize_vkGetPhysicalDevicePresentRectanglesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9469 | countingStream->rewind(); |
| 9470 | uint32_t opcode_vkGetPhysicalDevicePresentRectanglesKHR = OP_vkGetPhysicalDevicePresentRectanglesKHR; |
| 9471 | stream->write(&opcode_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| 9472 | stream->write(&packetSize_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9473 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9474 | stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9475 | stream->write((uint32_t**)&pRectCount, sizeof(uint32_t*)); |
| 9476 | if (pRectCount) |
| 9477 | { |
| 9478 | stream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 9479 | } |
| 9480 | stream->write((VkRect2D**)&pRects, sizeof(VkRect2D*)); |
| 9481 | if (pRects) |
| 9482 | { |
| 9483 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 9484 | { |
| 9485 | marshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 9486 | } |
| 9487 | } |
| 9488 | uint32_t* check_pRectCount; |
| 9489 | stream->read((uint32_t**)&check_pRectCount, sizeof(uint32_t*)); |
| 9490 | if (pRectCount) |
| 9491 | { |
| 9492 | if (!(check_pRectCount)) |
| 9493 | { |
| 9494 | fprintf(stderr, "fatal: pRectCount inconsistent between guest and host\n"); |
| 9495 | } |
| 9496 | stream->read((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 9497 | } |
| 9498 | VkRect2D* check_pRects; |
| 9499 | stream->read((VkRect2D**)&check_pRects, sizeof(VkRect2D*)); |
| 9500 | if (pRects) |
| 9501 | { |
| 9502 | if (!(check_pRects)) |
| 9503 | { |
| 9504 | fprintf(stderr, "fatal: pRects inconsistent between guest and host\n"); |
| 9505 | } |
| 9506 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 9507 | { |
| 9508 | unmarshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 9509 | } |
| 9510 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9511 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9512 | VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0; |
| 9513 | stream->read(&vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return, sizeof(VkResult)); |
| 9514 | return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return; |
| 9515 | } |
| 9516 | |
| 9517 | VkResult VkEncoder::vkAcquireNextImage2KHR( |
| 9518 | VkDevice device, |
| 9519 | const VkAcquireNextImageInfoKHR* pAcquireInfo, |
| 9520 | uint32_t* pImageIndex) |
| 9521 | { |
| 9522 | auto stream = mImpl->stream(); |
| 9523 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9524 | auto resources = mImpl->resources(); |
| 9525 | auto pool = mImpl->pool(); |
| 9526 | VkDevice local_device; |
| 9527 | local_device = device; |
| 9528 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 9529 | VkAcquireNextImageInfoKHR* local_pAcquireInfo; |
| 9530 | local_pAcquireInfo = nullptr; |
| 9531 | if (pAcquireInfo) |
| 9532 | { |
| 9533 | local_pAcquireInfo = (VkAcquireNextImageInfoKHR*)pool->alloc(sizeof(const VkAcquireNextImageInfoKHR)); |
| 9534 | deepcopy_VkAcquireNextImageInfoKHR(pool, pAcquireInfo, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| 9535 | } |
| 9536 | if (local_pAcquireInfo) |
| 9537 | { |
| 9538 | handlemap_VkAcquireNextImageInfoKHR(resources->unwrapMapping(), (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| 9539 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9540 | countingStream->rewind(); |
| 9541 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9542 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 9543 | marshal_VkAcquireNextImageInfoKHR(countingStream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9544 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 9545 | } |
| 9546 | uint32_t packetSize_vkAcquireNextImage2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9547 | countingStream->rewind(); |
| 9548 | uint32_t opcode_vkAcquireNextImage2KHR = OP_vkAcquireNextImage2KHR; |
| 9549 | stream->write(&opcode_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| 9550 | stream->write(&packetSize_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9551 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 9552 | marshal_VkAcquireNextImageInfoKHR(stream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9553 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 9554 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9555 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9556 | VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0; |
| 9557 | stream->read(&vkAcquireNextImage2KHR_VkResult_return, sizeof(VkResult)); |
| 9558 | return vkAcquireNextImage2KHR_VkResult_return; |
| 9559 | } |
| 9560 | |
| 9561 | #endif |
| 9562 | #ifdef VK_KHR_display |
| 9563 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPropertiesKHR( |
| 9564 | VkPhysicalDevice physicalDevice, |
| 9565 | uint32_t* pPropertyCount, |
| 9566 | VkDisplayPropertiesKHR* pProperties) |
| 9567 | { |
| 9568 | auto stream = mImpl->stream(); |
| 9569 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9570 | auto resources = mImpl->resources(); |
| 9571 | auto pool = mImpl->pool(); |
| 9572 | VkPhysicalDevice local_physicalDevice; |
| 9573 | local_physicalDevice = physicalDevice; |
| 9574 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9575 | countingStream->rewind(); |
| 9576 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9577 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9578 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 9579 | if (pPropertyCount) |
| 9580 | { |
| 9581 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9582 | } |
| 9583 | countingStream->write((VkDisplayPropertiesKHR**)&pProperties, sizeof(VkDisplayPropertiesKHR*)); |
| 9584 | if (pProperties) |
| 9585 | { |
| 9586 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9587 | { |
| 9588 | marshal_VkDisplayPropertiesKHR(countingStream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 9589 | } |
| 9590 | } |
| 9591 | } |
| 9592 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9593 | countingStream->rewind(); |
| 9594 | uint32_t opcode_vkGetPhysicalDeviceDisplayPropertiesKHR = OP_vkGetPhysicalDeviceDisplayPropertiesKHR; |
| 9595 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| 9596 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9597 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9598 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 9599 | if (pPropertyCount) |
| 9600 | { |
| 9601 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9602 | } |
| 9603 | stream->write((VkDisplayPropertiesKHR**)&pProperties, sizeof(VkDisplayPropertiesKHR*)); |
| 9604 | if (pProperties) |
| 9605 | { |
| 9606 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9607 | { |
| 9608 | marshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 9609 | } |
| 9610 | } |
| 9611 | uint32_t* check_pPropertyCount; |
| 9612 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 9613 | if (pPropertyCount) |
| 9614 | { |
| 9615 | if (!(check_pPropertyCount)) |
| 9616 | { |
| 9617 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 9618 | } |
| 9619 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9620 | } |
| 9621 | VkDisplayPropertiesKHR* check_pProperties; |
| 9622 | stream->read((VkDisplayPropertiesKHR**)&check_pProperties, sizeof(VkDisplayPropertiesKHR*)); |
| 9623 | if (pProperties) |
| 9624 | { |
| 9625 | if (!(check_pProperties)) |
| 9626 | { |
| 9627 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 9628 | } |
| 9629 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9630 | { |
| 9631 | unmarshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 9632 | } |
| 9633 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9634 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9635 | VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0; |
| 9636 | stream->read(&vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| 9637 | return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return; |
| 9638 | } |
| 9639 | |
| 9640 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlanePropertiesKHR( |
| 9641 | VkPhysicalDevice physicalDevice, |
| 9642 | uint32_t* pPropertyCount, |
| 9643 | VkDisplayPlanePropertiesKHR* pProperties) |
| 9644 | { |
| 9645 | auto stream = mImpl->stream(); |
| 9646 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9647 | auto resources = mImpl->resources(); |
| 9648 | auto pool = mImpl->pool(); |
| 9649 | VkPhysicalDevice local_physicalDevice; |
| 9650 | local_physicalDevice = physicalDevice; |
| 9651 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9652 | countingStream->rewind(); |
| 9653 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9654 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9655 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 9656 | if (pPropertyCount) |
| 9657 | { |
| 9658 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9659 | } |
| 9660 | countingStream->write((VkDisplayPlanePropertiesKHR**)&pProperties, sizeof(VkDisplayPlanePropertiesKHR*)); |
| 9661 | if (pProperties) |
| 9662 | { |
| 9663 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9664 | { |
| 9665 | marshal_VkDisplayPlanePropertiesKHR(countingStream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 9666 | } |
| 9667 | } |
| 9668 | } |
| 9669 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9670 | countingStream->rewind(); |
| 9671 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR; |
| 9672 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| 9673 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9674 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9675 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 9676 | if (pPropertyCount) |
| 9677 | { |
| 9678 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9679 | } |
| 9680 | stream->write((VkDisplayPlanePropertiesKHR**)&pProperties, sizeof(VkDisplayPlanePropertiesKHR*)); |
| 9681 | if (pProperties) |
| 9682 | { |
| 9683 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9684 | { |
| 9685 | marshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 9686 | } |
| 9687 | } |
| 9688 | uint32_t* check_pPropertyCount; |
| 9689 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 9690 | if (pPropertyCount) |
| 9691 | { |
| 9692 | if (!(check_pPropertyCount)) |
| 9693 | { |
| 9694 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 9695 | } |
| 9696 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9697 | } |
| 9698 | VkDisplayPlanePropertiesKHR* check_pProperties; |
| 9699 | stream->read((VkDisplayPlanePropertiesKHR**)&check_pProperties, sizeof(VkDisplayPlanePropertiesKHR*)); |
| 9700 | if (pProperties) |
| 9701 | { |
| 9702 | if (!(check_pProperties)) |
| 9703 | { |
| 9704 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 9705 | } |
| 9706 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9707 | { |
| 9708 | unmarshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 9709 | } |
| 9710 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9711 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9712 | VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0; |
| 9713 | stream->read(&vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| 9714 | return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return; |
| 9715 | } |
| 9716 | |
| 9717 | VkResult VkEncoder::vkGetDisplayPlaneSupportedDisplaysKHR( |
| 9718 | VkPhysicalDevice physicalDevice, |
| 9719 | uint32_t planeIndex, |
| 9720 | uint32_t* pDisplayCount, |
| 9721 | VkDisplayKHR* pDisplays) |
| 9722 | { |
| 9723 | auto stream = mImpl->stream(); |
| 9724 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9725 | auto resources = mImpl->resources(); |
| 9726 | auto pool = mImpl->pool(); |
| 9727 | VkPhysicalDevice local_physicalDevice; |
| 9728 | local_physicalDevice = physicalDevice; |
| 9729 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 9730 | uint32_t local_planeIndex; |
| 9731 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9732 | countingStream->rewind(); |
| 9733 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9734 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9735 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9736 | countingStream->write((uint32_t**)&pDisplayCount, sizeof(uint32_t*)); |
| 9737 | if (pDisplayCount) |
| 9738 | { |
| 9739 | countingStream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 9740 | } |
| 9741 | countingStream->write((VkDisplayKHR**)&pDisplays, sizeof(VkDisplayKHR*)); |
| 9742 | if (pDisplays) |
| 9743 | { |
| 9744 | countingStream->write((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR)); |
| 9745 | } |
| 9746 | } |
| 9747 | uint32_t packetSize_vkGetDisplayPlaneSupportedDisplaysKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9748 | countingStream->rewind(); |
| 9749 | uint32_t opcode_vkGetDisplayPlaneSupportedDisplaysKHR = OP_vkGetDisplayPlaneSupportedDisplaysKHR; |
| 9750 | stream->write(&opcode_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| 9751 | stream->write(&packetSize_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9752 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9753 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9754 | stream->write((uint32_t**)&pDisplayCount, sizeof(uint32_t*)); |
| 9755 | if (pDisplayCount) |
| 9756 | { |
| 9757 | stream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 9758 | } |
| 9759 | stream->write((VkDisplayKHR**)&pDisplays, sizeof(VkDisplayKHR*)); |
| 9760 | if (pDisplays) |
| 9761 | { |
| 9762 | stream->write((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR)); |
| 9763 | } |
| 9764 | uint32_t* check_pDisplayCount; |
| 9765 | stream->read((uint32_t**)&check_pDisplayCount, sizeof(uint32_t*)); |
| 9766 | if (pDisplayCount) |
| 9767 | { |
| 9768 | if (!(check_pDisplayCount)) |
| 9769 | { |
| 9770 | fprintf(stderr, "fatal: pDisplayCount inconsistent between guest and host\n"); |
| 9771 | } |
| 9772 | stream->read((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 9773 | } |
| 9774 | VkDisplayKHR* check_pDisplays; |
| 9775 | stream->read((VkDisplayKHR**)&check_pDisplays, sizeof(VkDisplayKHR*)); |
| 9776 | if (pDisplays) |
| 9777 | { |
| 9778 | if (!(check_pDisplays)) |
| 9779 | { |
| 9780 | fprintf(stderr, "fatal: pDisplays inconsistent between guest and host\n"); |
| 9781 | } |
| 9782 | stream->read((VkDisplayKHR*)pDisplays, (*(pDisplayCount)) * sizeof(VkDisplayKHR)); |
| 9783 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9784 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9785 | VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0; |
| 9786 | stream->read(&vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return, sizeof(VkResult)); |
| 9787 | return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return; |
| 9788 | } |
| 9789 | |
| 9790 | VkResult VkEncoder::vkGetDisplayModePropertiesKHR( |
| 9791 | VkPhysicalDevice physicalDevice, |
| 9792 | VkDisplayKHR display, |
| 9793 | uint32_t* pPropertyCount, |
| 9794 | VkDisplayModePropertiesKHR* pProperties) |
| 9795 | { |
| 9796 | auto stream = mImpl->stream(); |
| 9797 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9798 | auto resources = mImpl->resources(); |
| 9799 | auto pool = mImpl->pool(); |
| 9800 | VkPhysicalDevice local_physicalDevice; |
| 9801 | local_physicalDevice = physicalDevice; |
| 9802 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 9803 | VkDisplayKHR local_display; |
| 9804 | local_display = display; |
| 9805 | resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9806 | countingStream->rewind(); |
| 9807 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9808 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9809 | countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9810 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 9811 | if (pPropertyCount) |
| 9812 | { |
| 9813 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9814 | } |
| 9815 | countingStream->write((VkDisplayModePropertiesKHR**)&pProperties, sizeof(VkDisplayModePropertiesKHR*)); |
| 9816 | if (pProperties) |
| 9817 | { |
| 9818 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9819 | { |
| 9820 | marshal_VkDisplayModePropertiesKHR(countingStream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 9821 | } |
| 9822 | } |
| 9823 | } |
| 9824 | uint32_t packetSize_vkGetDisplayModePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9825 | countingStream->rewind(); |
| 9826 | uint32_t opcode_vkGetDisplayModePropertiesKHR = OP_vkGetDisplayModePropertiesKHR; |
| 9827 | stream->write(&opcode_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| 9828 | stream->write(&packetSize_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9829 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9830 | stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9831 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 9832 | if (pPropertyCount) |
| 9833 | { |
| 9834 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9835 | } |
| 9836 | stream->write((VkDisplayModePropertiesKHR**)&pProperties, sizeof(VkDisplayModePropertiesKHR*)); |
| 9837 | if (pProperties) |
| 9838 | { |
| 9839 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9840 | { |
| 9841 | marshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 9842 | } |
| 9843 | } |
| 9844 | uint32_t* check_pPropertyCount; |
| 9845 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 9846 | if (pPropertyCount) |
| 9847 | { |
| 9848 | if (!(check_pPropertyCount)) |
| 9849 | { |
| 9850 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 9851 | } |
| 9852 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9853 | } |
| 9854 | VkDisplayModePropertiesKHR* check_pProperties; |
| 9855 | stream->read((VkDisplayModePropertiesKHR**)&check_pProperties, sizeof(VkDisplayModePropertiesKHR*)); |
| 9856 | if (pProperties) |
| 9857 | { |
| 9858 | if (!(check_pProperties)) |
| 9859 | { |
| 9860 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 9861 | } |
| 9862 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9863 | { |
| 9864 | unmarshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 9865 | } |
| 9866 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9867 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9868 | VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0; |
| 9869 | stream->read(&vkGetDisplayModePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| 9870 | return vkGetDisplayModePropertiesKHR_VkResult_return; |
| 9871 | } |
| 9872 | |
| 9873 | VkResult VkEncoder::vkCreateDisplayModeKHR( |
| 9874 | VkPhysicalDevice physicalDevice, |
| 9875 | VkDisplayKHR display, |
| 9876 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
| 9877 | const VkAllocationCallbacks* pAllocator, |
| 9878 | VkDisplayModeKHR* pMode) |
| 9879 | { |
| 9880 | auto stream = mImpl->stream(); |
| 9881 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9882 | auto resources = mImpl->resources(); |
| 9883 | auto pool = mImpl->pool(); |
| 9884 | VkPhysicalDevice local_physicalDevice; |
| 9885 | local_physicalDevice = physicalDevice; |
| 9886 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 9887 | VkDisplayKHR local_display; |
| 9888 | local_display = display; |
| 9889 | resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display); |
| 9890 | VkDisplayModeCreateInfoKHR* local_pCreateInfo; |
| 9891 | local_pCreateInfo = nullptr; |
| 9892 | if (pCreateInfo) |
| 9893 | { |
| 9894 | local_pCreateInfo = (VkDisplayModeCreateInfoKHR*)pool->alloc(sizeof(const VkDisplayModeCreateInfoKHR)); |
| 9895 | deepcopy_VkDisplayModeCreateInfoKHR(pool, pCreateInfo, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| 9896 | } |
| 9897 | if (local_pCreateInfo) |
| 9898 | { |
| 9899 | handlemap_VkDisplayModeCreateInfoKHR(resources->unwrapMapping(), (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| 9900 | } |
| 9901 | VkAllocationCallbacks* local_pAllocator; |
| 9902 | local_pAllocator = nullptr; |
| 9903 | if (pAllocator) |
| 9904 | { |
| 9905 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 9906 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 9907 | } |
| 9908 | if (local_pAllocator) |
| 9909 | { |
| 9910 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 9911 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 9912 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9913 | countingStream->rewind(); |
| 9914 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9915 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9916 | countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| 9917 | marshal_VkDisplayModeCreateInfoKHR(countingStream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| 9918 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 9919 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9920 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9921 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9922 | } |
| 9923 | countingStream->write((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR)); |
| 9924 | } |
| 9925 | uint32_t packetSize_vkCreateDisplayModeKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9926 | countingStream->rewind(); |
| 9927 | uint32_t opcode_vkCreateDisplayModeKHR = OP_vkCreateDisplayModeKHR; |
| 9928 | stream->write(&opcode_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| 9929 | stream->write(&packetSize_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9930 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9931 | stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| 9932 | marshal_VkDisplayModeCreateInfoKHR(stream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| 9933 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 9934 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9935 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9936 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9937 | } |
| 9938 | stream->write((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR)); |
| 9939 | stream->read((VkDisplayModeKHR*)pMode, sizeof(VkDisplayModeKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9940 | if (pMode) |
| 9941 | { |
| 9942 | resources->createMapping()->mapHandles_VkDisplayModeKHR((VkDisplayModeKHR*)pMode, 1); |
| 9943 | } |
| 9944 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9945 | VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0; |
| 9946 | stream->read(&vkCreateDisplayModeKHR_VkResult_return, sizeof(VkResult)); |
| 9947 | return vkCreateDisplayModeKHR_VkResult_return; |
| 9948 | } |
| 9949 | |
| 9950 | VkResult VkEncoder::vkGetDisplayPlaneCapabilitiesKHR( |
| 9951 | VkPhysicalDevice physicalDevice, |
| 9952 | VkDisplayModeKHR mode, |
| 9953 | uint32_t planeIndex, |
| 9954 | VkDisplayPlaneCapabilitiesKHR* pCapabilities) |
| 9955 | { |
| 9956 | auto stream = mImpl->stream(); |
| 9957 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9958 | auto resources = mImpl->resources(); |
| 9959 | auto pool = mImpl->pool(); |
| 9960 | VkPhysicalDevice local_physicalDevice; |
| 9961 | local_physicalDevice = physicalDevice; |
| 9962 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 9963 | VkDisplayModeKHR local_mode; |
| 9964 | local_mode = mode; |
| 9965 | resources->unwrapMapping()->mapHandles_VkDisplayModeKHR((VkDisplayModeKHR*)&local_mode); |
| 9966 | uint32_t local_planeIndex; |
| 9967 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9968 | countingStream->rewind(); |
| 9969 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9970 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9971 | countingStream->write((VkDisplayModeKHR*)&local_mode, sizeof(VkDisplayModeKHR)); |
| 9972 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9973 | marshal_VkDisplayPlaneCapabilitiesKHR(countingStream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 9974 | } |
| 9975 | uint32_t packetSize_vkGetDisplayPlaneCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9976 | countingStream->rewind(); |
| 9977 | uint32_t opcode_vkGetDisplayPlaneCapabilitiesKHR = OP_vkGetDisplayPlaneCapabilitiesKHR; |
| 9978 | stream->write(&opcode_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| 9979 | stream->write(&packetSize_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9980 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 9981 | stream->write((VkDisplayModeKHR*)&local_mode, sizeof(VkDisplayModeKHR)); |
| 9982 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9983 | marshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 9984 | unmarshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9985 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9986 | VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 9987 | stream->read(&vkGetDisplayPlaneCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| 9988 | return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return; |
| 9989 | } |
| 9990 | |
| 9991 | VkResult VkEncoder::vkCreateDisplayPlaneSurfaceKHR( |
| 9992 | VkInstance instance, |
| 9993 | const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, |
| 9994 | const VkAllocationCallbacks* pAllocator, |
| 9995 | VkSurfaceKHR* pSurface) |
| 9996 | { |
| 9997 | auto stream = mImpl->stream(); |
| 9998 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9999 | auto resources = mImpl->resources(); |
| 10000 | auto pool = mImpl->pool(); |
| 10001 | VkInstance local_instance; |
| 10002 | local_instance = instance; |
| 10003 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 10004 | VkDisplaySurfaceCreateInfoKHR* local_pCreateInfo; |
| 10005 | local_pCreateInfo = nullptr; |
| 10006 | if (pCreateInfo) |
| 10007 | { |
| 10008 | local_pCreateInfo = (VkDisplaySurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkDisplaySurfaceCreateInfoKHR)); |
| 10009 | deepcopy_VkDisplaySurfaceCreateInfoKHR(pool, pCreateInfo, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10010 | } |
| 10011 | if (local_pCreateInfo) |
| 10012 | { |
| 10013 | handlemap_VkDisplaySurfaceCreateInfoKHR(resources->unwrapMapping(), (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10014 | } |
| 10015 | VkAllocationCallbacks* local_pAllocator; |
| 10016 | local_pAllocator = nullptr; |
| 10017 | if (pAllocator) |
| 10018 | { |
| 10019 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10020 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10021 | } |
| 10022 | if (local_pAllocator) |
| 10023 | { |
| 10024 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 10025 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 10026 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10027 | countingStream->rewind(); |
| 10028 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10029 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10030 | marshal_VkDisplaySurfaceCreateInfoKHR(countingStream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10031 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10032 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10033 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10034 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10035 | } |
| 10036 | countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10037 | } |
| 10038 | uint32_t packetSize_vkCreateDisplayPlaneSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10039 | countingStream->rewind(); |
| 10040 | uint32_t opcode_vkCreateDisplayPlaneSurfaceKHR = OP_vkCreateDisplayPlaneSurfaceKHR; |
| 10041 | stream->write(&opcode_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| 10042 | stream->write(&packetSize_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10043 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10044 | marshal_VkDisplaySurfaceCreateInfoKHR(stream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10045 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10046 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10047 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10048 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10049 | } |
| 10050 | stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10051 | stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10052 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10053 | VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0; |
| 10054 | stream->read(&vkCreateDisplayPlaneSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| 10055 | return vkCreateDisplayPlaneSurfaceKHR_VkResult_return; |
| 10056 | } |
| 10057 | |
| 10058 | #endif |
| 10059 | #ifdef VK_KHR_display_swapchain |
| 10060 | VkResult VkEncoder::vkCreateSharedSwapchainsKHR( |
| 10061 | VkDevice device, |
| 10062 | uint32_t swapchainCount, |
| 10063 | const VkSwapchainCreateInfoKHR* pCreateInfos, |
| 10064 | const VkAllocationCallbacks* pAllocator, |
| 10065 | VkSwapchainKHR* pSwapchains) |
| 10066 | { |
| 10067 | auto stream = mImpl->stream(); |
| 10068 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10069 | auto resources = mImpl->resources(); |
| 10070 | auto pool = mImpl->pool(); |
| 10071 | VkDevice local_device; |
| 10072 | local_device = device; |
| 10073 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 10074 | uint32_t local_swapchainCount; |
| 10075 | local_swapchainCount = swapchainCount; |
| 10076 | VkSwapchainCreateInfoKHR* local_pCreateInfos; |
| 10077 | local_pCreateInfos = nullptr; |
| 10078 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10079 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10080 | local_pCreateInfos = (VkSwapchainCreateInfoKHR*)pool->alloc(((swapchainCount)) * sizeof(const VkSwapchainCreateInfoKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10081 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 10082 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10083 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfos + i, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10084 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10085 | } |
| 10086 | if (local_pCreateInfos) |
| 10087 | { |
| 10088 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10089 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10090 | handlemap_VkSwapchainCreateInfoKHR(resources->unwrapMapping(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| 10091 | } |
| 10092 | } |
| 10093 | VkAllocationCallbacks* local_pAllocator; |
| 10094 | local_pAllocator = nullptr; |
| 10095 | if (pAllocator) |
| 10096 | { |
| 10097 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10098 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10099 | } |
| 10100 | if (local_pAllocator) |
| 10101 | { |
| 10102 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 10103 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 10104 | local_pAllocator = nullptr; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10105 | countingStream->rewind(); |
| 10106 | { |
| 10107 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 10108 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| 10109 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 10110 | { |
| 10111 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| 10112 | } |
| 10113 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10114 | if (local_pAllocator) |
| 10115 | { |
| 10116 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10117 | } |
| 10118 | countingStream->write((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR)); |
| 10119 | } |
| 10120 | uint32_t packetSize_vkCreateSharedSwapchainsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10121 | countingStream->rewind(); |
| 10122 | uint32_t opcode_vkCreateSharedSwapchainsKHR = OP_vkCreateSharedSwapchainsKHR; |
| 10123 | stream->write(&opcode_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| 10124 | stream->write(&packetSize_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10125 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 10126 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10127 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 10128 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10129 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10130 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10131 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10132 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10133 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10134 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10135 | } |
| 10136 | stream->write((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR)); |
| 10137 | stream->read((VkSwapchainKHR*)pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10138 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10139 | VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0; |
| 10140 | stream->read(&vkCreateSharedSwapchainsKHR_VkResult_return, sizeof(VkResult)); |
| 10141 | return vkCreateSharedSwapchainsKHR_VkResult_return; |
| 10142 | } |
| 10143 | |
| 10144 | #endif |
| 10145 | #ifdef VK_KHR_xlib_surface |
| 10146 | VkResult VkEncoder::vkCreateXlibSurfaceKHR( |
| 10147 | VkInstance instance, |
| 10148 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, |
| 10149 | const VkAllocationCallbacks* pAllocator, |
| 10150 | VkSurfaceKHR* pSurface) |
| 10151 | { |
| 10152 | auto stream = mImpl->stream(); |
| 10153 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10154 | auto resources = mImpl->resources(); |
| 10155 | auto pool = mImpl->pool(); |
| 10156 | VkInstance local_instance; |
| 10157 | local_instance = instance; |
| 10158 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 10159 | VkXlibSurfaceCreateInfoKHR* local_pCreateInfo; |
| 10160 | local_pCreateInfo = nullptr; |
| 10161 | if (pCreateInfo) |
| 10162 | { |
| 10163 | local_pCreateInfo = (VkXlibSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXlibSurfaceCreateInfoKHR)); |
| 10164 | deepcopy_VkXlibSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10165 | } |
| 10166 | if (local_pCreateInfo) |
| 10167 | { |
| 10168 | handlemap_VkXlibSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10169 | } |
| 10170 | VkAllocationCallbacks* local_pAllocator; |
| 10171 | local_pAllocator = nullptr; |
| 10172 | if (pAllocator) |
| 10173 | { |
| 10174 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10175 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10176 | } |
| 10177 | if (local_pAllocator) |
| 10178 | { |
| 10179 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 10180 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 10181 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10182 | countingStream->rewind(); |
| 10183 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10184 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10185 | marshal_VkXlibSurfaceCreateInfoKHR(countingStream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10186 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10187 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10188 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10189 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10190 | } |
| 10191 | countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10192 | } |
| 10193 | uint32_t packetSize_vkCreateXlibSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10194 | countingStream->rewind(); |
| 10195 | uint32_t opcode_vkCreateXlibSurfaceKHR = OP_vkCreateXlibSurfaceKHR; |
| 10196 | stream->write(&opcode_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| 10197 | stream->write(&packetSize_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10198 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10199 | marshal_VkXlibSurfaceCreateInfoKHR(stream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10200 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10201 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10202 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10203 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10204 | } |
| 10205 | stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10206 | stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10207 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10208 | VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0; |
| 10209 | stream->read(&vkCreateXlibSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| 10210 | return vkCreateXlibSurfaceKHR_VkResult_return; |
| 10211 | } |
| 10212 | |
| 10213 | VkBool32 VkEncoder::vkGetPhysicalDeviceXlibPresentationSupportKHR( |
| 10214 | VkPhysicalDevice physicalDevice, |
| 10215 | uint32_t queueFamilyIndex, |
| 10216 | Display* dpy, |
| 10217 | VisualID visualID) |
| 10218 | { |
| 10219 | auto stream = mImpl->stream(); |
| 10220 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10221 | auto resources = mImpl->resources(); |
| 10222 | auto pool = mImpl->pool(); |
| 10223 | VkPhysicalDevice local_physicalDevice; |
| 10224 | local_physicalDevice = physicalDevice; |
| 10225 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 10226 | uint32_t local_queueFamilyIndex; |
| 10227 | local_queueFamilyIndex = queueFamilyIndex; |
| 10228 | VisualID local_visualID; |
| 10229 | local_visualID = visualID; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10230 | countingStream->rewind(); |
| 10231 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10232 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10233 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10234 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10235 | countingStream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10236 | } |
| 10237 | uint32_t packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10238 | countingStream->rewind(); |
| 10239 | uint32_t opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR = OP_vkGetPhysicalDeviceXlibPresentationSupportKHR; |
| 10240 | stream->write(&opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| 10241 | stream->write(&packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10242 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10243 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10244 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10245 | stream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10246 | stream->read((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10247 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10248 | VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 10249 | stream->read(&vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| 10250 | return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return; |
| 10251 | } |
| 10252 | |
| 10253 | #endif |
| 10254 | #ifdef VK_KHR_xcb_surface |
| 10255 | VkResult VkEncoder::vkCreateXcbSurfaceKHR( |
| 10256 | VkInstance instance, |
| 10257 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, |
| 10258 | const VkAllocationCallbacks* pAllocator, |
| 10259 | VkSurfaceKHR* pSurface) |
| 10260 | { |
| 10261 | auto stream = mImpl->stream(); |
| 10262 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10263 | auto resources = mImpl->resources(); |
| 10264 | auto pool = mImpl->pool(); |
| 10265 | VkInstance local_instance; |
| 10266 | local_instance = instance; |
| 10267 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 10268 | VkXcbSurfaceCreateInfoKHR* local_pCreateInfo; |
| 10269 | local_pCreateInfo = nullptr; |
| 10270 | if (pCreateInfo) |
| 10271 | { |
| 10272 | local_pCreateInfo = (VkXcbSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXcbSurfaceCreateInfoKHR)); |
| 10273 | deepcopy_VkXcbSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10274 | } |
| 10275 | if (local_pCreateInfo) |
| 10276 | { |
| 10277 | handlemap_VkXcbSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10278 | } |
| 10279 | VkAllocationCallbacks* local_pAllocator; |
| 10280 | local_pAllocator = nullptr; |
| 10281 | if (pAllocator) |
| 10282 | { |
| 10283 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10284 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10285 | } |
| 10286 | if (local_pAllocator) |
| 10287 | { |
| 10288 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 10289 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 10290 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10291 | countingStream->rewind(); |
| 10292 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10293 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10294 | marshal_VkXcbSurfaceCreateInfoKHR(countingStream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10295 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10296 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10297 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10298 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10299 | } |
| 10300 | countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10301 | } |
| 10302 | uint32_t packetSize_vkCreateXcbSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10303 | countingStream->rewind(); |
| 10304 | uint32_t opcode_vkCreateXcbSurfaceKHR = OP_vkCreateXcbSurfaceKHR; |
| 10305 | stream->write(&opcode_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| 10306 | stream->write(&packetSize_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10307 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10308 | marshal_VkXcbSurfaceCreateInfoKHR(stream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10309 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10310 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10311 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10312 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10313 | } |
| 10314 | stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10315 | stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10316 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10317 | VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0; |
| 10318 | stream->read(&vkCreateXcbSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| 10319 | return vkCreateXcbSurfaceKHR_VkResult_return; |
| 10320 | } |
| 10321 | |
| 10322 | VkBool32 VkEncoder::vkGetPhysicalDeviceXcbPresentationSupportKHR( |
| 10323 | VkPhysicalDevice physicalDevice, |
| 10324 | uint32_t queueFamilyIndex, |
| 10325 | xcb_connection_t* connection, |
| 10326 | xcb_visualid_t visual_id) |
| 10327 | { |
| 10328 | auto stream = mImpl->stream(); |
| 10329 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10330 | auto resources = mImpl->resources(); |
| 10331 | auto pool = mImpl->pool(); |
| 10332 | VkPhysicalDevice local_physicalDevice; |
| 10333 | local_physicalDevice = physicalDevice; |
| 10334 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 10335 | uint32_t local_queueFamilyIndex; |
| 10336 | local_queueFamilyIndex = queueFamilyIndex; |
| 10337 | xcb_visualid_t local_visual_id; |
| 10338 | local_visual_id = visual_id; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10339 | countingStream->rewind(); |
| 10340 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10341 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10342 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10343 | countingStream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10344 | countingStream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10345 | } |
| 10346 | uint32_t packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10347 | countingStream->rewind(); |
| 10348 | uint32_t opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR = OP_vkGetPhysicalDeviceXcbPresentationSupportKHR; |
| 10349 | stream->write(&opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| 10350 | stream->write(&packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10351 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10352 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10353 | stream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10354 | stream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10355 | stream->read((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10356 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10357 | VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 10358 | stream->read(&vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| 10359 | return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return; |
| 10360 | } |
| 10361 | |
| 10362 | #endif |
| 10363 | #ifdef VK_KHR_wayland_surface |
| 10364 | VkResult VkEncoder::vkCreateWaylandSurfaceKHR( |
| 10365 | VkInstance instance, |
| 10366 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, |
| 10367 | const VkAllocationCallbacks* pAllocator, |
| 10368 | VkSurfaceKHR* pSurface) |
| 10369 | { |
| 10370 | auto stream = mImpl->stream(); |
| 10371 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10372 | auto resources = mImpl->resources(); |
| 10373 | auto pool = mImpl->pool(); |
| 10374 | VkInstance local_instance; |
| 10375 | local_instance = instance; |
| 10376 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 10377 | VkWaylandSurfaceCreateInfoKHR* local_pCreateInfo; |
| 10378 | local_pCreateInfo = nullptr; |
| 10379 | if (pCreateInfo) |
| 10380 | { |
| 10381 | local_pCreateInfo = (VkWaylandSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWaylandSurfaceCreateInfoKHR)); |
| 10382 | deepcopy_VkWaylandSurfaceCreateInfoKHR(pool, pCreateInfo, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10383 | } |
| 10384 | if (local_pCreateInfo) |
| 10385 | { |
| 10386 | handlemap_VkWaylandSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10387 | } |
| 10388 | VkAllocationCallbacks* local_pAllocator; |
| 10389 | local_pAllocator = nullptr; |
| 10390 | if (pAllocator) |
| 10391 | { |
| 10392 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10393 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10394 | } |
| 10395 | if (local_pAllocator) |
| 10396 | { |
| 10397 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 10398 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 10399 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10400 | countingStream->rewind(); |
| 10401 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10402 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10403 | marshal_VkWaylandSurfaceCreateInfoKHR(countingStream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10404 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10405 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10406 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10407 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10408 | } |
| 10409 | countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10410 | } |
| 10411 | uint32_t packetSize_vkCreateWaylandSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10412 | countingStream->rewind(); |
| 10413 | uint32_t opcode_vkCreateWaylandSurfaceKHR = OP_vkCreateWaylandSurfaceKHR; |
| 10414 | stream->write(&opcode_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| 10415 | stream->write(&packetSize_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10416 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10417 | marshal_VkWaylandSurfaceCreateInfoKHR(stream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10418 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10419 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10420 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10421 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10422 | } |
| 10423 | stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10424 | stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10425 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10426 | VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0; |
| 10427 | stream->read(&vkCreateWaylandSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| 10428 | return vkCreateWaylandSurfaceKHR_VkResult_return; |
| 10429 | } |
| 10430 | |
| 10431 | VkBool32 VkEncoder::vkGetPhysicalDeviceWaylandPresentationSupportKHR( |
| 10432 | VkPhysicalDevice physicalDevice, |
| 10433 | uint32_t queueFamilyIndex, |
| 10434 | wl_display* display) |
| 10435 | { |
| 10436 | auto stream = mImpl->stream(); |
| 10437 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10438 | auto resources = mImpl->resources(); |
| 10439 | auto pool = mImpl->pool(); |
| 10440 | VkPhysicalDevice local_physicalDevice; |
| 10441 | local_physicalDevice = physicalDevice; |
| 10442 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 10443 | uint32_t local_queueFamilyIndex; |
| 10444 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10445 | countingStream->rewind(); |
| 10446 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10447 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10448 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10449 | countingStream->write((wl_display*)display, sizeof(wl_display)); |
| 10450 | } |
| 10451 | uint32_t packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10452 | countingStream->rewind(); |
| 10453 | uint32_t opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR = OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR; |
| 10454 | stream->write(&opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| 10455 | stream->write(&packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10456 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10457 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10458 | stream->write((wl_display*)display, sizeof(wl_display)); |
| 10459 | stream->read((wl_display*)display, sizeof(wl_display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10460 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10461 | VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 10462 | stream->read(&vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| 10463 | return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return; |
| 10464 | } |
| 10465 | |
| 10466 | #endif |
| 10467 | #ifdef VK_KHR_mir_surface |
| 10468 | VkResult VkEncoder::vkCreateMirSurfaceKHR( |
| 10469 | VkInstance instance, |
| 10470 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, |
| 10471 | const VkAllocationCallbacks* pAllocator, |
| 10472 | VkSurfaceKHR* pSurface) |
| 10473 | { |
| 10474 | auto stream = mImpl->stream(); |
| 10475 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10476 | auto resources = mImpl->resources(); |
| 10477 | auto pool = mImpl->pool(); |
| 10478 | VkInstance local_instance; |
| 10479 | local_instance = instance; |
| 10480 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 10481 | VkMirSurfaceCreateInfoKHR* local_pCreateInfo; |
| 10482 | local_pCreateInfo = nullptr; |
| 10483 | if (pCreateInfo) |
| 10484 | { |
| 10485 | local_pCreateInfo = (VkMirSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkMirSurfaceCreateInfoKHR)); |
| 10486 | deepcopy_VkMirSurfaceCreateInfoKHR(pool, pCreateInfo, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10487 | } |
| 10488 | if (local_pCreateInfo) |
| 10489 | { |
| 10490 | handlemap_VkMirSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10491 | } |
| 10492 | VkAllocationCallbacks* local_pAllocator; |
| 10493 | local_pAllocator = nullptr; |
| 10494 | if (pAllocator) |
| 10495 | { |
| 10496 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10497 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10498 | } |
| 10499 | if (local_pAllocator) |
| 10500 | { |
| 10501 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 10502 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 10503 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10504 | countingStream->rewind(); |
| 10505 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10506 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10507 | marshal_VkMirSurfaceCreateInfoKHR(countingStream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10508 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10509 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10510 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10511 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10512 | } |
| 10513 | countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10514 | } |
| 10515 | uint32_t packetSize_vkCreateMirSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10516 | countingStream->rewind(); |
| 10517 | uint32_t opcode_vkCreateMirSurfaceKHR = OP_vkCreateMirSurfaceKHR; |
| 10518 | stream->write(&opcode_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| 10519 | stream->write(&packetSize_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10520 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10521 | marshal_VkMirSurfaceCreateInfoKHR(stream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10522 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10523 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10524 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10525 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10526 | } |
| 10527 | stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10528 | stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10529 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10530 | VkResult vkCreateMirSurfaceKHR_VkResult_return = (VkResult)0; |
| 10531 | stream->read(&vkCreateMirSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| 10532 | return vkCreateMirSurfaceKHR_VkResult_return; |
| 10533 | } |
| 10534 | |
| 10535 | VkBool32 VkEncoder::vkGetPhysicalDeviceMirPresentationSupportKHR( |
| 10536 | VkPhysicalDevice physicalDevice, |
| 10537 | uint32_t queueFamilyIndex, |
| 10538 | MirConnection* connection) |
| 10539 | { |
| 10540 | auto stream = mImpl->stream(); |
| 10541 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10542 | auto resources = mImpl->resources(); |
| 10543 | auto pool = mImpl->pool(); |
| 10544 | VkPhysicalDevice local_physicalDevice; |
| 10545 | local_physicalDevice = physicalDevice; |
| 10546 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 10547 | uint32_t local_queueFamilyIndex; |
| 10548 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10549 | countingStream->rewind(); |
| 10550 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10551 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10552 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10553 | countingStream->write((MirConnection*)connection, sizeof(MirConnection)); |
| 10554 | } |
| 10555 | uint32_t packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10556 | countingStream->rewind(); |
| 10557 | uint32_t opcode_vkGetPhysicalDeviceMirPresentationSupportKHR = OP_vkGetPhysicalDeviceMirPresentationSupportKHR; |
| 10558 | stream->write(&opcode_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| 10559 | stream->write(&packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10560 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10561 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10562 | stream->write((MirConnection*)connection, sizeof(MirConnection)); |
| 10563 | stream->read((MirConnection*)connection, sizeof(MirConnection)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10564 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10565 | VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 10566 | stream->read(&vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| 10567 | return vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return; |
| 10568 | } |
| 10569 | |
| 10570 | #endif |
| 10571 | #ifdef VK_KHR_android_surface |
| 10572 | VkResult VkEncoder::vkCreateAndroidSurfaceKHR( |
| 10573 | VkInstance instance, |
| 10574 | const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
| 10575 | const VkAllocationCallbacks* pAllocator, |
| 10576 | VkSurfaceKHR* pSurface) |
| 10577 | { |
| 10578 | auto stream = mImpl->stream(); |
| 10579 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10580 | auto resources = mImpl->resources(); |
| 10581 | auto pool = mImpl->pool(); |
| 10582 | VkInstance local_instance; |
| 10583 | local_instance = instance; |
| 10584 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 10585 | VkAndroidSurfaceCreateInfoKHR* local_pCreateInfo; |
| 10586 | local_pCreateInfo = nullptr; |
| 10587 | if (pCreateInfo) |
| 10588 | { |
| 10589 | local_pCreateInfo = (VkAndroidSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkAndroidSurfaceCreateInfoKHR)); |
| 10590 | deepcopy_VkAndroidSurfaceCreateInfoKHR(pool, pCreateInfo, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10591 | } |
| 10592 | if (local_pCreateInfo) |
| 10593 | { |
| 10594 | handlemap_VkAndroidSurfaceCreateInfoKHR(resources->unwrapMapping(), (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10595 | } |
| 10596 | VkAllocationCallbacks* local_pAllocator; |
| 10597 | local_pAllocator = nullptr; |
| 10598 | if (pAllocator) |
| 10599 | { |
| 10600 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10601 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10602 | } |
| 10603 | if (local_pAllocator) |
| 10604 | { |
| 10605 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 10606 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 10607 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10608 | countingStream->rewind(); |
| 10609 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10610 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10611 | marshal_VkAndroidSurfaceCreateInfoKHR(countingStream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10612 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10613 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10614 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10615 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10616 | } |
| 10617 | countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10618 | } |
| 10619 | uint32_t packetSize_vkCreateAndroidSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10620 | countingStream->rewind(); |
| 10621 | uint32_t opcode_vkCreateAndroidSurfaceKHR = OP_vkCreateAndroidSurfaceKHR; |
| 10622 | stream->write(&opcode_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| 10623 | stream->write(&packetSize_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10624 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10625 | marshal_VkAndroidSurfaceCreateInfoKHR(stream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10626 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10627 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10628 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10629 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10630 | } |
| 10631 | stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10632 | stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10633 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10634 | VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0; |
| 10635 | stream->read(&vkCreateAndroidSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| 10636 | return vkCreateAndroidSurfaceKHR_VkResult_return; |
| 10637 | } |
| 10638 | |
| 10639 | #endif |
| 10640 | #ifdef VK_KHR_win32_surface |
| 10641 | VkResult VkEncoder::vkCreateWin32SurfaceKHR( |
| 10642 | VkInstance instance, |
| 10643 | const VkWin32SurfaceCreateInfoKHR* pCreateInfo, |
| 10644 | const VkAllocationCallbacks* pAllocator, |
| 10645 | VkSurfaceKHR* pSurface) |
| 10646 | { |
| 10647 | auto stream = mImpl->stream(); |
| 10648 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10649 | auto resources = mImpl->resources(); |
| 10650 | auto pool = mImpl->pool(); |
| 10651 | VkInstance local_instance; |
| 10652 | local_instance = instance; |
| 10653 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 10654 | VkWin32SurfaceCreateInfoKHR* local_pCreateInfo; |
| 10655 | local_pCreateInfo = nullptr; |
| 10656 | if (pCreateInfo) |
| 10657 | { |
| 10658 | local_pCreateInfo = (VkWin32SurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWin32SurfaceCreateInfoKHR)); |
| 10659 | deepcopy_VkWin32SurfaceCreateInfoKHR(pool, pCreateInfo, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10660 | } |
| 10661 | if (local_pCreateInfo) |
| 10662 | { |
| 10663 | handlemap_VkWin32SurfaceCreateInfoKHR(resources->unwrapMapping(), (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10664 | } |
| 10665 | VkAllocationCallbacks* local_pAllocator; |
| 10666 | local_pAllocator = nullptr; |
| 10667 | if (pAllocator) |
| 10668 | { |
| 10669 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10670 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10671 | } |
| 10672 | if (local_pAllocator) |
| 10673 | { |
| 10674 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 10675 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 10676 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10677 | countingStream->rewind(); |
| 10678 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10679 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10680 | marshal_VkWin32SurfaceCreateInfoKHR(countingStream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10681 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10682 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10683 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10684 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10685 | } |
| 10686 | countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10687 | } |
| 10688 | uint32_t packetSize_vkCreateWin32SurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10689 | countingStream->rewind(); |
| 10690 | uint32_t opcode_vkCreateWin32SurfaceKHR = OP_vkCreateWin32SurfaceKHR; |
| 10691 | stream->write(&opcode_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| 10692 | stream->write(&packetSize_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10693 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 10694 | marshal_VkWin32SurfaceCreateInfoKHR(stream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 10695 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 10696 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10697 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10698 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10699 | } |
| 10700 | stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 10701 | stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10702 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10703 | VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0; |
| 10704 | stream->read(&vkCreateWin32SurfaceKHR_VkResult_return, sizeof(VkResult)); |
| 10705 | return vkCreateWin32SurfaceKHR_VkResult_return; |
| 10706 | } |
| 10707 | |
| 10708 | VkBool32 VkEncoder::vkGetPhysicalDeviceWin32PresentationSupportKHR( |
| 10709 | VkPhysicalDevice physicalDevice, |
| 10710 | uint32_t queueFamilyIndex) |
| 10711 | { |
| 10712 | auto stream = mImpl->stream(); |
| 10713 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10714 | auto resources = mImpl->resources(); |
| 10715 | auto pool = mImpl->pool(); |
| 10716 | VkPhysicalDevice local_physicalDevice; |
| 10717 | local_physicalDevice = physicalDevice; |
| 10718 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 10719 | uint32_t local_queueFamilyIndex; |
| 10720 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10721 | countingStream->rewind(); |
| 10722 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10723 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10724 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10725 | } |
| 10726 | uint32_t packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10727 | countingStream->rewind(); |
| 10728 | uint32_t opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR = OP_vkGetPhysicalDeviceWin32PresentationSupportKHR; |
| 10729 | stream->write(&opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| 10730 | stream->write(&packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10731 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10732 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 10733 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10734 | VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 10735 | stream->read(&vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| 10736 | return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return; |
| 10737 | } |
| 10738 | |
| 10739 | #endif |
| 10740 | #ifdef VK_KHR_sampler_mirror_clamp_to_edge |
| 10741 | #endif |
| 10742 | #ifdef VK_KHR_multiview |
| 10743 | #endif |
| 10744 | #ifdef VK_KHR_get_physical_device_properties2 |
| 10745 | void VkEncoder::vkGetPhysicalDeviceFeatures2KHR( |
| 10746 | VkPhysicalDevice physicalDevice, |
| 10747 | VkPhysicalDeviceFeatures2* pFeatures) |
| 10748 | { |
| 10749 | auto stream = mImpl->stream(); |
| 10750 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10751 | auto resources = mImpl->resources(); |
| 10752 | auto pool = mImpl->pool(); |
| 10753 | VkPhysicalDevice local_physicalDevice; |
| 10754 | local_physicalDevice = physicalDevice; |
| 10755 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10756 | countingStream->rewind(); |
| 10757 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10758 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10759 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 10760 | } |
| 10761 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10762 | countingStream->rewind(); |
| 10763 | uint32_t opcode_vkGetPhysicalDeviceFeatures2KHR = OP_vkGetPhysicalDeviceFeatures2KHR; |
| 10764 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| 10765 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10766 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10767 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 10768 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10769 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10770 | } |
| 10771 | |
| 10772 | void VkEncoder::vkGetPhysicalDeviceProperties2KHR( |
| 10773 | VkPhysicalDevice physicalDevice, |
| 10774 | VkPhysicalDeviceProperties2* pProperties) |
| 10775 | { |
| 10776 | auto stream = mImpl->stream(); |
| 10777 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10778 | auto resources = mImpl->resources(); |
| 10779 | auto pool = mImpl->pool(); |
| 10780 | VkPhysicalDevice local_physicalDevice; |
| 10781 | local_physicalDevice = physicalDevice; |
| 10782 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10783 | countingStream->rewind(); |
| 10784 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10785 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10786 | marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10787 | } |
| 10788 | uint32_t packetSize_vkGetPhysicalDeviceProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10789 | countingStream->rewind(); |
| 10790 | uint32_t opcode_vkGetPhysicalDeviceProperties2KHR = OP_vkGetPhysicalDeviceProperties2KHR; |
| 10791 | stream->write(&opcode_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| 10792 | stream->write(&packetSize_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10793 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10794 | marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10795 | unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10796 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10797 | } |
| 10798 | |
| 10799 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2KHR( |
| 10800 | VkPhysicalDevice physicalDevice, |
| 10801 | VkFormat format, |
| 10802 | VkFormatProperties2* pFormatProperties) |
| 10803 | { |
| 10804 | auto stream = mImpl->stream(); |
| 10805 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10806 | auto resources = mImpl->resources(); |
| 10807 | auto pool = mImpl->pool(); |
| 10808 | VkPhysicalDevice local_physicalDevice; |
| 10809 | local_physicalDevice = physicalDevice; |
| 10810 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 10811 | VkFormat local_format; |
| 10812 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10813 | countingStream->rewind(); |
| 10814 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10815 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10816 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10817 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 10818 | } |
| 10819 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10820 | countingStream->rewind(); |
| 10821 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2KHR = OP_vkGetPhysicalDeviceFormatProperties2KHR; |
| 10822 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| 10823 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10824 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10825 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10826 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| 10827 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10828 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10829 | } |
| 10830 | |
| 10831 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2KHR( |
| 10832 | VkPhysicalDevice physicalDevice, |
| 10833 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 10834 | VkImageFormatProperties2* pImageFormatProperties) |
| 10835 | { |
| 10836 | auto stream = mImpl->stream(); |
| 10837 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10838 | auto resources = mImpl->resources(); |
| 10839 | auto pool = mImpl->pool(); |
| 10840 | VkPhysicalDevice local_physicalDevice; |
| 10841 | local_physicalDevice = physicalDevice; |
| 10842 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 10843 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| 10844 | local_pImageFormatInfo = nullptr; |
| 10845 | if (pImageFormatInfo) |
| 10846 | { |
| 10847 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 10848 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 10849 | } |
| 10850 | if (local_pImageFormatInfo) |
| 10851 | { |
| 10852 | handlemap_VkPhysicalDeviceImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 10853 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10854 | countingStream->rewind(); |
| 10855 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10856 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10857 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10858 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 10859 | } |
| 10860 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10861 | countingStream->rewind(); |
| 10862 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2KHR = OP_vkGetPhysicalDeviceImageFormatProperties2KHR; |
| 10863 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| 10864 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10865 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 10866 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10867 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 10868 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10869 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10870 | VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0; |
| 10871 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return, sizeof(VkResult)); |
| 10872 | return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return; |
| 10873 | } |
| 10874 | |
| 10875 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2KHR( |
| 10876 | VkPhysicalDevice physicalDevice, |
| 10877 | uint32_t* pQueueFamilyPropertyCount, |
| 10878 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 10879 | { |
| 10880 | auto stream = mImpl->stream(); |
| 10881 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10882 | auto resources = mImpl->resources(); |
| 10883 | auto pool = mImpl->pool(); |
| 10884 | VkPhysicalDevice local_physicalDevice; |
| 10885 | local_physicalDevice = physicalDevice; |
| 10886 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10887 | countingStream->rewind(); |
| 10888 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10889 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10890 | countingStream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*)); |
| 10891 | if (pQueueFamilyPropertyCount) |
| 10892 | { |
| 10893 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10894 | } |
| 10895 | countingStream->write((VkQueueFamilyProperties2**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*)); |
| 10896 | if (pQueueFamilyProperties) |
| 10897 | { |
| 10898 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10899 | { |
| 10900 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10901 | } |
| 10902 | } |
| 10903 | } |
| 10904 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10905 | countingStream->rewind(); |
| 10906 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR = OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR; |
| 10907 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| 10908 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10909 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10910 | stream->write((uint32_t**)&pQueueFamilyPropertyCount, sizeof(uint32_t*)); |
| 10911 | if (pQueueFamilyPropertyCount) |
| 10912 | { |
| 10913 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10914 | } |
| 10915 | stream->write((VkQueueFamilyProperties2**)&pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*)); |
| 10916 | if (pQueueFamilyProperties) |
| 10917 | { |
| 10918 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10919 | { |
| 10920 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10921 | } |
| 10922 | } |
| 10923 | uint32_t* check_pQueueFamilyPropertyCount; |
| 10924 | stream->read((uint32_t**)&check_pQueueFamilyPropertyCount, sizeof(uint32_t*)); |
| 10925 | if (pQueueFamilyPropertyCount) |
| 10926 | { |
| 10927 | if (!(check_pQueueFamilyPropertyCount)) |
| 10928 | { |
| 10929 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 10930 | } |
| 10931 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10932 | } |
| 10933 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| 10934 | stream->read((VkQueueFamilyProperties2**)&check_pQueueFamilyProperties, sizeof(VkQueueFamilyProperties2*)); |
| 10935 | if (pQueueFamilyProperties) |
| 10936 | { |
| 10937 | if (!(check_pQueueFamilyProperties)) |
| 10938 | { |
| 10939 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 10940 | } |
| 10941 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10942 | { |
| 10943 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10944 | } |
| 10945 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10946 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10947 | } |
| 10948 | |
| 10949 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2KHR( |
| 10950 | VkPhysicalDevice physicalDevice, |
| 10951 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 10952 | { |
| 10953 | auto stream = mImpl->stream(); |
| 10954 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10955 | auto resources = mImpl->resources(); |
| 10956 | auto pool = mImpl->pool(); |
| 10957 | VkPhysicalDevice local_physicalDevice; |
| 10958 | local_physicalDevice = physicalDevice; |
| 10959 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10960 | countingStream->rewind(); |
| 10961 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10962 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10963 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10964 | } |
| 10965 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10966 | countingStream->rewind(); |
| 10967 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2KHR = OP_vkGetPhysicalDeviceMemoryProperties2KHR; |
| 10968 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| 10969 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10970 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10971 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10972 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10973 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10974 | } |
| 10975 | |
| 10976 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 10977 | VkPhysicalDevice physicalDevice, |
| 10978 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 10979 | uint32_t* pPropertyCount, |
| 10980 | VkSparseImageFormatProperties2* pProperties) |
| 10981 | { |
| 10982 | auto stream = mImpl->stream(); |
| 10983 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10984 | auto resources = mImpl->resources(); |
| 10985 | auto pool = mImpl->pool(); |
| 10986 | VkPhysicalDevice local_physicalDevice; |
| 10987 | local_physicalDevice = physicalDevice; |
| 10988 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 10989 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| 10990 | local_pFormatInfo = nullptr; |
| 10991 | if (pFormatInfo) |
| 10992 | { |
| 10993 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 10994 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 10995 | } |
| 10996 | if (local_pFormatInfo) |
| 10997 | { |
| 10998 | handlemap_VkPhysicalDeviceSparseImageFormatInfo2(resources->unwrapMapping(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 10999 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11000 | countingStream->rewind(); |
| 11001 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11002 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 11003 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11004 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 11005 | if (pPropertyCount) |
| 11006 | { |
| 11007 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11008 | } |
| 11009 | countingStream->write((VkSparseImageFormatProperties2**)&pProperties, sizeof(VkSparseImageFormatProperties2*)); |
| 11010 | if (pProperties) |
| 11011 | { |
| 11012 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11013 | { |
| 11014 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 11015 | } |
| 11016 | } |
| 11017 | } |
| 11018 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11019 | countingStream->rewind(); |
| 11020 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR; |
| 11021 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| 11022 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11023 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 11024 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11025 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 11026 | if (pPropertyCount) |
| 11027 | { |
| 11028 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11029 | } |
| 11030 | stream->write((VkSparseImageFormatProperties2**)&pProperties, sizeof(VkSparseImageFormatProperties2*)); |
| 11031 | if (pProperties) |
| 11032 | { |
| 11033 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11034 | { |
| 11035 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 11036 | } |
| 11037 | } |
| 11038 | uint32_t* check_pPropertyCount; |
| 11039 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 11040 | if (pPropertyCount) |
| 11041 | { |
| 11042 | if (!(check_pPropertyCount)) |
| 11043 | { |
| 11044 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 11045 | } |
| 11046 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11047 | } |
| 11048 | VkSparseImageFormatProperties2* check_pProperties; |
| 11049 | stream->read((VkSparseImageFormatProperties2**)&check_pProperties, sizeof(VkSparseImageFormatProperties2*)); |
| 11050 | if (pProperties) |
| 11051 | { |
| 11052 | if (!(check_pProperties)) |
| 11053 | { |
| 11054 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 11055 | } |
| 11056 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11057 | { |
| 11058 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 11059 | } |
| 11060 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11061 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11062 | } |
| 11063 | |
| 11064 | #endif |
| 11065 | #ifdef VK_KHR_device_group |
| 11066 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeaturesKHR( |
| 11067 | VkDevice device, |
| 11068 | uint32_t heapIndex, |
| 11069 | uint32_t localDeviceIndex, |
| 11070 | uint32_t remoteDeviceIndex, |
| 11071 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 11072 | { |
| 11073 | auto stream = mImpl->stream(); |
| 11074 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11075 | auto resources = mImpl->resources(); |
| 11076 | auto pool = mImpl->pool(); |
| 11077 | VkDevice local_device; |
| 11078 | local_device = device; |
| 11079 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11080 | uint32_t local_heapIndex; |
| 11081 | local_heapIndex = heapIndex; |
| 11082 | uint32_t local_localDeviceIndex; |
| 11083 | local_localDeviceIndex = localDeviceIndex; |
| 11084 | uint32_t local_remoteDeviceIndex; |
| 11085 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11086 | countingStream->rewind(); |
| 11087 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11088 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11089 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 11090 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 11091 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11092 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 11093 | } |
| 11094 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11095 | countingStream->rewind(); |
| 11096 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR = OP_vkGetDeviceGroupPeerMemoryFeaturesKHR; |
| 11097 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| 11098 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11099 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11100 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 11101 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 11102 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11103 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 11104 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11105 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11106 | } |
| 11107 | |
| 11108 | void VkEncoder::vkCmdSetDeviceMaskKHR( |
| 11109 | VkCommandBuffer commandBuffer, |
| 11110 | uint32_t deviceMask) |
| 11111 | { |
| 11112 | auto stream = mImpl->stream(); |
| 11113 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11114 | auto resources = mImpl->resources(); |
| 11115 | auto pool = mImpl->pool(); |
| 11116 | VkCommandBuffer local_commandBuffer; |
| 11117 | local_commandBuffer = commandBuffer; |
| 11118 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 11119 | uint32_t local_deviceMask; |
| 11120 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11121 | countingStream->rewind(); |
| 11122 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11123 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 11124 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11125 | } |
| 11126 | uint32_t packetSize_vkCmdSetDeviceMaskKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11127 | countingStream->rewind(); |
| 11128 | uint32_t opcode_vkCmdSetDeviceMaskKHR = OP_vkCmdSetDeviceMaskKHR; |
| 11129 | stream->write(&opcode_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| 11130 | stream->write(&packetSize_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11131 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 11132 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| 11133 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11134 | } |
| 11135 | |
| 11136 | void VkEncoder::vkCmdDispatchBaseKHR( |
| 11137 | VkCommandBuffer commandBuffer, |
| 11138 | uint32_t baseGroupX, |
| 11139 | uint32_t baseGroupY, |
| 11140 | uint32_t baseGroupZ, |
| 11141 | uint32_t groupCountX, |
| 11142 | uint32_t groupCountY, |
| 11143 | uint32_t groupCountZ) |
| 11144 | { |
| 11145 | auto stream = mImpl->stream(); |
| 11146 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11147 | auto resources = mImpl->resources(); |
| 11148 | auto pool = mImpl->pool(); |
| 11149 | VkCommandBuffer local_commandBuffer; |
| 11150 | local_commandBuffer = commandBuffer; |
| 11151 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 11152 | uint32_t local_baseGroupX; |
| 11153 | local_baseGroupX = baseGroupX; |
| 11154 | uint32_t local_baseGroupY; |
| 11155 | local_baseGroupY = baseGroupY; |
| 11156 | uint32_t local_baseGroupZ; |
| 11157 | local_baseGroupZ = baseGroupZ; |
| 11158 | uint32_t local_groupCountX; |
| 11159 | local_groupCountX = groupCountX; |
| 11160 | uint32_t local_groupCountY; |
| 11161 | local_groupCountY = groupCountY; |
| 11162 | uint32_t local_groupCountZ; |
| 11163 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11164 | countingStream->rewind(); |
| 11165 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11166 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 11167 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 11168 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 11169 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 11170 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 11171 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 11172 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11173 | } |
| 11174 | uint32_t packetSize_vkCmdDispatchBaseKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11175 | countingStream->rewind(); |
| 11176 | uint32_t opcode_vkCmdDispatchBaseKHR = OP_vkCmdDispatchBaseKHR; |
| 11177 | stream->write(&opcode_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| 11178 | stream->write(&packetSize_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11179 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 11180 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 11181 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 11182 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 11183 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 11184 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 11185 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| 11186 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11187 | } |
| 11188 | |
| 11189 | #endif |
| 11190 | #ifdef VK_KHR_shader_draw_parameters |
| 11191 | #endif |
| 11192 | #ifdef VK_KHR_maintenance1 |
| 11193 | void VkEncoder::vkTrimCommandPoolKHR( |
| 11194 | VkDevice device, |
| 11195 | VkCommandPool commandPool, |
| 11196 | VkCommandPoolTrimFlags flags) |
| 11197 | { |
| 11198 | auto stream = mImpl->stream(); |
| 11199 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11200 | auto resources = mImpl->resources(); |
| 11201 | auto pool = mImpl->pool(); |
| 11202 | VkDevice local_device; |
| 11203 | local_device = device; |
| 11204 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11205 | VkCommandPool local_commandPool; |
| 11206 | local_commandPool = commandPool; |
| 11207 | resources->unwrapMapping()->mapHandles_VkCommandPool((VkCommandPool*)&local_commandPool); |
| 11208 | VkCommandPoolTrimFlags local_flags; |
| 11209 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11210 | countingStream->rewind(); |
| 11211 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11212 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11213 | countingStream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool)); |
| 11214 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11215 | } |
| 11216 | uint32_t packetSize_vkTrimCommandPoolKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11217 | countingStream->rewind(); |
| 11218 | uint32_t opcode_vkTrimCommandPoolKHR = OP_vkTrimCommandPoolKHR; |
| 11219 | stream->write(&opcode_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| 11220 | stream->write(&packetSize_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11221 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11222 | stream->write((VkCommandPool*)&local_commandPool, sizeof(VkCommandPool)); |
| 11223 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| 11224 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11225 | } |
| 11226 | |
| 11227 | #endif |
| 11228 | #ifdef VK_KHR_device_group_creation |
| 11229 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroupsKHR( |
| 11230 | VkInstance instance, |
| 11231 | uint32_t* pPhysicalDeviceGroupCount, |
| 11232 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 11233 | { |
| 11234 | auto stream = mImpl->stream(); |
| 11235 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11236 | auto resources = mImpl->resources(); |
| 11237 | auto pool = mImpl->pool(); |
| 11238 | VkInstance local_instance; |
| 11239 | local_instance = instance; |
| 11240 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11241 | countingStream->rewind(); |
| 11242 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11243 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11244 | countingStream->write((uint32_t**)&pPhysicalDeviceGroupCount, sizeof(uint32_t*)); |
| 11245 | if (pPhysicalDeviceGroupCount) |
| 11246 | { |
| 11247 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 11248 | } |
| 11249 | countingStream->write((VkPhysicalDeviceGroupProperties**)&pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*)); |
| 11250 | if (pPhysicalDeviceGroupProperties) |
| 11251 | { |
| 11252 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 11253 | { |
| 11254 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 11255 | } |
| 11256 | } |
| 11257 | } |
| 11258 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroupsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11259 | countingStream->rewind(); |
| 11260 | uint32_t opcode_vkEnumeratePhysicalDeviceGroupsKHR = OP_vkEnumeratePhysicalDeviceGroupsKHR; |
| 11261 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| 11262 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11263 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11264 | stream->write((uint32_t**)&pPhysicalDeviceGroupCount, sizeof(uint32_t*)); |
| 11265 | if (pPhysicalDeviceGroupCount) |
| 11266 | { |
| 11267 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 11268 | } |
| 11269 | stream->write((VkPhysicalDeviceGroupProperties**)&pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*)); |
| 11270 | if (pPhysicalDeviceGroupProperties) |
| 11271 | { |
| 11272 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 11273 | { |
| 11274 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 11275 | } |
| 11276 | } |
| 11277 | uint32_t* check_pPhysicalDeviceGroupCount; |
| 11278 | stream->read((uint32_t**)&check_pPhysicalDeviceGroupCount, sizeof(uint32_t*)); |
| 11279 | if (pPhysicalDeviceGroupCount) |
| 11280 | { |
| 11281 | if (!(check_pPhysicalDeviceGroupCount)) |
| 11282 | { |
| 11283 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 11284 | } |
| 11285 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 11286 | } |
| 11287 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| 11288 | stream->read((VkPhysicalDeviceGroupProperties**)&check_pPhysicalDeviceGroupProperties, sizeof(VkPhysicalDeviceGroupProperties*)); |
| 11289 | if (pPhysicalDeviceGroupProperties) |
| 11290 | { |
| 11291 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 11292 | { |
| 11293 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 11294 | } |
| 11295 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 11296 | { |
| 11297 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 11298 | } |
| 11299 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11300 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11301 | VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0; |
| 11302 | stream->read(&vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return, sizeof(VkResult)); |
| 11303 | return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return; |
| 11304 | } |
| 11305 | |
| 11306 | #endif |
| 11307 | #ifdef VK_KHR_external_memory_capabilities |
| 11308 | void VkEncoder::vkGetPhysicalDeviceExternalBufferPropertiesKHR( |
| 11309 | VkPhysicalDevice physicalDevice, |
| 11310 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 11311 | VkExternalBufferProperties* pExternalBufferProperties) |
| 11312 | { |
| 11313 | auto stream = mImpl->stream(); |
| 11314 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11315 | auto resources = mImpl->resources(); |
| 11316 | auto pool = mImpl->pool(); |
| 11317 | VkPhysicalDevice local_physicalDevice; |
| 11318 | local_physicalDevice = physicalDevice; |
| 11319 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 11320 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| 11321 | local_pExternalBufferInfo = nullptr; |
| 11322 | if (pExternalBufferInfo) |
| 11323 | { |
| 11324 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 11325 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 11326 | } |
| 11327 | if (local_pExternalBufferInfo) |
| 11328 | { |
| 11329 | handlemap_VkPhysicalDeviceExternalBufferInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 11330 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11331 | countingStream->rewind(); |
| 11332 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11333 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 11334 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11335 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 11336 | } |
| 11337 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11338 | countingStream->rewind(); |
| 11339 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR = OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR; |
| 11340 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| 11341 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11342 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 11343 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11344 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 11345 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11346 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11347 | } |
| 11348 | |
| 11349 | #endif |
| 11350 | #ifdef VK_KHR_external_memory |
| 11351 | #endif |
| 11352 | #ifdef VK_KHR_external_memory_win32 |
| 11353 | VkResult VkEncoder::vkGetMemoryWin32HandleKHR( |
| 11354 | VkDevice device, |
| 11355 | const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 11356 | HANDLE* pHandle) |
| 11357 | { |
| 11358 | auto stream = mImpl->stream(); |
| 11359 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11360 | auto resources = mImpl->resources(); |
| 11361 | auto pool = mImpl->pool(); |
| 11362 | VkDevice local_device; |
| 11363 | local_device = device; |
| 11364 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11365 | VkMemoryGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| 11366 | local_pGetWin32HandleInfo = nullptr; |
| 11367 | if (pGetWin32HandleInfo) |
| 11368 | { |
| 11369 | local_pGetWin32HandleInfo = (VkMemoryGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkMemoryGetWin32HandleInfoKHR)); |
| 11370 | deepcopy_VkMemoryGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 11371 | } |
| 11372 | if (local_pGetWin32HandleInfo) |
| 11373 | { |
| 11374 | handlemap_VkMemoryGetWin32HandleInfoKHR(resources->unwrapMapping(), (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 11375 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11376 | countingStream->rewind(); |
| 11377 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11378 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11379 | marshal_VkMemoryGetWin32HandleInfoKHR(countingStream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11380 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 11381 | } |
| 11382 | uint32_t packetSize_vkGetMemoryWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11383 | countingStream->rewind(); |
| 11384 | uint32_t opcode_vkGetMemoryWin32HandleKHR = OP_vkGetMemoryWin32HandleKHR; |
| 11385 | stream->write(&opcode_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| 11386 | stream->write(&packetSize_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11387 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11388 | marshal_VkMemoryGetWin32HandleInfoKHR(stream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11389 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 11390 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11391 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11392 | VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0; |
| 11393 | stream->read(&vkGetMemoryWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| 11394 | return vkGetMemoryWin32HandleKHR_VkResult_return; |
| 11395 | } |
| 11396 | |
| 11397 | VkResult VkEncoder::vkGetMemoryWin32HandlePropertiesKHR( |
| 11398 | VkDevice device, |
| 11399 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 11400 | HANDLE handle, |
| 11401 | VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) |
| 11402 | { |
| 11403 | auto stream = mImpl->stream(); |
| 11404 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11405 | auto resources = mImpl->resources(); |
| 11406 | auto pool = mImpl->pool(); |
| 11407 | VkDevice local_device; |
| 11408 | local_device = device; |
| 11409 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11410 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| 11411 | local_handleType = handleType; |
| 11412 | HANDLE local_handle; |
| 11413 | local_handle = handle; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11414 | countingStream->rewind(); |
| 11415 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11416 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11417 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 11418 | countingStream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11419 | marshal_VkMemoryWin32HandlePropertiesKHR(countingStream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 11420 | } |
| 11421 | uint32_t packetSize_vkGetMemoryWin32HandlePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11422 | countingStream->rewind(); |
| 11423 | uint32_t opcode_vkGetMemoryWin32HandlePropertiesKHR = OP_vkGetMemoryWin32HandlePropertiesKHR; |
| 11424 | stream->write(&opcode_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| 11425 | stream->write(&packetSize_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11426 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11427 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 11428 | stream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11429 | marshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 11430 | unmarshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11431 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11432 | VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0; |
| 11433 | stream->read(&vkGetMemoryWin32HandlePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| 11434 | return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return; |
| 11435 | } |
| 11436 | |
| 11437 | #endif |
| 11438 | #ifdef VK_KHR_external_memory_fd |
| 11439 | VkResult VkEncoder::vkGetMemoryFdKHR( |
| 11440 | VkDevice device, |
| 11441 | const VkMemoryGetFdInfoKHR* pGetFdInfo, |
| 11442 | int* pFd) |
| 11443 | { |
| 11444 | auto stream = mImpl->stream(); |
| 11445 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11446 | auto resources = mImpl->resources(); |
| 11447 | auto pool = mImpl->pool(); |
| 11448 | VkDevice local_device; |
| 11449 | local_device = device; |
| 11450 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11451 | VkMemoryGetFdInfoKHR* local_pGetFdInfo; |
| 11452 | local_pGetFdInfo = nullptr; |
| 11453 | if (pGetFdInfo) |
| 11454 | { |
| 11455 | local_pGetFdInfo = (VkMemoryGetFdInfoKHR*)pool->alloc(sizeof(const VkMemoryGetFdInfoKHR)); |
| 11456 | deepcopy_VkMemoryGetFdInfoKHR(pool, pGetFdInfo, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| 11457 | } |
| 11458 | if (local_pGetFdInfo) |
| 11459 | { |
| 11460 | handlemap_VkMemoryGetFdInfoKHR(resources->unwrapMapping(), (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| 11461 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11462 | countingStream->rewind(); |
| 11463 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11464 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11465 | marshal_VkMemoryGetFdInfoKHR(countingStream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11466 | countingStream->write((int*)pFd, sizeof(int)); |
| 11467 | } |
| 11468 | uint32_t packetSize_vkGetMemoryFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11469 | countingStream->rewind(); |
| 11470 | uint32_t opcode_vkGetMemoryFdKHR = OP_vkGetMemoryFdKHR; |
| 11471 | stream->write(&opcode_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| 11472 | stream->write(&packetSize_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11473 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11474 | marshal_VkMemoryGetFdInfoKHR(stream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11475 | stream->write((int*)pFd, sizeof(int)); |
| 11476 | stream->read((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11477 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11478 | VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0; |
| 11479 | stream->read(&vkGetMemoryFdKHR_VkResult_return, sizeof(VkResult)); |
| 11480 | return vkGetMemoryFdKHR_VkResult_return; |
| 11481 | } |
| 11482 | |
| 11483 | VkResult VkEncoder::vkGetMemoryFdPropertiesKHR( |
| 11484 | VkDevice device, |
| 11485 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 11486 | int fd, |
| 11487 | VkMemoryFdPropertiesKHR* pMemoryFdProperties) |
| 11488 | { |
| 11489 | auto stream = mImpl->stream(); |
| 11490 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11491 | auto resources = mImpl->resources(); |
| 11492 | auto pool = mImpl->pool(); |
| 11493 | VkDevice local_device; |
| 11494 | local_device = device; |
| 11495 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11496 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| 11497 | local_handleType = handleType; |
| 11498 | int local_fd; |
| 11499 | local_fd = fd; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11500 | countingStream->rewind(); |
| 11501 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11502 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11503 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 11504 | countingStream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11505 | marshal_VkMemoryFdPropertiesKHR(countingStream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 11506 | } |
| 11507 | uint32_t packetSize_vkGetMemoryFdPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11508 | countingStream->rewind(); |
| 11509 | uint32_t opcode_vkGetMemoryFdPropertiesKHR = OP_vkGetMemoryFdPropertiesKHR; |
| 11510 | stream->write(&opcode_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| 11511 | stream->write(&packetSize_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11512 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11513 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 11514 | stream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11515 | marshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 11516 | unmarshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11517 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11518 | VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0; |
| 11519 | stream->read(&vkGetMemoryFdPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| 11520 | return vkGetMemoryFdPropertiesKHR_VkResult_return; |
| 11521 | } |
| 11522 | |
| 11523 | #endif |
| 11524 | #ifdef VK_KHR_win32_keyed_mutex |
| 11525 | #endif |
| 11526 | #ifdef VK_KHR_external_semaphore_capabilities |
| 11527 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( |
| 11528 | VkPhysicalDevice physicalDevice, |
| 11529 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 11530 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 11531 | { |
| 11532 | auto stream = mImpl->stream(); |
| 11533 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11534 | auto resources = mImpl->resources(); |
| 11535 | auto pool = mImpl->pool(); |
| 11536 | VkPhysicalDevice local_physicalDevice; |
| 11537 | local_physicalDevice = physicalDevice; |
| 11538 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 11539 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| 11540 | local_pExternalSemaphoreInfo = nullptr; |
| 11541 | if (pExternalSemaphoreInfo) |
| 11542 | { |
| 11543 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 11544 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 11545 | } |
| 11546 | if (local_pExternalSemaphoreInfo) |
| 11547 | { |
| 11548 | handlemap_VkPhysicalDeviceExternalSemaphoreInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 11549 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11550 | countingStream->rewind(); |
| 11551 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11552 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 11553 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11554 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 11555 | } |
| 11556 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11557 | countingStream->rewind(); |
| 11558 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; |
| 11559 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| 11560 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11561 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 11562 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11563 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 11564 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11565 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11566 | } |
| 11567 | |
| 11568 | #endif |
| 11569 | #ifdef VK_KHR_external_semaphore |
| 11570 | #endif |
| 11571 | #ifdef VK_KHR_external_semaphore_win32 |
| 11572 | VkResult VkEncoder::vkImportSemaphoreWin32HandleKHR( |
| 11573 | VkDevice device, |
| 11574 | const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) |
| 11575 | { |
| 11576 | auto stream = mImpl->stream(); |
| 11577 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11578 | auto resources = mImpl->resources(); |
| 11579 | auto pool = mImpl->pool(); |
| 11580 | VkDevice local_device; |
| 11581 | local_device = device; |
| 11582 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11583 | VkImportSemaphoreWin32HandleInfoKHR* local_pImportSemaphoreWin32HandleInfo; |
| 11584 | local_pImportSemaphoreWin32HandleInfo = nullptr; |
| 11585 | if (pImportSemaphoreWin32HandleInfo) |
| 11586 | { |
| 11587 | local_pImportSemaphoreWin32HandleInfo = (VkImportSemaphoreWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreWin32HandleInfoKHR)); |
| 11588 | deepcopy_VkImportSemaphoreWin32HandleInfoKHR(pool, pImportSemaphoreWin32HandleInfo, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| 11589 | } |
| 11590 | if (local_pImportSemaphoreWin32HandleInfo) |
| 11591 | { |
| 11592 | handlemap_VkImportSemaphoreWin32HandleInfoKHR(resources->unwrapMapping(), (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| 11593 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11594 | countingStream->rewind(); |
| 11595 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11596 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11597 | marshal_VkImportSemaphoreWin32HandleInfoKHR(countingStream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11598 | } |
| 11599 | uint32_t packetSize_vkImportSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11600 | countingStream->rewind(); |
| 11601 | uint32_t opcode_vkImportSemaphoreWin32HandleKHR = OP_vkImportSemaphoreWin32HandleKHR; |
| 11602 | stream->write(&opcode_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 11603 | stream->write(&packetSize_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11604 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11605 | marshal_VkImportSemaphoreWin32HandleInfoKHR(stream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| 11606 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11607 | VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 11608 | stream->read(&vkImportSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| 11609 | return vkImportSemaphoreWin32HandleKHR_VkResult_return; |
| 11610 | } |
| 11611 | |
| 11612 | VkResult VkEncoder::vkGetSemaphoreWin32HandleKHR( |
| 11613 | VkDevice device, |
| 11614 | const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 11615 | HANDLE* pHandle) |
| 11616 | { |
| 11617 | auto stream = mImpl->stream(); |
| 11618 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11619 | auto resources = mImpl->resources(); |
| 11620 | auto pool = mImpl->pool(); |
| 11621 | VkDevice local_device; |
| 11622 | local_device = device; |
| 11623 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11624 | VkSemaphoreGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| 11625 | local_pGetWin32HandleInfo = nullptr; |
| 11626 | if (pGetWin32HandleInfo) |
| 11627 | { |
| 11628 | local_pGetWin32HandleInfo = (VkSemaphoreGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetWin32HandleInfoKHR)); |
| 11629 | deepcopy_VkSemaphoreGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 11630 | } |
| 11631 | if (local_pGetWin32HandleInfo) |
| 11632 | { |
| 11633 | handlemap_VkSemaphoreGetWin32HandleInfoKHR(resources->unwrapMapping(), (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 11634 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11635 | countingStream->rewind(); |
| 11636 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11637 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11638 | marshal_VkSemaphoreGetWin32HandleInfoKHR(countingStream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11639 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 11640 | } |
| 11641 | uint32_t packetSize_vkGetSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11642 | countingStream->rewind(); |
| 11643 | uint32_t opcode_vkGetSemaphoreWin32HandleKHR = OP_vkGetSemaphoreWin32HandleKHR; |
| 11644 | stream->write(&opcode_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 11645 | stream->write(&packetSize_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11646 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11647 | marshal_VkSemaphoreGetWin32HandleInfoKHR(stream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11648 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 11649 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11650 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11651 | VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 11652 | stream->read(&vkGetSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| 11653 | return vkGetSemaphoreWin32HandleKHR_VkResult_return; |
| 11654 | } |
| 11655 | |
| 11656 | #endif |
| 11657 | #ifdef VK_KHR_external_semaphore_fd |
| 11658 | VkResult VkEncoder::vkImportSemaphoreFdKHR( |
| 11659 | VkDevice device, |
| 11660 | const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) |
| 11661 | { |
| 11662 | auto stream = mImpl->stream(); |
| 11663 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11664 | auto resources = mImpl->resources(); |
| 11665 | auto pool = mImpl->pool(); |
| 11666 | VkDevice local_device; |
| 11667 | local_device = device; |
| 11668 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11669 | VkImportSemaphoreFdInfoKHR* local_pImportSemaphoreFdInfo; |
| 11670 | local_pImportSemaphoreFdInfo = nullptr; |
| 11671 | if (pImportSemaphoreFdInfo) |
| 11672 | { |
| 11673 | local_pImportSemaphoreFdInfo = (VkImportSemaphoreFdInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreFdInfoKHR)); |
| 11674 | deepcopy_VkImportSemaphoreFdInfoKHR(pool, pImportSemaphoreFdInfo, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| 11675 | } |
| 11676 | if (local_pImportSemaphoreFdInfo) |
| 11677 | { |
| 11678 | handlemap_VkImportSemaphoreFdInfoKHR(resources->unwrapMapping(), (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| 11679 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11680 | countingStream->rewind(); |
| 11681 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11682 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11683 | marshal_VkImportSemaphoreFdInfoKHR(countingStream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11684 | } |
| 11685 | uint32_t packetSize_vkImportSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11686 | countingStream->rewind(); |
| 11687 | uint32_t opcode_vkImportSemaphoreFdKHR = OP_vkImportSemaphoreFdKHR; |
| 11688 | stream->write(&opcode_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| 11689 | stream->write(&packetSize_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11690 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11691 | marshal_VkImportSemaphoreFdInfoKHR(stream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| 11692 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11693 | VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 11694 | stream->read(&vkImportSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| 11695 | return vkImportSemaphoreFdKHR_VkResult_return; |
| 11696 | } |
| 11697 | |
| 11698 | VkResult VkEncoder::vkGetSemaphoreFdKHR( |
| 11699 | VkDevice device, |
| 11700 | const VkSemaphoreGetFdInfoKHR* pGetFdInfo, |
| 11701 | int* pFd) |
| 11702 | { |
| 11703 | auto stream = mImpl->stream(); |
| 11704 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11705 | auto resources = mImpl->resources(); |
| 11706 | auto pool = mImpl->pool(); |
| 11707 | VkDevice local_device; |
| 11708 | local_device = device; |
| 11709 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11710 | VkSemaphoreGetFdInfoKHR* local_pGetFdInfo; |
| 11711 | local_pGetFdInfo = nullptr; |
| 11712 | if (pGetFdInfo) |
| 11713 | { |
| 11714 | local_pGetFdInfo = (VkSemaphoreGetFdInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetFdInfoKHR)); |
| 11715 | deepcopy_VkSemaphoreGetFdInfoKHR(pool, pGetFdInfo, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| 11716 | } |
| 11717 | if (local_pGetFdInfo) |
| 11718 | { |
| 11719 | handlemap_VkSemaphoreGetFdInfoKHR(resources->unwrapMapping(), (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| 11720 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11721 | countingStream->rewind(); |
| 11722 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11723 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11724 | marshal_VkSemaphoreGetFdInfoKHR(countingStream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11725 | countingStream->write((int*)pFd, sizeof(int)); |
| 11726 | } |
| 11727 | uint32_t packetSize_vkGetSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11728 | countingStream->rewind(); |
| 11729 | uint32_t opcode_vkGetSemaphoreFdKHR = OP_vkGetSemaphoreFdKHR; |
| 11730 | stream->write(&opcode_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| 11731 | stream->write(&packetSize_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11732 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11733 | marshal_VkSemaphoreGetFdInfoKHR(stream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11734 | stream->write((int*)pFd, sizeof(int)); |
| 11735 | stream->read((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11736 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11737 | VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 11738 | stream->read(&vkGetSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| 11739 | return vkGetSemaphoreFdKHR_VkResult_return; |
| 11740 | } |
| 11741 | |
| 11742 | #endif |
| 11743 | #ifdef VK_KHR_push_descriptor |
| 11744 | void VkEncoder::vkCmdPushDescriptorSetKHR( |
| 11745 | VkCommandBuffer commandBuffer, |
| 11746 | VkPipelineBindPoint pipelineBindPoint, |
| 11747 | VkPipelineLayout layout, |
| 11748 | uint32_t set, |
| 11749 | uint32_t descriptorWriteCount, |
| 11750 | const VkWriteDescriptorSet* pDescriptorWrites) |
| 11751 | { |
| 11752 | auto stream = mImpl->stream(); |
| 11753 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11754 | auto resources = mImpl->resources(); |
| 11755 | auto pool = mImpl->pool(); |
| 11756 | VkCommandBuffer local_commandBuffer; |
| 11757 | local_commandBuffer = commandBuffer; |
| 11758 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 11759 | VkPipelineBindPoint local_pipelineBindPoint; |
| 11760 | local_pipelineBindPoint = pipelineBindPoint; |
| 11761 | VkPipelineLayout local_layout; |
| 11762 | local_layout = layout; |
| 11763 | resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout); |
| 11764 | uint32_t local_set; |
| 11765 | local_set = set; |
| 11766 | uint32_t local_descriptorWriteCount; |
| 11767 | local_descriptorWriteCount = descriptorWriteCount; |
| 11768 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| 11769 | local_pDescriptorWrites = nullptr; |
| 11770 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11771 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11772 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11773 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 11774 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11775 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 11776 | } |
| 11777 | } |
| 11778 | if (local_pDescriptorWrites) |
| 11779 | { |
| 11780 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 11781 | { |
| 11782 | handlemap_VkWriteDescriptorSet(resources->unwrapMapping(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 11783 | } |
| 11784 | } |
| 11785 | countingStream->rewind(); |
| 11786 | { |
| 11787 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 11788 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| 11789 | countingStream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout)); |
| 11790 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 11791 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 11792 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 11793 | { |
| 11794 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11795 | } |
| 11796 | } |
| 11797 | uint32_t packetSize_vkCmdPushDescriptorSetKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11798 | countingStream->rewind(); |
| 11799 | uint32_t opcode_vkCmdPushDescriptorSetKHR = OP_vkCmdPushDescriptorSetKHR; |
| 11800 | stream->write(&opcode_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| 11801 | stream->write(&packetSize_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11802 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 11803 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| 11804 | stream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout)); |
| 11805 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 11806 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11807 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 11808 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11809 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11810 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11811 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11812 | } |
| 11813 | |
| 11814 | void VkEncoder::vkCmdPushDescriptorSetWithTemplateKHR( |
| 11815 | VkCommandBuffer commandBuffer, |
| 11816 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 11817 | VkPipelineLayout layout, |
| 11818 | uint32_t set, |
| 11819 | const void* pData) |
| 11820 | { |
| 11821 | auto stream = mImpl->stream(); |
| 11822 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11823 | auto resources = mImpl->resources(); |
| 11824 | auto pool = mImpl->pool(); |
| 11825 | VkCommandBuffer local_commandBuffer; |
| 11826 | local_commandBuffer = commandBuffer; |
| 11827 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 11828 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 11829 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 11830 | resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate); |
| 11831 | VkPipelineLayout local_layout; |
| 11832 | local_layout = layout; |
| 11833 | resources->unwrapMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&local_layout); |
| 11834 | uint32_t local_set; |
| 11835 | local_set = set; |
| 11836 | void* local_pData; |
| 11837 | local_pData = nullptr; |
| 11838 | if (pData) |
| 11839 | { |
| 11840 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 11841 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11842 | countingStream->rewind(); |
| 11843 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11844 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 11845 | countingStream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| 11846 | countingStream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout)); |
| 11847 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 11848 | countingStream->write((void**)&local_pData, sizeof(void*)); |
| 11849 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11850 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11851 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11852 | } |
| 11853 | } |
| 11854 | uint32_t packetSize_vkCmdPushDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11855 | countingStream->rewind(); |
| 11856 | uint32_t opcode_vkCmdPushDescriptorSetWithTemplateKHR = OP_vkCmdPushDescriptorSetWithTemplateKHR; |
| 11857 | stream->write(&opcode_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 11858 | stream->write(&packetSize_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11859 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 11860 | stream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| 11861 | stream->write((VkPipelineLayout*)&local_layout, sizeof(VkPipelineLayout)); |
| 11862 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 11863 | stream->write((void**)&local_pData, sizeof(void*)); |
| 11864 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11865 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11866 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11867 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11868 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11869 | } |
| 11870 | |
| 11871 | #endif |
| 11872 | #ifdef VK_KHR_16bit_storage |
| 11873 | #endif |
| 11874 | #ifdef VK_KHR_incremental_present |
| 11875 | #endif |
| 11876 | #ifdef VK_KHR_descriptor_update_template |
| 11877 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplateKHR( |
| 11878 | VkDevice device, |
| 11879 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 11880 | const VkAllocationCallbacks* pAllocator, |
| 11881 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 11882 | { |
| 11883 | auto stream = mImpl->stream(); |
| 11884 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11885 | auto resources = mImpl->resources(); |
| 11886 | auto pool = mImpl->pool(); |
| 11887 | VkDevice local_device; |
| 11888 | local_device = device; |
| 11889 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11890 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| 11891 | local_pCreateInfo = nullptr; |
| 11892 | if (pCreateInfo) |
| 11893 | { |
| 11894 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 11895 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 11896 | } |
| 11897 | if (local_pCreateInfo) |
| 11898 | { |
| 11899 | handlemap_VkDescriptorUpdateTemplateCreateInfo(resources->unwrapMapping(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 11900 | } |
| 11901 | VkAllocationCallbacks* local_pAllocator; |
| 11902 | local_pAllocator = nullptr; |
| 11903 | if (pAllocator) |
| 11904 | { |
| 11905 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11906 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11907 | } |
| 11908 | if (local_pAllocator) |
| 11909 | { |
| 11910 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 11911 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 11912 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11913 | countingStream->rewind(); |
| 11914 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11915 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11916 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 11917 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 11918 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11919 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11920 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11921 | } |
| 11922 | countingStream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| 11923 | } |
| 11924 | uint32_t packetSize_vkCreateDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11925 | countingStream->rewind(); |
| 11926 | uint32_t opcode_vkCreateDescriptorUpdateTemplateKHR = OP_vkCreateDescriptorUpdateTemplateKHR; |
| 11927 | stream->write(&opcode_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 11928 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11929 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11930 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 11931 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 11932 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11933 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11934 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11935 | } |
| 11936 | stream->write((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| 11937 | stream->read((VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11938 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11939 | VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0; |
| 11940 | stream->read(&vkCreateDescriptorUpdateTemplateKHR_VkResult_return, sizeof(VkResult)); |
| 11941 | return vkCreateDescriptorUpdateTemplateKHR_VkResult_return; |
| 11942 | } |
| 11943 | |
| 11944 | void VkEncoder::vkDestroyDescriptorUpdateTemplateKHR( |
| 11945 | VkDevice device, |
| 11946 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 11947 | const VkAllocationCallbacks* pAllocator) |
| 11948 | { |
| 11949 | auto stream = mImpl->stream(); |
| 11950 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11951 | auto resources = mImpl->resources(); |
| 11952 | auto pool = mImpl->pool(); |
| 11953 | VkDevice local_device; |
| 11954 | local_device = device; |
| 11955 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 11956 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 11957 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 11958 | resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate); |
| 11959 | VkAllocationCallbacks* local_pAllocator; |
| 11960 | local_pAllocator = nullptr; |
| 11961 | if (pAllocator) |
| 11962 | { |
| 11963 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11964 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11965 | } |
| 11966 | if (local_pAllocator) |
| 11967 | { |
| 11968 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 11969 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 11970 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11971 | countingStream->rewind(); |
| 11972 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11973 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11974 | countingStream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| 11975 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 11976 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11977 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11978 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11979 | } |
| 11980 | } |
| 11981 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11982 | countingStream->rewind(); |
| 11983 | uint32_t opcode_vkDestroyDescriptorUpdateTemplateKHR = OP_vkDestroyDescriptorUpdateTemplateKHR; |
| 11984 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 11985 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11986 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 11987 | stream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| 11988 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 11989 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11990 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11991 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11992 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11993 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11994 | } |
| 11995 | |
| 11996 | void VkEncoder::vkUpdateDescriptorSetWithTemplateKHR( |
| 11997 | VkDevice device, |
| 11998 | VkDescriptorSet descriptorSet, |
| 11999 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 12000 | const void* pData) |
| 12001 | { |
| 12002 | auto stream = mImpl->stream(); |
| 12003 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12004 | auto resources = mImpl->resources(); |
| 12005 | auto pool = mImpl->pool(); |
| 12006 | VkDevice local_device; |
| 12007 | local_device = device; |
| 12008 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 12009 | VkDescriptorSet local_descriptorSet; |
| 12010 | local_descriptorSet = descriptorSet; |
| 12011 | resources->unwrapMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)&local_descriptorSet); |
| 12012 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 12013 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 12014 | resources->unwrapMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate); |
| 12015 | void* local_pData; |
| 12016 | local_pData = nullptr; |
| 12017 | if (pData) |
| 12018 | { |
| 12019 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 12020 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12021 | countingStream->rewind(); |
| 12022 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12023 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12024 | countingStream->write((VkDescriptorSet*)&local_descriptorSet, sizeof(VkDescriptorSet)); |
| 12025 | countingStream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| 12026 | countingStream->write((void**)&local_pData, sizeof(void*)); |
| 12027 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12028 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12029 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12030 | } |
| 12031 | } |
| 12032 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12033 | countingStream->rewind(); |
| 12034 | uint32_t opcode_vkUpdateDescriptorSetWithTemplateKHR = OP_vkUpdateDescriptorSetWithTemplateKHR; |
| 12035 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 12036 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12037 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12038 | stream->write((VkDescriptorSet*)&local_descriptorSet, sizeof(VkDescriptorSet)); |
| 12039 | stream->write((VkDescriptorUpdateTemplate*)&local_descriptorUpdateTemplate, sizeof(VkDescriptorUpdateTemplate)); |
| 12040 | stream->write((void**)&local_pData, sizeof(void*)); |
| 12041 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12042 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12043 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12044 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12045 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12046 | } |
| 12047 | |
| 12048 | #endif |
| 12049 | #ifdef VK_KHR_create_renderpass2 |
| 12050 | VkResult VkEncoder::vkCreateRenderPass2KHR( |
| 12051 | VkDevice device, |
| 12052 | const VkRenderPassCreateInfo2KHR* pCreateInfo, |
| 12053 | const VkAllocationCallbacks* pAllocator, |
| 12054 | VkRenderPass* pRenderPass) |
| 12055 | { |
| 12056 | auto stream = mImpl->stream(); |
| 12057 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12058 | auto resources = mImpl->resources(); |
| 12059 | auto pool = mImpl->pool(); |
| 12060 | VkDevice local_device; |
| 12061 | local_device = device; |
| 12062 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 12063 | VkRenderPassCreateInfo2KHR* local_pCreateInfo; |
| 12064 | local_pCreateInfo = nullptr; |
| 12065 | if (pCreateInfo) |
| 12066 | { |
| 12067 | local_pCreateInfo = (VkRenderPassCreateInfo2KHR*)pool->alloc(sizeof(const VkRenderPassCreateInfo2KHR)); |
| 12068 | deepcopy_VkRenderPassCreateInfo2KHR(pool, pCreateInfo, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| 12069 | } |
| 12070 | if (local_pCreateInfo) |
| 12071 | { |
| 12072 | handlemap_VkRenderPassCreateInfo2KHR(resources->unwrapMapping(), (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| 12073 | } |
| 12074 | VkAllocationCallbacks* local_pAllocator; |
| 12075 | local_pAllocator = nullptr; |
| 12076 | if (pAllocator) |
| 12077 | { |
| 12078 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12079 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12080 | } |
| 12081 | if (local_pAllocator) |
| 12082 | { |
| 12083 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 12084 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 12085 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12086 | countingStream->rewind(); |
| 12087 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12088 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12089 | marshal_VkRenderPassCreateInfo2KHR(countingStream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| 12090 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 12091 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12092 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12093 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12094 | } |
| 12095 | countingStream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass)); |
| 12096 | } |
| 12097 | uint32_t packetSize_vkCreateRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12098 | countingStream->rewind(); |
| 12099 | uint32_t opcode_vkCreateRenderPass2KHR = OP_vkCreateRenderPass2KHR; |
| 12100 | stream->write(&opcode_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| 12101 | stream->write(&packetSize_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12102 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12103 | marshal_VkRenderPassCreateInfo2KHR(stream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| 12104 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 12105 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12106 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12107 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12108 | } |
| 12109 | stream->write((VkRenderPass*)pRenderPass, sizeof(VkRenderPass)); |
| 12110 | stream->read((VkRenderPass*)pRenderPass, sizeof(VkRenderPass)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12111 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12112 | VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0; |
| 12113 | stream->read(&vkCreateRenderPass2KHR_VkResult_return, sizeof(VkResult)); |
| 12114 | return vkCreateRenderPass2KHR_VkResult_return; |
| 12115 | } |
| 12116 | |
| 12117 | void VkEncoder::vkCmdBeginRenderPass2KHR( |
| 12118 | VkCommandBuffer commandBuffer, |
| 12119 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 12120 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo) |
| 12121 | { |
| 12122 | auto stream = mImpl->stream(); |
| 12123 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12124 | auto resources = mImpl->resources(); |
| 12125 | auto pool = mImpl->pool(); |
| 12126 | VkCommandBuffer local_commandBuffer; |
| 12127 | local_commandBuffer = commandBuffer; |
| 12128 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 12129 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| 12130 | local_pRenderPassBegin = nullptr; |
| 12131 | if (pRenderPassBegin) |
| 12132 | { |
| 12133 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 12134 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 12135 | } |
| 12136 | if (local_pRenderPassBegin) |
| 12137 | { |
| 12138 | handlemap_VkRenderPassBeginInfo(resources->unwrapMapping(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 12139 | } |
| 12140 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| 12141 | local_pSubpassBeginInfo = nullptr; |
| 12142 | if (pSubpassBeginInfo) |
| 12143 | { |
| 12144 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 12145 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 12146 | } |
| 12147 | if (local_pSubpassBeginInfo) |
| 12148 | { |
| 12149 | handlemap_VkSubpassBeginInfoKHR(resources->unwrapMapping(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 12150 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12151 | countingStream->rewind(); |
| 12152 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12153 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 12154 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 12155 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12156 | } |
| 12157 | uint32_t packetSize_vkCmdBeginRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12158 | countingStream->rewind(); |
| 12159 | uint32_t opcode_vkCmdBeginRenderPass2KHR = OP_vkCmdBeginRenderPass2KHR; |
| 12160 | stream->write(&opcode_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| 12161 | stream->write(&packetSize_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12162 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 12163 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 12164 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 12165 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12166 | } |
| 12167 | |
| 12168 | void VkEncoder::vkCmdNextSubpass2KHR( |
| 12169 | VkCommandBuffer commandBuffer, |
| 12170 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo, |
| 12171 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 12172 | { |
| 12173 | auto stream = mImpl->stream(); |
| 12174 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12175 | auto resources = mImpl->resources(); |
| 12176 | auto pool = mImpl->pool(); |
| 12177 | VkCommandBuffer local_commandBuffer; |
| 12178 | local_commandBuffer = commandBuffer; |
| 12179 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 12180 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| 12181 | local_pSubpassBeginInfo = nullptr; |
| 12182 | if (pSubpassBeginInfo) |
| 12183 | { |
| 12184 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 12185 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 12186 | } |
| 12187 | if (local_pSubpassBeginInfo) |
| 12188 | { |
| 12189 | handlemap_VkSubpassBeginInfoKHR(resources->unwrapMapping(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 12190 | } |
| 12191 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| 12192 | local_pSubpassEndInfo = nullptr; |
| 12193 | if (pSubpassEndInfo) |
| 12194 | { |
| 12195 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 12196 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 12197 | } |
| 12198 | if (local_pSubpassEndInfo) |
| 12199 | { |
| 12200 | handlemap_VkSubpassEndInfoKHR(resources->unwrapMapping(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 12201 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12202 | countingStream->rewind(); |
| 12203 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12204 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 12205 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 12206 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12207 | } |
| 12208 | uint32_t packetSize_vkCmdNextSubpass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12209 | countingStream->rewind(); |
| 12210 | uint32_t opcode_vkCmdNextSubpass2KHR = OP_vkCmdNextSubpass2KHR; |
| 12211 | stream->write(&opcode_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| 12212 | stream->write(&packetSize_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12213 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 12214 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 12215 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 12216 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12217 | } |
| 12218 | |
| 12219 | void VkEncoder::vkCmdEndRenderPass2KHR( |
| 12220 | VkCommandBuffer commandBuffer, |
| 12221 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 12222 | { |
| 12223 | auto stream = mImpl->stream(); |
| 12224 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12225 | auto resources = mImpl->resources(); |
| 12226 | auto pool = mImpl->pool(); |
| 12227 | VkCommandBuffer local_commandBuffer; |
| 12228 | local_commandBuffer = commandBuffer; |
| 12229 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 12230 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| 12231 | local_pSubpassEndInfo = nullptr; |
| 12232 | if (pSubpassEndInfo) |
| 12233 | { |
| 12234 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 12235 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 12236 | } |
| 12237 | if (local_pSubpassEndInfo) |
| 12238 | { |
| 12239 | handlemap_VkSubpassEndInfoKHR(resources->unwrapMapping(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 12240 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12241 | countingStream->rewind(); |
| 12242 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12243 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 12244 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12245 | } |
| 12246 | uint32_t packetSize_vkCmdEndRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12247 | countingStream->rewind(); |
| 12248 | uint32_t opcode_vkCmdEndRenderPass2KHR = OP_vkCmdEndRenderPass2KHR; |
| 12249 | stream->write(&opcode_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| 12250 | stream->write(&packetSize_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12251 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 12252 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 12253 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12254 | } |
| 12255 | |
| 12256 | #endif |
| 12257 | #ifdef VK_KHR_shared_presentable_image |
| 12258 | VkResult VkEncoder::vkGetSwapchainStatusKHR( |
| 12259 | VkDevice device, |
| 12260 | VkSwapchainKHR swapchain) |
| 12261 | { |
| 12262 | auto stream = mImpl->stream(); |
| 12263 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12264 | auto resources = mImpl->resources(); |
| 12265 | auto pool = mImpl->pool(); |
| 12266 | VkDevice local_device; |
| 12267 | local_device = device; |
| 12268 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 12269 | VkSwapchainKHR local_swapchain; |
| 12270 | local_swapchain = swapchain; |
| 12271 | resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12272 | countingStream->rewind(); |
| 12273 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12274 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12275 | countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12276 | } |
| 12277 | uint32_t packetSize_vkGetSwapchainStatusKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12278 | countingStream->rewind(); |
| 12279 | uint32_t opcode_vkGetSwapchainStatusKHR = OP_vkGetSwapchainStatusKHR; |
| 12280 | stream->write(&opcode_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| 12281 | stream->write(&packetSize_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12282 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12283 | stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| 12284 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12285 | VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0; |
| 12286 | stream->read(&vkGetSwapchainStatusKHR_VkResult_return, sizeof(VkResult)); |
| 12287 | return vkGetSwapchainStatusKHR_VkResult_return; |
| 12288 | } |
| 12289 | |
| 12290 | #endif |
| 12291 | #ifdef VK_KHR_external_fence_capabilities |
| 12292 | void VkEncoder::vkGetPhysicalDeviceExternalFencePropertiesKHR( |
| 12293 | VkPhysicalDevice physicalDevice, |
| 12294 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 12295 | VkExternalFenceProperties* pExternalFenceProperties) |
| 12296 | { |
| 12297 | auto stream = mImpl->stream(); |
| 12298 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12299 | auto resources = mImpl->resources(); |
| 12300 | auto pool = mImpl->pool(); |
| 12301 | VkPhysicalDevice local_physicalDevice; |
| 12302 | local_physicalDevice = physicalDevice; |
| 12303 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 12304 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| 12305 | local_pExternalFenceInfo = nullptr; |
| 12306 | if (pExternalFenceInfo) |
| 12307 | { |
| 12308 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 12309 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 12310 | } |
| 12311 | if (local_pExternalFenceInfo) |
| 12312 | { |
| 12313 | handlemap_VkPhysicalDeviceExternalFenceInfo(resources->unwrapMapping(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 12314 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12315 | countingStream->rewind(); |
| 12316 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12317 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 12318 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12319 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 12320 | } |
| 12321 | uint32_t packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12322 | countingStream->rewind(); |
| 12323 | uint32_t opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR = OP_vkGetPhysicalDeviceExternalFencePropertiesKHR; |
| 12324 | stream->write(&opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| 12325 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12326 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 12327 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12328 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 12329 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12330 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12331 | } |
| 12332 | |
| 12333 | #endif |
| 12334 | #ifdef VK_KHR_external_fence |
| 12335 | #endif |
| 12336 | #ifdef VK_KHR_external_fence_win32 |
| 12337 | VkResult VkEncoder::vkImportFenceWin32HandleKHR( |
| 12338 | VkDevice device, |
| 12339 | const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) |
| 12340 | { |
| 12341 | auto stream = mImpl->stream(); |
| 12342 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12343 | auto resources = mImpl->resources(); |
| 12344 | auto pool = mImpl->pool(); |
| 12345 | VkDevice local_device; |
| 12346 | local_device = device; |
| 12347 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 12348 | VkImportFenceWin32HandleInfoKHR* local_pImportFenceWin32HandleInfo; |
| 12349 | local_pImportFenceWin32HandleInfo = nullptr; |
| 12350 | if (pImportFenceWin32HandleInfo) |
| 12351 | { |
| 12352 | local_pImportFenceWin32HandleInfo = (VkImportFenceWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportFenceWin32HandleInfoKHR)); |
| 12353 | deepcopy_VkImportFenceWin32HandleInfoKHR(pool, pImportFenceWin32HandleInfo, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| 12354 | } |
| 12355 | if (local_pImportFenceWin32HandleInfo) |
| 12356 | { |
| 12357 | handlemap_VkImportFenceWin32HandleInfoKHR(resources->unwrapMapping(), (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| 12358 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12359 | countingStream->rewind(); |
| 12360 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12361 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12362 | marshal_VkImportFenceWin32HandleInfoKHR(countingStream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12363 | } |
| 12364 | uint32_t packetSize_vkImportFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12365 | countingStream->rewind(); |
| 12366 | uint32_t opcode_vkImportFenceWin32HandleKHR = OP_vkImportFenceWin32HandleKHR; |
| 12367 | stream->write(&opcode_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| 12368 | stream->write(&packetSize_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12369 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12370 | marshal_VkImportFenceWin32HandleInfoKHR(stream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| 12371 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12372 | VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 12373 | stream->read(&vkImportFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| 12374 | return vkImportFenceWin32HandleKHR_VkResult_return; |
| 12375 | } |
| 12376 | |
| 12377 | VkResult VkEncoder::vkGetFenceWin32HandleKHR( |
| 12378 | VkDevice device, |
| 12379 | const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 12380 | HANDLE* pHandle) |
| 12381 | { |
| 12382 | auto stream = mImpl->stream(); |
| 12383 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12384 | auto resources = mImpl->resources(); |
| 12385 | auto pool = mImpl->pool(); |
| 12386 | VkDevice local_device; |
| 12387 | local_device = device; |
| 12388 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 12389 | VkFenceGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| 12390 | local_pGetWin32HandleInfo = nullptr; |
| 12391 | if (pGetWin32HandleInfo) |
| 12392 | { |
| 12393 | local_pGetWin32HandleInfo = (VkFenceGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkFenceGetWin32HandleInfoKHR)); |
| 12394 | deepcopy_VkFenceGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 12395 | } |
| 12396 | if (local_pGetWin32HandleInfo) |
| 12397 | { |
| 12398 | handlemap_VkFenceGetWin32HandleInfoKHR(resources->unwrapMapping(), (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 12399 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12400 | countingStream->rewind(); |
| 12401 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12402 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12403 | marshal_VkFenceGetWin32HandleInfoKHR(countingStream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12404 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 12405 | } |
| 12406 | uint32_t packetSize_vkGetFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12407 | countingStream->rewind(); |
| 12408 | uint32_t opcode_vkGetFenceWin32HandleKHR = OP_vkGetFenceWin32HandleKHR; |
| 12409 | stream->write(&opcode_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| 12410 | stream->write(&packetSize_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12411 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12412 | marshal_VkFenceGetWin32HandleInfoKHR(stream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12413 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 12414 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12415 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12416 | VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 12417 | stream->read(&vkGetFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| 12418 | return vkGetFenceWin32HandleKHR_VkResult_return; |
| 12419 | } |
| 12420 | |
| 12421 | #endif |
| 12422 | #ifdef VK_KHR_external_fence_fd |
| 12423 | VkResult VkEncoder::vkImportFenceFdKHR( |
| 12424 | VkDevice device, |
| 12425 | const VkImportFenceFdInfoKHR* pImportFenceFdInfo) |
| 12426 | { |
| 12427 | auto stream = mImpl->stream(); |
| 12428 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12429 | auto resources = mImpl->resources(); |
| 12430 | auto pool = mImpl->pool(); |
| 12431 | VkDevice local_device; |
| 12432 | local_device = device; |
| 12433 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 12434 | VkImportFenceFdInfoKHR* local_pImportFenceFdInfo; |
| 12435 | local_pImportFenceFdInfo = nullptr; |
| 12436 | if (pImportFenceFdInfo) |
| 12437 | { |
| 12438 | local_pImportFenceFdInfo = (VkImportFenceFdInfoKHR*)pool->alloc(sizeof(const VkImportFenceFdInfoKHR)); |
| 12439 | deepcopy_VkImportFenceFdInfoKHR(pool, pImportFenceFdInfo, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| 12440 | } |
| 12441 | if (local_pImportFenceFdInfo) |
| 12442 | { |
| 12443 | handlemap_VkImportFenceFdInfoKHR(resources->unwrapMapping(), (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| 12444 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12445 | countingStream->rewind(); |
| 12446 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12447 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12448 | marshal_VkImportFenceFdInfoKHR(countingStream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12449 | } |
| 12450 | uint32_t packetSize_vkImportFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12451 | countingStream->rewind(); |
| 12452 | uint32_t opcode_vkImportFenceFdKHR = OP_vkImportFenceFdKHR; |
| 12453 | stream->write(&opcode_vkImportFenceFdKHR, sizeof(uint32_t)); |
| 12454 | stream->write(&packetSize_vkImportFenceFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12455 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12456 | marshal_VkImportFenceFdInfoKHR(stream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| 12457 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12458 | VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0; |
| 12459 | stream->read(&vkImportFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| 12460 | return vkImportFenceFdKHR_VkResult_return; |
| 12461 | } |
| 12462 | |
| 12463 | VkResult VkEncoder::vkGetFenceFdKHR( |
| 12464 | VkDevice device, |
| 12465 | const VkFenceGetFdInfoKHR* pGetFdInfo, |
| 12466 | int* pFd) |
| 12467 | { |
| 12468 | auto stream = mImpl->stream(); |
| 12469 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12470 | auto resources = mImpl->resources(); |
| 12471 | auto pool = mImpl->pool(); |
| 12472 | VkDevice local_device; |
| 12473 | local_device = device; |
| 12474 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 12475 | VkFenceGetFdInfoKHR* local_pGetFdInfo; |
| 12476 | local_pGetFdInfo = nullptr; |
| 12477 | if (pGetFdInfo) |
| 12478 | { |
| 12479 | local_pGetFdInfo = (VkFenceGetFdInfoKHR*)pool->alloc(sizeof(const VkFenceGetFdInfoKHR)); |
| 12480 | deepcopy_VkFenceGetFdInfoKHR(pool, pGetFdInfo, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| 12481 | } |
| 12482 | if (local_pGetFdInfo) |
| 12483 | { |
| 12484 | handlemap_VkFenceGetFdInfoKHR(resources->unwrapMapping(), (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| 12485 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12486 | countingStream->rewind(); |
| 12487 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12488 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12489 | marshal_VkFenceGetFdInfoKHR(countingStream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12490 | countingStream->write((int*)pFd, sizeof(int)); |
| 12491 | } |
| 12492 | uint32_t packetSize_vkGetFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12493 | countingStream->rewind(); |
| 12494 | uint32_t opcode_vkGetFenceFdKHR = OP_vkGetFenceFdKHR; |
| 12495 | stream->write(&opcode_vkGetFenceFdKHR, sizeof(uint32_t)); |
| 12496 | stream->write(&packetSize_vkGetFenceFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12497 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12498 | marshal_VkFenceGetFdInfoKHR(stream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12499 | stream->write((int*)pFd, sizeof(int)); |
| 12500 | stream->read((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12501 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12502 | VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0; |
| 12503 | stream->read(&vkGetFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| 12504 | return vkGetFenceFdKHR_VkResult_return; |
| 12505 | } |
| 12506 | |
| 12507 | #endif |
| 12508 | #ifdef VK_KHR_maintenance2 |
| 12509 | #endif |
| 12510 | #ifdef VK_KHR_get_surface_capabilities2 |
| 12511 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2KHR( |
| 12512 | VkPhysicalDevice physicalDevice, |
| 12513 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 12514 | VkSurfaceCapabilities2KHR* pSurfaceCapabilities) |
| 12515 | { |
| 12516 | auto stream = mImpl->stream(); |
| 12517 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12518 | auto resources = mImpl->resources(); |
| 12519 | auto pool = mImpl->pool(); |
| 12520 | VkPhysicalDevice local_physicalDevice; |
| 12521 | local_physicalDevice = physicalDevice; |
| 12522 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 12523 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| 12524 | local_pSurfaceInfo = nullptr; |
| 12525 | if (pSurfaceInfo) |
| 12526 | { |
| 12527 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 12528 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 12529 | } |
| 12530 | if (local_pSurfaceInfo) |
| 12531 | { |
| 12532 | handlemap_VkPhysicalDeviceSurfaceInfo2KHR(resources->unwrapMapping(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 12533 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12534 | countingStream->rewind(); |
| 12535 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12536 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 12537 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12538 | marshal_VkSurfaceCapabilities2KHR(countingStream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 12539 | } |
| 12540 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12541 | countingStream->rewind(); |
| 12542 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR = OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR; |
| 12543 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| 12544 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12545 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 12546 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12547 | marshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 12548 | unmarshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12549 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12550 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0; |
| 12551 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| 12552 | return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return; |
| 12553 | } |
| 12554 | |
| 12555 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormats2KHR( |
| 12556 | VkPhysicalDevice physicalDevice, |
| 12557 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 12558 | uint32_t* pSurfaceFormatCount, |
| 12559 | VkSurfaceFormat2KHR* pSurfaceFormats) |
| 12560 | { |
| 12561 | auto stream = mImpl->stream(); |
| 12562 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12563 | auto resources = mImpl->resources(); |
| 12564 | auto pool = mImpl->pool(); |
| 12565 | VkPhysicalDevice local_physicalDevice; |
| 12566 | local_physicalDevice = physicalDevice; |
| 12567 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 12568 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| 12569 | local_pSurfaceInfo = nullptr; |
| 12570 | if (pSurfaceInfo) |
| 12571 | { |
| 12572 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 12573 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 12574 | } |
| 12575 | if (local_pSurfaceInfo) |
| 12576 | { |
| 12577 | handlemap_VkPhysicalDeviceSurfaceInfo2KHR(resources->unwrapMapping(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 12578 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12579 | countingStream->rewind(); |
| 12580 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12581 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 12582 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12583 | countingStream->write((uint32_t**)&pSurfaceFormatCount, sizeof(uint32_t*)); |
| 12584 | if (pSurfaceFormatCount) |
| 12585 | { |
| 12586 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 12587 | } |
| 12588 | countingStream->write((VkSurfaceFormat2KHR**)&pSurfaceFormats, sizeof(VkSurfaceFormat2KHR*)); |
| 12589 | if (pSurfaceFormats) |
| 12590 | { |
| 12591 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 12592 | { |
| 12593 | marshal_VkSurfaceFormat2KHR(countingStream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 12594 | } |
| 12595 | } |
| 12596 | } |
| 12597 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12598 | countingStream->rewind(); |
| 12599 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormats2KHR = OP_vkGetPhysicalDeviceSurfaceFormats2KHR; |
| 12600 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| 12601 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12602 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 12603 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12604 | stream->write((uint32_t**)&pSurfaceFormatCount, sizeof(uint32_t*)); |
| 12605 | if (pSurfaceFormatCount) |
| 12606 | { |
| 12607 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 12608 | } |
| 12609 | stream->write((VkSurfaceFormat2KHR**)&pSurfaceFormats, sizeof(VkSurfaceFormat2KHR*)); |
| 12610 | if (pSurfaceFormats) |
| 12611 | { |
| 12612 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 12613 | { |
| 12614 | marshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 12615 | } |
| 12616 | } |
| 12617 | uint32_t* check_pSurfaceFormatCount; |
| 12618 | stream->read((uint32_t**)&check_pSurfaceFormatCount, sizeof(uint32_t*)); |
| 12619 | if (pSurfaceFormatCount) |
| 12620 | { |
| 12621 | if (!(check_pSurfaceFormatCount)) |
| 12622 | { |
| 12623 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 12624 | } |
| 12625 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 12626 | } |
| 12627 | VkSurfaceFormat2KHR* check_pSurfaceFormats; |
| 12628 | stream->read((VkSurfaceFormat2KHR**)&check_pSurfaceFormats, sizeof(VkSurfaceFormat2KHR*)); |
| 12629 | if (pSurfaceFormats) |
| 12630 | { |
| 12631 | if (!(check_pSurfaceFormats)) |
| 12632 | { |
| 12633 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 12634 | } |
| 12635 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 12636 | { |
| 12637 | unmarshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 12638 | } |
| 12639 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12640 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12641 | VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0; |
| 12642 | stream->read(&vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return, sizeof(VkResult)); |
| 12643 | return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return; |
| 12644 | } |
| 12645 | |
| 12646 | #endif |
| 12647 | #ifdef VK_KHR_variable_pointers |
| 12648 | #endif |
| 12649 | #ifdef VK_KHR_get_display_properties2 |
| 12650 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayProperties2KHR( |
| 12651 | VkPhysicalDevice physicalDevice, |
| 12652 | uint32_t* pPropertyCount, |
| 12653 | VkDisplayProperties2KHR* pProperties) |
| 12654 | { |
| 12655 | auto stream = mImpl->stream(); |
| 12656 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12657 | auto resources = mImpl->resources(); |
| 12658 | auto pool = mImpl->pool(); |
| 12659 | VkPhysicalDevice local_physicalDevice; |
| 12660 | local_physicalDevice = physicalDevice; |
| 12661 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12662 | countingStream->rewind(); |
| 12663 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12664 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12665 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 12666 | if (pPropertyCount) |
| 12667 | { |
| 12668 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12669 | } |
| 12670 | countingStream->write((VkDisplayProperties2KHR**)&pProperties, sizeof(VkDisplayProperties2KHR*)); |
| 12671 | if (pProperties) |
| 12672 | { |
| 12673 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12674 | { |
| 12675 | marshal_VkDisplayProperties2KHR(countingStream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 12676 | } |
| 12677 | } |
| 12678 | } |
| 12679 | uint32_t packetSize_vkGetPhysicalDeviceDisplayProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12680 | countingStream->rewind(); |
| 12681 | uint32_t opcode_vkGetPhysicalDeviceDisplayProperties2KHR = OP_vkGetPhysicalDeviceDisplayProperties2KHR; |
| 12682 | stream->write(&opcode_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| 12683 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12684 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12685 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 12686 | if (pPropertyCount) |
| 12687 | { |
| 12688 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12689 | } |
| 12690 | stream->write((VkDisplayProperties2KHR**)&pProperties, sizeof(VkDisplayProperties2KHR*)); |
| 12691 | if (pProperties) |
| 12692 | { |
| 12693 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12694 | { |
| 12695 | marshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 12696 | } |
| 12697 | } |
| 12698 | uint32_t* check_pPropertyCount; |
| 12699 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 12700 | if (pPropertyCount) |
| 12701 | { |
| 12702 | if (!(check_pPropertyCount)) |
| 12703 | { |
| 12704 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12705 | } |
| 12706 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12707 | } |
| 12708 | VkDisplayProperties2KHR* check_pProperties; |
| 12709 | stream->read((VkDisplayProperties2KHR**)&check_pProperties, sizeof(VkDisplayProperties2KHR*)); |
| 12710 | if (pProperties) |
| 12711 | { |
| 12712 | if (!(check_pProperties)) |
| 12713 | { |
| 12714 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12715 | } |
| 12716 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12717 | { |
| 12718 | unmarshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 12719 | } |
| 12720 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12721 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12722 | VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0; |
| 12723 | stream->read(&vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return, sizeof(VkResult)); |
| 12724 | return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return; |
| 12725 | } |
| 12726 | |
| 12727 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlaneProperties2KHR( |
| 12728 | VkPhysicalDevice physicalDevice, |
| 12729 | uint32_t* pPropertyCount, |
| 12730 | VkDisplayPlaneProperties2KHR* pProperties) |
| 12731 | { |
| 12732 | auto stream = mImpl->stream(); |
| 12733 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12734 | auto resources = mImpl->resources(); |
| 12735 | auto pool = mImpl->pool(); |
| 12736 | VkPhysicalDevice local_physicalDevice; |
| 12737 | local_physicalDevice = physicalDevice; |
| 12738 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12739 | countingStream->rewind(); |
| 12740 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12741 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12742 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 12743 | if (pPropertyCount) |
| 12744 | { |
| 12745 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12746 | } |
| 12747 | countingStream->write((VkDisplayPlaneProperties2KHR**)&pProperties, sizeof(VkDisplayPlaneProperties2KHR*)); |
| 12748 | if (pProperties) |
| 12749 | { |
| 12750 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12751 | { |
| 12752 | marshal_VkDisplayPlaneProperties2KHR(countingStream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 12753 | } |
| 12754 | } |
| 12755 | } |
| 12756 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12757 | countingStream->rewind(); |
| 12758 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR; |
| 12759 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| 12760 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12761 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12762 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 12763 | if (pPropertyCount) |
| 12764 | { |
| 12765 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12766 | } |
| 12767 | stream->write((VkDisplayPlaneProperties2KHR**)&pProperties, sizeof(VkDisplayPlaneProperties2KHR*)); |
| 12768 | if (pProperties) |
| 12769 | { |
| 12770 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12771 | { |
| 12772 | marshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 12773 | } |
| 12774 | } |
| 12775 | uint32_t* check_pPropertyCount; |
| 12776 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 12777 | if (pPropertyCount) |
| 12778 | { |
| 12779 | if (!(check_pPropertyCount)) |
| 12780 | { |
| 12781 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12782 | } |
| 12783 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12784 | } |
| 12785 | VkDisplayPlaneProperties2KHR* check_pProperties; |
| 12786 | stream->read((VkDisplayPlaneProperties2KHR**)&check_pProperties, sizeof(VkDisplayPlaneProperties2KHR*)); |
| 12787 | if (pProperties) |
| 12788 | { |
| 12789 | if (!(check_pProperties)) |
| 12790 | { |
| 12791 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12792 | } |
| 12793 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12794 | { |
| 12795 | unmarshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 12796 | } |
| 12797 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12798 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12799 | VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0; |
| 12800 | stream->read(&vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return, sizeof(VkResult)); |
| 12801 | return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return; |
| 12802 | } |
| 12803 | |
| 12804 | VkResult VkEncoder::vkGetDisplayModeProperties2KHR( |
| 12805 | VkPhysicalDevice physicalDevice, |
| 12806 | VkDisplayKHR display, |
| 12807 | uint32_t* pPropertyCount, |
| 12808 | VkDisplayModeProperties2KHR* pProperties) |
| 12809 | { |
| 12810 | auto stream = mImpl->stream(); |
| 12811 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12812 | auto resources = mImpl->resources(); |
| 12813 | auto pool = mImpl->pool(); |
| 12814 | VkPhysicalDevice local_physicalDevice; |
| 12815 | local_physicalDevice = physicalDevice; |
| 12816 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 12817 | VkDisplayKHR local_display; |
| 12818 | local_display = display; |
| 12819 | resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12820 | countingStream->rewind(); |
| 12821 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12822 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 12823 | countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12824 | countingStream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 12825 | if (pPropertyCount) |
| 12826 | { |
| 12827 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12828 | } |
| 12829 | countingStream->write((VkDisplayModeProperties2KHR**)&pProperties, sizeof(VkDisplayModeProperties2KHR*)); |
| 12830 | if (pProperties) |
| 12831 | { |
| 12832 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12833 | { |
| 12834 | marshal_VkDisplayModeProperties2KHR(countingStream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 12835 | } |
| 12836 | } |
| 12837 | } |
| 12838 | uint32_t packetSize_vkGetDisplayModeProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12839 | countingStream->rewind(); |
| 12840 | uint32_t opcode_vkGetDisplayModeProperties2KHR = OP_vkGetDisplayModeProperties2KHR; |
| 12841 | stream->write(&opcode_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| 12842 | stream->write(&packetSize_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12843 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 12844 | stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12845 | stream->write((uint32_t**)&pPropertyCount, sizeof(uint32_t*)); |
| 12846 | if (pPropertyCount) |
| 12847 | { |
| 12848 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12849 | } |
| 12850 | stream->write((VkDisplayModeProperties2KHR**)&pProperties, sizeof(VkDisplayModeProperties2KHR*)); |
| 12851 | if (pProperties) |
| 12852 | { |
| 12853 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12854 | { |
| 12855 | marshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 12856 | } |
| 12857 | } |
| 12858 | uint32_t* check_pPropertyCount; |
| 12859 | stream->read((uint32_t**)&check_pPropertyCount, sizeof(uint32_t*)); |
| 12860 | if (pPropertyCount) |
| 12861 | { |
| 12862 | if (!(check_pPropertyCount)) |
| 12863 | { |
| 12864 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12865 | } |
| 12866 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12867 | } |
| 12868 | VkDisplayModeProperties2KHR* check_pProperties; |
| 12869 | stream->read((VkDisplayModeProperties2KHR**)&check_pProperties, sizeof(VkDisplayModeProperties2KHR*)); |
| 12870 | if (pProperties) |
| 12871 | { |
| 12872 | if (!(check_pProperties)) |
| 12873 | { |
| 12874 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12875 | } |
| 12876 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12877 | { |
| 12878 | unmarshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 12879 | } |
| 12880 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12881 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12882 | VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0; |
| 12883 | stream->read(&vkGetDisplayModeProperties2KHR_VkResult_return, sizeof(VkResult)); |
| 12884 | return vkGetDisplayModeProperties2KHR_VkResult_return; |
| 12885 | } |
| 12886 | |
| 12887 | VkResult VkEncoder::vkGetDisplayPlaneCapabilities2KHR( |
| 12888 | VkPhysicalDevice physicalDevice, |
| 12889 | const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, |
| 12890 | VkDisplayPlaneCapabilities2KHR* pCapabilities) |
| 12891 | { |
| 12892 | auto stream = mImpl->stream(); |
| 12893 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12894 | auto resources = mImpl->resources(); |
| 12895 | auto pool = mImpl->pool(); |
| 12896 | VkPhysicalDevice local_physicalDevice; |
| 12897 | local_physicalDevice = physicalDevice; |
| 12898 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 12899 | VkDisplayPlaneInfo2KHR* local_pDisplayPlaneInfo; |
| 12900 | local_pDisplayPlaneInfo = nullptr; |
| 12901 | if (pDisplayPlaneInfo) |
| 12902 | { |
| 12903 | local_pDisplayPlaneInfo = (VkDisplayPlaneInfo2KHR*)pool->alloc(sizeof(const VkDisplayPlaneInfo2KHR)); |
| 12904 | deepcopy_VkDisplayPlaneInfo2KHR(pool, pDisplayPlaneInfo, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| 12905 | } |
| 12906 | if (local_pDisplayPlaneInfo) |
| 12907 | { |
| 12908 | handlemap_VkDisplayPlaneInfo2KHR(resources->unwrapMapping(), (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| 12909 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12910 | countingStream->rewind(); |
| 12911 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12912 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 12913 | marshal_VkDisplayPlaneInfo2KHR(countingStream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12914 | marshal_VkDisplayPlaneCapabilities2KHR(countingStream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 12915 | } |
| 12916 | uint32_t packetSize_vkGetDisplayPlaneCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12917 | countingStream->rewind(); |
| 12918 | uint32_t opcode_vkGetDisplayPlaneCapabilities2KHR = OP_vkGetDisplayPlaneCapabilities2KHR; |
| 12919 | stream->write(&opcode_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| 12920 | stream->write(&packetSize_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12921 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 12922 | marshal_VkDisplayPlaneInfo2KHR(stream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12923 | marshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 12924 | unmarshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12925 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12926 | VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0; |
| 12927 | stream->read(&vkGetDisplayPlaneCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| 12928 | return vkGetDisplayPlaneCapabilities2KHR_VkResult_return; |
| 12929 | } |
| 12930 | |
| 12931 | #endif |
| 12932 | #ifdef VK_KHR_dedicated_allocation |
| 12933 | #endif |
| 12934 | #ifdef VK_KHR_storage_buffer_storage_class |
| 12935 | #endif |
| 12936 | #ifdef VK_KHR_relaxed_block_layout |
| 12937 | #endif |
| 12938 | #ifdef VK_KHR_get_memory_requirements2 |
| 12939 | void VkEncoder::vkGetImageMemoryRequirements2KHR( |
| 12940 | VkDevice device, |
| 12941 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 12942 | VkMemoryRequirements2* pMemoryRequirements) |
| 12943 | { |
| 12944 | auto stream = mImpl->stream(); |
| 12945 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12946 | auto resources = mImpl->resources(); |
| 12947 | auto pool = mImpl->pool(); |
| 12948 | VkDevice local_device; |
| 12949 | local_device = device; |
| 12950 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 12951 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| 12952 | local_pInfo = nullptr; |
| 12953 | if (pInfo) |
| 12954 | { |
| 12955 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 12956 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 12957 | } |
| 12958 | if (local_pInfo) |
| 12959 | { |
| 12960 | handlemap_VkImageMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 12961 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12962 | countingStream->rewind(); |
| 12963 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12964 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12965 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12966 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 12967 | } |
| 12968 | uint32_t packetSize_vkGetImageMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12969 | countingStream->rewind(); |
| 12970 | uint32_t opcode_vkGetImageMemoryRequirements2KHR = OP_vkGetImageMemoryRequirements2KHR; |
| 12971 | stream->write(&opcode_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| 12972 | stream->write(&packetSize_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12973 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 12974 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12975 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 12976 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12977 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12978 | } |
| 12979 | |
| 12980 | void VkEncoder::vkGetBufferMemoryRequirements2KHR( |
| 12981 | VkDevice device, |
| 12982 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 12983 | VkMemoryRequirements2* pMemoryRequirements) |
| 12984 | { |
| 12985 | auto stream = mImpl->stream(); |
| 12986 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12987 | auto resources = mImpl->resources(); |
| 12988 | auto pool = mImpl->pool(); |
| 12989 | VkDevice local_device; |
| 12990 | local_device = device; |
| 12991 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 12992 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| 12993 | local_pInfo = nullptr; |
| 12994 | if (pInfo) |
| 12995 | { |
| 12996 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 12997 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 12998 | } |
| 12999 | if (local_pInfo) |
| 13000 | { |
| 13001 | handlemap_VkBufferMemoryRequirementsInfo2(resources->unwrapMapping(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 13002 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13003 | countingStream->rewind(); |
| 13004 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13005 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13006 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13007 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 13008 | } |
| 13009 | uint32_t packetSize_vkGetBufferMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13010 | countingStream->rewind(); |
| 13011 | uint32_t opcode_vkGetBufferMemoryRequirements2KHR = OP_vkGetBufferMemoryRequirements2KHR; |
| 13012 | stream->write(&opcode_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| 13013 | stream->write(&packetSize_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13014 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13015 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13016 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 13017 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13018 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13019 | } |
| 13020 | |
| 13021 | void VkEncoder::vkGetImageSparseMemoryRequirements2KHR( |
| 13022 | VkDevice device, |
| 13023 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 13024 | uint32_t* pSparseMemoryRequirementCount, |
| 13025 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 13026 | { |
| 13027 | auto stream = mImpl->stream(); |
| 13028 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13029 | auto resources = mImpl->resources(); |
| 13030 | auto pool = mImpl->pool(); |
| 13031 | VkDevice local_device; |
| 13032 | local_device = device; |
| 13033 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 13034 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| 13035 | local_pInfo = nullptr; |
| 13036 | if (pInfo) |
| 13037 | { |
| 13038 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 13039 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 13040 | } |
| 13041 | if (local_pInfo) |
| 13042 | { |
| 13043 | handlemap_VkImageSparseMemoryRequirementsInfo2(resources->unwrapMapping(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 13044 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13045 | countingStream->rewind(); |
| 13046 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13047 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13048 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13049 | countingStream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*)); |
| 13050 | if (pSparseMemoryRequirementCount) |
| 13051 | { |
| 13052 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 13053 | } |
| 13054 | countingStream->write((VkSparseImageMemoryRequirements2**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*)); |
| 13055 | if (pSparseMemoryRequirements) |
| 13056 | { |
| 13057 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 13058 | { |
| 13059 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 13060 | } |
| 13061 | } |
| 13062 | } |
| 13063 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13064 | countingStream->rewind(); |
| 13065 | uint32_t opcode_vkGetImageSparseMemoryRequirements2KHR = OP_vkGetImageSparseMemoryRequirements2KHR; |
| 13066 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| 13067 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13068 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13069 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13070 | stream->write((uint32_t**)&pSparseMemoryRequirementCount, sizeof(uint32_t*)); |
| 13071 | if (pSparseMemoryRequirementCount) |
| 13072 | { |
| 13073 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 13074 | } |
| 13075 | stream->write((VkSparseImageMemoryRequirements2**)&pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*)); |
| 13076 | if (pSparseMemoryRequirements) |
| 13077 | { |
| 13078 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 13079 | { |
| 13080 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 13081 | } |
| 13082 | } |
| 13083 | uint32_t* check_pSparseMemoryRequirementCount; |
| 13084 | stream->read((uint32_t**)&check_pSparseMemoryRequirementCount, sizeof(uint32_t*)); |
| 13085 | if (pSparseMemoryRequirementCount) |
| 13086 | { |
| 13087 | if (!(check_pSparseMemoryRequirementCount)) |
| 13088 | { |
| 13089 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 13090 | } |
| 13091 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 13092 | } |
| 13093 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| 13094 | stream->read((VkSparseImageMemoryRequirements2**)&check_pSparseMemoryRequirements, sizeof(VkSparseImageMemoryRequirements2*)); |
| 13095 | if (pSparseMemoryRequirements) |
| 13096 | { |
| 13097 | if (!(check_pSparseMemoryRequirements)) |
| 13098 | { |
| 13099 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 13100 | } |
| 13101 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 13102 | { |
| 13103 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 13104 | } |
| 13105 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13106 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13107 | } |
| 13108 | |
| 13109 | #endif |
| 13110 | #ifdef VK_KHR_image_format_list |
| 13111 | #endif |
| 13112 | #ifdef VK_KHR_sampler_ycbcr_conversion |
| 13113 | VkResult VkEncoder::vkCreateSamplerYcbcrConversionKHR( |
| 13114 | VkDevice device, |
| 13115 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 13116 | const VkAllocationCallbacks* pAllocator, |
| 13117 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 13118 | { |
| 13119 | auto stream = mImpl->stream(); |
| 13120 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13121 | auto resources = mImpl->resources(); |
| 13122 | auto pool = mImpl->pool(); |
| 13123 | VkDevice local_device; |
| 13124 | local_device = device; |
| 13125 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 13126 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| 13127 | local_pCreateInfo = nullptr; |
| 13128 | if (pCreateInfo) |
| 13129 | { |
| 13130 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 13131 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 13132 | } |
| 13133 | if (local_pCreateInfo) |
| 13134 | { |
| 13135 | handlemap_VkSamplerYcbcrConversionCreateInfo(resources->unwrapMapping(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 13136 | } |
| 13137 | VkAllocationCallbacks* local_pAllocator; |
| 13138 | local_pAllocator = nullptr; |
| 13139 | if (pAllocator) |
| 13140 | { |
| 13141 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13142 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13143 | } |
| 13144 | if (local_pAllocator) |
| 13145 | { |
| 13146 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 13147 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 13148 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13149 | countingStream->rewind(); |
| 13150 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13151 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13152 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 13153 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 13154 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13155 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13156 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13157 | } |
| 13158 | countingStream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion)); |
| 13159 | } |
| 13160 | uint32_t packetSize_vkCreateSamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13161 | countingStream->rewind(); |
| 13162 | uint32_t opcode_vkCreateSamplerYcbcrConversionKHR = OP_vkCreateSamplerYcbcrConversionKHR; |
| 13163 | stream->write(&opcode_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 13164 | stream->write(&packetSize_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13165 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13166 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 13167 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 13168 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13169 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13170 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13171 | } |
| 13172 | stream->write((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion)); |
| 13173 | stream->read((VkSamplerYcbcrConversion*)pYcbcrConversion, sizeof(VkSamplerYcbcrConversion)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13174 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13175 | VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0; |
| 13176 | stream->read(&vkCreateSamplerYcbcrConversionKHR_VkResult_return, sizeof(VkResult)); |
| 13177 | return vkCreateSamplerYcbcrConversionKHR_VkResult_return; |
| 13178 | } |
| 13179 | |
| 13180 | void VkEncoder::vkDestroySamplerYcbcrConversionKHR( |
| 13181 | VkDevice device, |
| 13182 | VkSamplerYcbcrConversion ycbcrConversion, |
| 13183 | const VkAllocationCallbacks* pAllocator) |
| 13184 | { |
| 13185 | auto stream = mImpl->stream(); |
| 13186 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13187 | auto resources = mImpl->resources(); |
| 13188 | auto pool = mImpl->pool(); |
| 13189 | VkDevice local_device; |
| 13190 | local_device = device; |
| 13191 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 13192 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| 13193 | local_ycbcrConversion = ycbcrConversion; |
| 13194 | resources->unwrapMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&local_ycbcrConversion); |
| 13195 | VkAllocationCallbacks* local_pAllocator; |
| 13196 | local_pAllocator = nullptr; |
| 13197 | if (pAllocator) |
| 13198 | { |
| 13199 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13200 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13201 | } |
| 13202 | if (local_pAllocator) |
| 13203 | { |
| 13204 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 13205 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 13206 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13207 | countingStream->rewind(); |
| 13208 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13209 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13210 | countingStream->write((VkSamplerYcbcrConversion*)&local_ycbcrConversion, sizeof(VkSamplerYcbcrConversion)); |
| 13211 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 13212 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13213 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13214 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13215 | } |
| 13216 | } |
| 13217 | uint32_t packetSize_vkDestroySamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13218 | countingStream->rewind(); |
| 13219 | uint32_t opcode_vkDestroySamplerYcbcrConversionKHR = OP_vkDestroySamplerYcbcrConversionKHR; |
| 13220 | stream->write(&opcode_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 13221 | stream->write(&packetSize_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13222 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13223 | stream->write((VkSamplerYcbcrConversion*)&local_ycbcrConversion, sizeof(VkSamplerYcbcrConversion)); |
| 13224 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 13225 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13226 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13227 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13228 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13229 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13230 | } |
| 13231 | |
| 13232 | #endif |
| 13233 | #ifdef VK_KHR_bind_memory2 |
| 13234 | VkResult VkEncoder::vkBindBufferMemory2KHR( |
| 13235 | VkDevice device, |
| 13236 | uint32_t bindInfoCount, |
| 13237 | const VkBindBufferMemoryInfo* pBindInfos) |
| 13238 | { |
| 13239 | auto stream = mImpl->stream(); |
| 13240 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13241 | auto resources = mImpl->resources(); |
| 13242 | auto pool = mImpl->pool(); |
| 13243 | VkDevice local_device; |
| 13244 | local_device = device; |
| 13245 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 13246 | uint32_t local_bindInfoCount; |
| 13247 | local_bindInfoCount = bindInfoCount; |
| 13248 | VkBindBufferMemoryInfo* local_pBindInfos; |
| 13249 | local_pBindInfos = nullptr; |
| 13250 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13251 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13252 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13253 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 13254 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13255 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 13256 | } |
| 13257 | } |
| 13258 | if (local_pBindInfos) |
| 13259 | { |
| 13260 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 13261 | { |
| 13262 | handlemap_VkBindBufferMemoryInfo(resources->unwrapMapping(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 13263 | } |
| 13264 | } |
| 13265 | countingStream->rewind(); |
| 13266 | { |
| 13267 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13268 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 13269 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 13270 | { |
| 13271 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13272 | } |
| 13273 | } |
| 13274 | uint32_t packetSize_vkBindBufferMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13275 | countingStream->rewind(); |
| 13276 | uint32_t opcode_vkBindBufferMemory2KHR = OP_vkBindBufferMemory2KHR; |
| 13277 | stream->write(&opcode_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| 13278 | stream->write(&packetSize_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13279 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13280 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13281 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 13282 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13283 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13284 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13285 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13286 | VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0; |
| 13287 | stream->read(&vkBindBufferMemory2KHR_VkResult_return, sizeof(VkResult)); |
| 13288 | return vkBindBufferMemory2KHR_VkResult_return; |
| 13289 | } |
| 13290 | |
| 13291 | VkResult VkEncoder::vkBindImageMemory2KHR( |
| 13292 | VkDevice device, |
| 13293 | uint32_t bindInfoCount, |
| 13294 | const VkBindImageMemoryInfo* pBindInfos) |
| 13295 | { |
| 13296 | auto stream = mImpl->stream(); |
| 13297 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13298 | auto resources = mImpl->resources(); |
| 13299 | auto pool = mImpl->pool(); |
| 13300 | VkDevice local_device; |
| 13301 | local_device = device; |
| 13302 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 13303 | uint32_t local_bindInfoCount; |
| 13304 | local_bindInfoCount = bindInfoCount; |
| 13305 | VkBindImageMemoryInfo* local_pBindInfos; |
| 13306 | local_pBindInfos = nullptr; |
| 13307 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13308 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13309 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13310 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 13311 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13312 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 13313 | } |
| 13314 | } |
| 13315 | if (local_pBindInfos) |
| 13316 | { |
| 13317 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 13318 | { |
| 13319 | handlemap_VkBindImageMemoryInfo(resources->unwrapMapping(), (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 13320 | } |
| 13321 | } |
| 13322 | countingStream->rewind(); |
| 13323 | { |
| 13324 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13325 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 13326 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 13327 | { |
| 13328 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13329 | } |
| 13330 | } |
| 13331 | uint32_t packetSize_vkBindImageMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13332 | countingStream->rewind(); |
| 13333 | uint32_t opcode_vkBindImageMemory2KHR = OP_vkBindImageMemory2KHR; |
| 13334 | stream->write(&opcode_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| 13335 | stream->write(&packetSize_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13336 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13337 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13338 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 13339 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13340 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13341 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13342 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13343 | VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0; |
| 13344 | stream->read(&vkBindImageMemory2KHR_VkResult_return, sizeof(VkResult)); |
| 13345 | return vkBindImageMemory2KHR_VkResult_return; |
| 13346 | } |
| 13347 | |
| 13348 | #endif |
| 13349 | #ifdef VK_KHR_maintenance3 |
| 13350 | void VkEncoder::vkGetDescriptorSetLayoutSupportKHR( |
| 13351 | VkDevice device, |
| 13352 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 13353 | VkDescriptorSetLayoutSupport* pSupport) |
| 13354 | { |
| 13355 | auto stream = mImpl->stream(); |
| 13356 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13357 | auto resources = mImpl->resources(); |
| 13358 | auto pool = mImpl->pool(); |
| 13359 | VkDevice local_device; |
| 13360 | local_device = device; |
| 13361 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 13362 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| 13363 | local_pCreateInfo = nullptr; |
| 13364 | if (pCreateInfo) |
| 13365 | { |
| 13366 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 13367 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 13368 | } |
| 13369 | if (local_pCreateInfo) |
| 13370 | { |
| 13371 | handlemap_VkDescriptorSetLayoutCreateInfo(resources->unwrapMapping(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 13372 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13373 | countingStream->rewind(); |
| 13374 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13375 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13376 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13377 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 13378 | } |
| 13379 | uint32_t packetSize_vkGetDescriptorSetLayoutSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13380 | countingStream->rewind(); |
| 13381 | uint32_t opcode_vkGetDescriptorSetLayoutSupportKHR = OP_vkGetDescriptorSetLayoutSupportKHR; |
| 13382 | stream->write(&opcode_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| 13383 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13384 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13385 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13386 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 13387 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13388 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13389 | } |
| 13390 | |
| 13391 | #endif |
| 13392 | #ifdef VK_KHR_draw_indirect_count |
| 13393 | void VkEncoder::vkCmdDrawIndirectCountKHR( |
| 13394 | VkCommandBuffer commandBuffer, |
| 13395 | VkBuffer buffer, |
| 13396 | VkDeviceSize offset, |
| 13397 | VkBuffer countBuffer, |
| 13398 | VkDeviceSize countBufferOffset, |
| 13399 | uint32_t maxDrawCount, |
| 13400 | uint32_t stride) |
| 13401 | { |
| 13402 | auto stream = mImpl->stream(); |
| 13403 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13404 | auto resources = mImpl->resources(); |
| 13405 | auto pool = mImpl->pool(); |
| 13406 | VkCommandBuffer local_commandBuffer; |
| 13407 | local_commandBuffer = commandBuffer; |
| 13408 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 13409 | VkBuffer local_buffer; |
| 13410 | local_buffer = buffer; |
| 13411 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer); |
| 13412 | VkDeviceSize local_offset; |
| 13413 | local_offset = offset; |
| 13414 | VkBuffer local_countBuffer; |
| 13415 | local_countBuffer = countBuffer; |
| 13416 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer); |
| 13417 | VkDeviceSize local_countBufferOffset; |
| 13418 | local_countBufferOffset = countBufferOffset; |
| 13419 | uint32_t local_maxDrawCount; |
| 13420 | local_maxDrawCount = maxDrawCount; |
| 13421 | uint32_t local_stride; |
| 13422 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13423 | countingStream->rewind(); |
| 13424 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13425 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13426 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 13427 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 13428 | countingStream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer)); |
| 13429 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 13430 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 13431 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13432 | } |
| 13433 | uint32_t packetSize_vkCmdDrawIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13434 | countingStream->rewind(); |
| 13435 | uint32_t opcode_vkCmdDrawIndirectCountKHR = OP_vkCmdDrawIndirectCountKHR; |
| 13436 | stream->write(&opcode_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| 13437 | stream->write(&packetSize_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13438 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13439 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 13440 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 13441 | stream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer)); |
| 13442 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 13443 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 13444 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| 13445 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13446 | } |
| 13447 | |
| 13448 | void VkEncoder::vkCmdDrawIndexedIndirectCountKHR( |
| 13449 | VkCommandBuffer commandBuffer, |
| 13450 | VkBuffer buffer, |
| 13451 | VkDeviceSize offset, |
| 13452 | VkBuffer countBuffer, |
| 13453 | VkDeviceSize countBufferOffset, |
| 13454 | uint32_t maxDrawCount, |
| 13455 | uint32_t stride) |
| 13456 | { |
| 13457 | auto stream = mImpl->stream(); |
| 13458 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13459 | auto resources = mImpl->resources(); |
| 13460 | auto pool = mImpl->pool(); |
| 13461 | VkCommandBuffer local_commandBuffer; |
| 13462 | local_commandBuffer = commandBuffer; |
| 13463 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 13464 | VkBuffer local_buffer; |
| 13465 | local_buffer = buffer; |
| 13466 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer); |
| 13467 | VkDeviceSize local_offset; |
| 13468 | local_offset = offset; |
| 13469 | VkBuffer local_countBuffer; |
| 13470 | local_countBuffer = countBuffer; |
| 13471 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer); |
| 13472 | VkDeviceSize local_countBufferOffset; |
| 13473 | local_countBufferOffset = countBufferOffset; |
| 13474 | uint32_t local_maxDrawCount; |
| 13475 | local_maxDrawCount = maxDrawCount; |
| 13476 | uint32_t local_stride; |
| 13477 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13478 | countingStream->rewind(); |
| 13479 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13480 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13481 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 13482 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 13483 | countingStream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer)); |
| 13484 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 13485 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 13486 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13487 | } |
| 13488 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13489 | countingStream->rewind(); |
| 13490 | uint32_t opcode_vkCmdDrawIndexedIndirectCountKHR = OP_vkCmdDrawIndexedIndirectCountKHR; |
| 13491 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| 13492 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13493 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13494 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 13495 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 13496 | stream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer)); |
| 13497 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 13498 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 13499 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| 13500 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13501 | } |
| 13502 | |
| 13503 | #endif |
| 13504 | #ifdef VK_KHR_8bit_storage |
| 13505 | #endif |
| 13506 | #ifdef VK_EXT_debug_report |
| 13507 | VkResult VkEncoder::vkCreateDebugReportCallbackEXT( |
| 13508 | VkInstance instance, |
| 13509 | const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, |
| 13510 | const VkAllocationCallbacks* pAllocator, |
| 13511 | VkDebugReportCallbackEXT* pCallback) |
| 13512 | { |
| 13513 | auto stream = mImpl->stream(); |
| 13514 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13515 | auto resources = mImpl->resources(); |
| 13516 | auto pool = mImpl->pool(); |
| 13517 | VkInstance local_instance; |
| 13518 | local_instance = instance; |
| 13519 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 13520 | VkDebugReportCallbackCreateInfoEXT* local_pCreateInfo; |
| 13521 | local_pCreateInfo = nullptr; |
| 13522 | if (pCreateInfo) |
| 13523 | { |
| 13524 | local_pCreateInfo = (VkDebugReportCallbackCreateInfoEXT*)pool->alloc(sizeof(const VkDebugReportCallbackCreateInfoEXT)); |
| 13525 | deepcopy_VkDebugReportCallbackCreateInfoEXT(pool, pCreateInfo, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| 13526 | } |
| 13527 | if (local_pCreateInfo) |
| 13528 | { |
| 13529 | handlemap_VkDebugReportCallbackCreateInfoEXT(resources->unwrapMapping(), (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| 13530 | } |
| 13531 | VkAllocationCallbacks* local_pAllocator; |
| 13532 | local_pAllocator = nullptr; |
| 13533 | if (pAllocator) |
| 13534 | { |
| 13535 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13536 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13537 | } |
| 13538 | if (local_pAllocator) |
| 13539 | { |
| 13540 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 13541 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 13542 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13543 | countingStream->rewind(); |
| 13544 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13545 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 13546 | marshal_VkDebugReportCallbackCreateInfoEXT(countingStream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| 13547 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 13548 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13549 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13550 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13551 | } |
| 13552 | countingStream->write((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT)); |
| 13553 | } |
| 13554 | uint32_t packetSize_vkCreateDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13555 | countingStream->rewind(); |
| 13556 | uint32_t opcode_vkCreateDebugReportCallbackEXT = OP_vkCreateDebugReportCallbackEXT; |
| 13557 | stream->write(&opcode_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| 13558 | stream->write(&packetSize_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13559 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 13560 | marshal_VkDebugReportCallbackCreateInfoEXT(stream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| 13561 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 13562 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13563 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13564 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13565 | } |
| 13566 | stream->write((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT)); |
| 13567 | stream->read((VkDebugReportCallbackEXT*)pCallback, sizeof(VkDebugReportCallbackEXT)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13568 | if (pCallback) |
| 13569 | { |
| 13570 | resources->createMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)pCallback, 1); |
| 13571 | } |
| 13572 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13573 | VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0; |
| 13574 | stream->read(&vkCreateDebugReportCallbackEXT_VkResult_return, sizeof(VkResult)); |
| 13575 | return vkCreateDebugReportCallbackEXT_VkResult_return; |
| 13576 | } |
| 13577 | |
| 13578 | void VkEncoder::vkDestroyDebugReportCallbackEXT( |
| 13579 | VkInstance instance, |
| 13580 | VkDebugReportCallbackEXT callback, |
| 13581 | const VkAllocationCallbacks* pAllocator) |
| 13582 | { |
| 13583 | auto stream = mImpl->stream(); |
| 13584 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13585 | auto resources = mImpl->resources(); |
| 13586 | auto pool = mImpl->pool(); |
| 13587 | VkInstance local_instance; |
| 13588 | local_instance = instance; |
| 13589 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 13590 | VkDebugReportCallbackEXT local_callback; |
| 13591 | local_callback = callback; |
| 13592 | resources->unwrapMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)&local_callback); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13593 | VkAllocationCallbacks* local_pAllocator; |
| 13594 | local_pAllocator = nullptr; |
| 13595 | if (pAllocator) |
| 13596 | { |
| 13597 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13598 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13599 | } |
| 13600 | if (local_pAllocator) |
| 13601 | { |
| 13602 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 13603 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 13604 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13605 | countingStream->rewind(); |
| 13606 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13607 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 13608 | countingStream->write((VkDebugReportCallbackEXT*)&local_callback, sizeof(VkDebugReportCallbackEXT)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13609 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 13610 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13611 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13612 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13613 | } |
| 13614 | } |
| 13615 | uint32_t packetSize_vkDestroyDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13616 | countingStream->rewind(); |
| 13617 | uint32_t opcode_vkDestroyDebugReportCallbackEXT = OP_vkDestroyDebugReportCallbackEXT; |
| 13618 | stream->write(&opcode_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| 13619 | stream->write(&packetSize_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13620 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 13621 | stream->write((VkDebugReportCallbackEXT*)&local_callback, sizeof(VkDebugReportCallbackEXT)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13622 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 13623 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13624 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13625 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13626 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13627 | resources->destroyMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)&callback); |
| 13628 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13629 | } |
| 13630 | |
| 13631 | void VkEncoder::vkDebugReportMessageEXT( |
| 13632 | VkInstance instance, |
| 13633 | VkDebugReportFlagsEXT flags, |
| 13634 | VkDebugReportObjectTypeEXT objectType, |
| 13635 | uint64_t object, |
| 13636 | size_t location, |
| 13637 | int32_t messageCode, |
| 13638 | const char* pLayerPrefix, |
| 13639 | const char* pMessage) |
| 13640 | { |
| 13641 | auto stream = mImpl->stream(); |
| 13642 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13643 | auto resources = mImpl->resources(); |
| 13644 | auto pool = mImpl->pool(); |
| 13645 | VkInstance local_instance; |
| 13646 | local_instance = instance; |
| 13647 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 13648 | VkDebugReportFlagsEXT local_flags; |
| 13649 | local_flags = flags; |
| 13650 | VkDebugReportObjectTypeEXT local_objectType; |
| 13651 | local_objectType = objectType; |
| 13652 | uint64_t local_object; |
| 13653 | local_object = object; |
| 13654 | size_t local_location; |
| 13655 | local_location = location; |
| 13656 | int32_t local_messageCode; |
| 13657 | local_messageCode = messageCode; |
| 13658 | char* local_pLayerPrefix; |
| 13659 | local_pLayerPrefix = nullptr; |
| 13660 | if (pLayerPrefix) |
| 13661 | { |
| 13662 | local_pLayerPrefix = pool->strDup(pLayerPrefix); |
| 13663 | } |
| 13664 | char* local_pMessage; |
| 13665 | local_pMessage = nullptr; |
| 13666 | if (pMessage) |
| 13667 | { |
| 13668 | local_pMessage = pool->strDup(pMessage); |
| 13669 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13670 | countingStream->rewind(); |
| 13671 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13672 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 13673 | countingStream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 13674 | countingStream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 13675 | countingStream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| 13676 | countingStream->write((size_t*)&local_location, sizeof(size_t)); |
| 13677 | countingStream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 13678 | countingStream->putString(local_pLayerPrefix); |
| 13679 | countingStream->putString(local_pMessage); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13680 | } |
| 13681 | uint32_t packetSize_vkDebugReportMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13682 | countingStream->rewind(); |
| 13683 | uint32_t opcode_vkDebugReportMessageEXT = OP_vkDebugReportMessageEXT; |
| 13684 | stream->write(&opcode_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| 13685 | stream->write(&packetSize_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13686 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 13687 | stream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 13688 | stream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 13689 | stream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| 13690 | stream->write((size_t*)&local_location, sizeof(size_t)); |
| 13691 | stream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 13692 | stream->putString(local_pLayerPrefix); |
| 13693 | stream->putString(local_pMessage); |
| 13694 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13695 | } |
| 13696 | |
| 13697 | #endif |
| 13698 | #ifdef VK_NV_glsl_shader |
| 13699 | #endif |
| 13700 | #ifdef VK_EXT_depth_range_unrestricted |
| 13701 | #endif |
| 13702 | #ifdef VK_IMG_filter_cubic |
| 13703 | #endif |
| 13704 | #ifdef VK_AMD_rasterization_order |
| 13705 | #endif |
| 13706 | #ifdef VK_AMD_shader_trinary_minmax |
| 13707 | #endif |
| 13708 | #ifdef VK_AMD_shader_explicit_vertex_parameter |
| 13709 | #endif |
| 13710 | #ifdef VK_EXT_debug_marker |
| 13711 | VkResult VkEncoder::vkDebugMarkerSetObjectTagEXT( |
| 13712 | VkDevice device, |
| 13713 | const VkDebugMarkerObjectTagInfoEXT* pTagInfo) |
| 13714 | { |
| 13715 | auto stream = mImpl->stream(); |
| 13716 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13717 | auto resources = mImpl->resources(); |
| 13718 | auto pool = mImpl->pool(); |
| 13719 | VkDevice local_device; |
| 13720 | local_device = device; |
| 13721 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 13722 | VkDebugMarkerObjectTagInfoEXT* local_pTagInfo; |
| 13723 | local_pTagInfo = nullptr; |
| 13724 | if (pTagInfo) |
| 13725 | { |
| 13726 | local_pTagInfo = (VkDebugMarkerObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectTagInfoEXT)); |
| 13727 | deepcopy_VkDebugMarkerObjectTagInfoEXT(pool, pTagInfo, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| 13728 | } |
| 13729 | if (local_pTagInfo) |
| 13730 | { |
| 13731 | handlemap_VkDebugMarkerObjectTagInfoEXT(resources->unwrapMapping(), (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| 13732 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13733 | countingStream->rewind(); |
| 13734 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13735 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13736 | marshal_VkDebugMarkerObjectTagInfoEXT(countingStream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13737 | } |
| 13738 | uint32_t packetSize_vkDebugMarkerSetObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13739 | countingStream->rewind(); |
| 13740 | uint32_t opcode_vkDebugMarkerSetObjectTagEXT = OP_vkDebugMarkerSetObjectTagEXT; |
| 13741 | stream->write(&opcode_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| 13742 | stream->write(&packetSize_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13743 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13744 | marshal_VkDebugMarkerObjectTagInfoEXT(stream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| 13745 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13746 | VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0; |
| 13747 | stream->read(&vkDebugMarkerSetObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| 13748 | return vkDebugMarkerSetObjectTagEXT_VkResult_return; |
| 13749 | } |
| 13750 | |
| 13751 | VkResult VkEncoder::vkDebugMarkerSetObjectNameEXT( |
| 13752 | VkDevice device, |
| 13753 | const VkDebugMarkerObjectNameInfoEXT* pNameInfo) |
| 13754 | { |
| 13755 | auto stream = mImpl->stream(); |
| 13756 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13757 | auto resources = mImpl->resources(); |
| 13758 | auto pool = mImpl->pool(); |
| 13759 | VkDevice local_device; |
| 13760 | local_device = device; |
| 13761 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 13762 | VkDebugMarkerObjectNameInfoEXT* local_pNameInfo; |
| 13763 | local_pNameInfo = nullptr; |
| 13764 | if (pNameInfo) |
| 13765 | { |
| 13766 | local_pNameInfo = (VkDebugMarkerObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectNameInfoEXT)); |
| 13767 | deepcopy_VkDebugMarkerObjectNameInfoEXT(pool, pNameInfo, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| 13768 | } |
| 13769 | if (local_pNameInfo) |
| 13770 | { |
| 13771 | handlemap_VkDebugMarkerObjectNameInfoEXT(resources->unwrapMapping(), (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| 13772 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13773 | countingStream->rewind(); |
| 13774 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13775 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13776 | marshal_VkDebugMarkerObjectNameInfoEXT(countingStream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13777 | } |
| 13778 | uint32_t packetSize_vkDebugMarkerSetObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13779 | countingStream->rewind(); |
| 13780 | uint32_t opcode_vkDebugMarkerSetObjectNameEXT = OP_vkDebugMarkerSetObjectNameEXT; |
| 13781 | stream->write(&opcode_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| 13782 | stream->write(&packetSize_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13783 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 13784 | marshal_VkDebugMarkerObjectNameInfoEXT(stream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| 13785 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13786 | VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0; |
| 13787 | stream->read(&vkDebugMarkerSetObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| 13788 | return vkDebugMarkerSetObjectNameEXT_VkResult_return; |
| 13789 | } |
| 13790 | |
| 13791 | void VkEncoder::vkCmdDebugMarkerBeginEXT( |
| 13792 | VkCommandBuffer commandBuffer, |
| 13793 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 13794 | { |
| 13795 | auto stream = mImpl->stream(); |
| 13796 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13797 | auto resources = mImpl->resources(); |
| 13798 | auto pool = mImpl->pool(); |
| 13799 | VkCommandBuffer local_commandBuffer; |
| 13800 | local_commandBuffer = commandBuffer; |
| 13801 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 13802 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| 13803 | local_pMarkerInfo = nullptr; |
| 13804 | if (pMarkerInfo) |
| 13805 | { |
| 13806 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 13807 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 13808 | } |
| 13809 | if (local_pMarkerInfo) |
| 13810 | { |
| 13811 | handlemap_VkDebugMarkerMarkerInfoEXT(resources->unwrapMapping(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 13812 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13813 | countingStream->rewind(); |
| 13814 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13815 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13816 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13817 | } |
| 13818 | uint32_t packetSize_vkCmdDebugMarkerBeginEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13819 | countingStream->rewind(); |
| 13820 | uint32_t opcode_vkCmdDebugMarkerBeginEXT = OP_vkCmdDebugMarkerBeginEXT; |
| 13821 | stream->write(&opcode_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| 13822 | stream->write(&packetSize_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13823 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13824 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 13825 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13826 | } |
| 13827 | |
| 13828 | void VkEncoder::vkCmdDebugMarkerEndEXT( |
| 13829 | VkCommandBuffer commandBuffer) |
| 13830 | { |
| 13831 | auto stream = mImpl->stream(); |
| 13832 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13833 | auto resources = mImpl->resources(); |
| 13834 | auto pool = mImpl->pool(); |
| 13835 | VkCommandBuffer local_commandBuffer; |
| 13836 | local_commandBuffer = commandBuffer; |
| 13837 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13838 | countingStream->rewind(); |
| 13839 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13840 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13841 | } |
| 13842 | uint32_t packetSize_vkCmdDebugMarkerEndEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13843 | countingStream->rewind(); |
| 13844 | uint32_t opcode_vkCmdDebugMarkerEndEXT = OP_vkCmdDebugMarkerEndEXT; |
| 13845 | stream->write(&opcode_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| 13846 | stream->write(&packetSize_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13847 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13848 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13849 | } |
| 13850 | |
| 13851 | void VkEncoder::vkCmdDebugMarkerInsertEXT( |
| 13852 | VkCommandBuffer commandBuffer, |
| 13853 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 13854 | { |
| 13855 | auto stream = mImpl->stream(); |
| 13856 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13857 | auto resources = mImpl->resources(); |
| 13858 | auto pool = mImpl->pool(); |
| 13859 | VkCommandBuffer local_commandBuffer; |
| 13860 | local_commandBuffer = commandBuffer; |
| 13861 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 13862 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| 13863 | local_pMarkerInfo = nullptr; |
| 13864 | if (pMarkerInfo) |
| 13865 | { |
| 13866 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 13867 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 13868 | } |
| 13869 | if (local_pMarkerInfo) |
| 13870 | { |
| 13871 | handlemap_VkDebugMarkerMarkerInfoEXT(resources->unwrapMapping(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 13872 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13873 | countingStream->rewind(); |
| 13874 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13875 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13876 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13877 | } |
| 13878 | uint32_t packetSize_vkCmdDebugMarkerInsertEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13879 | countingStream->rewind(); |
| 13880 | uint32_t opcode_vkCmdDebugMarkerInsertEXT = OP_vkCmdDebugMarkerInsertEXT; |
| 13881 | stream->write(&opcode_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| 13882 | stream->write(&packetSize_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13883 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13884 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 13885 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13886 | } |
| 13887 | |
| 13888 | #endif |
| 13889 | #ifdef VK_AMD_gcn_shader |
| 13890 | #endif |
| 13891 | #ifdef VK_NV_dedicated_allocation |
| 13892 | #endif |
| 13893 | #ifdef VK_AMD_draw_indirect_count |
| 13894 | void VkEncoder::vkCmdDrawIndirectCountAMD( |
| 13895 | VkCommandBuffer commandBuffer, |
| 13896 | VkBuffer buffer, |
| 13897 | VkDeviceSize offset, |
| 13898 | VkBuffer countBuffer, |
| 13899 | VkDeviceSize countBufferOffset, |
| 13900 | uint32_t maxDrawCount, |
| 13901 | uint32_t stride) |
| 13902 | { |
| 13903 | auto stream = mImpl->stream(); |
| 13904 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13905 | auto resources = mImpl->resources(); |
| 13906 | auto pool = mImpl->pool(); |
| 13907 | VkCommandBuffer local_commandBuffer; |
| 13908 | local_commandBuffer = commandBuffer; |
| 13909 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 13910 | VkBuffer local_buffer; |
| 13911 | local_buffer = buffer; |
| 13912 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer); |
| 13913 | VkDeviceSize local_offset; |
| 13914 | local_offset = offset; |
| 13915 | VkBuffer local_countBuffer; |
| 13916 | local_countBuffer = countBuffer; |
| 13917 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer); |
| 13918 | VkDeviceSize local_countBufferOffset; |
| 13919 | local_countBufferOffset = countBufferOffset; |
| 13920 | uint32_t local_maxDrawCount; |
| 13921 | local_maxDrawCount = maxDrawCount; |
| 13922 | uint32_t local_stride; |
| 13923 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13924 | countingStream->rewind(); |
| 13925 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13926 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13927 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 13928 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 13929 | countingStream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer)); |
| 13930 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 13931 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 13932 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13933 | } |
| 13934 | uint32_t packetSize_vkCmdDrawIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13935 | countingStream->rewind(); |
| 13936 | uint32_t opcode_vkCmdDrawIndirectCountAMD = OP_vkCmdDrawIndirectCountAMD; |
| 13937 | stream->write(&opcode_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| 13938 | stream->write(&packetSize_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13939 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13940 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 13941 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 13942 | stream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer)); |
| 13943 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 13944 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 13945 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| 13946 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13947 | } |
| 13948 | |
| 13949 | void VkEncoder::vkCmdDrawIndexedIndirectCountAMD( |
| 13950 | VkCommandBuffer commandBuffer, |
| 13951 | VkBuffer buffer, |
| 13952 | VkDeviceSize offset, |
| 13953 | VkBuffer countBuffer, |
| 13954 | VkDeviceSize countBufferOffset, |
| 13955 | uint32_t maxDrawCount, |
| 13956 | uint32_t stride) |
| 13957 | { |
| 13958 | auto stream = mImpl->stream(); |
| 13959 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13960 | auto resources = mImpl->resources(); |
| 13961 | auto pool = mImpl->pool(); |
| 13962 | VkCommandBuffer local_commandBuffer; |
| 13963 | local_commandBuffer = commandBuffer; |
| 13964 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 13965 | VkBuffer local_buffer; |
| 13966 | local_buffer = buffer; |
| 13967 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_buffer); |
| 13968 | VkDeviceSize local_offset; |
| 13969 | local_offset = offset; |
| 13970 | VkBuffer local_countBuffer; |
| 13971 | local_countBuffer = countBuffer; |
| 13972 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_countBuffer); |
| 13973 | VkDeviceSize local_countBufferOffset; |
| 13974 | local_countBufferOffset = countBufferOffset; |
| 13975 | uint32_t local_maxDrawCount; |
| 13976 | local_maxDrawCount = maxDrawCount; |
| 13977 | uint32_t local_stride; |
| 13978 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13979 | countingStream->rewind(); |
| 13980 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13981 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13982 | countingStream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 13983 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 13984 | countingStream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer)); |
| 13985 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 13986 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 13987 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13988 | } |
| 13989 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13990 | countingStream->rewind(); |
| 13991 | uint32_t opcode_vkCmdDrawIndexedIndirectCountAMD = OP_vkCmdDrawIndexedIndirectCountAMD; |
| 13992 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| 13993 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13994 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 13995 | stream->write((VkBuffer*)&local_buffer, sizeof(VkBuffer)); |
| 13996 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 13997 | stream->write((VkBuffer*)&local_countBuffer, sizeof(VkBuffer)); |
| 13998 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 13999 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 14000 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| 14001 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14002 | } |
| 14003 | |
| 14004 | #endif |
| 14005 | #ifdef VK_AMD_negative_viewport_height |
| 14006 | #endif |
| 14007 | #ifdef VK_AMD_gpu_shader_half_float |
| 14008 | #endif |
| 14009 | #ifdef VK_AMD_shader_ballot |
| 14010 | #endif |
| 14011 | #ifdef VK_AMD_texture_gather_bias_lod |
| 14012 | #endif |
| 14013 | #ifdef VK_AMD_shader_info |
| 14014 | VkResult VkEncoder::vkGetShaderInfoAMD( |
| 14015 | VkDevice device, |
| 14016 | VkPipeline pipeline, |
| 14017 | VkShaderStageFlagBits shaderStage, |
| 14018 | VkShaderInfoTypeAMD infoType, |
| 14019 | size_t* pInfoSize, |
| 14020 | void* pInfo) |
| 14021 | { |
| 14022 | auto stream = mImpl->stream(); |
| 14023 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14024 | auto resources = mImpl->resources(); |
| 14025 | auto pool = mImpl->pool(); |
| 14026 | VkDevice local_device; |
| 14027 | local_device = device; |
| 14028 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 14029 | VkPipeline local_pipeline; |
| 14030 | local_pipeline = pipeline; |
| 14031 | resources->unwrapMapping()->mapHandles_VkPipeline((VkPipeline*)&local_pipeline); |
| 14032 | VkShaderStageFlagBits local_shaderStage; |
| 14033 | local_shaderStage = shaderStage; |
| 14034 | VkShaderInfoTypeAMD local_infoType; |
| 14035 | local_infoType = infoType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14036 | countingStream->rewind(); |
| 14037 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14038 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14039 | countingStream->write((VkPipeline*)&local_pipeline, sizeof(VkPipeline)); |
| 14040 | countingStream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 14041 | countingStream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14042 | countingStream->write((size_t**)&pInfoSize, sizeof(size_t*)); |
| 14043 | if (pInfoSize) |
| 14044 | { |
| 14045 | countingStream->write((size_t*)pInfoSize, sizeof(size_t)); |
| 14046 | } |
| 14047 | countingStream->write((void**)&pInfo, sizeof(void*)); |
| 14048 | if (pInfo) |
| 14049 | { |
| 14050 | countingStream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 14051 | } |
| 14052 | } |
| 14053 | uint32_t packetSize_vkGetShaderInfoAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14054 | countingStream->rewind(); |
| 14055 | uint32_t opcode_vkGetShaderInfoAMD = OP_vkGetShaderInfoAMD; |
| 14056 | stream->write(&opcode_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| 14057 | stream->write(&packetSize_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14058 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14059 | stream->write((VkPipeline*)&local_pipeline, sizeof(VkPipeline)); |
| 14060 | stream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 14061 | stream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14062 | stream->write((size_t**)&pInfoSize, sizeof(size_t*)); |
| 14063 | if (pInfoSize) |
| 14064 | { |
| 14065 | stream->write((size_t*)pInfoSize, sizeof(size_t)); |
| 14066 | } |
| 14067 | stream->write((void**)&pInfo, sizeof(void*)); |
| 14068 | if (pInfo) |
| 14069 | { |
| 14070 | stream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 14071 | } |
| 14072 | size_t* check_pInfoSize; |
| 14073 | stream->read((size_t**)&check_pInfoSize, sizeof(size_t*)); |
| 14074 | if (pInfoSize) |
| 14075 | { |
| 14076 | if (!(check_pInfoSize)) |
| 14077 | { |
| 14078 | fprintf(stderr, "fatal: pInfoSize inconsistent between guest and host\n"); |
| 14079 | } |
| 14080 | stream->read((size_t*)pInfoSize, sizeof(size_t)); |
| 14081 | } |
| 14082 | void* check_pInfo; |
| 14083 | stream->read((void**)&check_pInfo, sizeof(void*)); |
| 14084 | if (pInfo) |
| 14085 | { |
| 14086 | if (!(check_pInfo)) |
| 14087 | { |
| 14088 | fprintf(stderr, "fatal: pInfo inconsistent between guest and host\n"); |
| 14089 | } |
| 14090 | stream->read((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 14091 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14092 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14093 | VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0; |
| 14094 | stream->read(&vkGetShaderInfoAMD_VkResult_return, sizeof(VkResult)); |
| 14095 | return vkGetShaderInfoAMD_VkResult_return; |
| 14096 | } |
| 14097 | |
| 14098 | #endif |
| 14099 | #ifdef VK_AMD_shader_image_load_store_lod |
| 14100 | #endif |
| 14101 | #ifdef VK_IMG_format_pvrtc |
| 14102 | #endif |
| 14103 | #ifdef VK_NV_external_memory_capabilities |
| 14104 | VkResult VkEncoder::vkGetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 14105 | VkPhysicalDevice physicalDevice, |
| 14106 | VkFormat format, |
| 14107 | VkImageType type, |
| 14108 | VkImageTiling tiling, |
| 14109 | VkImageUsageFlags usage, |
| 14110 | VkImageCreateFlags flags, |
| 14111 | VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 14112 | VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) |
| 14113 | { |
| 14114 | auto stream = mImpl->stream(); |
| 14115 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14116 | auto resources = mImpl->resources(); |
| 14117 | auto pool = mImpl->pool(); |
| 14118 | VkPhysicalDevice local_physicalDevice; |
| 14119 | local_physicalDevice = physicalDevice; |
| 14120 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 14121 | VkFormat local_format; |
| 14122 | local_format = format; |
| 14123 | VkImageType local_type; |
| 14124 | local_type = type; |
| 14125 | VkImageTiling local_tiling; |
| 14126 | local_tiling = tiling; |
| 14127 | VkImageUsageFlags local_usage; |
| 14128 | local_usage = usage; |
| 14129 | VkImageCreateFlags local_flags; |
| 14130 | local_flags = flags; |
| 14131 | VkExternalMemoryHandleTypeFlagsNV local_externalHandleType; |
| 14132 | local_externalHandleType = externalHandleType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14133 | countingStream->rewind(); |
| 14134 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14135 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 14136 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 14137 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 14138 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 14139 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 14140 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 14141 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14142 | marshal_VkExternalImageFormatPropertiesNV(countingStream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 14143 | } |
| 14144 | uint32_t packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14145 | countingStream->rewind(); |
| 14146 | uint32_t opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV; |
| 14147 | stream->write(&opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| 14148 | stream->write(&packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14149 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 14150 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 14151 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 14152 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 14153 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 14154 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 14155 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14156 | marshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 14157 | unmarshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14158 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14159 | VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0; |
| 14160 | stream->read(&vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return, sizeof(VkResult)); |
| 14161 | return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return; |
| 14162 | } |
| 14163 | |
| 14164 | #endif |
| 14165 | #ifdef VK_NV_external_memory |
| 14166 | #endif |
| 14167 | #ifdef VK_NV_external_memory_win32 |
| 14168 | VkResult VkEncoder::vkGetMemoryWin32HandleNV( |
| 14169 | VkDevice device, |
| 14170 | VkDeviceMemory memory, |
| 14171 | VkExternalMemoryHandleTypeFlagsNV handleType, |
| 14172 | HANDLE* pHandle) |
| 14173 | { |
| 14174 | auto stream = mImpl->stream(); |
| 14175 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14176 | auto resources = mImpl->resources(); |
| 14177 | auto pool = mImpl->pool(); |
| 14178 | VkDevice local_device; |
| 14179 | local_device = device; |
| 14180 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 14181 | VkDeviceMemory local_memory; |
| 14182 | local_memory = memory; |
| 14183 | resources->unwrapMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&local_memory); |
| 14184 | VkExternalMemoryHandleTypeFlagsNV local_handleType; |
| 14185 | local_handleType = handleType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14186 | countingStream->rewind(); |
| 14187 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14188 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14189 | countingStream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory)); |
| 14190 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14191 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14192 | } |
| 14193 | uint32_t packetSize_vkGetMemoryWin32HandleNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14194 | countingStream->rewind(); |
| 14195 | uint32_t opcode_vkGetMemoryWin32HandleNV = OP_vkGetMemoryWin32HandleNV; |
| 14196 | stream->write(&opcode_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| 14197 | stream->write(&packetSize_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14198 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14199 | stream->write((VkDeviceMemory*)&local_memory, sizeof(VkDeviceMemory)); |
| 14200 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14201 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14202 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14203 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14204 | VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0; |
| 14205 | stream->read(&vkGetMemoryWin32HandleNV_VkResult_return, sizeof(VkResult)); |
| 14206 | return vkGetMemoryWin32HandleNV_VkResult_return; |
| 14207 | } |
| 14208 | |
| 14209 | #endif |
| 14210 | #ifdef VK_NV_win32_keyed_mutex |
| 14211 | #endif |
| 14212 | #ifdef VK_EXT_validation_flags |
| 14213 | #endif |
| 14214 | #ifdef VK_NN_vi_surface |
| 14215 | VkResult VkEncoder::vkCreateViSurfaceNN( |
| 14216 | VkInstance instance, |
| 14217 | const VkViSurfaceCreateInfoNN* pCreateInfo, |
| 14218 | const VkAllocationCallbacks* pAllocator, |
| 14219 | VkSurfaceKHR* pSurface) |
| 14220 | { |
| 14221 | auto stream = mImpl->stream(); |
| 14222 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14223 | auto resources = mImpl->resources(); |
| 14224 | auto pool = mImpl->pool(); |
| 14225 | VkInstance local_instance; |
| 14226 | local_instance = instance; |
| 14227 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 14228 | VkViSurfaceCreateInfoNN* local_pCreateInfo; |
| 14229 | local_pCreateInfo = nullptr; |
| 14230 | if (pCreateInfo) |
| 14231 | { |
| 14232 | local_pCreateInfo = (VkViSurfaceCreateInfoNN*)pool->alloc(sizeof(const VkViSurfaceCreateInfoNN)); |
| 14233 | deepcopy_VkViSurfaceCreateInfoNN(pool, pCreateInfo, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| 14234 | } |
| 14235 | if (local_pCreateInfo) |
| 14236 | { |
| 14237 | handlemap_VkViSurfaceCreateInfoNN(resources->unwrapMapping(), (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| 14238 | } |
| 14239 | VkAllocationCallbacks* local_pAllocator; |
| 14240 | local_pAllocator = nullptr; |
| 14241 | if (pAllocator) |
| 14242 | { |
| 14243 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14244 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14245 | } |
| 14246 | if (local_pAllocator) |
| 14247 | { |
| 14248 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 14249 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14250 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14251 | countingStream->rewind(); |
| 14252 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14253 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 14254 | marshal_VkViSurfaceCreateInfoNN(countingStream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| 14255 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 14256 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14257 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14258 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14259 | } |
| 14260 | countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 14261 | } |
| 14262 | uint32_t packetSize_vkCreateViSurfaceNN = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14263 | countingStream->rewind(); |
| 14264 | uint32_t opcode_vkCreateViSurfaceNN = OP_vkCreateViSurfaceNN; |
| 14265 | stream->write(&opcode_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| 14266 | stream->write(&packetSize_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14267 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 14268 | marshal_VkViSurfaceCreateInfoNN(stream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| 14269 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 14270 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14271 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14272 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14273 | } |
| 14274 | stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 14275 | stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14276 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14277 | VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0; |
| 14278 | stream->read(&vkCreateViSurfaceNN_VkResult_return, sizeof(VkResult)); |
| 14279 | return vkCreateViSurfaceNN_VkResult_return; |
| 14280 | } |
| 14281 | |
| 14282 | #endif |
| 14283 | #ifdef VK_EXT_shader_subgroup_ballot |
| 14284 | #endif |
| 14285 | #ifdef VK_EXT_shader_subgroup_vote |
| 14286 | #endif |
| 14287 | #ifdef VK_EXT_conditional_rendering |
| 14288 | void VkEncoder::vkCmdBeginConditionalRenderingEXT( |
| 14289 | VkCommandBuffer commandBuffer, |
| 14290 | const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) |
| 14291 | { |
| 14292 | auto stream = mImpl->stream(); |
| 14293 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14294 | auto resources = mImpl->resources(); |
| 14295 | auto pool = mImpl->pool(); |
| 14296 | VkCommandBuffer local_commandBuffer; |
| 14297 | local_commandBuffer = commandBuffer; |
| 14298 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 14299 | VkConditionalRenderingBeginInfoEXT* local_pConditionalRenderingBegin; |
| 14300 | local_pConditionalRenderingBegin = nullptr; |
| 14301 | if (pConditionalRenderingBegin) |
| 14302 | { |
| 14303 | local_pConditionalRenderingBegin = (VkConditionalRenderingBeginInfoEXT*)pool->alloc(sizeof(const VkConditionalRenderingBeginInfoEXT)); |
| 14304 | deepcopy_VkConditionalRenderingBeginInfoEXT(pool, pConditionalRenderingBegin, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| 14305 | } |
| 14306 | if (local_pConditionalRenderingBegin) |
| 14307 | { |
| 14308 | handlemap_VkConditionalRenderingBeginInfoEXT(resources->unwrapMapping(), (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| 14309 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14310 | countingStream->rewind(); |
| 14311 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14312 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 14313 | marshal_VkConditionalRenderingBeginInfoEXT(countingStream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14314 | } |
| 14315 | uint32_t packetSize_vkCmdBeginConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14316 | countingStream->rewind(); |
| 14317 | uint32_t opcode_vkCmdBeginConditionalRenderingEXT = OP_vkCmdBeginConditionalRenderingEXT; |
| 14318 | stream->write(&opcode_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| 14319 | stream->write(&packetSize_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14320 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 14321 | marshal_VkConditionalRenderingBeginInfoEXT(stream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| 14322 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14323 | } |
| 14324 | |
| 14325 | void VkEncoder::vkCmdEndConditionalRenderingEXT( |
| 14326 | VkCommandBuffer commandBuffer) |
| 14327 | { |
| 14328 | auto stream = mImpl->stream(); |
| 14329 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14330 | auto resources = mImpl->resources(); |
| 14331 | auto pool = mImpl->pool(); |
| 14332 | VkCommandBuffer local_commandBuffer; |
| 14333 | local_commandBuffer = commandBuffer; |
| 14334 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14335 | countingStream->rewind(); |
| 14336 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14337 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14338 | } |
| 14339 | uint32_t packetSize_vkCmdEndConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14340 | countingStream->rewind(); |
| 14341 | uint32_t opcode_vkCmdEndConditionalRenderingEXT = OP_vkCmdEndConditionalRenderingEXT; |
| 14342 | stream->write(&opcode_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| 14343 | stream->write(&packetSize_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14344 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 14345 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14346 | } |
| 14347 | |
| 14348 | #endif |
| 14349 | #ifdef VK_NVX_device_generated_commands |
| 14350 | void VkEncoder::vkCmdProcessCommandsNVX( |
| 14351 | VkCommandBuffer commandBuffer, |
| 14352 | const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) |
| 14353 | { |
| 14354 | auto stream = mImpl->stream(); |
| 14355 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14356 | auto resources = mImpl->resources(); |
| 14357 | auto pool = mImpl->pool(); |
| 14358 | VkCommandBuffer local_commandBuffer; |
| 14359 | local_commandBuffer = commandBuffer; |
| 14360 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 14361 | VkCmdProcessCommandsInfoNVX* local_pProcessCommandsInfo; |
| 14362 | local_pProcessCommandsInfo = nullptr; |
| 14363 | if (pProcessCommandsInfo) |
| 14364 | { |
| 14365 | local_pProcessCommandsInfo = (VkCmdProcessCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdProcessCommandsInfoNVX)); |
| 14366 | deepcopy_VkCmdProcessCommandsInfoNVX(pool, pProcessCommandsInfo, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| 14367 | } |
| 14368 | if (local_pProcessCommandsInfo) |
| 14369 | { |
| 14370 | handlemap_VkCmdProcessCommandsInfoNVX(resources->unwrapMapping(), (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| 14371 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14372 | countingStream->rewind(); |
| 14373 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14374 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 14375 | marshal_VkCmdProcessCommandsInfoNVX(countingStream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14376 | } |
| 14377 | uint32_t packetSize_vkCmdProcessCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14378 | countingStream->rewind(); |
| 14379 | uint32_t opcode_vkCmdProcessCommandsNVX = OP_vkCmdProcessCommandsNVX; |
| 14380 | stream->write(&opcode_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| 14381 | stream->write(&packetSize_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14382 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 14383 | marshal_VkCmdProcessCommandsInfoNVX(stream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| 14384 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14385 | } |
| 14386 | |
| 14387 | void VkEncoder::vkCmdReserveSpaceForCommandsNVX( |
| 14388 | VkCommandBuffer commandBuffer, |
| 14389 | const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) |
| 14390 | { |
| 14391 | auto stream = mImpl->stream(); |
| 14392 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14393 | auto resources = mImpl->resources(); |
| 14394 | auto pool = mImpl->pool(); |
| 14395 | VkCommandBuffer local_commandBuffer; |
| 14396 | local_commandBuffer = commandBuffer; |
| 14397 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 14398 | VkCmdReserveSpaceForCommandsInfoNVX* local_pReserveSpaceInfo; |
| 14399 | local_pReserveSpaceInfo = nullptr; |
| 14400 | if (pReserveSpaceInfo) |
| 14401 | { |
| 14402 | local_pReserveSpaceInfo = (VkCmdReserveSpaceForCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdReserveSpaceForCommandsInfoNVX)); |
| 14403 | deepcopy_VkCmdReserveSpaceForCommandsInfoNVX(pool, pReserveSpaceInfo, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| 14404 | } |
| 14405 | if (local_pReserveSpaceInfo) |
| 14406 | { |
| 14407 | handlemap_VkCmdReserveSpaceForCommandsInfoNVX(resources->unwrapMapping(), (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| 14408 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14409 | countingStream->rewind(); |
| 14410 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14411 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 14412 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(countingStream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14413 | } |
| 14414 | uint32_t packetSize_vkCmdReserveSpaceForCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14415 | countingStream->rewind(); |
| 14416 | uint32_t opcode_vkCmdReserveSpaceForCommandsNVX = OP_vkCmdReserveSpaceForCommandsNVX; |
| 14417 | stream->write(&opcode_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| 14418 | stream->write(&packetSize_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14419 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 14420 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(stream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| 14421 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14422 | } |
| 14423 | |
| 14424 | VkResult VkEncoder::vkCreateIndirectCommandsLayoutNVX( |
| 14425 | VkDevice device, |
| 14426 | const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, |
| 14427 | const VkAllocationCallbacks* pAllocator, |
| 14428 | VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) |
| 14429 | { |
| 14430 | auto stream = mImpl->stream(); |
| 14431 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14432 | auto resources = mImpl->resources(); |
| 14433 | auto pool = mImpl->pool(); |
| 14434 | VkDevice local_device; |
| 14435 | local_device = device; |
| 14436 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 14437 | VkIndirectCommandsLayoutCreateInfoNVX* local_pCreateInfo; |
| 14438 | local_pCreateInfo = nullptr; |
| 14439 | if (pCreateInfo) |
| 14440 | { |
| 14441 | local_pCreateInfo = (VkIndirectCommandsLayoutCreateInfoNVX*)pool->alloc(sizeof(const VkIndirectCommandsLayoutCreateInfoNVX)); |
| 14442 | deepcopy_VkIndirectCommandsLayoutCreateInfoNVX(pool, pCreateInfo, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| 14443 | } |
| 14444 | if (local_pCreateInfo) |
| 14445 | { |
| 14446 | handlemap_VkIndirectCommandsLayoutCreateInfoNVX(resources->unwrapMapping(), (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| 14447 | } |
| 14448 | VkAllocationCallbacks* local_pAllocator; |
| 14449 | local_pAllocator = nullptr; |
| 14450 | if (pAllocator) |
| 14451 | { |
| 14452 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14453 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14454 | } |
| 14455 | if (local_pAllocator) |
| 14456 | { |
| 14457 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 14458 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14459 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14460 | countingStream->rewind(); |
| 14461 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14462 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14463 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(countingStream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| 14464 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 14465 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14466 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14467 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14468 | } |
| 14469 | countingStream->write((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX)); |
| 14470 | } |
| 14471 | uint32_t packetSize_vkCreateIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14472 | countingStream->rewind(); |
| 14473 | uint32_t opcode_vkCreateIndirectCommandsLayoutNVX = OP_vkCreateIndirectCommandsLayoutNVX; |
| 14474 | stream->write(&opcode_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 14475 | stream->write(&packetSize_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14476 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14477 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(stream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| 14478 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 14479 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14480 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14481 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14482 | } |
| 14483 | stream->write((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX)); |
| 14484 | stream->read((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14485 | if (pIndirectCommandsLayout) |
| 14486 | { |
| 14487 | resources->createMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, 1); |
| 14488 | } |
| 14489 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14490 | VkResult vkCreateIndirectCommandsLayoutNVX_VkResult_return = (VkResult)0; |
| 14491 | stream->read(&vkCreateIndirectCommandsLayoutNVX_VkResult_return, sizeof(VkResult)); |
| 14492 | return vkCreateIndirectCommandsLayoutNVX_VkResult_return; |
| 14493 | } |
| 14494 | |
| 14495 | void VkEncoder::vkDestroyIndirectCommandsLayoutNVX( |
| 14496 | VkDevice device, |
| 14497 | VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 14498 | const VkAllocationCallbacks* pAllocator) |
| 14499 | { |
| 14500 | auto stream = mImpl->stream(); |
| 14501 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14502 | auto resources = mImpl->resources(); |
| 14503 | auto pool = mImpl->pool(); |
| 14504 | VkDevice local_device; |
| 14505 | local_device = device; |
| 14506 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14507 | VkIndirectCommandsLayoutNVX local_indirectCommandsLayout; |
| 14508 | local_indirectCommandsLayout = indirectCommandsLayout; |
| 14509 | resources->unwrapMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)&local_indirectCommandsLayout); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14510 | VkAllocationCallbacks* local_pAllocator; |
| 14511 | local_pAllocator = nullptr; |
| 14512 | if (pAllocator) |
| 14513 | { |
| 14514 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14515 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14516 | } |
| 14517 | if (local_pAllocator) |
| 14518 | { |
| 14519 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 14520 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14521 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14522 | countingStream->rewind(); |
| 14523 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14524 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14525 | countingStream->write((VkIndirectCommandsLayoutNVX*)&local_indirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14526 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 14527 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14528 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14529 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14530 | } |
| 14531 | } |
| 14532 | uint32_t packetSize_vkDestroyIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14533 | countingStream->rewind(); |
| 14534 | uint32_t opcode_vkDestroyIndirectCommandsLayoutNVX = OP_vkDestroyIndirectCommandsLayoutNVX; |
| 14535 | stream->write(&opcode_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 14536 | stream->write(&packetSize_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14537 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14538 | stream->write((VkIndirectCommandsLayoutNVX*)&local_indirectCommandsLayout, sizeof(VkIndirectCommandsLayoutNVX)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14539 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 14540 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14541 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14542 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14543 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14544 | resources->destroyMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)&indirectCommandsLayout); |
| 14545 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14546 | } |
| 14547 | |
| 14548 | VkResult VkEncoder::vkCreateObjectTableNVX( |
| 14549 | VkDevice device, |
| 14550 | const VkObjectTableCreateInfoNVX* pCreateInfo, |
| 14551 | const VkAllocationCallbacks* pAllocator, |
| 14552 | VkObjectTableNVX* pObjectTable) |
| 14553 | { |
| 14554 | auto stream = mImpl->stream(); |
| 14555 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14556 | auto resources = mImpl->resources(); |
| 14557 | auto pool = mImpl->pool(); |
| 14558 | VkDevice local_device; |
| 14559 | local_device = device; |
| 14560 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 14561 | VkObjectTableCreateInfoNVX* local_pCreateInfo; |
| 14562 | local_pCreateInfo = nullptr; |
| 14563 | if (pCreateInfo) |
| 14564 | { |
| 14565 | local_pCreateInfo = (VkObjectTableCreateInfoNVX*)pool->alloc(sizeof(const VkObjectTableCreateInfoNVX)); |
| 14566 | deepcopy_VkObjectTableCreateInfoNVX(pool, pCreateInfo, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| 14567 | } |
| 14568 | if (local_pCreateInfo) |
| 14569 | { |
| 14570 | handlemap_VkObjectTableCreateInfoNVX(resources->unwrapMapping(), (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| 14571 | } |
| 14572 | VkAllocationCallbacks* local_pAllocator; |
| 14573 | local_pAllocator = nullptr; |
| 14574 | if (pAllocator) |
| 14575 | { |
| 14576 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14577 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14578 | } |
| 14579 | if (local_pAllocator) |
| 14580 | { |
| 14581 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 14582 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14583 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14584 | countingStream->rewind(); |
| 14585 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14586 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14587 | marshal_VkObjectTableCreateInfoNVX(countingStream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| 14588 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 14589 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14590 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14591 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14592 | } |
| 14593 | countingStream->write((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX)); |
| 14594 | } |
| 14595 | uint32_t packetSize_vkCreateObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14596 | countingStream->rewind(); |
| 14597 | uint32_t opcode_vkCreateObjectTableNVX = OP_vkCreateObjectTableNVX; |
| 14598 | stream->write(&opcode_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| 14599 | stream->write(&packetSize_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14600 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14601 | marshal_VkObjectTableCreateInfoNVX(stream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| 14602 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 14603 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14604 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14605 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14606 | } |
| 14607 | stream->write((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX)); |
| 14608 | stream->read((VkObjectTableNVX*)pObjectTable, sizeof(VkObjectTableNVX)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14609 | if (pObjectTable) |
| 14610 | { |
| 14611 | resources->createMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)pObjectTable, 1); |
| 14612 | } |
| 14613 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14614 | VkResult vkCreateObjectTableNVX_VkResult_return = (VkResult)0; |
| 14615 | stream->read(&vkCreateObjectTableNVX_VkResult_return, sizeof(VkResult)); |
| 14616 | return vkCreateObjectTableNVX_VkResult_return; |
| 14617 | } |
| 14618 | |
| 14619 | void VkEncoder::vkDestroyObjectTableNVX( |
| 14620 | VkDevice device, |
| 14621 | VkObjectTableNVX objectTable, |
| 14622 | const VkAllocationCallbacks* pAllocator) |
| 14623 | { |
| 14624 | auto stream = mImpl->stream(); |
| 14625 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14626 | auto resources = mImpl->resources(); |
| 14627 | auto pool = mImpl->pool(); |
| 14628 | VkDevice local_device; |
| 14629 | local_device = device; |
| 14630 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14631 | VkObjectTableNVX local_objectTable; |
| 14632 | local_objectTable = objectTable; |
| 14633 | resources->unwrapMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&local_objectTable); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14634 | VkAllocationCallbacks* local_pAllocator; |
| 14635 | local_pAllocator = nullptr; |
| 14636 | if (pAllocator) |
| 14637 | { |
| 14638 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14639 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14640 | } |
| 14641 | if (local_pAllocator) |
| 14642 | { |
| 14643 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 14644 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14645 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14646 | countingStream->rewind(); |
| 14647 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14648 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14649 | countingStream->write((VkObjectTableNVX*)&local_objectTable, sizeof(VkObjectTableNVX)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14650 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 14651 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14652 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14653 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14654 | } |
| 14655 | } |
| 14656 | uint32_t packetSize_vkDestroyObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14657 | countingStream->rewind(); |
| 14658 | uint32_t opcode_vkDestroyObjectTableNVX = OP_vkDestroyObjectTableNVX; |
| 14659 | stream->write(&opcode_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| 14660 | stream->write(&packetSize_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14661 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 14662 | stream->write((VkObjectTableNVX*)&local_objectTable, sizeof(VkObjectTableNVX)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14663 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 14664 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14665 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14666 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14667 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14668 | resources->destroyMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&objectTable); |
| 14669 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14670 | } |
| 14671 | |
| 14672 | VkResult VkEncoder::vkRegisterObjectsNVX( |
| 14673 | VkDevice device, |
| 14674 | VkObjectTableNVX objectTable, |
| 14675 | uint32_t objectCount, |
| 14676 | const VkObjectTableEntryNVX* const* ppObjectTableEntries, |
| 14677 | const uint32_t* pObjectIndices) |
| 14678 | { |
| 14679 | auto stream = mImpl->stream(); |
| 14680 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14681 | auto resources = mImpl->resources(); |
| 14682 | auto pool = mImpl->pool(); |
| 14683 | VkDevice local_device; |
| 14684 | local_device = device; |
| 14685 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 14686 | VkObjectTableNVX local_objectTable; |
| 14687 | local_objectTable = objectTable; |
| 14688 | resources->unwrapMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&local_objectTable); |
| 14689 | uint32_t local_objectCount; |
| 14690 | local_objectCount = objectCount; |
| 14691 | VkObjectTableEntryNVX** local_ppObjectTableEntries; |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 14692 | (void)ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14693 | uint32_t* local_pObjectIndices; |
| 14694 | local_pObjectIndices = nullptr; |
| 14695 | if (pObjectIndices) |
| 14696 | { |
| 14697 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 14698 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14699 | countingStream->rewind(); |
| 14700 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14701 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14702 | countingStream->write((VkObjectTableNVX*)&local_objectTable, sizeof(VkObjectTableNVX)); |
| 14703 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 14704 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14705 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14706 | } |
| 14707 | uint32_t packetSize_vkRegisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14708 | countingStream->rewind(); |
| 14709 | uint32_t opcode_vkRegisterObjectsNVX = OP_vkRegisterObjectsNVX; |
| 14710 | stream->write(&opcode_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| 14711 | stream->write(&packetSize_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14712 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14713 | stream->write((VkObjectTableNVX*)&local_objectTable, sizeof(VkObjectTableNVX)); |
| 14714 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 14715 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14716 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| 14717 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14718 | VkResult vkRegisterObjectsNVX_VkResult_return = (VkResult)0; |
| 14719 | stream->read(&vkRegisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| 14720 | return vkRegisterObjectsNVX_VkResult_return; |
| 14721 | } |
| 14722 | |
| 14723 | VkResult VkEncoder::vkUnregisterObjectsNVX( |
| 14724 | VkDevice device, |
| 14725 | VkObjectTableNVX objectTable, |
| 14726 | uint32_t objectCount, |
| 14727 | const VkObjectEntryTypeNVX* pObjectEntryTypes, |
| 14728 | const uint32_t* pObjectIndices) |
| 14729 | { |
| 14730 | auto stream = mImpl->stream(); |
| 14731 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14732 | auto resources = mImpl->resources(); |
| 14733 | auto pool = mImpl->pool(); |
| 14734 | VkDevice local_device; |
| 14735 | local_device = device; |
| 14736 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 14737 | VkObjectTableNVX local_objectTable; |
| 14738 | local_objectTable = objectTable; |
| 14739 | resources->unwrapMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&local_objectTable); |
| 14740 | uint32_t local_objectCount; |
| 14741 | local_objectCount = objectCount; |
| 14742 | VkObjectEntryTypeNVX* local_pObjectEntryTypes; |
| 14743 | local_pObjectEntryTypes = nullptr; |
| 14744 | if (pObjectEntryTypes) |
| 14745 | { |
| 14746 | local_pObjectEntryTypes = (VkObjectEntryTypeNVX*)pool->dupArray(pObjectEntryTypes, ((objectCount)) * sizeof(const VkObjectEntryTypeNVX)); |
| 14747 | } |
| 14748 | uint32_t* local_pObjectIndices; |
| 14749 | local_pObjectIndices = nullptr; |
| 14750 | if (pObjectIndices) |
| 14751 | { |
| 14752 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 14753 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14754 | countingStream->rewind(); |
| 14755 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14756 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14757 | countingStream->write((VkObjectTableNVX*)&local_objectTable, sizeof(VkObjectTableNVX)); |
| 14758 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 14759 | countingStream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 14760 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14761 | } |
| 14762 | uint32_t packetSize_vkUnregisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14763 | countingStream->rewind(); |
| 14764 | uint32_t opcode_vkUnregisterObjectsNVX = OP_vkUnregisterObjectsNVX; |
| 14765 | stream->write(&opcode_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| 14766 | stream->write(&packetSize_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14767 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 14768 | stream->write((VkObjectTableNVX*)&local_objectTable, sizeof(VkObjectTableNVX)); |
| 14769 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 14770 | stream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 14771 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| 14772 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14773 | VkResult vkUnregisterObjectsNVX_VkResult_return = (VkResult)0; |
| 14774 | stream->read(&vkUnregisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| 14775 | return vkUnregisterObjectsNVX_VkResult_return; |
| 14776 | } |
| 14777 | |
| 14778 | void VkEncoder::vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( |
| 14779 | VkPhysicalDevice physicalDevice, |
| 14780 | VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, |
| 14781 | VkDeviceGeneratedCommandsLimitsNVX* pLimits) |
| 14782 | { |
| 14783 | auto stream = mImpl->stream(); |
| 14784 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14785 | auto resources = mImpl->resources(); |
| 14786 | auto pool = mImpl->pool(); |
| 14787 | VkPhysicalDevice local_physicalDevice; |
| 14788 | local_physicalDevice = physicalDevice; |
| 14789 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14790 | countingStream->rewind(); |
| 14791 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14792 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14793 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(countingStream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 14794 | marshal_VkDeviceGeneratedCommandsLimitsNVX(countingStream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 14795 | } |
| 14796 | uint32_t packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14797 | countingStream->rewind(); |
| 14798 | uint32_t opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = OP_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX; |
| 14799 | stream->write(&opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| 14800 | stream->write(&packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14801 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14802 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 14803 | marshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 14804 | unmarshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 14805 | unmarshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14806 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14807 | } |
| 14808 | |
| 14809 | #endif |
| 14810 | #ifdef VK_NV_clip_space_w_scaling |
| 14811 | void VkEncoder::vkCmdSetViewportWScalingNV( |
| 14812 | VkCommandBuffer commandBuffer, |
| 14813 | uint32_t firstViewport, |
| 14814 | uint32_t viewportCount, |
| 14815 | const VkViewportWScalingNV* pViewportWScalings) |
| 14816 | { |
| 14817 | auto stream = mImpl->stream(); |
| 14818 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14819 | auto resources = mImpl->resources(); |
| 14820 | auto pool = mImpl->pool(); |
| 14821 | VkCommandBuffer local_commandBuffer; |
| 14822 | local_commandBuffer = commandBuffer; |
| 14823 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 14824 | uint32_t local_firstViewport; |
| 14825 | local_firstViewport = firstViewport; |
| 14826 | uint32_t local_viewportCount; |
| 14827 | local_viewportCount = viewportCount; |
| 14828 | VkViewportWScalingNV* local_pViewportWScalings; |
| 14829 | local_pViewportWScalings = nullptr; |
| 14830 | if (pViewportWScalings) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14831 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14832 | local_pViewportWScalings = (VkViewportWScalingNV*)pool->alloc(((viewportCount)) * sizeof(const VkViewportWScalingNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14833 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 14834 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14835 | deepcopy_VkViewportWScalingNV(pool, pViewportWScalings + i, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| 14836 | } |
| 14837 | } |
| 14838 | if (local_pViewportWScalings) |
| 14839 | { |
| 14840 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 14841 | { |
| 14842 | handlemap_VkViewportWScalingNV(resources->unwrapMapping(), (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| 14843 | } |
| 14844 | } |
| 14845 | countingStream->rewind(); |
| 14846 | { |
| 14847 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 14848 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 14849 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 14850 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 14851 | { |
| 14852 | marshal_VkViewportWScalingNV(countingStream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14853 | } |
| 14854 | } |
| 14855 | uint32_t packetSize_vkCmdSetViewportWScalingNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14856 | countingStream->rewind(); |
| 14857 | uint32_t opcode_vkCmdSetViewportWScalingNV = OP_vkCmdSetViewportWScalingNV; |
| 14858 | stream->write(&opcode_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| 14859 | stream->write(&packetSize_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14860 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 14861 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 14862 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14863 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 14864 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14865 | marshal_VkViewportWScalingNV(stream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14866 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14867 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14868 | } |
| 14869 | |
| 14870 | #endif |
| 14871 | #ifdef VK_EXT_direct_mode_display |
| 14872 | VkResult VkEncoder::vkReleaseDisplayEXT( |
| 14873 | VkPhysicalDevice physicalDevice, |
| 14874 | VkDisplayKHR display) |
| 14875 | { |
| 14876 | auto stream = mImpl->stream(); |
| 14877 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14878 | auto resources = mImpl->resources(); |
| 14879 | auto pool = mImpl->pool(); |
| 14880 | VkPhysicalDevice local_physicalDevice; |
| 14881 | local_physicalDevice = physicalDevice; |
| 14882 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 14883 | VkDisplayKHR local_display; |
| 14884 | local_display = display; |
| 14885 | resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14886 | countingStream->rewind(); |
| 14887 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14888 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 14889 | countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14890 | } |
| 14891 | uint32_t packetSize_vkReleaseDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14892 | countingStream->rewind(); |
| 14893 | uint32_t opcode_vkReleaseDisplayEXT = OP_vkReleaseDisplayEXT; |
| 14894 | stream->write(&opcode_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| 14895 | stream->write(&packetSize_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14896 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 14897 | stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| 14898 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14899 | VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0; |
| 14900 | stream->read(&vkReleaseDisplayEXT_VkResult_return, sizeof(VkResult)); |
| 14901 | return vkReleaseDisplayEXT_VkResult_return; |
| 14902 | } |
| 14903 | |
| 14904 | #endif |
| 14905 | #ifdef VK_EXT_acquire_xlib_display |
| 14906 | VkResult VkEncoder::vkAcquireXlibDisplayEXT( |
| 14907 | VkPhysicalDevice physicalDevice, |
| 14908 | Display* dpy, |
| 14909 | VkDisplayKHR display) |
| 14910 | { |
| 14911 | auto stream = mImpl->stream(); |
| 14912 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14913 | auto resources = mImpl->resources(); |
| 14914 | auto pool = mImpl->pool(); |
| 14915 | VkPhysicalDevice local_physicalDevice; |
| 14916 | local_physicalDevice = physicalDevice; |
| 14917 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 14918 | VkDisplayKHR local_display; |
| 14919 | local_display = display; |
| 14920 | resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14921 | countingStream->rewind(); |
| 14922 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14923 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14924 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14925 | countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14926 | } |
| 14927 | uint32_t packetSize_vkAcquireXlibDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14928 | countingStream->rewind(); |
| 14929 | uint32_t opcode_vkAcquireXlibDisplayEXT = OP_vkAcquireXlibDisplayEXT; |
| 14930 | stream->write(&opcode_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| 14931 | stream->write(&packetSize_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14932 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14933 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14934 | stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14935 | stream->read((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14936 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14937 | VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0; |
| 14938 | stream->read(&vkAcquireXlibDisplayEXT_VkResult_return, sizeof(VkResult)); |
| 14939 | return vkAcquireXlibDisplayEXT_VkResult_return; |
| 14940 | } |
| 14941 | |
| 14942 | VkResult VkEncoder::vkGetRandROutputDisplayEXT( |
| 14943 | VkPhysicalDevice physicalDevice, |
| 14944 | Display* dpy, |
| 14945 | RROutput rrOutput, |
| 14946 | VkDisplayKHR* pDisplay) |
| 14947 | { |
| 14948 | auto stream = mImpl->stream(); |
| 14949 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14950 | auto resources = mImpl->resources(); |
| 14951 | auto pool = mImpl->pool(); |
| 14952 | VkPhysicalDevice local_physicalDevice; |
| 14953 | local_physicalDevice = physicalDevice; |
| 14954 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 14955 | RROutput local_rrOutput; |
| 14956 | local_rrOutput = rrOutput; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14957 | countingStream->rewind(); |
| 14958 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14959 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14960 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14961 | countingStream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14962 | countingStream->write((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR)); |
| 14963 | } |
| 14964 | uint32_t packetSize_vkGetRandROutputDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14965 | countingStream->rewind(); |
| 14966 | uint32_t opcode_vkGetRandROutputDisplayEXT = OP_vkGetRandROutputDisplayEXT; |
| 14967 | stream->write(&opcode_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| 14968 | stream->write(&packetSize_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14969 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14970 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14971 | stream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14972 | stream->write((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR)); |
| 14973 | stream->read((Display*)dpy, sizeof(Display)); |
| 14974 | stream->read((VkDisplayKHR*)pDisplay, sizeof(VkDisplayKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14975 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14976 | VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0; |
| 14977 | stream->read(&vkGetRandROutputDisplayEXT_VkResult_return, sizeof(VkResult)); |
| 14978 | return vkGetRandROutputDisplayEXT_VkResult_return; |
| 14979 | } |
| 14980 | |
| 14981 | #endif |
| 14982 | #ifdef VK_EXT_display_surface_counter |
| 14983 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2EXT( |
| 14984 | VkPhysicalDevice physicalDevice, |
| 14985 | VkSurfaceKHR surface, |
| 14986 | VkSurfaceCapabilities2EXT* pSurfaceCapabilities) |
| 14987 | { |
| 14988 | auto stream = mImpl->stream(); |
| 14989 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14990 | auto resources = mImpl->resources(); |
| 14991 | auto pool = mImpl->pool(); |
| 14992 | VkPhysicalDevice local_physicalDevice; |
| 14993 | local_physicalDevice = physicalDevice; |
| 14994 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 14995 | VkSurfaceKHR local_surface; |
| 14996 | local_surface = surface; |
| 14997 | resources->unwrapMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&local_surface); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14998 | countingStream->rewind(); |
| 14999 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15000 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 15001 | countingStream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15002 | marshal_VkSurfaceCapabilities2EXT(countingStream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 15003 | } |
| 15004 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15005 | countingStream->rewind(); |
| 15006 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT = OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT; |
| 15007 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| 15008 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15009 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 15010 | stream->write((VkSurfaceKHR*)&local_surface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15011 | marshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 15012 | unmarshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15013 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15014 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0; |
| 15015 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return, sizeof(VkResult)); |
| 15016 | return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return; |
| 15017 | } |
| 15018 | |
| 15019 | #endif |
| 15020 | #ifdef VK_EXT_display_control |
| 15021 | VkResult VkEncoder::vkDisplayPowerControlEXT( |
| 15022 | VkDevice device, |
| 15023 | VkDisplayKHR display, |
| 15024 | const VkDisplayPowerInfoEXT* pDisplayPowerInfo) |
| 15025 | { |
| 15026 | auto stream = mImpl->stream(); |
| 15027 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15028 | auto resources = mImpl->resources(); |
| 15029 | auto pool = mImpl->pool(); |
| 15030 | VkDevice local_device; |
| 15031 | local_device = device; |
| 15032 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 15033 | VkDisplayKHR local_display; |
| 15034 | local_display = display; |
| 15035 | resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display); |
| 15036 | VkDisplayPowerInfoEXT* local_pDisplayPowerInfo; |
| 15037 | local_pDisplayPowerInfo = nullptr; |
| 15038 | if (pDisplayPowerInfo) |
| 15039 | { |
| 15040 | local_pDisplayPowerInfo = (VkDisplayPowerInfoEXT*)pool->alloc(sizeof(const VkDisplayPowerInfoEXT)); |
| 15041 | deepcopy_VkDisplayPowerInfoEXT(pool, pDisplayPowerInfo, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| 15042 | } |
| 15043 | if (local_pDisplayPowerInfo) |
| 15044 | { |
| 15045 | handlemap_VkDisplayPowerInfoEXT(resources->unwrapMapping(), (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| 15046 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15047 | countingStream->rewind(); |
| 15048 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15049 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15050 | countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| 15051 | marshal_VkDisplayPowerInfoEXT(countingStream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15052 | } |
| 15053 | uint32_t packetSize_vkDisplayPowerControlEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15054 | countingStream->rewind(); |
| 15055 | uint32_t opcode_vkDisplayPowerControlEXT = OP_vkDisplayPowerControlEXT; |
| 15056 | stream->write(&opcode_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| 15057 | stream->write(&packetSize_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15058 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15059 | stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| 15060 | marshal_VkDisplayPowerInfoEXT(stream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| 15061 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15062 | VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0; |
| 15063 | stream->read(&vkDisplayPowerControlEXT_VkResult_return, sizeof(VkResult)); |
| 15064 | return vkDisplayPowerControlEXT_VkResult_return; |
| 15065 | } |
| 15066 | |
| 15067 | VkResult VkEncoder::vkRegisterDeviceEventEXT( |
| 15068 | VkDevice device, |
| 15069 | const VkDeviceEventInfoEXT* pDeviceEventInfo, |
| 15070 | const VkAllocationCallbacks* pAllocator, |
| 15071 | VkFence* pFence) |
| 15072 | { |
| 15073 | auto stream = mImpl->stream(); |
| 15074 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15075 | auto resources = mImpl->resources(); |
| 15076 | auto pool = mImpl->pool(); |
| 15077 | VkDevice local_device; |
| 15078 | local_device = device; |
| 15079 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 15080 | VkDeviceEventInfoEXT* local_pDeviceEventInfo; |
| 15081 | local_pDeviceEventInfo = nullptr; |
| 15082 | if (pDeviceEventInfo) |
| 15083 | { |
| 15084 | local_pDeviceEventInfo = (VkDeviceEventInfoEXT*)pool->alloc(sizeof(const VkDeviceEventInfoEXT)); |
| 15085 | deepcopy_VkDeviceEventInfoEXT(pool, pDeviceEventInfo, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| 15086 | } |
| 15087 | if (local_pDeviceEventInfo) |
| 15088 | { |
| 15089 | handlemap_VkDeviceEventInfoEXT(resources->unwrapMapping(), (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| 15090 | } |
| 15091 | VkAllocationCallbacks* local_pAllocator; |
| 15092 | local_pAllocator = nullptr; |
| 15093 | if (pAllocator) |
| 15094 | { |
| 15095 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15096 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15097 | } |
| 15098 | if (local_pAllocator) |
| 15099 | { |
| 15100 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 15101 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 15102 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15103 | countingStream->rewind(); |
| 15104 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15105 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15106 | marshal_VkDeviceEventInfoEXT(countingStream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| 15107 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 15108 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15109 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15110 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15111 | } |
| 15112 | countingStream->write((VkFence*)pFence, sizeof(VkFence)); |
| 15113 | } |
| 15114 | uint32_t packetSize_vkRegisterDeviceEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15115 | countingStream->rewind(); |
| 15116 | uint32_t opcode_vkRegisterDeviceEventEXT = OP_vkRegisterDeviceEventEXT; |
| 15117 | stream->write(&opcode_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| 15118 | stream->write(&packetSize_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15119 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15120 | marshal_VkDeviceEventInfoEXT(stream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| 15121 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 15122 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15123 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15124 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15125 | } |
| 15126 | stream->write((VkFence*)pFence, sizeof(VkFence)); |
| 15127 | stream->read((VkFence*)pFence, sizeof(VkFence)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15128 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15129 | VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0; |
| 15130 | stream->read(&vkRegisterDeviceEventEXT_VkResult_return, sizeof(VkResult)); |
| 15131 | return vkRegisterDeviceEventEXT_VkResult_return; |
| 15132 | } |
| 15133 | |
| 15134 | VkResult VkEncoder::vkRegisterDisplayEventEXT( |
| 15135 | VkDevice device, |
| 15136 | VkDisplayKHR display, |
| 15137 | const VkDisplayEventInfoEXT* pDisplayEventInfo, |
| 15138 | const VkAllocationCallbacks* pAllocator, |
| 15139 | VkFence* pFence) |
| 15140 | { |
| 15141 | auto stream = mImpl->stream(); |
| 15142 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15143 | auto resources = mImpl->resources(); |
| 15144 | auto pool = mImpl->pool(); |
| 15145 | VkDevice local_device; |
| 15146 | local_device = device; |
| 15147 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 15148 | VkDisplayKHR local_display; |
| 15149 | local_display = display; |
| 15150 | resources->unwrapMapping()->mapHandles_VkDisplayKHR((VkDisplayKHR*)&local_display); |
| 15151 | VkDisplayEventInfoEXT* local_pDisplayEventInfo; |
| 15152 | local_pDisplayEventInfo = nullptr; |
| 15153 | if (pDisplayEventInfo) |
| 15154 | { |
| 15155 | local_pDisplayEventInfo = (VkDisplayEventInfoEXT*)pool->alloc(sizeof(const VkDisplayEventInfoEXT)); |
| 15156 | deepcopy_VkDisplayEventInfoEXT(pool, pDisplayEventInfo, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| 15157 | } |
| 15158 | if (local_pDisplayEventInfo) |
| 15159 | { |
| 15160 | handlemap_VkDisplayEventInfoEXT(resources->unwrapMapping(), (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| 15161 | } |
| 15162 | VkAllocationCallbacks* local_pAllocator; |
| 15163 | local_pAllocator = nullptr; |
| 15164 | if (pAllocator) |
| 15165 | { |
| 15166 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15167 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15168 | } |
| 15169 | if (local_pAllocator) |
| 15170 | { |
| 15171 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 15172 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 15173 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15174 | countingStream->rewind(); |
| 15175 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15176 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15177 | countingStream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| 15178 | marshal_VkDisplayEventInfoEXT(countingStream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| 15179 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 15180 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15181 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15182 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15183 | } |
| 15184 | countingStream->write((VkFence*)pFence, sizeof(VkFence)); |
| 15185 | } |
| 15186 | uint32_t packetSize_vkRegisterDisplayEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15187 | countingStream->rewind(); |
| 15188 | uint32_t opcode_vkRegisterDisplayEventEXT = OP_vkRegisterDisplayEventEXT; |
| 15189 | stream->write(&opcode_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| 15190 | stream->write(&packetSize_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15191 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15192 | stream->write((VkDisplayKHR*)&local_display, sizeof(VkDisplayKHR)); |
| 15193 | marshal_VkDisplayEventInfoEXT(stream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| 15194 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 15195 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15196 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15197 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15198 | } |
| 15199 | stream->write((VkFence*)pFence, sizeof(VkFence)); |
| 15200 | stream->read((VkFence*)pFence, sizeof(VkFence)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15201 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15202 | VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0; |
| 15203 | stream->read(&vkRegisterDisplayEventEXT_VkResult_return, sizeof(VkResult)); |
| 15204 | return vkRegisterDisplayEventEXT_VkResult_return; |
| 15205 | } |
| 15206 | |
| 15207 | VkResult VkEncoder::vkGetSwapchainCounterEXT( |
| 15208 | VkDevice device, |
| 15209 | VkSwapchainKHR swapchain, |
| 15210 | VkSurfaceCounterFlagBitsEXT counter, |
| 15211 | uint64_t* pCounterValue) |
| 15212 | { |
| 15213 | auto stream = mImpl->stream(); |
| 15214 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15215 | auto resources = mImpl->resources(); |
| 15216 | auto pool = mImpl->pool(); |
| 15217 | VkDevice local_device; |
| 15218 | local_device = device; |
| 15219 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 15220 | VkSwapchainKHR local_swapchain; |
| 15221 | local_swapchain = swapchain; |
| 15222 | resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain); |
| 15223 | VkSurfaceCounterFlagBitsEXT local_counter; |
| 15224 | local_counter = counter; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15225 | countingStream->rewind(); |
| 15226 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15227 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15228 | countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| 15229 | countingStream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15230 | countingStream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 15231 | } |
| 15232 | uint32_t packetSize_vkGetSwapchainCounterEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15233 | countingStream->rewind(); |
| 15234 | uint32_t opcode_vkGetSwapchainCounterEXT = OP_vkGetSwapchainCounterEXT; |
| 15235 | stream->write(&opcode_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| 15236 | stream->write(&packetSize_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15237 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15238 | stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| 15239 | stream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15240 | stream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 15241 | stream->read((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15242 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15243 | VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0; |
| 15244 | stream->read(&vkGetSwapchainCounterEXT_VkResult_return, sizeof(VkResult)); |
| 15245 | return vkGetSwapchainCounterEXT_VkResult_return; |
| 15246 | } |
| 15247 | |
| 15248 | #endif |
| 15249 | #ifdef VK_GOOGLE_display_timing |
| 15250 | VkResult VkEncoder::vkGetRefreshCycleDurationGOOGLE( |
| 15251 | VkDevice device, |
| 15252 | VkSwapchainKHR swapchain, |
| 15253 | VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) |
| 15254 | { |
| 15255 | auto stream = mImpl->stream(); |
| 15256 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15257 | auto resources = mImpl->resources(); |
| 15258 | auto pool = mImpl->pool(); |
| 15259 | VkDevice local_device; |
| 15260 | local_device = device; |
| 15261 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 15262 | VkSwapchainKHR local_swapchain; |
| 15263 | local_swapchain = swapchain; |
| 15264 | resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15265 | countingStream->rewind(); |
| 15266 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15267 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15268 | countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15269 | marshal_VkRefreshCycleDurationGOOGLE(countingStream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 15270 | } |
| 15271 | uint32_t packetSize_vkGetRefreshCycleDurationGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15272 | countingStream->rewind(); |
| 15273 | uint32_t opcode_vkGetRefreshCycleDurationGOOGLE = OP_vkGetRefreshCycleDurationGOOGLE; |
| 15274 | stream->write(&opcode_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| 15275 | stream->write(&packetSize_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15276 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15277 | stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15278 | marshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 15279 | unmarshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15280 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15281 | VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0; |
| 15282 | stream->read(&vkGetRefreshCycleDurationGOOGLE_VkResult_return, sizeof(VkResult)); |
| 15283 | return vkGetRefreshCycleDurationGOOGLE_VkResult_return; |
| 15284 | } |
| 15285 | |
| 15286 | VkResult VkEncoder::vkGetPastPresentationTimingGOOGLE( |
| 15287 | VkDevice device, |
| 15288 | VkSwapchainKHR swapchain, |
| 15289 | uint32_t* pPresentationTimingCount, |
| 15290 | VkPastPresentationTimingGOOGLE* pPresentationTimings) |
| 15291 | { |
| 15292 | auto stream = mImpl->stream(); |
| 15293 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15294 | auto resources = mImpl->resources(); |
| 15295 | auto pool = mImpl->pool(); |
| 15296 | VkDevice local_device; |
| 15297 | local_device = device; |
| 15298 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 15299 | VkSwapchainKHR local_swapchain; |
| 15300 | local_swapchain = swapchain; |
| 15301 | resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&local_swapchain); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15302 | countingStream->rewind(); |
| 15303 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15304 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15305 | countingStream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15306 | countingStream->write((uint32_t**)&pPresentationTimingCount, sizeof(uint32_t*)); |
| 15307 | if (pPresentationTimingCount) |
| 15308 | { |
| 15309 | countingStream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 15310 | } |
| 15311 | countingStream->write((VkPastPresentationTimingGOOGLE**)&pPresentationTimings, sizeof(VkPastPresentationTimingGOOGLE*)); |
| 15312 | if (pPresentationTimings) |
| 15313 | { |
| 15314 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 15315 | { |
| 15316 | marshal_VkPastPresentationTimingGOOGLE(countingStream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 15317 | } |
| 15318 | } |
| 15319 | } |
| 15320 | uint32_t packetSize_vkGetPastPresentationTimingGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15321 | countingStream->rewind(); |
| 15322 | uint32_t opcode_vkGetPastPresentationTimingGOOGLE = OP_vkGetPastPresentationTimingGOOGLE; |
| 15323 | stream->write(&opcode_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| 15324 | stream->write(&packetSize_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15325 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15326 | stream->write((VkSwapchainKHR*)&local_swapchain, sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15327 | stream->write((uint32_t**)&pPresentationTimingCount, sizeof(uint32_t*)); |
| 15328 | if (pPresentationTimingCount) |
| 15329 | { |
| 15330 | stream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 15331 | } |
| 15332 | stream->write((VkPastPresentationTimingGOOGLE**)&pPresentationTimings, sizeof(VkPastPresentationTimingGOOGLE*)); |
| 15333 | if (pPresentationTimings) |
| 15334 | { |
| 15335 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 15336 | { |
| 15337 | marshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 15338 | } |
| 15339 | } |
| 15340 | uint32_t* check_pPresentationTimingCount; |
| 15341 | stream->read((uint32_t**)&check_pPresentationTimingCount, sizeof(uint32_t*)); |
| 15342 | if (pPresentationTimingCount) |
| 15343 | { |
| 15344 | if (!(check_pPresentationTimingCount)) |
| 15345 | { |
| 15346 | fprintf(stderr, "fatal: pPresentationTimingCount inconsistent between guest and host\n"); |
| 15347 | } |
| 15348 | stream->read((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 15349 | } |
| 15350 | VkPastPresentationTimingGOOGLE* check_pPresentationTimings; |
| 15351 | stream->read((VkPastPresentationTimingGOOGLE**)&check_pPresentationTimings, sizeof(VkPastPresentationTimingGOOGLE*)); |
| 15352 | if (pPresentationTimings) |
| 15353 | { |
| 15354 | if (!(check_pPresentationTimings)) |
| 15355 | { |
| 15356 | fprintf(stderr, "fatal: pPresentationTimings inconsistent between guest and host\n"); |
| 15357 | } |
| 15358 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 15359 | { |
| 15360 | unmarshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 15361 | } |
| 15362 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15363 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15364 | VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0; |
| 15365 | stream->read(&vkGetPastPresentationTimingGOOGLE_VkResult_return, sizeof(VkResult)); |
| 15366 | return vkGetPastPresentationTimingGOOGLE_VkResult_return; |
| 15367 | } |
| 15368 | |
| 15369 | #endif |
| 15370 | #ifdef VK_NV_sample_mask_override_coverage |
| 15371 | #endif |
| 15372 | #ifdef VK_NV_geometry_shader_passthrough |
| 15373 | #endif |
| 15374 | #ifdef VK_NV_viewport_array2 |
| 15375 | #endif |
| 15376 | #ifdef VK_NVX_multiview_per_view_attributes |
| 15377 | #endif |
| 15378 | #ifdef VK_NV_viewport_swizzle |
| 15379 | #endif |
| 15380 | #ifdef VK_EXT_discard_rectangles |
| 15381 | void VkEncoder::vkCmdSetDiscardRectangleEXT( |
| 15382 | VkCommandBuffer commandBuffer, |
| 15383 | uint32_t firstDiscardRectangle, |
| 15384 | uint32_t discardRectangleCount, |
| 15385 | const VkRect2D* pDiscardRectangles) |
| 15386 | { |
| 15387 | auto stream = mImpl->stream(); |
| 15388 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15389 | auto resources = mImpl->resources(); |
| 15390 | auto pool = mImpl->pool(); |
| 15391 | VkCommandBuffer local_commandBuffer; |
| 15392 | local_commandBuffer = commandBuffer; |
| 15393 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 15394 | uint32_t local_firstDiscardRectangle; |
| 15395 | local_firstDiscardRectangle = firstDiscardRectangle; |
| 15396 | uint32_t local_discardRectangleCount; |
| 15397 | local_discardRectangleCount = discardRectangleCount; |
| 15398 | VkRect2D* local_pDiscardRectangles; |
| 15399 | local_pDiscardRectangles = nullptr; |
| 15400 | if (pDiscardRectangles) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15401 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15402 | local_pDiscardRectangles = (VkRect2D*)pool->alloc(((discardRectangleCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15403 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 15404 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15405 | deepcopy_VkRect2D(pool, pDiscardRectangles + i, (VkRect2D*)(local_pDiscardRectangles + i)); |
| 15406 | } |
| 15407 | } |
| 15408 | if (local_pDiscardRectangles) |
| 15409 | { |
| 15410 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 15411 | { |
| 15412 | handlemap_VkRect2D(resources->unwrapMapping(), (VkRect2D*)(local_pDiscardRectangles + i)); |
| 15413 | } |
| 15414 | } |
| 15415 | countingStream->rewind(); |
| 15416 | { |
| 15417 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 15418 | countingStream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 15419 | countingStream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| 15420 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 15421 | { |
| 15422 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15423 | } |
| 15424 | } |
| 15425 | uint32_t packetSize_vkCmdSetDiscardRectangleEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15426 | countingStream->rewind(); |
| 15427 | uint32_t opcode_vkCmdSetDiscardRectangleEXT = OP_vkCmdSetDiscardRectangleEXT; |
| 15428 | stream->write(&opcode_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| 15429 | stream->write(&packetSize_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15430 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 15431 | stream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 15432 | stream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15433 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 15434 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15435 | marshal_VkRect2D(stream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15436 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15437 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15438 | } |
| 15439 | |
| 15440 | #endif |
| 15441 | #ifdef VK_EXT_conservative_rasterization |
| 15442 | #endif |
| 15443 | #ifdef VK_EXT_swapchain_colorspace |
| 15444 | #endif |
| 15445 | #ifdef VK_EXT_hdr_metadata |
| 15446 | void VkEncoder::vkSetHdrMetadataEXT( |
| 15447 | VkDevice device, |
| 15448 | uint32_t swapchainCount, |
| 15449 | const VkSwapchainKHR* pSwapchains, |
| 15450 | const VkHdrMetadataEXT* pMetadata) |
| 15451 | { |
| 15452 | auto stream = mImpl->stream(); |
| 15453 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15454 | auto resources = mImpl->resources(); |
| 15455 | auto pool = mImpl->pool(); |
| 15456 | VkDevice local_device; |
| 15457 | local_device = device; |
| 15458 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 15459 | uint32_t local_swapchainCount; |
| 15460 | local_swapchainCount = swapchainCount; |
| 15461 | VkSwapchainKHR* local_pSwapchains; |
| 15462 | local_pSwapchains = nullptr; |
| 15463 | if (pSwapchains) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15464 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15465 | local_pSwapchains = (VkSwapchainKHR*)pool->dupArray(pSwapchains, ((swapchainCount)) * sizeof(const VkSwapchainKHR)); |
| 15466 | } |
| 15467 | if (local_pSwapchains) |
| 15468 | { |
| 15469 | resources->unwrapMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount))); |
| 15470 | } |
| 15471 | VkHdrMetadataEXT* local_pMetadata; |
| 15472 | local_pMetadata = nullptr; |
| 15473 | if (pMetadata) |
| 15474 | { |
| 15475 | local_pMetadata = (VkHdrMetadataEXT*)pool->alloc(((swapchainCount)) * sizeof(const VkHdrMetadataEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15476 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 15477 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15478 | deepcopy_VkHdrMetadataEXT(pool, pMetadata + i, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| 15479 | } |
| 15480 | } |
| 15481 | if (local_pMetadata) |
| 15482 | { |
| 15483 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 15484 | { |
| 15485 | handlemap_VkHdrMetadataEXT(resources->unwrapMapping(), (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| 15486 | } |
| 15487 | } |
| 15488 | countingStream->rewind(); |
| 15489 | { |
| 15490 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15491 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| 15492 | countingStream->write((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR)); |
| 15493 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 15494 | { |
| 15495 | marshal_VkHdrMetadataEXT(countingStream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15496 | } |
| 15497 | } |
| 15498 | uint32_t packetSize_vkSetHdrMetadataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15499 | countingStream->rewind(); |
| 15500 | uint32_t opcode_vkSetHdrMetadataEXT = OP_vkSetHdrMetadataEXT; |
| 15501 | stream->write(&opcode_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| 15502 | stream->write(&packetSize_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15503 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15504 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| 15505 | stream->write((VkSwapchainKHR*)local_pSwapchains, ((swapchainCount)) * sizeof(VkSwapchainKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15506 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 15507 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15508 | marshal_VkHdrMetadataEXT(stream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15509 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15510 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15511 | } |
| 15512 | |
| 15513 | #endif |
| 15514 | #ifdef VK_MVK_ios_surface |
| 15515 | VkResult VkEncoder::vkCreateIOSSurfaceMVK( |
| 15516 | VkInstance instance, |
| 15517 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo, |
| 15518 | const VkAllocationCallbacks* pAllocator, |
| 15519 | VkSurfaceKHR* pSurface) |
| 15520 | { |
| 15521 | auto stream = mImpl->stream(); |
| 15522 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15523 | auto resources = mImpl->resources(); |
| 15524 | auto pool = mImpl->pool(); |
| 15525 | VkInstance local_instance; |
| 15526 | local_instance = instance; |
| 15527 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 15528 | VkIOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| 15529 | local_pCreateInfo = nullptr; |
| 15530 | if (pCreateInfo) |
| 15531 | { |
| 15532 | local_pCreateInfo = (VkIOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkIOSSurfaceCreateInfoMVK)); |
| 15533 | deepcopy_VkIOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 15534 | } |
| 15535 | if (local_pCreateInfo) |
| 15536 | { |
| 15537 | handlemap_VkIOSSurfaceCreateInfoMVK(resources->unwrapMapping(), (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 15538 | } |
| 15539 | VkAllocationCallbacks* local_pAllocator; |
| 15540 | local_pAllocator = nullptr; |
| 15541 | if (pAllocator) |
| 15542 | { |
| 15543 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15544 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15545 | } |
| 15546 | if (local_pAllocator) |
| 15547 | { |
| 15548 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 15549 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 15550 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15551 | countingStream->rewind(); |
| 15552 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15553 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 15554 | marshal_VkIOSSurfaceCreateInfoMVK(countingStream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 15555 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 15556 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15557 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15558 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15559 | } |
| 15560 | countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 15561 | } |
| 15562 | uint32_t packetSize_vkCreateIOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15563 | countingStream->rewind(); |
| 15564 | uint32_t opcode_vkCreateIOSSurfaceMVK = OP_vkCreateIOSSurfaceMVK; |
| 15565 | stream->write(&opcode_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| 15566 | stream->write(&packetSize_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15567 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 15568 | marshal_VkIOSSurfaceCreateInfoMVK(stream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 15569 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 15570 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15571 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15572 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15573 | } |
| 15574 | stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 15575 | stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15576 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15577 | VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 15578 | stream->read(&vkCreateIOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| 15579 | return vkCreateIOSSurfaceMVK_VkResult_return; |
| 15580 | } |
| 15581 | |
| 15582 | #endif |
| 15583 | #ifdef VK_MVK_macos_surface |
| 15584 | VkResult VkEncoder::vkCreateMacOSSurfaceMVK( |
| 15585 | VkInstance instance, |
| 15586 | const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, |
| 15587 | const VkAllocationCallbacks* pAllocator, |
| 15588 | VkSurfaceKHR* pSurface) |
| 15589 | { |
| 15590 | auto stream = mImpl->stream(); |
| 15591 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15592 | auto resources = mImpl->resources(); |
| 15593 | auto pool = mImpl->pool(); |
| 15594 | VkInstance local_instance; |
| 15595 | local_instance = instance; |
| 15596 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 15597 | VkMacOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| 15598 | local_pCreateInfo = nullptr; |
| 15599 | if (pCreateInfo) |
| 15600 | { |
| 15601 | local_pCreateInfo = (VkMacOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkMacOSSurfaceCreateInfoMVK)); |
| 15602 | deepcopy_VkMacOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 15603 | } |
| 15604 | if (local_pCreateInfo) |
| 15605 | { |
| 15606 | handlemap_VkMacOSSurfaceCreateInfoMVK(resources->unwrapMapping(), (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 15607 | } |
| 15608 | VkAllocationCallbacks* local_pAllocator; |
| 15609 | local_pAllocator = nullptr; |
| 15610 | if (pAllocator) |
| 15611 | { |
| 15612 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15613 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15614 | } |
| 15615 | if (local_pAllocator) |
| 15616 | { |
| 15617 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 15618 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 15619 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15620 | countingStream->rewind(); |
| 15621 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15622 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 15623 | marshal_VkMacOSSurfaceCreateInfoMVK(countingStream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 15624 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 15625 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15626 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15627 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15628 | } |
| 15629 | countingStream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 15630 | } |
| 15631 | uint32_t packetSize_vkCreateMacOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15632 | countingStream->rewind(); |
| 15633 | uint32_t opcode_vkCreateMacOSSurfaceMVK = OP_vkCreateMacOSSurfaceMVK; |
| 15634 | stream->write(&opcode_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| 15635 | stream->write(&packetSize_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15636 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 15637 | marshal_VkMacOSSurfaceCreateInfoMVK(stream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 15638 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 15639 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15640 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15641 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15642 | } |
| 15643 | stream->write((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| 15644 | stream->read((VkSurfaceKHR*)pSurface, sizeof(VkSurfaceKHR)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15645 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15646 | VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 15647 | stream->read(&vkCreateMacOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| 15648 | return vkCreateMacOSSurfaceMVK_VkResult_return; |
| 15649 | } |
| 15650 | |
| 15651 | #endif |
| 15652 | #ifdef VK_EXT_external_memory_dma_buf |
| 15653 | #endif |
| 15654 | #ifdef VK_EXT_queue_family_foreign |
| 15655 | #endif |
| 15656 | #ifdef VK_EXT_debug_utils |
| 15657 | VkResult VkEncoder::vkSetDebugUtilsObjectNameEXT( |
| 15658 | VkDevice device, |
| 15659 | const VkDebugUtilsObjectNameInfoEXT* pNameInfo) |
| 15660 | { |
| 15661 | auto stream = mImpl->stream(); |
| 15662 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15663 | auto resources = mImpl->resources(); |
| 15664 | auto pool = mImpl->pool(); |
| 15665 | VkDevice local_device; |
| 15666 | local_device = device; |
| 15667 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 15668 | VkDebugUtilsObjectNameInfoEXT* local_pNameInfo; |
| 15669 | local_pNameInfo = nullptr; |
| 15670 | if (pNameInfo) |
| 15671 | { |
| 15672 | local_pNameInfo = (VkDebugUtilsObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectNameInfoEXT)); |
| 15673 | deepcopy_VkDebugUtilsObjectNameInfoEXT(pool, pNameInfo, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| 15674 | } |
| 15675 | if (local_pNameInfo) |
| 15676 | { |
| 15677 | handlemap_VkDebugUtilsObjectNameInfoEXT(resources->unwrapMapping(), (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| 15678 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15679 | countingStream->rewind(); |
| 15680 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15681 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15682 | marshal_VkDebugUtilsObjectNameInfoEXT(countingStream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15683 | } |
| 15684 | uint32_t packetSize_vkSetDebugUtilsObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15685 | countingStream->rewind(); |
| 15686 | uint32_t opcode_vkSetDebugUtilsObjectNameEXT = OP_vkSetDebugUtilsObjectNameEXT; |
| 15687 | stream->write(&opcode_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| 15688 | stream->write(&packetSize_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15689 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15690 | marshal_VkDebugUtilsObjectNameInfoEXT(stream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| 15691 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15692 | VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0; |
| 15693 | stream->read(&vkSetDebugUtilsObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| 15694 | return vkSetDebugUtilsObjectNameEXT_VkResult_return; |
| 15695 | } |
| 15696 | |
| 15697 | VkResult VkEncoder::vkSetDebugUtilsObjectTagEXT( |
| 15698 | VkDevice device, |
| 15699 | const VkDebugUtilsObjectTagInfoEXT* pTagInfo) |
| 15700 | { |
| 15701 | auto stream = mImpl->stream(); |
| 15702 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15703 | auto resources = mImpl->resources(); |
| 15704 | auto pool = mImpl->pool(); |
| 15705 | VkDevice local_device; |
| 15706 | local_device = device; |
| 15707 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 15708 | VkDebugUtilsObjectTagInfoEXT* local_pTagInfo; |
| 15709 | local_pTagInfo = nullptr; |
| 15710 | if (pTagInfo) |
| 15711 | { |
| 15712 | local_pTagInfo = (VkDebugUtilsObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectTagInfoEXT)); |
| 15713 | deepcopy_VkDebugUtilsObjectTagInfoEXT(pool, pTagInfo, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| 15714 | } |
| 15715 | if (local_pTagInfo) |
| 15716 | { |
| 15717 | handlemap_VkDebugUtilsObjectTagInfoEXT(resources->unwrapMapping(), (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| 15718 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15719 | countingStream->rewind(); |
| 15720 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15721 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15722 | marshal_VkDebugUtilsObjectTagInfoEXT(countingStream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15723 | } |
| 15724 | uint32_t packetSize_vkSetDebugUtilsObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15725 | countingStream->rewind(); |
| 15726 | uint32_t opcode_vkSetDebugUtilsObjectTagEXT = OP_vkSetDebugUtilsObjectTagEXT; |
| 15727 | stream->write(&opcode_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| 15728 | stream->write(&packetSize_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15729 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 15730 | marshal_VkDebugUtilsObjectTagInfoEXT(stream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| 15731 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15732 | VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0; |
| 15733 | stream->read(&vkSetDebugUtilsObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| 15734 | return vkSetDebugUtilsObjectTagEXT_VkResult_return; |
| 15735 | } |
| 15736 | |
| 15737 | void VkEncoder::vkQueueBeginDebugUtilsLabelEXT( |
| 15738 | VkQueue queue, |
| 15739 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 15740 | { |
| 15741 | auto stream = mImpl->stream(); |
| 15742 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15743 | auto resources = mImpl->resources(); |
| 15744 | auto pool = mImpl->pool(); |
| 15745 | VkQueue local_queue; |
| 15746 | local_queue = queue; |
| 15747 | resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue); |
| 15748 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| 15749 | local_pLabelInfo = nullptr; |
| 15750 | if (pLabelInfo) |
| 15751 | { |
| 15752 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 15753 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15754 | } |
| 15755 | if (local_pLabelInfo) |
| 15756 | { |
| 15757 | handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15758 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15759 | countingStream->rewind(); |
| 15760 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15761 | countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 15762 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15763 | } |
| 15764 | uint32_t packetSize_vkQueueBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15765 | countingStream->rewind(); |
| 15766 | uint32_t opcode_vkQueueBeginDebugUtilsLabelEXT = OP_vkQueueBeginDebugUtilsLabelEXT; |
| 15767 | stream->write(&opcode_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 15768 | stream->write(&packetSize_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15769 | stream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 15770 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15771 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15772 | } |
| 15773 | |
| 15774 | void VkEncoder::vkQueueEndDebugUtilsLabelEXT( |
| 15775 | VkQueue queue) |
| 15776 | { |
| 15777 | auto stream = mImpl->stream(); |
| 15778 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15779 | auto resources = mImpl->resources(); |
| 15780 | auto pool = mImpl->pool(); |
| 15781 | VkQueue local_queue; |
| 15782 | local_queue = queue; |
| 15783 | resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15784 | countingStream->rewind(); |
| 15785 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15786 | countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15787 | } |
| 15788 | uint32_t packetSize_vkQueueEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15789 | countingStream->rewind(); |
| 15790 | uint32_t opcode_vkQueueEndDebugUtilsLabelEXT = OP_vkQueueEndDebugUtilsLabelEXT; |
| 15791 | stream->write(&opcode_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 15792 | stream->write(&packetSize_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15793 | stream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 15794 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15795 | } |
| 15796 | |
| 15797 | void VkEncoder::vkQueueInsertDebugUtilsLabelEXT( |
| 15798 | VkQueue queue, |
| 15799 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 15800 | { |
| 15801 | auto stream = mImpl->stream(); |
| 15802 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15803 | auto resources = mImpl->resources(); |
| 15804 | auto pool = mImpl->pool(); |
| 15805 | VkQueue local_queue; |
| 15806 | local_queue = queue; |
| 15807 | resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue); |
| 15808 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| 15809 | local_pLabelInfo = nullptr; |
| 15810 | if (pLabelInfo) |
| 15811 | { |
| 15812 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 15813 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15814 | } |
| 15815 | if (local_pLabelInfo) |
| 15816 | { |
| 15817 | handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15818 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15819 | countingStream->rewind(); |
| 15820 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15821 | countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 15822 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15823 | } |
| 15824 | uint32_t packetSize_vkQueueInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15825 | countingStream->rewind(); |
| 15826 | uint32_t opcode_vkQueueInsertDebugUtilsLabelEXT = OP_vkQueueInsertDebugUtilsLabelEXT; |
| 15827 | stream->write(&opcode_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 15828 | stream->write(&packetSize_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15829 | stream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| 15830 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15831 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15832 | } |
| 15833 | |
| 15834 | void VkEncoder::vkCmdBeginDebugUtilsLabelEXT( |
| 15835 | VkCommandBuffer commandBuffer, |
| 15836 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 15837 | { |
| 15838 | auto stream = mImpl->stream(); |
| 15839 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15840 | auto resources = mImpl->resources(); |
| 15841 | auto pool = mImpl->pool(); |
| 15842 | VkCommandBuffer local_commandBuffer; |
| 15843 | local_commandBuffer = commandBuffer; |
| 15844 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 15845 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| 15846 | local_pLabelInfo = nullptr; |
| 15847 | if (pLabelInfo) |
| 15848 | { |
| 15849 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 15850 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15851 | } |
| 15852 | if (local_pLabelInfo) |
| 15853 | { |
| 15854 | handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15855 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15856 | countingStream->rewind(); |
| 15857 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15858 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 15859 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15860 | } |
| 15861 | uint32_t packetSize_vkCmdBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15862 | countingStream->rewind(); |
| 15863 | uint32_t opcode_vkCmdBeginDebugUtilsLabelEXT = OP_vkCmdBeginDebugUtilsLabelEXT; |
| 15864 | stream->write(&opcode_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 15865 | stream->write(&packetSize_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15866 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 15867 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15868 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15869 | } |
| 15870 | |
| 15871 | void VkEncoder::vkCmdEndDebugUtilsLabelEXT( |
| 15872 | VkCommandBuffer commandBuffer) |
| 15873 | { |
| 15874 | auto stream = mImpl->stream(); |
| 15875 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15876 | auto resources = mImpl->resources(); |
| 15877 | auto pool = mImpl->pool(); |
| 15878 | VkCommandBuffer local_commandBuffer; |
| 15879 | local_commandBuffer = commandBuffer; |
| 15880 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15881 | countingStream->rewind(); |
| 15882 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15883 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15884 | } |
| 15885 | uint32_t packetSize_vkCmdEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15886 | countingStream->rewind(); |
| 15887 | uint32_t opcode_vkCmdEndDebugUtilsLabelEXT = OP_vkCmdEndDebugUtilsLabelEXT; |
| 15888 | stream->write(&opcode_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 15889 | stream->write(&packetSize_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15890 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 15891 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15892 | } |
| 15893 | |
| 15894 | void VkEncoder::vkCmdInsertDebugUtilsLabelEXT( |
| 15895 | VkCommandBuffer commandBuffer, |
| 15896 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 15897 | { |
| 15898 | auto stream = mImpl->stream(); |
| 15899 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15900 | auto resources = mImpl->resources(); |
| 15901 | auto pool = mImpl->pool(); |
| 15902 | VkCommandBuffer local_commandBuffer; |
| 15903 | local_commandBuffer = commandBuffer; |
| 15904 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 15905 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| 15906 | local_pLabelInfo = nullptr; |
| 15907 | if (pLabelInfo) |
| 15908 | { |
| 15909 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 15910 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15911 | } |
| 15912 | if (local_pLabelInfo) |
| 15913 | { |
| 15914 | handlemap_VkDebugUtilsLabelEXT(resources->unwrapMapping(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15915 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15916 | countingStream->rewind(); |
| 15917 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15918 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 15919 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15920 | } |
| 15921 | uint32_t packetSize_vkCmdInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15922 | countingStream->rewind(); |
| 15923 | uint32_t opcode_vkCmdInsertDebugUtilsLabelEXT = OP_vkCmdInsertDebugUtilsLabelEXT; |
| 15924 | stream->write(&opcode_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 15925 | stream->write(&packetSize_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15926 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 15927 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 15928 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15929 | } |
| 15930 | |
| 15931 | VkResult VkEncoder::vkCreateDebugUtilsMessengerEXT( |
| 15932 | VkInstance instance, |
| 15933 | const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, |
| 15934 | const VkAllocationCallbacks* pAllocator, |
| 15935 | VkDebugUtilsMessengerEXT* pMessenger) |
| 15936 | { |
| 15937 | auto stream = mImpl->stream(); |
| 15938 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15939 | auto resources = mImpl->resources(); |
| 15940 | auto pool = mImpl->pool(); |
| 15941 | VkInstance local_instance; |
| 15942 | local_instance = instance; |
| 15943 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 15944 | VkDebugUtilsMessengerCreateInfoEXT* local_pCreateInfo; |
| 15945 | local_pCreateInfo = nullptr; |
| 15946 | if (pCreateInfo) |
| 15947 | { |
| 15948 | local_pCreateInfo = (VkDebugUtilsMessengerCreateInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCreateInfoEXT)); |
| 15949 | deepcopy_VkDebugUtilsMessengerCreateInfoEXT(pool, pCreateInfo, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| 15950 | } |
| 15951 | if (local_pCreateInfo) |
| 15952 | { |
| 15953 | handlemap_VkDebugUtilsMessengerCreateInfoEXT(resources->unwrapMapping(), (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| 15954 | } |
| 15955 | VkAllocationCallbacks* local_pAllocator; |
| 15956 | local_pAllocator = nullptr; |
| 15957 | if (pAllocator) |
| 15958 | { |
| 15959 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15960 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15961 | } |
| 15962 | if (local_pAllocator) |
| 15963 | { |
| 15964 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 15965 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 15966 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15967 | countingStream->rewind(); |
| 15968 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15969 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 15970 | marshal_VkDebugUtilsMessengerCreateInfoEXT(countingStream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| 15971 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 15972 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15973 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15974 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15975 | } |
| 15976 | countingStream->write((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT)); |
| 15977 | } |
| 15978 | uint32_t packetSize_vkCreateDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15979 | countingStream->rewind(); |
| 15980 | uint32_t opcode_vkCreateDebugUtilsMessengerEXT = OP_vkCreateDebugUtilsMessengerEXT; |
| 15981 | stream->write(&opcode_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 15982 | stream->write(&packetSize_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15983 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 15984 | marshal_VkDebugUtilsMessengerCreateInfoEXT(stream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| 15985 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 15986 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15987 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15988 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15989 | } |
| 15990 | stream->write((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT)); |
| 15991 | stream->read((VkDebugUtilsMessengerEXT*)pMessenger, sizeof(VkDebugUtilsMessengerEXT)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15992 | if (pMessenger) |
| 15993 | { |
| 15994 | resources->createMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)pMessenger, 1); |
| 15995 | } |
| 15996 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15997 | VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0; |
| 15998 | stream->read(&vkCreateDebugUtilsMessengerEXT_VkResult_return, sizeof(VkResult)); |
| 15999 | return vkCreateDebugUtilsMessengerEXT_VkResult_return; |
| 16000 | } |
| 16001 | |
| 16002 | void VkEncoder::vkDestroyDebugUtilsMessengerEXT( |
| 16003 | VkInstance instance, |
| 16004 | VkDebugUtilsMessengerEXT messenger, |
| 16005 | const VkAllocationCallbacks* pAllocator) |
| 16006 | { |
| 16007 | auto stream = mImpl->stream(); |
| 16008 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16009 | auto resources = mImpl->resources(); |
| 16010 | auto pool = mImpl->pool(); |
| 16011 | VkInstance local_instance; |
| 16012 | local_instance = instance; |
| 16013 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 16014 | VkDebugUtilsMessengerEXT local_messenger; |
| 16015 | local_messenger = messenger; |
| 16016 | resources->unwrapMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)&local_messenger); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16017 | VkAllocationCallbacks* local_pAllocator; |
| 16018 | local_pAllocator = nullptr; |
| 16019 | if (pAllocator) |
| 16020 | { |
| 16021 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16022 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16023 | } |
| 16024 | if (local_pAllocator) |
| 16025 | { |
| 16026 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 16027 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 16028 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16029 | countingStream->rewind(); |
| 16030 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16031 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 16032 | countingStream->write((VkDebugUtilsMessengerEXT*)&local_messenger, sizeof(VkDebugUtilsMessengerEXT)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16033 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 16034 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16035 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16036 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16037 | } |
| 16038 | } |
| 16039 | uint32_t packetSize_vkDestroyDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16040 | countingStream->rewind(); |
| 16041 | uint32_t opcode_vkDestroyDebugUtilsMessengerEXT = OP_vkDestroyDebugUtilsMessengerEXT; |
| 16042 | stream->write(&opcode_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 16043 | stream->write(&packetSize_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16044 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 16045 | stream->write((VkDebugUtilsMessengerEXT*)&local_messenger, sizeof(VkDebugUtilsMessengerEXT)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16046 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 16047 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16048 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16049 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16050 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16051 | resources->destroyMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)&messenger); |
| 16052 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16053 | } |
| 16054 | |
| 16055 | void VkEncoder::vkSubmitDebugUtilsMessageEXT( |
| 16056 | VkInstance instance, |
| 16057 | VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, |
| 16058 | VkDebugUtilsMessageTypeFlagsEXT messageTypes, |
| 16059 | const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) |
| 16060 | { |
| 16061 | auto stream = mImpl->stream(); |
| 16062 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16063 | auto resources = mImpl->resources(); |
| 16064 | auto pool = mImpl->pool(); |
| 16065 | VkInstance local_instance; |
| 16066 | local_instance = instance; |
| 16067 | resources->unwrapMapping()->mapHandles_VkInstance((VkInstance*)&local_instance); |
| 16068 | VkDebugUtilsMessageSeverityFlagBitsEXT local_messageSeverity; |
| 16069 | local_messageSeverity = messageSeverity; |
| 16070 | VkDebugUtilsMessageTypeFlagsEXT local_messageTypes; |
| 16071 | local_messageTypes = messageTypes; |
| 16072 | VkDebugUtilsMessengerCallbackDataEXT* local_pCallbackData; |
| 16073 | local_pCallbackData = nullptr; |
| 16074 | if (pCallbackData) |
| 16075 | { |
| 16076 | local_pCallbackData = (VkDebugUtilsMessengerCallbackDataEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCallbackDataEXT)); |
| 16077 | deepcopy_VkDebugUtilsMessengerCallbackDataEXT(pool, pCallbackData, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| 16078 | } |
| 16079 | if (local_pCallbackData) |
| 16080 | { |
| 16081 | handlemap_VkDebugUtilsMessengerCallbackDataEXT(resources->unwrapMapping(), (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| 16082 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16083 | countingStream->rewind(); |
| 16084 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16085 | countingStream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 16086 | countingStream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 16087 | countingStream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 16088 | marshal_VkDebugUtilsMessengerCallbackDataEXT(countingStream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16089 | } |
| 16090 | uint32_t packetSize_vkSubmitDebugUtilsMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16091 | countingStream->rewind(); |
| 16092 | uint32_t opcode_vkSubmitDebugUtilsMessageEXT = OP_vkSubmitDebugUtilsMessageEXT; |
| 16093 | stream->write(&opcode_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| 16094 | stream->write(&packetSize_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16095 | stream->write((VkInstance*)&local_instance, sizeof(VkInstance)); |
| 16096 | stream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 16097 | stream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 16098 | marshal_VkDebugUtilsMessengerCallbackDataEXT(stream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| 16099 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16100 | } |
| 16101 | |
| 16102 | #endif |
| 16103 | #ifdef VK_ANDROID_external_memory_android_hardware_buffer |
| 16104 | VkResult VkEncoder::vkGetAndroidHardwareBufferPropertiesANDROID( |
| 16105 | VkDevice device, |
| 16106 | const AHardwareBuffer* buffer, |
| 16107 | VkAndroidHardwareBufferPropertiesANDROID* pProperties) |
| 16108 | { |
| 16109 | auto stream = mImpl->stream(); |
| 16110 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16111 | auto resources = mImpl->resources(); |
| 16112 | auto pool = mImpl->pool(); |
| 16113 | VkDevice local_device; |
| 16114 | local_device = device; |
| 16115 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 16116 | AHardwareBuffer* local_buffer; |
| 16117 | local_buffer = nullptr; |
| 16118 | if (buffer) |
| 16119 | { |
| 16120 | local_buffer = (AHardwareBuffer*)pool->dupArray(buffer, sizeof(const AHardwareBuffer)); |
| 16121 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16122 | countingStream->rewind(); |
| 16123 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16124 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16125 | countingStream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16126 | marshal_VkAndroidHardwareBufferPropertiesANDROID(countingStream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 16127 | } |
| 16128 | uint32_t packetSize_vkGetAndroidHardwareBufferPropertiesANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16129 | countingStream->rewind(); |
| 16130 | uint32_t opcode_vkGetAndroidHardwareBufferPropertiesANDROID = OP_vkGetAndroidHardwareBufferPropertiesANDROID; |
| 16131 | stream->write(&opcode_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| 16132 | stream->write(&packetSize_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16133 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16134 | stream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16135 | marshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 16136 | unmarshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16137 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16138 | VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0; |
| 16139 | stream->read(&vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return, sizeof(VkResult)); |
| 16140 | return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return; |
| 16141 | } |
| 16142 | |
| 16143 | VkResult VkEncoder::vkGetMemoryAndroidHardwareBufferANDROID( |
| 16144 | VkDevice device, |
| 16145 | const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, |
| 16146 | AHardwareBuffer** pBuffer) |
| 16147 | { |
| 16148 | auto stream = mImpl->stream(); |
| 16149 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16150 | auto resources = mImpl->resources(); |
| 16151 | auto pool = mImpl->pool(); |
| 16152 | VkDevice local_device; |
| 16153 | local_device = device; |
| 16154 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 16155 | VkMemoryGetAndroidHardwareBufferInfoANDROID* local_pInfo; |
| 16156 | local_pInfo = nullptr; |
| 16157 | if (pInfo) |
| 16158 | { |
| 16159 | local_pInfo = (VkMemoryGetAndroidHardwareBufferInfoANDROID*)pool->alloc(sizeof(const VkMemoryGetAndroidHardwareBufferInfoANDROID)); |
| 16160 | deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(pool, pInfo, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| 16161 | } |
| 16162 | if (local_pInfo) |
| 16163 | { |
| 16164 | handlemap_VkMemoryGetAndroidHardwareBufferInfoANDROID(resources->unwrapMapping(), (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| 16165 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16166 | countingStream->rewind(); |
| 16167 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16168 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16169 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(countingStream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16170 | countingStream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 16171 | } |
| 16172 | uint32_t packetSize_vkGetMemoryAndroidHardwareBufferANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16173 | countingStream->rewind(); |
| 16174 | uint32_t opcode_vkGetMemoryAndroidHardwareBufferANDROID = OP_vkGetMemoryAndroidHardwareBufferANDROID; |
| 16175 | stream->write(&opcode_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| 16176 | stream->write(&packetSize_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16177 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16178 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(stream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16179 | stream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 16180 | stream->read((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16181 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16182 | VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0; |
| 16183 | stream->read(&vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return, sizeof(VkResult)); |
| 16184 | return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return; |
| 16185 | } |
| 16186 | |
| 16187 | #endif |
| 16188 | #ifdef VK_EXT_sampler_filter_minmax |
| 16189 | #endif |
| 16190 | #ifdef VK_AMD_gpu_shader_int16 |
| 16191 | #endif |
| 16192 | #ifdef VK_AMD_mixed_attachment_samples |
| 16193 | #endif |
| 16194 | #ifdef VK_AMD_shader_fragment_mask |
| 16195 | #endif |
| 16196 | #ifdef VK_EXT_shader_stencil_export |
| 16197 | #endif |
| 16198 | #ifdef VK_EXT_sample_locations |
| 16199 | void VkEncoder::vkCmdSetSampleLocationsEXT( |
| 16200 | VkCommandBuffer commandBuffer, |
| 16201 | const VkSampleLocationsInfoEXT* pSampleLocationsInfo) |
| 16202 | { |
| 16203 | auto stream = mImpl->stream(); |
| 16204 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16205 | auto resources = mImpl->resources(); |
| 16206 | auto pool = mImpl->pool(); |
| 16207 | VkCommandBuffer local_commandBuffer; |
| 16208 | local_commandBuffer = commandBuffer; |
| 16209 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 16210 | VkSampleLocationsInfoEXT* local_pSampleLocationsInfo; |
| 16211 | local_pSampleLocationsInfo = nullptr; |
| 16212 | if (pSampleLocationsInfo) |
| 16213 | { |
| 16214 | local_pSampleLocationsInfo = (VkSampleLocationsInfoEXT*)pool->alloc(sizeof(const VkSampleLocationsInfoEXT)); |
| 16215 | deepcopy_VkSampleLocationsInfoEXT(pool, pSampleLocationsInfo, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| 16216 | } |
| 16217 | if (local_pSampleLocationsInfo) |
| 16218 | { |
| 16219 | handlemap_VkSampleLocationsInfoEXT(resources->unwrapMapping(), (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| 16220 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16221 | countingStream->rewind(); |
| 16222 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16223 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 16224 | marshal_VkSampleLocationsInfoEXT(countingStream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16225 | } |
| 16226 | uint32_t packetSize_vkCmdSetSampleLocationsEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16227 | countingStream->rewind(); |
| 16228 | uint32_t opcode_vkCmdSetSampleLocationsEXT = OP_vkCmdSetSampleLocationsEXT; |
| 16229 | stream->write(&opcode_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| 16230 | stream->write(&packetSize_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16231 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 16232 | marshal_VkSampleLocationsInfoEXT(stream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| 16233 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16234 | } |
| 16235 | |
| 16236 | void VkEncoder::vkGetPhysicalDeviceMultisamplePropertiesEXT( |
| 16237 | VkPhysicalDevice physicalDevice, |
| 16238 | VkSampleCountFlagBits samples, |
| 16239 | VkMultisamplePropertiesEXT* pMultisampleProperties) |
| 16240 | { |
| 16241 | auto stream = mImpl->stream(); |
| 16242 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16243 | auto resources = mImpl->resources(); |
| 16244 | auto pool = mImpl->pool(); |
| 16245 | VkPhysicalDevice local_physicalDevice; |
| 16246 | local_physicalDevice = physicalDevice; |
| 16247 | resources->unwrapMapping()->mapHandles_VkPhysicalDevice((VkPhysicalDevice*)&local_physicalDevice); |
| 16248 | VkSampleCountFlagBits local_samples; |
| 16249 | local_samples = samples; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16250 | countingStream->rewind(); |
| 16251 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16252 | countingStream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 16253 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16254 | marshal_VkMultisamplePropertiesEXT(countingStream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 16255 | } |
| 16256 | uint32_t packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16257 | countingStream->rewind(); |
| 16258 | uint32_t opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT = OP_vkGetPhysicalDeviceMultisamplePropertiesEXT; |
| 16259 | stream->write(&opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| 16260 | stream->write(&packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16261 | stream->write((VkPhysicalDevice*)&local_physicalDevice, sizeof(VkPhysicalDevice)); |
| 16262 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16263 | marshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 16264 | unmarshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16265 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16266 | } |
| 16267 | |
| 16268 | #endif |
| 16269 | #ifdef VK_EXT_blend_operation_advanced |
| 16270 | #endif |
| 16271 | #ifdef VK_NV_fragment_coverage_to_color |
| 16272 | #endif |
| 16273 | #ifdef VK_NV_framebuffer_mixed_samples |
| 16274 | #endif |
| 16275 | #ifdef VK_NV_fill_rectangle |
| 16276 | #endif |
| 16277 | #ifdef VK_EXT_post_depth_coverage |
| 16278 | #endif |
| 16279 | #ifdef VK_EXT_validation_cache |
| 16280 | VkResult VkEncoder::vkCreateValidationCacheEXT( |
| 16281 | VkDevice device, |
| 16282 | const VkValidationCacheCreateInfoEXT* pCreateInfo, |
| 16283 | const VkAllocationCallbacks* pAllocator, |
| 16284 | VkValidationCacheEXT* pValidationCache) |
| 16285 | { |
| 16286 | auto stream = mImpl->stream(); |
| 16287 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16288 | auto resources = mImpl->resources(); |
| 16289 | auto pool = mImpl->pool(); |
| 16290 | VkDevice local_device; |
| 16291 | local_device = device; |
| 16292 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 16293 | VkValidationCacheCreateInfoEXT* local_pCreateInfo; |
| 16294 | local_pCreateInfo = nullptr; |
| 16295 | if (pCreateInfo) |
| 16296 | { |
| 16297 | local_pCreateInfo = (VkValidationCacheCreateInfoEXT*)pool->alloc(sizeof(const VkValidationCacheCreateInfoEXT)); |
| 16298 | deepcopy_VkValidationCacheCreateInfoEXT(pool, pCreateInfo, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| 16299 | } |
| 16300 | if (local_pCreateInfo) |
| 16301 | { |
| 16302 | handlemap_VkValidationCacheCreateInfoEXT(resources->unwrapMapping(), (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| 16303 | } |
| 16304 | VkAllocationCallbacks* local_pAllocator; |
| 16305 | local_pAllocator = nullptr; |
| 16306 | if (pAllocator) |
| 16307 | { |
| 16308 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16309 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16310 | } |
| 16311 | if (local_pAllocator) |
| 16312 | { |
| 16313 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 16314 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 16315 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16316 | countingStream->rewind(); |
| 16317 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16318 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16319 | marshal_VkValidationCacheCreateInfoEXT(countingStream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| 16320 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 16321 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16322 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16323 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16324 | } |
| 16325 | countingStream->write((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT)); |
| 16326 | } |
| 16327 | uint32_t packetSize_vkCreateValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16328 | countingStream->rewind(); |
| 16329 | uint32_t opcode_vkCreateValidationCacheEXT = OP_vkCreateValidationCacheEXT; |
| 16330 | stream->write(&opcode_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| 16331 | stream->write(&packetSize_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16332 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16333 | marshal_VkValidationCacheCreateInfoEXT(stream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| 16334 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 16335 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16336 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16337 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16338 | } |
| 16339 | stream->write((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT)); |
| 16340 | stream->read((VkValidationCacheEXT*)pValidationCache, sizeof(VkValidationCacheEXT)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16341 | if (pValidationCache) |
| 16342 | { |
| 16343 | resources->createMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)pValidationCache, 1); |
| 16344 | } |
| 16345 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16346 | VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0; |
| 16347 | stream->read(&vkCreateValidationCacheEXT_VkResult_return, sizeof(VkResult)); |
| 16348 | return vkCreateValidationCacheEXT_VkResult_return; |
| 16349 | } |
| 16350 | |
| 16351 | void VkEncoder::vkDestroyValidationCacheEXT( |
| 16352 | VkDevice device, |
| 16353 | VkValidationCacheEXT validationCache, |
| 16354 | const VkAllocationCallbacks* pAllocator) |
| 16355 | { |
| 16356 | auto stream = mImpl->stream(); |
| 16357 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16358 | auto resources = mImpl->resources(); |
| 16359 | auto pool = mImpl->pool(); |
| 16360 | VkDevice local_device; |
| 16361 | local_device = device; |
| 16362 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 16363 | VkValidationCacheEXT local_validationCache; |
| 16364 | local_validationCache = validationCache; |
| 16365 | resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&local_validationCache); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16366 | VkAllocationCallbacks* local_pAllocator; |
| 16367 | local_pAllocator = nullptr; |
| 16368 | if (pAllocator) |
| 16369 | { |
| 16370 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16371 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16372 | } |
| 16373 | if (local_pAllocator) |
| 16374 | { |
| 16375 | handlemap_VkAllocationCallbacks(resources->unwrapMapping(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 16376 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 16377 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16378 | countingStream->rewind(); |
| 16379 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16380 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 16381 | countingStream->write((VkValidationCacheEXT*)&local_validationCache, sizeof(VkValidationCacheEXT)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16382 | countingStream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 16383 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16384 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16385 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16386 | } |
| 16387 | } |
| 16388 | uint32_t packetSize_vkDestroyValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16389 | countingStream->rewind(); |
| 16390 | uint32_t opcode_vkDestroyValidationCacheEXT = OP_vkDestroyValidationCacheEXT; |
| 16391 | stream->write(&opcode_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| 16392 | stream->write(&packetSize_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16393 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame^] | 16394 | stream->write((VkValidationCacheEXT*)&local_validationCache, sizeof(VkValidationCacheEXT)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16395 | stream->write((VkAllocationCallbacks**)&local_pAllocator, sizeof(VkAllocationCallbacks*)); |
| 16396 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16397 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16398 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16399 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16400 | resources->destroyMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&validationCache); |
| 16401 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16402 | } |
| 16403 | |
| 16404 | VkResult VkEncoder::vkMergeValidationCachesEXT( |
| 16405 | VkDevice device, |
| 16406 | VkValidationCacheEXT dstCache, |
| 16407 | uint32_t srcCacheCount, |
| 16408 | const VkValidationCacheEXT* pSrcCaches) |
| 16409 | { |
| 16410 | auto stream = mImpl->stream(); |
| 16411 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16412 | auto resources = mImpl->resources(); |
| 16413 | auto pool = mImpl->pool(); |
| 16414 | VkDevice local_device; |
| 16415 | local_device = device; |
| 16416 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 16417 | VkValidationCacheEXT local_dstCache; |
| 16418 | local_dstCache = dstCache; |
| 16419 | resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&local_dstCache); |
| 16420 | uint32_t local_srcCacheCount; |
| 16421 | local_srcCacheCount = srcCacheCount; |
| 16422 | VkValidationCacheEXT* local_pSrcCaches; |
| 16423 | local_pSrcCaches = nullptr; |
| 16424 | if (pSrcCaches) |
| 16425 | { |
| 16426 | local_pSrcCaches = (VkValidationCacheEXT*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkValidationCacheEXT)); |
| 16427 | } |
| 16428 | if (local_pSrcCaches) |
| 16429 | { |
| 16430 | resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount))); |
| 16431 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16432 | countingStream->rewind(); |
| 16433 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16434 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16435 | countingStream->write((VkValidationCacheEXT*)&local_dstCache, sizeof(VkValidationCacheEXT)); |
| 16436 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| 16437 | countingStream->write((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkValidationCacheEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16438 | } |
| 16439 | uint32_t packetSize_vkMergeValidationCachesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16440 | countingStream->rewind(); |
| 16441 | uint32_t opcode_vkMergeValidationCachesEXT = OP_vkMergeValidationCachesEXT; |
| 16442 | stream->write(&opcode_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| 16443 | stream->write(&packetSize_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16444 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16445 | stream->write((VkValidationCacheEXT*)&local_dstCache, sizeof(VkValidationCacheEXT)); |
| 16446 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| 16447 | stream->write((VkValidationCacheEXT*)local_pSrcCaches, ((srcCacheCount)) * sizeof(VkValidationCacheEXT)); |
| 16448 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16449 | VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0; |
| 16450 | stream->read(&vkMergeValidationCachesEXT_VkResult_return, sizeof(VkResult)); |
| 16451 | return vkMergeValidationCachesEXT_VkResult_return; |
| 16452 | } |
| 16453 | |
| 16454 | VkResult VkEncoder::vkGetValidationCacheDataEXT( |
| 16455 | VkDevice device, |
| 16456 | VkValidationCacheEXT validationCache, |
| 16457 | size_t* pDataSize, |
| 16458 | void* pData) |
| 16459 | { |
| 16460 | auto stream = mImpl->stream(); |
| 16461 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16462 | auto resources = mImpl->resources(); |
| 16463 | auto pool = mImpl->pool(); |
| 16464 | VkDevice local_device; |
| 16465 | local_device = device; |
| 16466 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 16467 | VkValidationCacheEXT local_validationCache; |
| 16468 | local_validationCache = validationCache; |
| 16469 | resources->unwrapMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&local_validationCache); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16470 | countingStream->rewind(); |
| 16471 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16472 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16473 | countingStream->write((VkValidationCacheEXT*)&local_validationCache, sizeof(VkValidationCacheEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16474 | countingStream->write((size_t**)&pDataSize, sizeof(size_t*)); |
| 16475 | if (pDataSize) |
| 16476 | { |
| 16477 | countingStream->write((size_t*)pDataSize, sizeof(size_t)); |
| 16478 | } |
| 16479 | countingStream->write((void**)&pData, sizeof(void*)); |
| 16480 | if (pData) |
| 16481 | { |
| 16482 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 16483 | } |
| 16484 | } |
| 16485 | uint32_t packetSize_vkGetValidationCacheDataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16486 | countingStream->rewind(); |
| 16487 | uint32_t opcode_vkGetValidationCacheDataEXT = OP_vkGetValidationCacheDataEXT; |
| 16488 | stream->write(&opcode_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| 16489 | stream->write(&packetSize_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16490 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16491 | stream->write((VkValidationCacheEXT*)&local_validationCache, sizeof(VkValidationCacheEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16492 | stream->write((size_t**)&pDataSize, sizeof(size_t*)); |
| 16493 | if (pDataSize) |
| 16494 | { |
| 16495 | stream->write((size_t*)pDataSize, sizeof(size_t)); |
| 16496 | } |
| 16497 | stream->write((void**)&pData, sizeof(void*)); |
| 16498 | if (pData) |
| 16499 | { |
| 16500 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 16501 | } |
| 16502 | size_t* check_pDataSize; |
| 16503 | stream->read((size_t**)&check_pDataSize, sizeof(size_t*)); |
| 16504 | if (pDataSize) |
| 16505 | { |
| 16506 | if (!(check_pDataSize)) |
| 16507 | { |
| 16508 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 16509 | } |
| 16510 | stream->read((size_t*)pDataSize, sizeof(size_t)); |
| 16511 | } |
| 16512 | void* check_pData; |
| 16513 | stream->read((void**)&check_pData, sizeof(void*)); |
| 16514 | if (pData) |
| 16515 | { |
| 16516 | if (!(check_pData)) |
| 16517 | { |
| 16518 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 16519 | } |
| 16520 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 16521 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16522 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16523 | VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0; |
| 16524 | stream->read(&vkGetValidationCacheDataEXT_VkResult_return, sizeof(VkResult)); |
| 16525 | return vkGetValidationCacheDataEXT_VkResult_return; |
| 16526 | } |
| 16527 | |
| 16528 | #endif |
| 16529 | #ifdef VK_EXT_descriptor_indexing |
| 16530 | #endif |
| 16531 | #ifdef VK_EXT_shader_viewport_index_layer |
| 16532 | #endif |
| 16533 | #ifdef VK_EXT_global_priority |
| 16534 | #endif |
| 16535 | #ifdef VK_EXT_external_memory_host |
| 16536 | VkResult VkEncoder::vkGetMemoryHostPointerPropertiesEXT( |
| 16537 | VkDevice device, |
| 16538 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 16539 | const void* pHostPointer, |
| 16540 | VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) |
| 16541 | { |
| 16542 | auto stream = mImpl->stream(); |
| 16543 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16544 | auto resources = mImpl->resources(); |
| 16545 | auto pool = mImpl->pool(); |
| 16546 | VkDevice local_device; |
| 16547 | local_device = device; |
| 16548 | resources->unwrapMapping()->mapHandles_VkDevice((VkDevice*)&local_device); |
| 16549 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| 16550 | local_handleType = handleType; |
| 16551 | void* local_pHostPointer; |
| 16552 | local_pHostPointer = nullptr; |
| 16553 | if (pHostPointer) |
| 16554 | { |
| 16555 | local_pHostPointer = (void*)pool->dupArray(pHostPointer, sizeof(const uint8_t)); |
| 16556 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16557 | countingStream->rewind(); |
| 16558 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16559 | countingStream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16560 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 16561 | countingStream->write((void**)&local_pHostPointer, sizeof(void*)); |
| 16562 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16563 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16564 | countingStream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16565 | } |
| 16566 | marshal_VkMemoryHostPointerPropertiesEXT(countingStream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 16567 | } |
| 16568 | uint32_t packetSize_vkGetMemoryHostPointerPropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16569 | countingStream->rewind(); |
| 16570 | uint32_t opcode_vkGetMemoryHostPointerPropertiesEXT = OP_vkGetMemoryHostPointerPropertiesEXT; |
| 16571 | stream->write(&opcode_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| 16572 | stream->write(&packetSize_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16573 | stream->write((VkDevice*)&local_device, sizeof(VkDevice)); |
| 16574 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 16575 | stream->write((void**)&local_pHostPointer, sizeof(void*)); |
| 16576 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16577 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16578 | stream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16579 | } |
| 16580 | marshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 16581 | unmarshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16582 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16583 | VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0; |
| 16584 | stream->read(&vkGetMemoryHostPointerPropertiesEXT_VkResult_return, sizeof(VkResult)); |
| 16585 | return vkGetMemoryHostPointerPropertiesEXT_VkResult_return; |
| 16586 | } |
| 16587 | |
| 16588 | #endif |
| 16589 | #ifdef VK_AMD_buffer_marker |
| 16590 | void VkEncoder::vkCmdWriteBufferMarkerAMD( |
| 16591 | VkCommandBuffer commandBuffer, |
| 16592 | VkPipelineStageFlagBits pipelineStage, |
| 16593 | VkBuffer dstBuffer, |
| 16594 | VkDeviceSize dstOffset, |
| 16595 | uint32_t marker) |
| 16596 | { |
| 16597 | auto stream = mImpl->stream(); |
| 16598 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16599 | auto resources = mImpl->resources(); |
| 16600 | auto pool = mImpl->pool(); |
| 16601 | VkCommandBuffer local_commandBuffer; |
| 16602 | local_commandBuffer = commandBuffer; |
| 16603 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 16604 | VkPipelineStageFlagBits local_pipelineStage; |
| 16605 | local_pipelineStage = pipelineStage; |
| 16606 | VkBuffer local_dstBuffer; |
| 16607 | local_dstBuffer = dstBuffer; |
| 16608 | resources->unwrapMapping()->mapHandles_VkBuffer((VkBuffer*)&local_dstBuffer); |
| 16609 | VkDeviceSize local_dstOffset; |
| 16610 | local_dstOffset = dstOffset; |
| 16611 | uint32_t local_marker; |
| 16612 | local_marker = marker; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16613 | countingStream->rewind(); |
| 16614 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16615 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 16616 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| 16617 | countingStream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 16618 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 16619 | countingStream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16620 | } |
| 16621 | uint32_t packetSize_vkCmdWriteBufferMarkerAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16622 | countingStream->rewind(); |
| 16623 | uint32_t opcode_vkCmdWriteBufferMarkerAMD = OP_vkCmdWriteBufferMarkerAMD; |
| 16624 | stream->write(&opcode_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| 16625 | stream->write(&packetSize_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16626 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 16627 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| 16628 | stream->write((VkBuffer*)&local_dstBuffer, sizeof(VkBuffer)); |
| 16629 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 16630 | stream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| 16631 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16632 | } |
| 16633 | |
| 16634 | #endif |
| 16635 | #ifdef VK_AMD_shader_core_properties |
| 16636 | #endif |
| 16637 | #ifdef VK_EXT_vertex_attribute_divisor |
| 16638 | #endif |
| 16639 | #ifdef VK_NV_shader_subgroup_partitioned |
| 16640 | #endif |
| 16641 | #ifdef VK_NV_device_diagnostic_checkpoints |
| 16642 | void VkEncoder::vkCmdSetCheckpointNV( |
| 16643 | VkCommandBuffer commandBuffer, |
| 16644 | const void* pCheckpointMarker) |
| 16645 | { |
| 16646 | auto stream = mImpl->stream(); |
| 16647 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16648 | auto resources = mImpl->resources(); |
| 16649 | auto pool = mImpl->pool(); |
| 16650 | VkCommandBuffer local_commandBuffer; |
| 16651 | local_commandBuffer = commandBuffer; |
| 16652 | resources->unwrapMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)&local_commandBuffer); |
| 16653 | void* local_pCheckpointMarker; |
| 16654 | local_pCheckpointMarker = nullptr; |
| 16655 | if (pCheckpointMarker) |
| 16656 | { |
| 16657 | local_pCheckpointMarker = (void*)pool->dupArray(pCheckpointMarker, sizeof(const uint8_t)); |
| 16658 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16659 | countingStream->rewind(); |
| 16660 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16661 | countingStream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 16662 | countingStream->write((void**)&local_pCheckpointMarker, sizeof(void*)); |
| 16663 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16664 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16665 | countingStream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16666 | } |
| 16667 | } |
| 16668 | uint32_t packetSize_vkCmdSetCheckpointNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16669 | countingStream->rewind(); |
| 16670 | uint32_t opcode_vkCmdSetCheckpointNV = OP_vkCmdSetCheckpointNV; |
| 16671 | stream->write(&opcode_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| 16672 | stream->write(&packetSize_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16673 | stream->write((VkCommandBuffer*)&local_commandBuffer, sizeof(VkCommandBuffer)); |
| 16674 | stream->write((void**)&local_pCheckpointMarker, sizeof(void*)); |
| 16675 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16676 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16677 | stream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16678 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16679 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16680 | } |
| 16681 | |
| 16682 | void VkEncoder::vkGetQueueCheckpointDataNV( |
| 16683 | VkQueue queue, |
| 16684 | uint32_t* pCheckpointDataCount, |
| 16685 | VkCheckpointDataNV* pCheckpointData) |
| 16686 | { |
| 16687 | auto stream = mImpl->stream(); |
| 16688 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16689 | auto resources = mImpl->resources(); |
| 16690 | auto pool = mImpl->pool(); |
| 16691 | VkQueue local_queue; |
| 16692 | local_queue = queue; |
| 16693 | resources->unwrapMapping()->mapHandles_VkQueue((VkQueue*)&local_queue); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16694 | countingStream->rewind(); |
| 16695 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16696 | countingStream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16697 | countingStream->write((uint32_t**)&pCheckpointDataCount, sizeof(uint32_t*)); |
| 16698 | if (pCheckpointDataCount) |
| 16699 | { |
| 16700 | countingStream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 16701 | } |
| 16702 | countingStream->write((VkCheckpointDataNV**)&pCheckpointData, sizeof(VkCheckpointDataNV*)); |
| 16703 | if (pCheckpointData) |
| 16704 | { |
| 16705 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 16706 | { |
| 16707 | marshal_VkCheckpointDataNV(countingStream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 16708 | } |
| 16709 | } |
| 16710 | } |
| 16711 | uint32_t packetSize_vkGetQueueCheckpointDataNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16712 | countingStream->rewind(); |
| 16713 | uint32_t opcode_vkGetQueueCheckpointDataNV = OP_vkGetQueueCheckpointDataNV; |
| 16714 | stream->write(&opcode_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| 16715 | stream->write(&packetSize_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16716 | stream->write((VkQueue*)&local_queue, sizeof(VkQueue)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16717 | stream->write((uint32_t**)&pCheckpointDataCount, sizeof(uint32_t*)); |
| 16718 | if (pCheckpointDataCount) |
| 16719 | { |
| 16720 | stream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 16721 | } |
| 16722 | stream->write((VkCheckpointDataNV**)&pCheckpointData, sizeof(VkCheckpointDataNV*)); |
| 16723 | if (pCheckpointData) |
| 16724 | { |
| 16725 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 16726 | { |
| 16727 | marshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 16728 | } |
| 16729 | } |
| 16730 | uint32_t* check_pCheckpointDataCount; |
| 16731 | stream->read((uint32_t**)&check_pCheckpointDataCount, sizeof(uint32_t*)); |
| 16732 | if (pCheckpointDataCount) |
| 16733 | { |
| 16734 | if (!(check_pCheckpointDataCount)) |
| 16735 | { |
| 16736 | fprintf(stderr, "fatal: pCheckpointDataCount inconsistent between guest and host\n"); |
| 16737 | } |
| 16738 | stream->read((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 16739 | } |
| 16740 | VkCheckpointDataNV* check_pCheckpointData; |
| 16741 | stream->read((VkCheckpointDataNV**)&check_pCheckpointData, sizeof(VkCheckpointDataNV*)); |
| 16742 | if (pCheckpointData) |
| 16743 | { |
| 16744 | if (!(check_pCheckpointData)) |
| 16745 | { |
| 16746 | fprintf(stderr, "fatal: pCheckpointData inconsistent between guest and host\n"); |
| 16747 | } |
| 16748 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 16749 | { |
| 16750 | unmarshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 16751 | } |
| 16752 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16753 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16754 | } |
| 16755 | |
| 16756 | #endif |
| 16757 | |
| 16758 | |