| 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(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 76 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 77 | VkInstanceCreateInfo* local_pCreateInfo; |
| 78 | local_pCreateInfo = nullptr; |
| 79 | if (pCreateInfo) |
| 80 | { |
| 81 | local_pCreateInfo = (VkInstanceCreateInfo*)pool->alloc(sizeof(const VkInstanceCreateInfo)); |
| 82 | deepcopy_VkInstanceCreateInfo(pool, pCreateInfo, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| 83 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 84 | VkAllocationCallbacks* local_pAllocator; |
| 85 | local_pAllocator = nullptr; |
| 86 | if (pAllocator) |
| 87 | { |
| 88 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 89 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 90 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 91 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 92 | countingStream->rewind(); |
| 93 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 94 | marshal_VkInstanceCreateInfo(countingStream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 95 | // WARNING PTR CHECK |
| 96 | uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pAllocator; |
| 97 | countingStream->putBe64(cgen_var_0); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 98 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 99 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 100 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 101 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 102 | uint64_t cgen_var_1; |
| 103 | countingStream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_1, 1); |
| 104 | countingStream->write((uint64_t*)&cgen_var_1, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 105 | } |
| 106 | uint32_t packetSize_vkCreateInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 107 | countingStream->rewind(); |
| 108 | uint32_t opcode_vkCreateInstance = OP_vkCreateInstance; |
| 109 | stream->write(&opcode_vkCreateInstance, sizeof(uint32_t)); |
| 110 | stream->write(&packetSize_vkCreateInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 111 | marshal_VkInstanceCreateInfo(stream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 112 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 113 | uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator; |
| 114 | stream->putBe64(cgen_var_2); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 115 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 116 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 117 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 118 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 119 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 120 | uint64_t cgen_var_3; |
| 121 | stream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_3, 1); |
| 122 | stream->write((uint64_t*)&cgen_var_3, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 123 | stream->setHandleMapping(resources->unwrapMapping()); |
| 124 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 125 | uint64_t cgen_var_4; |
| 126 | stream->read((uint64_t*)&cgen_var_4, 8); |
| 127 | stream->handleMapping()->mapHandles_u64_VkInstance(&cgen_var_4, (VkInstance*)pInstance, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 128 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 129 | VkResult vkCreateInstance_VkResult_return = (VkResult)0; |
| 130 | stream->read(&vkCreateInstance_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 131 | countingStream->clearPool(); |
| 132 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 133 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 134 | return vkCreateInstance_VkResult_return; |
| 135 | } |
| 136 | |
| 137 | void VkEncoder::vkDestroyInstance( |
| 138 | VkInstance instance, |
| 139 | const VkAllocationCallbacks* pAllocator) |
| 140 | { |
| 141 | auto stream = mImpl->stream(); |
| 142 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 143 | auto resources = mImpl->resources(); |
| 144 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 145 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 146 | VkInstance local_instance; |
| 147 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 148 | VkAllocationCallbacks* local_pAllocator; |
| 149 | local_pAllocator = nullptr; |
| 150 | if (pAllocator) |
| 151 | { |
| 152 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 153 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 154 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 155 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 156 | countingStream->rewind(); |
| 157 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 158 | uint64_t cgen_var_5; |
| 159 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_5, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 160 | countingStream->write((uint64_t*)&cgen_var_5, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 161 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 162 | uint64_t cgen_var_6 = (uint64_t)(uintptr_t)local_pAllocator; |
| 163 | countingStream->putBe64(cgen_var_6); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 164 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 165 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 166 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 167 | } |
| 168 | } |
| 169 | uint32_t packetSize_vkDestroyInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 170 | countingStream->rewind(); |
| 171 | uint32_t opcode_vkDestroyInstance = OP_vkDestroyInstance; |
| 172 | stream->write(&opcode_vkDestroyInstance, sizeof(uint32_t)); |
| 173 | stream->write(&packetSize_vkDestroyInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 174 | uint64_t cgen_var_7; |
| 175 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_7, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 176 | stream->write((uint64_t*)&cgen_var_7, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 177 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 178 | uint64_t cgen_var_8 = (uint64_t)(uintptr_t)local_pAllocator; |
| 179 | stream->putBe64(cgen_var_8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 180 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 181 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 182 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 183 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 184 | resources->destroyMapping()->mapHandles_VkInstance((VkInstance*)&instance); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | VkResult VkEncoder::vkEnumeratePhysicalDevices( |
| 188 | VkInstance instance, |
| 189 | uint32_t* pPhysicalDeviceCount, |
| 190 | VkPhysicalDevice* pPhysicalDevices) |
| 191 | { |
| 192 | auto stream = mImpl->stream(); |
| 193 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 194 | auto resources = mImpl->resources(); |
| 195 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 196 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 197 | VkInstance local_instance; |
| 198 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 199 | countingStream->rewind(); |
| 200 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 201 | uint64_t cgen_var_9; |
| 202 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_9, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 203 | countingStream->write((uint64_t*)&cgen_var_9, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 204 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 205 | uint64_t cgen_var_10 = (uint64_t)(uintptr_t)pPhysicalDeviceCount; |
| 206 | countingStream->putBe64(cgen_var_10); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 207 | if (pPhysicalDeviceCount) |
| 208 | { |
| 209 | countingStream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 210 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 211 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 212 | uint64_t cgen_var_11 = (uint64_t)(uintptr_t)pPhysicalDevices; |
| 213 | countingStream->putBe64(cgen_var_11); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 214 | if (pPhysicalDevices) |
| 215 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 216 | if ((*(pPhysicalDeviceCount))) |
| 217 | { |
| 218 | uint64_t* cgen_var_12; |
| 219 | countingStream->alloc((void**)&cgen_var_12, (*(pPhysicalDeviceCount)) * 8); |
| 220 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_12, (*(pPhysicalDeviceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 221 | countingStream->write((uint64_t*)cgen_var_12, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 222 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 223 | } |
| 224 | } |
| 225 | uint32_t packetSize_vkEnumeratePhysicalDevices = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 226 | countingStream->rewind(); |
| 227 | uint32_t opcode_vkEnumeratePhysicalDevices = OP_vkEnumeratePhysicalDevices; |
| 228 | stream->write(&opcode_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| 229 | stream->write(&packetSize_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 230 | uint64_t cgen_var_13; |
| 231 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_13, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 232 | stream->write((uint64_t*)&cgen_var_13, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 233 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 234 | uint64_t cgen_var_14 = (uint64_t)(uintptr_t)pPhysicalDeviceCount; |
| 235 | stream->putBe64(cgen_var_14); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 236 | if (pPhysicalDeviceCount) |
| 237 | { |
| 238 | stream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 239 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 240 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 241 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 242 | uint64_t cgen_var_15 = (uint64_t)(uintptr_t)pPhysicalDevices; |
| 243 | stream->putBe64(cgen_var_15); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 244 | if (pPhysicalDevices) |
| 245 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 246 | if ((*(pPhysicalDeviceCount))) |
| 247 | { |
| 248 | uint64_t* cgen_var_16; |
| 249 | stream->alloc((void**)&cgen_var_16, (*(pPhysicalDeviceCount)) * 8); |
| 250 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_16, (*(pPhysicalDeviceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 251 | stream->write((uint64_t*)cgen_var_16, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 252 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 253 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 254 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 255 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 256 | uint32_t* check_pPhysicalDeviceCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 257 | check_pPhysicalDeviceCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 258 | if (pPhysicalDeviceCount) |
| 259 | { |
| 260 | if (!(check_pPhysicalDeviceCount)) |
| 261 | { |
| 262 | fprintf(stderr, "fatal: pPhysicalDeviceCount inconsistent between guest and host\n"); |
| 263 | } |
| 264 | stream->read((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 265 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 266 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 267 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 268 | VkPhysicalDevice* check_pPhysicalDevices; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 269 | check_pPhysicalDevices = (VkPhysicalDevice*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 270 | if (pPhysicalDevices) |
| 271 | { |
| 272 | if (!(check_pPhysicalDevices)) |
| 273 | { |
| 274 | fprintf(stderr, "fatal: pPhysicalDevices inconsistent between guest and host\n"); |
| 275 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 276 | if ((*(pPhysicalDeviceCount))) |
| 277 | { |
| 278 | uint64_t* cgen_var_19; |
| 279 | stream->alloc((void**)&cgen_var_19, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 280 | stream->read((uint64_t*)cgen_var_19, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 281 | stream->handleMapping()->mapHandles_u64_VkPhysicalDevice(cgen_var_19, (VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount))); |
| 282 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 283 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 284 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 285 | VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0; |
| 286 | stream->read(&vkEnumeratePhysicalDevices_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 287 | countingStream->clearPool(); |
| 288 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 289 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 290 | return vkEnumeratePhysicalDevices_VkResult_return; |
| 291 | } |
| 292 | |
| 293 | void VkEncoder::vkGetPhysicalDeviceFeatures( |
| 294 | VkPhysicalDevice physicalDevice, |
| 295 | VkPhysicalDeviceFeatures* pFeatures) |
| 296 | { |
| 297 | auto stream = mImpl->stream(); |
| 298 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 299 | auto resources = mImpl->resources(); |
| 300 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 301 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 302 | VkPhysicalDevice local_physicalDevice; |
| 303 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 304 | countingStream->rewind(); |
| 305 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 306 | uint64_t cgen_var_20; |
| 307 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_20, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 308 | countingStream->write((uint64_t*)&cgen_var_20, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 309 | marshal_VkPhysicalDeviceFeatures(countingStream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 310 | } |
| 311 | uint32_t packetSize_vkGetPhysicalDeviceFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 312 | countingStream->rewind(); |
| 313 | uint32_t opcode_vkGetPhysicalDeviceFeatures = OP_vkGetPhysicalDeviceFeatures; |
| 314 | stream->write(&opcode_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| 315 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 316 | uint64_t cgen_var_21; |
| 317 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_21, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 318 | stream->write((uint64_t*)&cgen_var_21, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 319 | marshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 320 | unmarshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 321 | } |
| 322 | |
| 323 | void VkEncoder::vkGetPhysicalDeviceFormatProperties( |
| 324 | VkPhysicalDevice physicalDevice, |
| 325 | VkFormat format, |
| 326 | VkFormatProperties* pFormatProperties) |
| 327 | { |
| 328 | auto stream = mImpl->stream(); |
| 329 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 330 | auto resources = mImpl->resources(); |
| 331 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 332 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 333 | VkPhysicalDevice local_physicalDevice; |
| 334 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 335 | VkFormat local_format; |
| 336 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 337 | countingStream->rewind(); |
| 338 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 339 | uint64_t cgen_var_22; |
| 340 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_22, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 341 | countingStream->write((uint64_t*)&cgen_var_22, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 342 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 343 | marshal_VkFormatProperties(countingStream, (VkFormatProperties*)(pFormatProperties)); |
| 344 | } |
| 345 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 346 | countingStream->rewind(); |
| 347 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties = OP_vkGetPhysicalDeviceFormatProperties; |
| 348 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| 349 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 350 | uint64_t cgen_var_23; |
| 351 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_23, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 352 | stream->write((uint64_t*)&cgen_var_23, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 353 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 354 | marshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| 355 | unmarshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| 356 | } |
| 357 | |
| 358 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties( |
| 359 | VkPhysicalDevice physicalDevice, |
| 360 | VkFormat format, |
| 361 | VkImageType type, |
| 362 | VkImageTiling tiling, |
| 363 | VkImageUsageFlags usage, |
| 364 | VkImageCreateFlags flags, |
| 365 | VkImageFormatProperties* pImageFormatProperties) |
| 366 | { |
| 367 | auto stream = mImpl->stream(); |
| 368 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 369 | auto resources = mImpl->resources(); |
| 370 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 371 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 372 | VkPhysicalDevice local_physicalDevice; |
| 373 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 374 | VkFormat local_format; |
| 375 | local_format = format; |
| 376 | VkImageType local_type; |
| 377 | local_type = type; |
| 378 | VkImageTiling local_tiling; |
| 379 | local_tiling = tiling; |
| 380 | VkImageUsageFlags local_usage; |
| 381 | local_usage = usage; |
| 382 | VkImageCreateFlags local_flags; |
| 383 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 384 | countingStream->rewind(); |
| 385 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 386 | uint64_t cgen_var_24; |
| 387 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_24, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 388 | countingStream->write((uint64_t*)&cgen_var_24, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 389 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 390 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 391 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 392 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 393 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 394 | marshal_VkImageFormatProperties(countingStream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 395 | } |
| 396 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 397 | countingStream->rewind(); |
| 398 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties = OP_vkGetPhysicalDeviceImageFormatProperties; |
| 399 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| 400 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 401 | uint64_t cgen_var_25; |
| 402 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_25, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 403 | stream->write((uint64_t*)&cgen_var_25, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 404 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 405 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 406 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 407 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 408 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 409 | marshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 410 | unmarshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 411 | VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0; |
| 412 | stream->read(&vkGetPhysicalDeviceImageFormatProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 413 | countingStream->clearPool(); |
| 414 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 415 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 416 | return vkGetPhysicalDeviceImageFormatProperties_VkResult_return; |
| 417 | } |
| 418 | |
| 419 | void VkEncoder::vkGetPhysicalDeviceProperties( |
| 420 | VkPhysicalDevice physicalDevice, |
| 421 | VkPhysicalDeviceProperties* pProperties) |
| 422 | { |
| 423 | auto stream = mImpl->stream(); |
| 424 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 425 | auto resources = mImpl->resources(); |
| 426 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 427 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 428 | VkPhysicalDevice local_physicalDevice; |
| 429 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 430 | countingStream->rewind(); |
| 431 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 432 | uint64_t cgen_var_26; |
| 433 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_26, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 434 | countingStream->write((uint64_t*)&cgen_var_26, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 435 | marshal_VkPhysicalDeviceProperties(countingStream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 436 | } |
| 437 | uint32_t packetSize_vkGetPhysicalDeviceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 438 | countingStream->rewind(); |
| 439 | uint32_t opcode_vkGetPhysicalDeviceProperties = OP_vkGetPhysicalDeviceProperties; |
| 440 | stream->write(&opcode_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| 441 | stream->write(&packetSize_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 442 | uint64_t cgen_var_27; |
| 443 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_27, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 444 | stream->write((uint64_t*)&cgen_var_27, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 445 | marshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 446 | unmarshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 447 | } |
| 448 | |
| 449 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties( |
| 450 | VkPhysicalDevice physicalDevice, |
| 451 | uint32_t* pQueueFamilyPropertyCount, |
| 452 | VkQueueFamilyProperties* pQueueFamilyProperties) |
| 453 | { |
| 454 | auto stream = mImpl->stream(); |
| 455 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 456 | auto resources = mImpl->resources(); |
| 457 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 458 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 459 | VkPhysicalDevice local_physicalDevice; |
| 460 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 461 | countingStream->rewind(); |
| 462 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 463 | uint64_t cgen_var_28; |
| 464 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_28, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 465 | countingStream->write((uint64_t*)&cgen_var_28, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 466 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 467 | uint64_t cgen_var_29 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 468 | countingStream->putBe64(cgen_var_29); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 469 | if (pQueueFamilyPropertyCount) |
| 470 | { |
| 471 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 472 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 473 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 474 | uint64_t cgen_var_30 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 475 | countingStream->putBe64(cgen_var_30); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 476 | if (pQueueFamilyProperties) |
| 477 | { |
| 478 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 479 | { |
| 480 | marshal_VkQueueFamilyProperties(countingStream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 481 | } |
| 482 | } |
| 483 | } |
| 484 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 485 | countingStream->rewind(); |
| 486 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties = OP_vkGetPhysicalDeviceQueueFamilyProperties; |
| 487 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| 488 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 489 | uint64_t cgen_var_31; |
| 490 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_31, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 491 | stream->write((uint64_t*)&cgen_var_31, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 492 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 493 | uint64_t cgen_var_32 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 494 | stream->putBe64(cgen_var_32); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 495 | if (pQueueFamilyPropertyCount) |
| 496 | { |
| 497 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 498 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 499 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 500 | uint64_t cgen_var_33 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 501 | stream->putBe64(cgen_var_33); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 502 | if (pQueueFamilyProperties) |
| 503 | { |
| 504 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 505 | { |
| 506 | marshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 507 | } |
| 508 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 509 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 510 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 511 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 512 | if (pQueueFamilyPropertyCount) |
| 513 | { |
| 514 | if (!(check_pQueueFamilyPropertyCount)) |
| 515 | { |
| 516 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 517 | } |
| 518 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 519 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 520 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 521 | VkQueueFamilyProperties* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 522 | check_pQueueFamilyProperties = (VkQueueFamilyProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 523 | if (pQueueFamilyProperties) |
| 524 | { |
| 525 | if (!(check_pQueueFamilyProperties)) |
| 526 | { |
| 527 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 528 | } |
| 529 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 530 | { |
| 531 | unmarshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 532 | } |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties( |
| 537 | VkPhysicalDevice physicalDevice, |
| 538 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 539 | { |
| 540 | auto stream = mImpl->stream(); |
| 541 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 542 | auto resources = mImpl->resources(); |
| 543 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 544 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 545 | VkPhysicalDevice local_physicalDevice; |
| 546 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 547 | countingStream->rewind(); |
| 548 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 549 | uint64_t cgen_var_36; |
| 550 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_36, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 551 | countingStream->write((uint64_t*)&cgen_var_36, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 552 | marshal_VkPhysicalDeviceMemoryProperties(countingStream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 553 | } |
| 554 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 555 | countingStream->rewind(); |
| 556 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties = OP_vkGetPhysicalDeviceMemoryProperties; |
| 557 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| 558 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 559 | uint64_t cgen_var_37; |
| 560 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_37, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 561 | stream->write((uint64_t*)&cgen_var_37, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 562 | marshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 563 | unmarshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 564 | } |
| 565 | |
| 566 | PFN_vkVoidFunction VkEncoder::vkGetInstanceProcAddr( |
| 567 | VkInstance instance, |
| 568 | const char* pName) |
| 569 | { |
| 570 | auto stream = mImpl->stream(); |
| 571 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 572 | auto resources = mImpl->resources(); |
| 573 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 574 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 575 | VkInstance local_instance; |
| 576 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 577 | char* local_pName; |
| 578 | local_pName = nullptr; |
| 579 | if (pName) |
| 580 | { |
| 581 | local_pName = pool->strDup(pName); |
| 582 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 583 | countingStream->rewind(); |
| 584 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 585 | uint64_t cgen_var_38; |
| 586 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_38, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 587 | countingStream->write((uint64_t*)&cgen_var_38, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 588 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 589 | } |
| 590 | uint32_t packetSize_vkGetInstanceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 591 | countingStream->rewind(); |
| 592 | uint32_t opcode_vkGetInstanceProcAddr = OP_vkGetInstanceProcAddr; |
| 593 | stream->write(&opcode_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| 594 | stream->write(&packetSize_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 595 | uint64_t cgen_var_39; |
| 596 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_39, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 597 | stream->write((uint64_t*)&cgen_var_39, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 598 | stream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 599 | PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 600 | stream->read(&vkGetInstanceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 601 | countingStream->clearPool(); |
| 602 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 603 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 604 | return vkGetInstanceProcAddr_PFN_vkVoidFunction_return; |
| 605 | } |
| 606 | |
| 607 | PFN_vkVoidFunction VkEncoder::vkGetDeviceProcAddr( |
| 608 | VkDevice device, |
| 609 | const char* pName) |
| 610 | { |
| 611 | auto stream = mImpl->stream(); |
| 612 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 613 | auto resources = mImpl->resources(); |
| 614 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 615 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 616 | VkDevice local_device; |
| 617 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 618 | char* local_pName; |
| 619 | local_pName = nullptr; |
| 620 | if (pName) |
| 621 | { |
| 622 | local_pName = pool->strDup(pName); |
| 623 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 624 | countingStream->rewind(); |
| 625 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 626 | uint64_t cgen_var_40; |
| 627 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_40, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 628 | countingStream->write((uint64_t*)&cgen_var_40, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 629 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 630 | } |
| 631 | uint32_t packetSize_vkGetDeviceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 632 | countingStream->rewind(); |
| 633 | uint32_t opcode_vkGetDeviceProcAddr = OP_vkGetDeviceProcAddr; |
| 634 | stream->write(&opcode_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| 635 | stream->write(&packetSize_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 636 | uint64_t cgen_var_41; |
| 637 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_41, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 638 | stream->write((uint64_t*)&cgen_var_41, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 639 | stream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 640 | PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 641 | stream->read(&vkGetDeviceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 642 | countingStream->clearPool(); |
| 643 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 644 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 645 | return vkGetDeviceProcAddr_PFN_vkVoidFunction_return; |
| 646 | } |
| 647 | |
| 648 | VkResult VkEncoder::vkCreateDevice( |
| 649 | VkPhysicalDevice physicalDevice, |
| 650 | const VkDeviceCreateInfo* pCreateInfo, |
| 651 | const VkAllocationCallbacks* pAllocator, |
| 652 | VkDevice* pDevice) |
| 653 | { |
| 654 | auto stream = mImpl->stream(); |
| 655 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 656 | auto resources = mImpl->resources(); |
| 657 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 658 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 659 | VkPhysicalDevice local_physicalDevice; |
| 660 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 661 | VkDeviceCreateInfo* local_pCreateInfo; |
| 662 | local_pCreateInfo = nullptr; |
| 663 | if (pCreateInfo) |
| 664 | { |
| 665 | local_pCreateInfo = (VkDeviceCreateInfo*)pool->alloc(sizeof(const VkDeviceCreateInfo)); |
| 666 | deepcopy_VkDeviceCreateInfo(pool, pCreateInfo, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| 667 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 668 | VkAllocationCallbacks* local_pAllocator; |
| 669 | local_pAllocator = nullptr; |
| 670 | if (pAllocator) |
| 671 | { |
| 672 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 673 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 674 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 675 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 676 | countingStream->rewind(); |
| 677 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 678 | uint64_t cgen_var_42; |
| 679 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_42, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 680 | countingStream->write((uint64_t*)&cgen_var_42, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 681 | marshal_VkDeviceCreateInfo(countingStream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 682 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 683 | uint64_t cgen_var_43 = (uint64_t)(uintptr_t)local_pAllocator; |
| 684 | countingStream->putBe64(cgen_var_43); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 685 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 686 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 687 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 688 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 689 | uint64_t cgen_var_44; |
| 690 | countingStream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_44, 1); |
| 691 | countingStream->write((uint64_t*)&cgen_var_44, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 692 | } |
| 693 | uint32_t packetSize_vkCreateDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 694 | countingStream->rewind(); |
| 695 | uint32_t opcode_vkCreateDevice = OP_vkCreateDevice; |
| 696 | stream->write(&opcode_vkCreateDevice, sizeof(uint32_t)); |
| 697 | stream->write(&packetSize_vkCreateDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 698 | uint64_t cgen_var_45; |
| 699 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_45, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 700 | stream->write((uint64_t*)&cgen_var_45, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 701 | marshal_VkDeviceCreateInfo(stream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 702 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 703 | uint64_t cgen_var_46 = (uint64_t)(uintptr_t)local_pAllocator; |
| 704 | stream->putBe64(cgen_var_46); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 705 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 706 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 707 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 708 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 709 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 710 | uint64_t cgen_var_47; |
| 711 | stream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_47, 1); |
| 712 | stream->write((uint64_t*)&cgen_var_47, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 713 | stream->setHandleMapping(resources->unwrapMapping()); |
| 714 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 715 | uint64_t cgen_var_48; |
| 716 | stream->read((uint64_t*)&cgen_var_48, 8); |
| 717 | stream->handleMapping()->mapHandles_u64_VkDevice(&cgen_var_48, (VkDevice*)pDevice, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 718 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 719 | VkResult vkCreateDevice_VkResult_return = (VkResult)0; |
| 720 | stream->read(&vkCreateDevice_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 721 | countingStream->clearPool(); |
| 722 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 723 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 724 | return vkCreateDevice_VkResult_return; |
| 725 | } |
| 726 | |
| 727 | void VkEncoder::vkDestroyDevice( |
| 728 | VkDevice device, |
| 729 | const VkAllocationCallbacks* pAllocator) |
| 730 | { |
| 731 | auto stream = mImpl->stream(); |
| 732 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 733 | auto resources = mImpl->resources(); |
| 734 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 735 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 736 | VkDevice local_device; |
| 737 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 738 | VkAllocationCallbacks* local_pAllocator; |
| 739 | local_pAllocator = nullptr; |
| 740 | if (pAllocator) |
| 741 | { |
| 742 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 743 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 744 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 745 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 746 | countingStream->rewind(); |
| 747 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 748 | uint64_t cgen_var_49; |
| 749 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_49, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 750 | countingStream->write((uint64_t*)&cgen_var_49, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 751 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 752 | uint64_t cgen_var_50 = (uint64_t)(uintptr_t)local_pAllocator; |
| 753 | countingStream->putBe64(cgen_var_50); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 754 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 755 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 756 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 757 | } |
| 758 | } |
| 759 | uint32_t packetSize_vkDestroyDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 760 | countingStream->rewind(); |
| 761 | uint32_t opcode_vkDestroyDevice = OP_vkDestroyDevice; |
| 762 | stream->write(&opcode_vkDestroyDevice, sizeof(uint32_t)); |
| 763 | stream->write(&packetSize_vkDestroyDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 764 | uint64_t cgen_var_51; |
| 765 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_51, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 766 | stream->write((uint64_t*)&cgen_var_51, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 767 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 768 | uint64_t cgen_var_52 = (uint64_t)(uintptr_t)local_pAllocator; |
| 769 | stream->putBe64(cgen_var_52); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 770 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 771 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 772 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 773 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 774 | resources->destroyMapping()->mapHandles_VkDevice((VkDevice*)&device); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 775 | } |
| 776 | |
| 777 | VkResult VkEncoder::vkEnumerateInstanceExtensionProperties( |
| 778 | const char* pLayerName, |
| 779 | uint32_t* pPropertyCount, |
| 780 | VkExtensionProperties* pProperties) |
| 781 | { |
| 782 | auto stream = mImpl->stream(); |
| 783 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 784 | auto resources = mImpl->resources(); |
| 785 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 786 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 787 | char* local_pLayerName; |
| 788 | local_pLayerName = nullptr; |
| 789 | if (pLayerName) |
| 790 | { |
| 791 | local_pLayerName = pool->strDup(pLayerName); |
| 792 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 793 | countingStream->rewind(); |
| 794 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 795 | countingStream->putString(local_pLayerName); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 796 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 797 | uint64_t cgen_var_53 = (uint64_t)(uintptr_t)pPropertyCount; |
| 798 | countingStream->putBe64(cgen_var_53); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 799 | if (pPropertyCount) |
| 800 | { |
| 801 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 802 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 803 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 804 | uint64_t cgen_var_54 = (uint64_t)(uintptr_t)pProperties; |
| 805 | countingStream->putBe64(cgen_var_54); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 806 | if (pProperties) |
| 807 | { |
| 808 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 809 | { |
| 810 | marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i)); |
| 811 | } |
| 812 | } |
| 813 | } |
| 814 | uint32_t packetSize_vkEnumerateInstanceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 815 | countingStream->rewind(); |
| 816 | uint32_t opcode_vkEnumerateInstanceExtensionProperties = OP_vkEnumerateInstanceExtensionProperties; |
| 817 | stream->write(&opcode_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| 818 | stream->write(&packetSize_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 819 | stream->putString(local_pLayerName); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 820 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 821 | uint64_t cgen_var_55 = (uint64_t)(uintptr_t)pPropertyCount; |
| 822 | stream->putBe64(cgen_var_55); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 823 | if (pPropertyCount) |
| 824 | { |
| 825 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 826 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 827 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 828 | uint64_t cgen_var_56 = (uint64_t)(uintptr_t)pProperties; |
| 829 | stream->putBe64(cgen_var_56); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 830 | if (pProperties) |
| 831 | { |
| 832 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 833 | { |
| 834 | marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 835 | } |
| 836 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 837 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 838 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 839 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 840 | if (pPropertyCount) |
| 841 | { |
| 842 | if (!(check_pPropertyCount)) |
| 843 | { |
| 844 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 845 | } |
| 846 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 847 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 848 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 849 | VkExtensionProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 850 | check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 851 | if (pProperties) |
| 852 | { |
| 853 | if (!(check_pProperties)) |
| 854 | { |
| 855 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 856 | } |
| 857 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 858 | { |
| 859 | unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 860 | } |
| 861 | } |
| 862 | VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0; |
| 863 | stream->read(&vkEnumerateInstanceExtensionProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 864 | countingStream->clearPool(); |
| 865 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 866 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 867 | return vkEnumerateInstanceExtensionProperties_VkResult_return; |
| 868 | } |
| 869 | |
| 870 | VkResult VkEncoder::vkEnumerateDeviceExtensionProperties( |
| 871 | VkPhysicalDevice physicalDevice, |
| 872 | const char* pLayerName, |
| 873 | uint32_t* pPropertyCount, |
| 874 | VkExtensionProperties* pProperties) |
| 875 | { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 876 | VkResult vkEnumerateDeviceExtensionProperties_VkResult_return = (VkResult)0; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 877 | vkEnumerateDeviceExtensionProperties_VkResult_return = goldfish_vkEnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pPropertyCount, pProperties); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 878 | return vkEnumerateDeviceExtensionProperties_VkResult_return; |
| 879 | } |
| 880 | |
| 881 | VkResult VkEncoder::vkEnumerateInstanceLayerProperties( |
| 882 | uint32_t* pPropertyCount, |
| 883 | VkLayerProperties* pProperties) |
| 884 | { |
| 885 | auto stream = mImpl->stream(); |
| 886 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 887 | auto resources = mImpl->resources(); |
| 888 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 889 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 890 | countingStream->rewind(); |
| 891 | { |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 892 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 893 | uint64_t cgen_var_59 = (uint64_t)(uintptr_t)pPropertyCount; |
| 894 | countingStream->putBe64(cgen_var_59); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 895 | if (pPropertyCount) |
| 896 | { |
| 897 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 898 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 899 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 900 | uint64_t cgen_var_60 = (uint64_t)(uintptr_t)pProperties; |
| 901 | countingStream->putBe64(cgen_var_60); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 902 | if (pProperties) |
| 903 | { |
| 904 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 905 | { |
| 906 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 907 | } |
| 908 | } |
| 909 | } |
| 910 | uint32_t packetSize_vkEnumerateInstanceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 911 | countingStream->rewind(); |
| 912 | uint32_t opcode_vkEnumerateInstanceLayerProperties = OP_vkEnumerateInstanceLayerProperties; |
| 913 | stream->write(&opcode_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| 914 | stream->write(&packetSize_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 915 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 916 | uint64_t cgen_var_61 = (uint64_t)(uintptr_t)pPropertyCount; |
| 917 | stream->putBe64(cgen_var_61); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 918 | if (pPropertyCount) |
| 919 | { |
| 920 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 921 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 922 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 923 | uint64_t cgen_var_62 = (uint64_t)(uintptr_t)pProperties; |
| 924 | stream->putBe64(cgen_var_62); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 925 | if (pProperties) |
| 926 | { |
| 927 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 928 | { |
| 929 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 930 | } |
| 931 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 932 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 933 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 934 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 935 | if (pPropertyCount) |
| 936 | { |
| 937 | if (!(check_pPropertyCount)) |
| 938 | { |
| 939 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 940 | } |
| 941 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 942 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 943 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 944 | VkLayerProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 945 | check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 946 | if (pProperties) |
| 947 | { |
| 948 | if (!(check_pProperties)) |
| 949 | { |
| 950 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 951 | } |
| 952 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 953 | { |
| 954 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 955 | } |
| 956 | } |
| 957 | VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0; |
| 958 | stream->read(&vkEnumerateInstanceLayerProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 959 | countingStream->clearPool(); |
| 960 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 961 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 962 | return vkEnumerateInstanceLayerProperties_VkResult_return; |
| 963 | } |
| 964 | |
| 965 | VkResult VkEncoder::vkEnumerateDeviceLayerProperties( |
| 966 | VkPhysicalDevice physicalDevice, |
| 967 | uint32_t* pPropertyCount, |
| 968 | VkLayerProperties* pProperties) |
| 969 | { |
| 970 | auto stream = mImpl->stream(); |
| 971 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 972 | auto resources = mImpl->resources(); |
| 973 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 974 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 975 | VkPhysicalDevice local_physicalDevice; |
| 976 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 977 | countingStream->rewind(); |
| 978 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 979 | uint64_t cgen_var_65; |
| 980 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_65, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 981 | countingStream->write((uint64_t*)&cgen_var_65, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 982 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 983 | uint64_t cgen_var_66 = (uint64_t)(uintptr_t)pPropertyCount; |
| 984 | countingStream->putBe64(cgen_var_66); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 985 | if (pPropertyCount) |
| 986 | { |
| 987 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 988 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 989 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 990 | uint64_t cgen_var_67 = (uint64_t)(uintptr_t)pProperties; |
| 991 | countingStream->putBe64(cgen_var_67); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 992 | if (pProperties) |
| 993 | { |
| 994 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 995 | { |
| 996 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 997 | } |
| 998 | } |
| 999 | } |
| 1000 | uint32_t packetSize_vkEnumerateDeviceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1001 | countingStream->rewind(); |
| 1002 | uint32_t opcode_vkEnumerateDeviceLayerProperties = OP_vkEnumerateDeviceLayerProperties; |
| 1003 | stream->write(&opcode_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| 1004 | stream->write(&packetSize_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1005 | uint64_t cgen_var_68; |
| 1006 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_68, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1007 | stream->write((uint64_t*)&cgen_var_68, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1008 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1009 | uint64_t cgen_var_69 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1010 | stream->putBe64(cgen_var_69); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1011 | if (pPropertyCount) |
| 1012 | { |
| 1013 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1014 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1015 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1016 | uint64_t cgen_var_70 = (uint64_t)(uintptr_t)pProperties; |
| 1017 | stream->putBe64(cgen_var_70); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1018 | if (pProperties) |
| 1019 | { |
| 1020 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1021 | { |
| 1022 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1023 | } |
| 1024 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1025 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1026 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1027 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1028 | if (pPropertyCount) |
| 1029 | { |
| 1030 | if (!(check_pPropertyCount)) |
| 1031 | { |
| 1032 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1033 | } |
| 1034 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1035 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1036 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1037 | VkLayerProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1038 | check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1039 | if (pProperties) |
| 1040 | { |
| 1041 | if (!(check_pProperties)) |
| 1042 | { |
| 1043 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1044 | } |
| 1045 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1046 | { |
| 1047 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1048 | } |
| 1049 | } |
| 1050 | VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0; |
| 1051 | stream->read(&vkEnumerateDeviceLayerProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1052 | countingStream->clearPool(); |
| 1053 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1054 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1055 | return vkEnumerateDeviceLayerProperties_VkResult_return; |
| 1056 | } |
| 1057 | |
| 1058 | void VkEncoder::vkGetDeviceQueue( |
| 1059 | VkDevice device, |
| 1060 | uint32_t queueFamilyIndex, |
| 1061 | uint32_t queueIndex, |
| 1062 | VkQueue* pQueue) |
| 1063 | { |
| 1064 | auto stream = mImpl->stream(); |
| 1065 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1066 | auto resources = mImpl->resources(); |
| 1067 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1068 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1069 | VkDevice local_device; |
| 1070 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1071 | uint32_t local_queueFamilyIndex; |
| 1072 | local_queueFamilyIndex = queueFamilyIndex; |
| 1073 | uint32_t local_queueIndex; |
| 1074 | local_queueIndex = queueIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1075 | countingStream->rewind(); |
| 1076 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1077 | uint64_t cgen_var_73; |
| 1078 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_73, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1079 | countingStream->write((uint64_t*)&cgen_var_73, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1080 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 1081 | countingStream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1082 | uint64_t cgen_var_74; |
| 1083 | countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_74, 1); |
| 1084 | countingStream->write((uint64_t*)&cgen_var_74, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1085 | } |
| 1086 | uint32_t packetSize_vkGetDeviceQueue = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1087 | countingStream->rewind(); |
| 1088 | uint32_t opcode_vkGetDeviceQueue = OP_vkGetDeviceQueue; |
| 1089 | stream->write(&opcode_vkGetDeviceQueue, sizeof(uint32_t)); |
| 1090 | stream->write(&packetSize_vkGetDeviceQueue, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1091 | uint64_t cgen_var_75; |
| 1092 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_75, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1093 | stream->write((uint64_t*)&cgen_var_75, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1094 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 1095 | stream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1096 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1097 | uint64_t cgen_var_76; |
| 1098 | stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_76, 1); |
| 1099 | stream->write((uint64_t*)&cgen_var_76, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1100 | stream->setHandleMapping(resources->unwrapMapping()); |
| 1101 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1102 | uint64_t cgen_var_77; |
| 1103 | stream->read((uint64_t*)&cgen_var_77, 8); |
| 1104 | stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_77, (VkQueue*)pQueue, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1105 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1106 | } |
| 1107 | |
| 1108 | VkResult VkEncoder::vkQueueSubmit( |
| 1109 | VkQueue queue, |
| 1110 | uint32_t submitCount, |
| 1111 | const VkSubmitInfo* pSubmits, |
| 1112 | VkFence fence) |
| 1113 | { |
| 1114 | auto stream = mImpl->stream(); |
| 1115 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1116 | auto resources = mImpl->resources(); |
| 1117 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1118 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1119 | VkQueue local_queue; |
| 1120 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1121 | uint32_t local_submitCount; |
| 1122 | local_submitCount = submitCount; |
| 1123 | VkSubmitInfo* local_pSubmits; |
| 1124 | local_pSubmits = nullptr; |
| 1125 | if (pSubmits) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1126 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1127 | local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1128 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1129 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1130 | deepcopy_VkSubmitInfo(pool, pSubmits + i, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1131 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1132 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1133 | VkFence local_fence; |
| 1134 | local_fence = fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1135 | countingStream->rewind(); |
| 1136 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1137 | uint64_t cgen_var_78; |
| 1138 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_78, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1139 | countingStream->write((uint64_t*)&cgen_var_78, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1140 | countingStream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| 1141 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1142 | { |
| 1143 | marshal_VkSubmitInfo(countingStream, (VkSubmitInfo*)(local_pSubmits + i)); |
| 1144 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1145 | uint64_t cgen_var_79; |
| 1146 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_79, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1147 | countingStream->write((uint64_t*)&cgen_var_79, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1148 | } |
| 1149 | uint32_t packetSize_vkQueueSubmit = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1150 | countingStream->rewind(); |
| 1151 | uint32_t opcode_vkQueueSubmit = OP_vkQueueSubmit; |
| 1152 | stream->write(&opcode_vkQueueSubmit, sizeof(uint32_t)); |
| 1153 | stream->write(&packetSize_vkQueueSubmit, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1154 | uint64_t cgen_var_80; |
| 1155 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_80, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1156 | stream->write((uint64_t*)&cgen_var_80, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1157 | stream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1158 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1159 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1160 | marshal_VkSubmitInfo(stream, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1161 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1162 | uint64_t cgen_var_81; |
| 1163 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_81, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1164 | stream->write((uint64_t*)&cgen_var_81, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1165 | VkResult vkQueueSubmit_VkResult_return = (VkResult)0; |
| 1166 | stream->read(&vkQueueSubmit_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1167 | countingStream->clearPool(); |
| 1168 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1169 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1170 | return vkQueueSubmit_VkResult_return; |
| 1171 | } |
| 1172 | |
| 1173 | VkResult VkEncoder::vkQueueWaitIdle( |
| 1174 | VkQueue queue) |
| 1175 | { |
| 1176 | auto stream = mImpl->stream(); |
| 1177 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1178 | auto resources = mImpl->resources(); |
| 1179 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1180 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1181 | VkQueue local_queue; |
| 1182 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1183 | countingStream->rewind(); |
| 1184 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1185 | uint64_t cgen_var_82; |
| 1186 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_82, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1187 | countingStream->write((uint64_t*)&cgen_var_82, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1188 | } |
| 1189 | uint32_t packetSize_vkQueueWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1190 | countingStream->rewind(); |
| 1191 | uint32_t opcode_vkQueueWaitIdle = OP_vkQueueWaitIdle; |
| 1192 | stream->write(&opcode_vkQueueWaitIdle, sizeof(uint32_t)); |
| 1193 | stream->write(&packetSize_vkQueueWaitIdle, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1194 | uint64_t cgen_var_83; |
| 1195 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_83, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1196 | stream->write((uint64_t*)&cgen_var_83, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1197 | VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0; |
| 1198 | stream->read(&vkQueueWaitIdle_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1199 | countingStream->clearPool(); |
| 1200 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1201 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1202 | return vkQueueWaitIdle_VkResult_return; |
| 1203 | } |
| 1204 | |
| 1205 | VkResult VkEncoder::vkDeviceWaitIdle( |
| 1206 | VkDevice device) |
| 1207 | { |
| 1208 | auto stream = mImpl->stream(); |
| 1209 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1210 | auto resources = mImpl->resources(); |
| 1211 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1212 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1213 | VkDevice local_device; |
| 1214 | local_device = device; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1215 | countingStream->rewind(); |
| 1216 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1217 | uint64_t cgen_var_84; |
| 1218 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_84, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1219 | countingStream->write((uint64_t*)&cgen_var_84, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1220 | } |
| 1221 | uint32_t packetSize_vkDeviceWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1222 | countingStream->rewind(); |
| 1223 | uint32_t opcode_vkDeviceWaitIdle = OP_vkDeviceWaitIdle; |
| 1224 | stream->write(&opcode_vkDeviceWaitIdle, sizeof(uint32_t)); |
| 1225 | stream->write(&packetSize_vkDeviceWaitIdle, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1226 | uint64_t cgen_var_85; |
| 1227 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_85, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1228 | stream->write((uint64_t*)&cgen_var_85, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1229 | VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0; |
| 1230 | stream->read(&vkDeviceWaitIdle_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1231 | countingStream->clearPool(); |
| 1232 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1233 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1234 | return vkDeviceWaitIdle_VkResult_return; |
| 1235 | } |
| 1236 | |
| 1237 | VkResult VkEncoder::vkAllocateMemory( |
| 1238 | VkDevice device, |
| 1239 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 1240 | const VkAllocationCallbacks* pAllocator, |
| 1241 | VkDeviceMemory* pMemory) |
| 1242 | { |
| 1243 | auto stream = mImpl->stream(); |
| 1244 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1245 | auto resources = mImpl->resources(); |
| 1246 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1247 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1248 | VkDevice local_device; |
| 1249 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1250 | VkMemoryAllocateInfo* local_pAllocateInfo; |
| 1251 | local_pAllocateInfo = nullptr; |
| 1252 | if (pAllocateInfo) |
| 1253 | { |
| 1254 | local_pAllocateInfo = (VkMemoryAllocateInfo*)pool->alloc(sizeof(const VkMemoryAllocateInfo)); |
| 1255 | deepcopy_VkMemoryAllocateInfo(pool, pAllocateInfo, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| 1256 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1257 | VkAllocationCallbacks* local_pAllocator; |
| 1258 | local_pAllocator = nullptr; |
| 1259 | if (pAllocator) |
| 1260 | { |
| 1261 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1262 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1263 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1264 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1265 | countingStream->rewind(); |
| 1266 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1267 | uint64_t cgen_var_86; |
| 1268 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_86, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1269 | countingStream->write((uint64_t*)&cgen_var_86, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1270 | marshal_VkMemoryAllocateInfo(countingStream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1271 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1272 | uint64_t cgen_var_87 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1273 | countingStream->putBe64(cgen_var_87); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1274 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1275 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1276 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1277 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1278 | uint64_t cgen_var_88; |
| 1279 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_88, 1); |
| 1280 | countingStream->write((uint64_t*)&cgen_var_88, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1281 | } |
| 1282 | uint32_t packetSize_vkAllocateMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1283 | countingStream->rewind(); |
| 1284 | uint32_t opcode_vkAllocateMemory = OP_vkAllocateMemory; |
| 1285 | stream->write(&opcode_vkAllocateMemory, sizeof(uint32_t)); |
| 1286 | stream->write(&packetSize_vkAllocateMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1287 | uint64_t cgen_var_89; |
| 1288 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_89, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1289 | stream->write((uint64_t*)&cgen_var_89, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1290 | marshal_VkMemoryAllocateInfo(stream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1291 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1292 | uint64_t cgen_var_90 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1293 | stream->putBe64(cgen_var_90); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1294 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1295 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1296 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1297 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1298 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1299 | uint64_t cgen_var_91; |
| 1300 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_91, 1); |
| 1301 | stream->write((uint64_t*)&cgen_var_91, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1302 | stream->setHandleMapping(resources->unwrapMapping()); |
| 1303 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1304 | uint64_t cgen_var_92; |
| 1305 | stream->read((uint64_t*)&cgen_var_92, 8); |
| 1306 | stream->handleMapping()->mapHandles_u64_VkDeviceMemory(&cgen_var_92, (VkDeviceMemory*)pMemory, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1307 | stream->unsetHandleMapping(); |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1308 | goldfish_vkAllocateMemory(device, pAllocateInfo, pAllocator, pMemory); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1309 | VkResult vkAllocateMemory_VkResult_return = (VkResult)0; |
| 1310 | stream->read(&vkAllocateMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1311 | countingStream->clearPool(); |
| 1312 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1313 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1314 | return vkAllocateMemory_VkResult_return; |
| 1315 | } |
| 1316 | |
| 1317 | void VkEncoder::vkFreeMemory( |
| 1318 | VkDevice device, |
| 1319 | VkDeviceMemory memory, |
| 1320 | const VkAllocationCallbacks* pAllocator) |
| 1321 | { |
| 1322 | auto stream = mImpl->stream(); |
| 1323 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1324 | auto resources = mImpl->resources(); |
| 1325 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1326 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1327 | VkDevice local_device; |
| 1328 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1329 | VkDeviceMemory local_memory; |
| 1330 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1331 | VkAllocationCallbacks* local_pAllocator; |
| 1332 | local_pAllocator = nullptr; |
| 1333 | if (pAllocator) |
| 1334 | { |
| 1335 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1336 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1337 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1338 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1339 | countingStream->rewind(); |
| 1340 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1341 | uint64_t cgen_var_93; |
| 1342 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_93, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1343 | countingStream->write((uint64_t*)&cgen_var_93, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1344 | uint64_t cgen_var_94; |
| 1345 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_94, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1346 | countingStream->write((uint64_t*)&cgen_var_94, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1347 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1348 | uint64_t cgen_var_95 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1349 | countingStream->putBe64(cgen_var_95); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1350 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1351 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1352 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1353 | } |
| 1354 | } |
| 1355 | uint32_t packetSize_vkFreeMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1356 | countingStream->rewind(); |
| 1357 | uint32_t opcode_vkFreeMemory = OP_vkFreeMemory; |
| 1358 | stream->write(&opcode_vkFreeMemory, sizeof(uint32_t)); |
| 1359 | stream->write(&packetSize_vkFreeMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1360 | uint64_t cgen_var_96; |
| 1361 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_96, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1362 | stream->write((uint64_t*)&cgen_var_96, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1363 | uint64_t cgen_var_97; |
| 1364 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_97, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1365 | stream->write((uint64_t*)&cgen_var_97, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1366 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1367 | uint64_t cgen_var_98 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1368 | stream->putBe64(cgen_var_98); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1369 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1370 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1371 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1372 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1373 | resources->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1374 | } |
| 1375 | |
| 1376 | VkResult VkEncoder::vkMapMemory( |
| 1377 | VkDevice device, |
| 1378 | VkDeviceMemory memory, |
| 1379 | VkDeviceSize offset, |
| 1380 | VkDeviceSize size, |
| 1381 | VkMemoryMapFlags flags, |
| 1382 | void** ppData) |
| 1383 | { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1384 | VkResult vkMapMemory_VkResult_return = (VkResult)0; |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1385 | vkMapMemory_VkResult_return = goldfish_vkMapMemory(device, memory, offset, size, flags, ppData); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1386 | return vkMapMemory_VkResult_return; |
| 1387 | } |
| 1388 | |
| 1389 | void VkEncoder::vkUnmapMemory( |
| 1390 | VkDevice device, |
| 1391 | VkDeviceMemory memory) |
| 1392 | { |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1393 | goldfish_vkUnmapMemory(device, memory); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1394 | } |
| 1395 | |
| 1396 | VkResult VkEncoder::vkFlushMappedMemoryRanges( |
| 1397 | VkDevice device, |
| 1398 | uint32_t memoryRangeCount, |
| 1399 | const VkMappedMemoryRange* pMemoryRanges) |
| 1400 | { |
| 1401 | auto stream = mImpl->stream(); |
| 1402 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1403 | auto resources = mImpl->resources(); |
| 1404 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1405 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1406 | VkDevice local_device; |
| 1407 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1408 | uint32_t local_memoryRangeCount; |
| 1409 | local_memoryRangeCount = memoryRangeCount; |
| 1410 | VkMappedMemoryRange* local_pMemoryRanges; |
| 1411 | local_pMemoryRanges = nullptr; |
| 1412 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1413 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1414 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1415 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1416 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1417 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1418 | } |
| 1419 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1420 | countingStream->rewind(); |
| 1421 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1422 | uint64_t cgen_var_99; |
| 1423 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_99, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1424 | countingStream->write((uint64_t*)&cgen_var_99, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1425 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 1426 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1427 | { |
| 1428 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1429 | } |
| 1430 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1431 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1432 | { |
| 1433 | auto range = pMemoryRanges[i]; |
| 1434 | auto memory = pMemoryRanges[i].memory; |
| 1435 | auto size = pMemoryRanges[i].size; |
| 1436 | auto offset = pMemoryRanges[i].offset; |
| 1437 | auto goldfishMem = as_goldfish_VkDeviceMemory(memory); |
| 1438 | size_t streamSize = 0; |
| 1439 | if (!goldfishMem) { countingStream->write(&streamSize, sizeof(size_t)); continue; }; |
| 1440 | auto hostPtr = goldfishMem->ptr; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1441 | auto actualSize = size == VK_WHOLE_SIZE ? goldfishMem->size : size; |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1442 | if (!hostPtr) { countingStream->write(&streamSize, sizeof(size_t)); continue; }; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1443 | streamSize = actualSize; |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1444 | countingStream->write(&streamSize, sizeof(size_t)); |
| 1445 | uint8_t* targetRange = hostPtr + offset; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1446 | countingStream->write(targetRange, actualSize); |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1447 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1448 | uint32_t packetSize_vkFlushMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1449 | countingStream->rewind(); |
| 1450 | uint32_t opcode_vkFlushMappedMemoryRanges = OP_vkFlushMappedMemoryRanges; |
| 1451 | stream->write(&opcode_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| 1452 | stream->write(&packetSize_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1453 | uint64_t cgen_var_100; |
| 1454 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_100, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1455 | stream->write((uint64_t*)&cgen_var_100, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1456 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1457 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1458 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1459 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1460 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1461 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1462 | { |
| 1463 | auto range = pMemoryRanges[i]; |
| 1464 | auto memory = pMemoryRanges[i].memory; |
| 1465 | auto size = pMemoryRanges[i].size; |
| 1466 | auto offset = pMemoryRanges[i].offset; |
| 1467 | auto goldfishMem = as_goldfish_VkDeviceMemory(memory); |
| 1468 | size_t streamSize = 0; |
| 1469 | if (!goldfishMem) { stream->write(&streamSize, sizeof(size_t)); continue; }; |
| 1470 | auto hostPtr = goldfishMem->ptr; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1471 | auto actualSize = size == VK_WHOLE_SIZE ? goldfishMem->size : size; |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1472 | if (!hostPtr) { stream->write(&streamSize, sizeof(size_t)); continue; }; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1473 | streamSize = actualSize; |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1474 | stream->write(&streamSize, sizeof(size_t)); |
| 1475 | uint8_t* targetRange = hostPtr + offset; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1476 | stream->write(targetRange, actualSize); |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1477 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1478 | VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 1479 | stream->read(&vkFlushMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1480 | countingStream->clearPool(); |
| 1481 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1482 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1483 | return vkFlushMappedMemoryRanges_VkResult_return; |
| 1484 | } |
| 1485 | |
| 1486 | VkResult VkEncoder::vkInvalidateMappedMemoryRanges( |
| 1487 | VkDevice device, |
| 1488 | uint32_t memoryRangeCount, |
| 1489 | const VkMappedMemoryRange* pMemoryRanges) |
| 1490 | { |
| 1491 | auto stream = mImpl->stream(); |
| 1492 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1493 | auto resources = mImpl->resources(); |
| 1494 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1495 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1496 | VkDevice local_device; |
| 1497 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1498 | uint32_t local_memoryRangeCount; |
| 1499 | local_memoryRangeCount = memoryRangeCount; |
| 1500 | VkMappedMemoryRange* local_pMemoryRanges; |
| 1501 | local_pMemoryRanges = nullptr; |
| 1502 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1503 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1504 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1505 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1506 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1507 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1508 | } |
| 1509 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1510 | countingStream->rewind(); |
| 1511 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1512 | uint64_t cgen_var_101; |
| 1513 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_101, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1514 | countingStream->write((uint64_t*)&cgen_var_101, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1515 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 1516 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1517 | { |
| 1518 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1519 | } |
| 1520 | } |
| 1521 | uint32_t packetSize_vkInvalidateMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1522 | countingStream->rewind(); |
| 1523 | uint32_t opcode_vkInvalidateMappedMemoryRanges = OP_vkInvalidateMappedMemoryRanges; |
| 1524 | stream->write(&opcode_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| 1525 | stream->write(&packetSize_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1526 | uint64_t cgen_var_102; |
| 1527 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_102, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1528 | stream->write((uint64_t*)&cgen_var_102, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1529 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1530 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1531 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1532 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1533 | } |
| 1534 | VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 1535 | stream->read(&vkInvalidateMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1536 | countingStream->clearPool(); |
| 1537 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1538 | pool->freeAll(); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1539 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1540 | { |
| 1541 | auto range = pMemoryRanges[i]; |
| 1542 | auto memory = pMemoryRanges[i].memory; |
| 1543 | auto size = pMemoryRanges[i].size; |
| 1544 | auto offset = pMemoryRanges[i].offset; |
| 1545 | auto goldfishMem = as_goldfish_VkDeviceMemory(memory); |
| 1546 | size_t streamSize = 0; |
| 1547 | if (!goldfishMem) { stream->read(&streamSize, sizeof(size_t)); continue; }; |
| 1548 | auto hostPtr = goldfishMem->ptr; |
| 1549 | auto actualSize = size == VK_WHOLE_SIZE ? goldfishMem->size : size; |
| 1550 | if (!hostPtr) { stream->read(&streamSize, sizeof(size_t)); continue; }; |
| 1551 | streamSize = actualSize; |
| 1552 | stream->read(&streamSize, sizeof(size_t)); |
| 1553 | uint8_t* targetRange = hostPtr + offset; |
| 1554 | stream->read(targetRange, actualSize); |
| 1555 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1556 | return vkInvalidateMappedMemoryRanges_VkResult_return; |
| 1557 | } |
| 1558 | |
| 1559 | void VkEncoder::vkGetDeviceMemoryCommitment( |
| 1560 | VkDevice device, |
| 1561 | VkDeviceMemory memory, |
| 1562 | VkDeviceSize* pCommittedMemoryInBytes) |
| 1563 | { |
| 1564 | auto stream = mImpl->stream(); |
| 1565 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1566 | auto resources = mImpl->resources(); |
| 1567 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1568 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1569 | VkDevice local_device; |
| 1570 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1571 | VkDeviceMemory local_memory; |
| 1572 | local_memory = memory; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1573 | countingStream->rewind(); |
| 1574 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1575 | uint64_t cgen_var_103; |
| 1576 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_103, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1577 | countingStream->write((uint64_t*)&cgen_var_103, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1578 | uint64_t cgen_var_104; |
| 1579 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_104, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1580 | countingStream->write((uint64_t*)&cgen_var_104, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1581 | countingStream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 1582 | } |
| 1583 | uint32_t packetSize_vkGetDeviceMemoryCommitment = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1584 | countingStream->rewind(); |
| 1585 | uint32_t opcode_vkGetDeviceMemoryCommitment = OP_vkGetDeviceMemoryCommitment; |
| 1586 | stream->write(&opcode_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| 1587 | stream->write(&packetSize_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1588 | uint64_t cgen_var_105; |
| 1589 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_105, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1590 | stream->write((uint64_t*)&cgen_var_105, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1591 | uint64_t cgen_var_106; |
| 1592 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_106, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1593 | stream->write((uint64_t*)&cgen_var_106, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1594 | stream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 1595 | stream->read((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 1596 | } |
| 1597 | |
| 1598 | VkResult VkEncoder::vkBindBufferMemory( |
| 1599 | VkDevice device, |
| 1600 | VkBuffer buffer, |
| 1601 | VkDeviceMemory memory, |
| 1602 | VkDeviceSize memoryOffset) |
| 1603 | { |
| 1604 | auto stream = mImpl->stream(); |
| 1605 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1606 | auto resources = mImpl->resources(); |
| 1607 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1608 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1609 | VkDevice local_device; |
| 1610 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1611 | VkBuffer local_buffer; |
| 1612 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1613 | VkDeviceMemory local_memory; |
| 1614 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1615 | VkDeviceSize local_memoryOffset; |
| 1616 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1617 | countingStream->rewind(); |
| 1618 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1619 | uint64_t cgen_var_107; |
| 1620 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_107, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1621 | countingStream->write((uint64_t*)&cgen_var_107, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1622 | uint64_t cgen_var_108; |
| 1623 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_108, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1624 | countingStream->write((uint64_t*)&cgen_var_108, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1625 | uint64_t cgen_var_109; |
| 1626 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_109, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1627 | countingStream->write((uint64_t*)&cgen_var_109, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1628 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1629 | } |
| 1630 | uint32_t packetSize_vkBindBufferMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1631 | countingStream->rewind(); |
| 1632 | uint32_t opcode_vkBindBufferMemory = OP_vkBindBufferMemory; |
| 1633 | stream->write(&opcode_vkBindBufferMemory, sizeof(uint32_t)); |
| 1634 | stream->write(&packetSize_vkBindBufferMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1635 | uint64_t cgen_var_110; |
| 1636 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_110, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1637 | stream->write((uint64_t*)&cgen_var_110, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1638 | uint64_t cgen_var_111; |
| 1639 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_111, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1640 | stream->write((uint64_t*)&cgen_var_111, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1641 | uint64_t cgen_var_112; |
| 1642 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_112, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1643 | stream->write((uint64_t*)&cgen_var_112, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1644 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1645 | VkResult vkBindBufferMemory_VkResult_return = (VkResult)0; |
| 1646 | stream->read(&vkBindBufferMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1647 | countingStream->clearPool(); |
| 1648 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1649 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1650 | return vkBindBufferMemory_VkResult_return; |
| 1651 | } |
| 1652 | |
| 1653 | VkResult VkEncoder::vkBindImageMemory( |
| 1654 | VkDevice device, |
| 1655 | VkImage image, |
| 1656 | VkDeviceMemory memory, |
| 1657 | VkDeviceSize memoryOffset) |
| 1658 | { |
| 1659 | auto stream = mImpl->stream(); |
| 1660 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1661 | auto resources = mImpl->resources(); |
| 1662 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1663 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1664 | VkDevice local_device; |
| 1665 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1666 | VkImage local_image; |
| 1667 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1668 | VkDeviceMemory local_memory; |
| 1669 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1670 | VkDeviceSize local_memoryOffset; |
| 1671 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1672 | countingStream->rewind(); |
| 1673 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1674 | uint64_t cgen_var_113; |
| 1675 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_113, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1676 | countingStream->write((uint64_t*)&cgen_var_113, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1677 | uint64_t cgen_var_114; |
| 1678 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_114, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1679 | countingStream->write((uint64_t*)&cgen_var_114, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1680 | uint64_t cgen_var_115; |
| 1681 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_115, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1682 | countingStream->write((uint64_t*)&cgen_var_115, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1683 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1684 | } |
| 1685 | uint32_t packetSize_vkBindImageMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1686 | countingStream->rewind(); |
| 1687 | uint32_t opcode_vkBindImageMemory = OP_vkBindImageMemory; |
| 1688 | stream->write(&opcode_vkBindImageMemory, sizeof(uint32_t)); |
| 1689 | stream->write(&packetSize_vkBindImageMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1690 | uint64_t cgen_var_116; |
| 1691 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_116, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1692 | stream->write((uint64_t*)&cgen_var_116, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1693 | uint64_t cgen_var_117; |
| 1694 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_117, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1695 | stream->write((uint64_t*)&cgen_var_117, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1696 | uint64_t cgen_var_118; |
| 1697 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_118, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1698 | stream->write((uint64_t*)&cgen_var_118, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1699 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1700 | VkResult vkBindImageMemory_VkResult_return = (VkResult)0; |
| 1701 | stream->read(&vkBindImageMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1702 | countingStream->clearPool(); |
| 1703 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1704 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1705 | return vkBindImageMemory_VkResult_return; |
| 1706 | } |
| 1707 | |
| 1708 | void VkEncoder::vkGetBufferMemoryRequirements( |
| 1709 | VkDevice device, |
| 1710 | VkBuffer buffer, |
| 1711 | VkMemoryRequirements* pMemoryRequirements) |
| 1712 | { |
| 1713 | auto stream = mImpl->stream(); |
| 1714 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1715 | auto resources = mImpl->resources(); |
| 1716 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1717 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1718 | VkDevice local_device; |
| 1719 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1720 | VkBuffer local_buffer; |
| 1721 | local_buffer = buffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1722 | countingStream->rewind(); |
| 1723 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1724 | uint64_t cgen_var_119; |
| 1725 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_119, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1726 | countingStream->write((uint64_t*)&cgen_var_119, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1727 | uint64_t cgen_var_120; |
| 1728 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_120, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1729 | countingStream->write((uint64_t*)&cgen_var_120, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1730 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1731 | } |
| 1732 | uint32_t packetSize_vkGetBufferMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1733 | countingStream->rewind(); |
| 1734 | uint32_t opcode_vkGetBufferMemoryRequirements = OP_vkGetBufferMemoryRequirements; |
| 1735 | stream->write(&opcode_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| 1736 | stream->write(&packetSize_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1737 | uint64_t cgen_var_121; |
| 1738 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_121, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1739 | stream->write((uint64_t*)&cgen_var_121, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1740 | uint64_t cgen_var_122; |
| 1741 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_122, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1742 | stream->write((uint64_t*)&cgen_var_122, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1743 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1744 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1745 | } |
| 1746 | |
| 1747 | void VkEncoder::vkGetImageMemoryRequirements( |
| 1748 | VkDevice device, |
| 1749 | VkImage image, |
| 1750 | VkMemoryRequirements* pMemoryRequirements) |
| 1751 | { |
| 1752 | auto stream = mImpl->stream(); |
| 1753 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1754 | auto resources = mImpl->resources(); |
| 1755 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1756 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1757 | VkDevice local_device; |
| 1758 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1759 | VkImage local_image; |
| 1760 | local_image = image; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1761 | countingStream->rewind(); |
| 1762 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1763 | uint64_t cgen_var_123; |
| 1764 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_123, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1765 | countingStream->write((uint64_t*)&cgen_var_123, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1766 | uint64_t cgen_var_124; |
| 1767 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_124, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1768 | countingStream->write((uint64_t*)&cgen_var_124, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1769 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1770 | } |
| 1771 | uint32_t packetSize_vkGetImageMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1772 | countingStream->rewind(); |
| 1773 | uint32_t opcode_vkGetImageMemoryRequirements = OP_vkGetImageMemoryRequirements; |
| 1774 | stream->write(&opcode_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| 1775 | stream->write(&packetSize_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1776 | uint64_t cgen_var_125; |
| 1777 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_125, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1778 | stream->write((uint64_t*)&cgen_var_125, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1779 | uint64_t cgen_var_126; |
| 1780 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_126, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1781 | stream->write((uint64_t*)&cgen_var_126, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1782 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1783 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1784 | } |
| 1785 | |
| 1786 | void VkEncoder::vkGetImageSparseMemoryRequirements( |
| 1787 | VkDevice device, |
| 1788 | VkImage image, |
| 1789 | uint32_t* pSparseMemoryRequirementCount, |
| 1790 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 1791 | { |
| 1792 | auto stream = mImpl->stream(); |
| 1793 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1794 | auto resources = mImpl->resources(); |
| 1795 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1796 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1797 | VkDevice local_device; |
| 1798 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1799 | VkImage local_image; |
| 1800 | local_image = image; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1801 | countingStream->rewind(); |
| 1802 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1803 | uint64_t cgen_var_127; |
| 1804 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_127, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1805 | countingStream->write((uint64_t*)&cgen_var_127, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1806 | uint64_t cgen_var_128; |
| 1807 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_128, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1808 | countingStream->write((uint64_t*)&cgen_var_128, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1809 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1810 | uint64_t cgen_var_129 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 1811 | countingStream->putBe64(cgen_var_129); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1812 | if (pSparseMemoryRequirementCount) |
| 1813 | { |
| 1814 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 1815 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1816 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1817 | uint64_t cgen_var_130 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 1818 | countingStream->putBe64(cgen_var_130); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1819 | if (pSparseMemoryRequirements) |
| 1820 | { |
| 1821 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 1822 | { |
| 1823 | marshal_VkSparseImageMemoryRequirements(countingStream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 1824 | } |
| 1825 | } |
| 1826 | } |
| 1827 | uint32_t packetSize_vkGetImageSparseMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1828 | countingStream->rewind(); |
| 1829 | uint32_t opcode_vkGetImageSparseMemoryRequirements = OP_vkGetImageSparseMemoryRequirements; |
| 1830 | stream->write(&opcode_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| 1831 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1832 | uint64_t cgen_var_131; |
| 1833 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_131, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1834 | stream->write((uint64_t*)&cgen_var_131, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1835 | uint64_t cgen_var_132; |
| 1836 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_132, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1837 | stream->write((uint64_t*)&cgen_var_132, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1838 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1839 | uint64_t cgen_var_133 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 1840 | stream->putBe64(cgen_var_133); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1841 | if (pSparseMemoryRequirementCount) |
| 1842 | { |
| 1843 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 1844 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1845 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1846 | uint64_t cgen_var_134 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 1847 | stream->putBe64(cgen_var_134); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1848 | if (pSparseMemoryRequirements) |
| 1849 | { |
| 1850 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 1851 | { |
| 1852 | marshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 1853 | } |
| 1854 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1855 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1856 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1857 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1858 | if (pSparseMemoryRequirementCount) |
| 1859 | { |
| 1860 | if (!(check_pSparseMemoryRequirementCount)) |
| 1861 | { |
| 1862 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 1863 | } |
| 1864 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 1865 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1866 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1867 | VkSparseImageMemoryRequirements* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1868 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1869 | if (pSparseMemoryRequirements) |
| 1870 | { |
| 1871 | if (!(check_pSparseMemoryRequirements)) |
| 1872 | { |
| 1873 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 1874 | } |
| 1875 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 1876 | { |
| 1877 | unmarshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 1878 | } |
| 1879 | } |
| 1880 | } |
| 1881 | |
| 1882 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties( |
| 1883 | VkPhysicalDevice physicalDevice, |
| 1884 | VkFormat format, |
| 1885 | VkImageType type, |
| 1886 | VkSampleCountFlagBits samples, |
| 1887 | VkImageUsageFlags usage, |
| 1888 | VkImageTiling tiling, |
| 1889 | uint32_t* pPropertyCount, |
| 1890 | VkSparseImageFormatProperties* pProperties) |
| 1891 | { |
| 1892 | auto stream = mImpl->stream(); |
| 1893 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1894 | auto resources = mImpl->resources(); |
| 1895 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1896 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1897 | VkPhysicalDevice local_physicalDevice; |
| 1898 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1899 | VkFormat local_format; |
| 1900 | local_format = format; |
| 1901 | VkImageType local_type; |
| 1902 | local_type = type; |
| 1903 | VkSampleCountFlagBits local_samples; |
| 1904 | local_samples = samples; |
| 1905 | VkImageUsageFlags local_usage; |
| 1906 | local_usage = usage; |
| 1907 | VkImageTiling local_tiling; |
| 1908 | local_tiling = tiling; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1909 | countingStream->rewind(); |
| 1910 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1911 | uint64_t cgen_var_137; |
| 1912 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_137, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1913 | countingStream->write((uint64_t*)&cgen_var_137, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1914 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 1915 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 1916 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 1917 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 1918 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1919 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1920 | uint64_t cgen_var_138 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1921 | countingStream->putBe64(cgen_var_138); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1922 | if (pPropertyCount) |
| 1923 | { |
| 1924 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1925 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1926 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1927 | uint64_t cgen_var_139 = (uint64_t)(uintptr_t)pProperties; |
| 1928 | countingStream->putBe64(cgen_var_139); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1929 | if (pProperties) |
| 1930 | { |
| 1931 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1932 | { |
| 1933 | marshal_VkSparseImageFormatProperties(countingStream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 1934 | } |
| 1935 | } |
| 1936 | } |
| 1937 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1938 | countingStream->rewind(); |
| 1939 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties = OP_vkGetPhysicalDeviceSparseImageFormatProperties; |
| 1940 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| 1941 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1942 | uint64_t cgen_var_140; |
| 1943 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_140, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 1944 | stream->write((uint64_t*)&cgen_var_140, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1945 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 1946 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 1947 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 1948 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 1949 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1950 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1951 | uint64_t cgen_var_141 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1952 | stream->putBe64(cgen_var_141); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1953 | if (pPropertyCount) |
| 1954 | { |
| 1955 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1956 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1957 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1958 | uint64_t cgen_var_142 = (uint64_t)(uintptr_t)pProperties; |
| 1959 | stream->putBe64(cgen_var_142); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1960 | if (pProperties) |
| 1961 | { |
| 1962 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1963 | { |
| 1964 | marshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 1965 | } |
| 1966 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1967 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1968 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1969 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1970 | if (pPropertyCount) |
| 1971 | { |
| 1972 | if (!(check_pPropertyCount)) |
| 1973 | { |
| 1974 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1975 | } |
| 1976 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1977 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1978 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1979 | VkSparseImageFormatProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1980 | check_pProperties = (VkSparseImageFormatProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1981 | if (pProperties) |
| 1982 | { |
| 1983 | if (!(check_pProperties)) |
| 1984 | { |
| 1985 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1986 | } |
| 1987 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1988 | { |
| 1989 | unmarshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 1990 | } |
| 1991 | } |
| 1992 | } |
| 1993 | |
| 1994 | VkResult VkEncoder::vkQueueBindSparse( |
| 1995 | VkQueue queue, |
| 1996 | uint32_t bindInfoCount, |
| 1997 | const VkBindSparseInfo* pBindInfo, |
| 1998 | VkFence fence) |
| 1999 | { |
| 2000 | auto stream = mImpl->stream(); |
| 2001 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2002 | auto resources = mImpl->resources(); |
| 2003 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2004 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2005 | VkQueue local_queue; |
| 2006 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2007 | uint32_t local_bindInfoCount; |
| 2008 | local_bindInfoCount = bindInfoCount; |
| 2009 | VkBindSparseInfo* local_pBindInfo; |
| 2010 | local_pBindInfo = nullptr; |
| 2011 | if (pBindInfo) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2012 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2013 | local_pBindInfo = (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2014 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2015 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2016 | deepcopy_VkBindSparseInfo(pool, pBindInfo + i, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2017 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2018 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2019 | VkFence local_fence; |
| 2020 | local_fence = fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2021 | countingStream->rewind(); |
| 2022 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2023 | uint64_t cgen_var_145; |
| 2024 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_145, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2025 | countingStream->write((uint64_t*)&cgen_var_145, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2026 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 2027 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2028 | { |
| 2029 | marshal_VkBindSparseInfo(countingStream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 2030 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2031 | uint64_t cgen_var_146; |
| 2032 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_146, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2033 | countingStream->write((uint64_t*)&cgen_var_146, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2034 | } |
| 2035 | uint32_t packetSize_vkQueueBindSparse = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2036 | countingStream->rewind(); |
| 2037 | uint32_t opcode_vkQueueBindSparse = OP_vkQueueBindSparse; |
| 2038 | stream->write(&opcode_vkQueueBindSparse, sizeof(uint32_t)); |
| 2039 | stream->write(&packetSize_vkQueueBindSparse, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2040 | uint64_t cgen_var_147; |
| 2041 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_147, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2042 | stream->write((uint64_t*)&cgen_var_147, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2043 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2044 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2045 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2046 | marshal_VkBindSparseInfo(stream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2047 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2048 | uint64_t cgen_var_148; |
| 2049 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_148, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2050 | stream->write((uint64_t*)&cgen_var_148, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2051 | VkResult vkQueueBindSparse_VkResult_return = (VkResult)0; |
| 2052 | stream->read(&vkQueueBindSparse_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2053 | countingStream->clearPool(); |
| 2054 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2055 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2056 | return vkQueueBindSparse_VkResult_return; |
| 2057 | } |
| 2058 | |
| 2059 | VkResult VkEncoder::vkCreateFence( |
| 2060 | VkDevice device, |
| 2061 | const VkFenceCreateInfo* pCreateInfo, |
| 2062 | const VkAllocationCallbacks* pAllocator, |
| 2063 | VkFence* pFence) |
| 2064 | { |
| 2065 | auto stream = mImpl->stream(); |
| 2066 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2067 | auto resources = mImpl->resources(); |
| 2068 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2069 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2070 | VkDevice local_device; |
| 2071 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2072 | VkFenceCreateInfo* local_pCreateInfo; |
| 2073 | local_pCreateInfo = nullptr; |
| 2074 | if (pCreateInfo) |
| 2075 | { |
| 2076 | local_pCreateInfo = (VkFenceCreateInfo*)pool->alloc(sizeof(const VkFenceCreateInfo)); |
| 2077 | deepcopy_VkFenceCreateInfo(pool, pCreateInfo, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| 2078 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2079 | VkAllocationCallbacks* local_pAllocator; |
| 2080 | local_pAllocator = nullptr; |
| 2081 | if (pAllocator) |
| 2082 | { |
| 2083 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2084 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2085 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2086 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2087 | countingStream->rewind(); |
| 2088 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2089 | uint64_t cgen_var_149; |
| 2090 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_149, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2091 | countingStream->write((uint64_t*)&cgen_var_149, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2092 | marshal_VkFenceCreateInfo(countingStream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2093 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2094 | uint64_t cgen_var_150 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2095 | countingStream->putBe64(cgen_var_150); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2096 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2097 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2098 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2099 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2100 | uint64_t cgen_var_151; |
| 2101 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_151, 1); |
| 2102 | countingStream->write((uint64_t*)&cgen_var_151, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2103 | } |
| 2104 | uint32_t packetSize_vkCreateFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2105 | countingStream->rewind(); |
| 2106 | uint32_t opcode_vkCreateFence = OP_vkCreateFence; |
| 2107 | stream->write(&opcode_vkCreateFence, sizeof(uint32_t)); |
| 2108 | stream->write(&packetSize_vkCreateFence, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2109 | uint64_t cgen_var_152; |
| 2110 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_152, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2111 | stream->write((uint64_t*)&cgen_var_152, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2112 | marshal_VkFenceCreateInfo(stream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2113 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2114 | uint64_t cgen_var_153 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2115 | stream->putBe64(cgen_var_153); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2116 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2117 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2118 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2119 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2120 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2121 | uint64_t cgen_var_154; |
| 2122 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_154, 1); |
| 2123 | stream->write((uint64_t*)&cgen_var_154, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2124 | stream->setHandleMapping(resources->unwrapMapping()); |
| 2125 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2126 | uint64_t cgen_var_155; |
| 2127 | stream->read((uint64_t*)&cgen_var_155, 8); |
| 2128 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_155, (VkFence*)pFence, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2129 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2130 | VkResult vkCreateFence_VkResult_return = (VkResult)0; |
| 2131 | stream->read(&vkCreateFence_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2132 | countingStream->clearPool(); |
| 2133 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2134 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2135 | return vkCreateFence_VkResult_return; |
| 2136 | } |
| 2137 | |
| 2138 | void VkEncoder::vkDestroyFence( |
| 2139 | VkDevice device, |
| 2140 | VkFence fence, |
| 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(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2147 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2148 | VkDevice local_device; |
| 2149 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2150 | VkFence local_fence; |
| 2151 | local_fence = fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2152 | VkAllocationCallbacks* local_pAllocator; |
| 2153 | local_pAllocator = nullptr; |
| 2154 | if (pAllocator) |
| 2155 | { |
| 2156 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2157 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2158 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2159 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2160 | countingStream->rewind(); |
| 2161 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2162 | uint64_t cgen_var_156; |
| 2163 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_156, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2164 | countingStream->write((uint64_t*)&cgen_var_156, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2165 | uint64_t cgen_var_157; |
| 2166 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_157, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2167 | countingStream->write((uint64_t*)&cgen_var_157, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2168 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2169 | uint64_t cgen_var_158 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2170 | countingStream->putBe64(cgen_var_158); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2171 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2172 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2173 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2174 | } |
| 2175 | } |
| 2176 | uint32_t packetSize_vkDestroyFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2177 | countingStream->rewind(); |
| 2178 | uint32_t opcode_vkDestroyFence = OP_vkDestroyFence; |
| 2179 | stream->write(&opcode_vkDestroyFence, sizeof(uint32_t)); |
| 2180 | stream->write(&packetSize_vkDestroyFence, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2181 | uint64_t cgen_var_159; |
| 2182 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_159, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2183 | stream->write((uint64_t*)&cgen_var_159, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2184 | uint64_t cgen_var_160; |
| 2185 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_160, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2186 | stream->write((uint64_t*)&cgen_var_160, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2187 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2188 | uint64_t cgen_var_161 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2189 | stream->putBe64(cgen_var_161); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2190 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2191 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2192 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2193 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2194 | resources->destroyMapping()->mapHandles_VkFence((VkFence*)&fence); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2195 | } |
| 2196 | |
| 2197 | VkResult VkEncoder::vkResetFences( |
| 2198 | VkDevice device, |
| 2199 | uint32_t fenceCount, |
| 2200 | const VkFence* pFences) |
| 2201 | { |
| 2202 | auto stream = mImpl->stream(); |
| 2203 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2204 | auto resources = mImpl->resources(); |
| 2205 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2206 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2207 | VkDevice local_device; |
| 2208 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2209 | uint32_t local_fenceCount; |
| 2210 | local_fenceCount = fenceCount; |
| 2211 | VkFence* local_pFences; |
| 2212 | local_pFences = nullptr; |
| 2213 | if (pFences) |
| 2214 | { |
| 2215 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2216 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2217 | countingStream->rewind(); |
| 2218 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2219 | uint64_t cgen_var_162; |
| 2220 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_162, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2221 | countingStream->write((uint64_t*)&cgen_var_162, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2222 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2223 | if (((fenceCount))) |
| 2224 | { |
| 2225 | uint64_t* cgen_var_163; |
| 2226 | countingStream->alloc((void**)&cgen_var_163, ((fenceCount)) * 8); |
| 2227 | countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_163, ((fenceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2228 | countingStream->write((uint64_t*)cgen_var_163, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2229 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2230 | } |
| 2231 | uint32_t packetSize_vkResetFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2232 | countingStream->rewind(); |
| 2233 | uint32_t opcode_vkResetFences = OP_vkResetFences; |
| 2234 | stream->write(&opcode_vkResetFences, sizeof(uint32_t)); |
| 2235 | stream->write(&packetSize_vkResetFences, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2236 | uint64_t cgen_var_164; |
| 2237 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_164, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2238 | stream->write((uint64_t*)&cgen_var_164, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2239 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2240 | if (((fenceCount))) |
| 2241 | { |
| 2242 | uint64_t* cgen_var_165; |
| 2243 | stream->alloc((void**)&cgen_var_165, ((fenceCount)) * 8); |
| 2244 | stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_165, ((fenceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2245 | stream->write((uint64_t*)cgen_var_165, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2246 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2247 | VkResult vkResetFences_VkResult_return = (VkResult)0; |
| 2248 | stream->read(&vkResetFences_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2249 | countingStream->clearPool(); |
| 2250 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2251 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2252 | return vkResetFences_VkResult_return; |
| 2253 | } |
| 2254 | |
| 2255 | VkResult VkEncoder::vkGetFenceStatus( |
| 2256 | VkDevice device, |
| 2257 | VkFence fence) |
| 2258 | { |
| 2259 | auto stream = mImpl->stream(); |
| 2260 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2261 | auto resources = mImpl->resources(); |
| 2262 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2263 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2264 | VkDevice local_device; |
| 2265 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2266 | VkFence local_fence; |
| 2267 | local_fence = fence; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2268 | countingStream->rewind(); |
| 2269 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2270 | uint64_t cgen_var_166; |
| 2271 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_166, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2272 | countingStream->write((uint64_t*)&cgen_var_166, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2273 | uint64_t cgen_var_167; |
| 2274 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_167, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2275 | countingStream->write((uint64_t*)&cgen_var_167, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2276 | } |
| 2277 | uint32_t packetSize_vkGetFenceStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2278 | countingStream->rewind(); |
| 2279 | uint32_t opcode_vkGetFenceStatus = OP_vkGetFenceStatus; |
| 2280 | stream->write(&opcode_vkGetFenceStatus, sizeof(uint32_t)); |
| 2281 | stream->write(&packetSize_vkGetFenceStatus, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2282 | uint64_t cgen_var_168; |
| 2283 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_168, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2284 | stream->write((uint64_t*)&cgen_var_168, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2285 | uint64_t cgen_var_169; |
| 2286 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_169, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2287 | stream->write((uint64_t*)&cgen_var_169, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2288 | VkResult vkGetFenceStatus_VkResult_return = (VkResult)0; |
| 2289 | stream->read(&vkGetFenceStatus_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2290 | countingStream->clearPool(); |
| 2291 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2292 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2293 | return vkGetFenceStatus_VkResult_return; |
| 2294 | } |
| 2295 | |
| 2296 | VkResult VkEncoder::vkWaitForFences( |
| 2297 | VkDevice device, |
| 2298 | uint32_t fenceCount, |
| 2299 | const VkFence* pFences, |
| 2300 | VkBool32 waitAll, |
| 2301 | uint64_t timeout) |
| 2302 | { |
| 2303 | auto stream = mImpl->stream(); |
| 2304 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2305 | auto resources = mImpl->resources(); |
| 2306 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2307 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2308 | VkDevice local_device; |
| 2309 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2310 | uint32_t local_fenceCount; |
| 2311 | local_fenceCount = fenceCount; |
| 2312 | VkFence* local_pFences; |
| 2313 | local_pFences = nullptr; |
| 2314 | if (pFences) |
| 2315 | { |
| 2316 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2317 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2318 | VkBool32 local_waitAll; |
| 2319 | local_waitAll = waitAll; |
| 2320 | uint64_t local_timeout; |
| 2321 | local_timeout = timeout; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2322 | countingStream->rewind(); |
| 2323 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2324 | uint64_t cgen_var_170; |
| 2325 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_170, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2326 | countingStream->write((uint64_t*)&cgen_var_170, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2327 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2328 | if (((fenceCount))) |
| 2329 | { |
| 2330 | uint64_t* cgen_var_171; |
| 2331 | countingStream->alloc((void**)&cgen_var_171, ((fenceCount)) * 8); |
| 2332 | countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_171, ((fenceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2333 | countingStream->write((uint64_t*)cgen_var_171, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2334 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2335 | countingStream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2336 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2337 | } |
| 2338 | uint32_t packetSize_vkWaitForFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2339 | countingStream->rewind(); |
| 2340 | uint32_t opcode_vkWaitForFences = OP_vkWaitForFences; |
| 2341 | stream->write(&opcode_vkWaitForFences, sizeof(uint32_t)); |
| 2342 | stream->write(&packetSize_vkWaitForFences, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2343 | uint64_t cgen_var_172; |
| 2344 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_172, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2345 | stream->write((uint64_t*)&cgen_var_172, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2346 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2347 | if (((fenceCount))) |
| 2348 | { |
| 2349 | uint64_t* cgen_var_173; |
| 2350 | stream->alloc((void**)&cgen_var_173, ((fenceCount)) * 8); |
| 2351 | stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_173, ((fenceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2352 | stream->write((uint64_t*)cgen_var_173, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2353 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2354 | stream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2355 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2356 | VkResult vkWaitForFences_VkResult_return = (VkResult)0; |
| 2357 | stream->read(&vkWaitForFences_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2358 | countingStream->clearPool(); |
| 2359 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2360 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2361 | return vkWaitForFences_VkResult_return; |
| 2362 | } |
| 2363 | |
| 2364 | VkResult VkEncoder::vkCreateSemaphore( |
| 2365 | VkDevice device, |
| 2366 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 2367 | const VkAllocationCallbacks* pAllocator, |
| 2368 | VkSemaphore* pSemaphore) |
| 2369 | { |
| 2370 | auto stream = mImpl->stream(); |
| 2371 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2372 | auto resources = mImpl->resources(); |
| 2373 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2374 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2375 | VkDevice local_device; |
| 2376 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2377 | VkSemaphoreCreateInfo* local_pCreateInfo; |
| 2378 | local_pCreateInfo = nullptr; |
| 2379 | if (pCreateInfo) |
| 2380 | { |
| 2381 | local_pCreateInfo = (VkSemaphoreCreateInfo*)pool->alloc(sizeof(const VkSemaphoreCreateInfo)); |
| 2382 | deepcopy_VkSemaphoreCreateInfo(pool, pCreateInfo, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| 2383 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2384 | VkAllocationCallbacks* local_pAllocator; |
| 2385 | local_pAllocator = nullptr; |
| 2386 | if (pAllocator) |
| 2387 | { |
| 2388 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2389 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2390 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2391 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2392 | countingStream->rewind(); |
| 2393 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2394 | uint64_t cgen_var_174; |
| 2395 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_174, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2396 | countingStream->write((uint64_t*)&cgen_var_174, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2397 | marshal_VkSemaphoreCreateInfo(countingStream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2398 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2399 | uint64_t cgen_var_175 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2400 | countingStream->putBe64(cgen_var_175); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2401 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2402 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2403 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2404 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2405 | uint64_t cgen_var_176; |
| 2406 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_176, 1); |
| 2407 | countingStream->write((uint64_t*)&cgen_var_176, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2408 | } |
| 2409 | uint32_t packetSize_vkCreateSemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2410 | countingStream->rewind(); |
| 2411 | uint32_t opcode_vkCreateSemaphore = OP_vkCreateSemaphore; |
| 2412 | stream->write(&opcode_vkCreateSemaphore, sizeof(uint32_t)); |
| 2413 | stream->write(&packetSize_vkCreateSemaphore, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2414 | uint64_t cgen_var_177; |
| 2415 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_177, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2416 | stream->write((uint64_t*)&cgen_var_177, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2417 | marshal_VkSemaphoreCreateInfo(stream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2418 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2419 | uint64_t cgen_var_178 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2420 | stream->putBe64(cgen_var_178); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2421 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2422 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2423 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2424 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2425 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2426 | uint64_t cgen_var_179; |
| 2427 | stream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_179, 1); |
| 2428 | stream->write((uint64_t*)&cgen_var_179, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2429 | stream->setHandleMapping(resources->unwrapMapping()); |
| 2430 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2431 | uint64_t cgen_var_180; |
| 2432 | stream->read((uint64_t*)&cgen_var_180, 8); |
| 2433 | stream->handleMapping()->mapHandles_u64_VkSemaphore(&cgen_var_180, (VkSemaphore*)pSemaphore, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2434 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2435 | VkResult vkCreateSemaphore_VkResult_return = (VkResult)0; |
| 2436 | stream->read(&vkCreateSemaphore_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2437 | countingStream->clearPool(); |
| 2438 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2439 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2440 | return vkCreateSemaphore_VkResult_return; |
| 2441 | } |
| 2442 | |
| 2443 | void VkEncoder::vkDestroySemaphore( |
| 2444 | VkDevice device, |
| 2445 | VkSemaphore semaphore, |
| 2446 | const VkAllocationCallbacks* pAllocator) |
| 2447 | { |
| 2448 | auto stream = mImpl->stream(); |
| 2449 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2450 | auto resources = mImpl->resources(); |
| 2451 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2452 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2453 | VkDevice local_device; |
| 2454 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2455 | VkSemaphore local_semaphore; |
| 2456 | local_semaphore = semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2457 | VkAllocationCallbacks* local_pAllocator; |
| 2458 | local_pAllocator = nullptr; |
| 2459 | if (pAllocator) |
| 2460 | { |
| 2461 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2462 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2463 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2464 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2465 | countingStream->rewind(); |
| 2466 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2467 | uint64_t cgen_var_181; |
| 2468 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_181, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2469 | countingStream->write((uint64_t*)&cgen_var_181, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2470 | uint64_t cgen_var_182; |
| 2471 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_182, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2472 | countingStream->write((uint64_t*)&cgen_var_182, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2473 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2474 | uint64_t cgen_var_183 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2475 | countingStream->putBe64(cgen_var_183); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2476 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2477 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2478 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2479 | } |
| 2480 | } |
| 2481 | uint32_t packetSize_vkDestroySemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2482 | countingStream->rewind(); |
| 2483 | uint32_t opcode_vkDestroySemaphore = OP_vkDestroySemaphore; |
| 2484 | stream->write(&opcode_vkDestroySemaphore, sizeof(uint32_t)); |
| 2485 | stream->write(&packetSize_vkDestroySemaphore, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2486 | uint64_t cgen_var_184; |
| 2487 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_184, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2488 | stream->write((uint64_t*)&cgen_var_184, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2489 | uint64_t cgen_var_185; |
| 2490 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_185, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2491 | stream->write((uint64_t*)&cgen_var_185, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2492 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2493 | uint64_t cgen_var_186 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2494 | stream->putBe64(cgen_var_186); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2495 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2496 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2497 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2498 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2499 | resources->destroyMapping()->mapHandles_VkSemaphore((VkSemaphore*)&semaphore); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2500 | } |
| 2501 | |
| 2502 | VkResult VkEncoder::vkCreateEvent( |
| 2503 | VkDevice device, |
| 2504 | const VkEventCreateInfo* pCreateInfo, |
| 2505 | const VkAllocationCallbacks* pAllocator, |
| 2506 | VkEvent* pEvent) |
| 2507 | { |
| 2508 | auto stream = mImpl->stream(); |
| 2509 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2510 | auto resources = mImpl->resources(); |
| 2511 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2512 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2513 | VkDevice local_device; |
| 2514 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2515 | VkEventCreateInfo* local_pCreateInfo; |
| 2516 | local_pCreateInfo = nullptr; |
| 2517 | if (pCreateInfo) |
| 2518 | { |
| 2519 | local_pCreateInfo = (VkEventCreateInfo*)pool->alloc(sizeof(const VkEventCreateInfo)); |
| 2520 | deepcopy_VkEventCreateInfo(pool, pCreateInfo, (VkEventCreateInfo*)(local_pCreateInfo)); |
| 2521 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2522 | VkAllocationCallbacks* local_pAllocator; |
| 2523 | local_pAllocator = nullptr; |
| 2524 | if (pAllocator) |
| 2525 | { |
| 2526 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2527 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2528 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2529 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2530 | countingStream->rewind(); |
| 2531 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2532 | uint64_t cgen_var_187; |
| 2533 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_187, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2534 | countingStream->write((uint64_t*)&cgen_var_187, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2535 | marshal_VkEventCreateInfo(countingStream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2536 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2537 | uint64_t cgen_var_188 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2538 | countingStream->putBe64(cgen_var_188); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2539 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2540 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2541 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2542 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2543 | uint64_t cgen_var_189; |
| 2544 | countingStream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_189, 1); |
| 2545 | countingStream->write((uint64_t*)&cgen_var_189, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2546 | } |
| 2547 | uint32_t packetSize_vkCreateEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2548 | countingStream->rewind(); |
| 2549 | uint32_t opcode_vkCreateEvent = OP_vkCreateEvent; |
| 2550 | stream->write(&opcode_vkCreateEvent, sizeof(uint32_t)); |
| 2551 | stream->write(&packetSize_vkCreateEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2552 | uint64_t cgen_var_190; |
| 2553 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_190, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2554 | stream->write((uint64_t*)&cgen_var_190, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2555 | marshal_VkEventCreateInfo(stream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2556 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2557 | uint64_t cgen_var_191 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2558 | stream->putBe64(cgen_var_191); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2559 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2560 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2561 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2562 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2563 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2564 | uint64_t cgen_var_192; |
| 2565 | stream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_192, 1); |
| 2566 | stream->write((uint64_t*)&cgen_var_192, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2567 | stream->setHandleMapping(resources->unwrapMapping()); |
| 2568 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2569 | uint64_t cgen_var_193; |
| 2570 | stream->read((uint64_t*)&cgen_var_193, 8); |
| 2571 | stream->handleMapping()->mapHandles_u64_VkEvent(&cgen_var_193, (VkEvent*)pEvent, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2572 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2573 | VkResult vkCreateEvent_VkResult_return = (VkResult)0; |
| 2574 | stream->read(&vkCreateEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2575 | countingStream->clearPool(); |
| 2576 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2577 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2578 | return vkCreateEvent_VkResult_return; |
| 2579 | } |
| 2580 | |
| 2581 | void VkEncoder::vkDestroyEvent( |
| 2582 | VkDevice device, |
| 2583 | VkEvent event, |
| 2584 | const VkAllocationCallbacks* pAllocator) |
| 2585 | { |
| 2586 | auto stream = mImpl->stream(); |
| 2587 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2588 | auto resources = mImpl->resources(); |
| 2589 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2590 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2591 | VkDevice local_device; |
| 2592 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2593 | VkEvent local_event; |
| 2594 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2595 | VkAllocationCallbacks* local_pAllocator; |
| 2596 | local_pAllocator = nullptr; |
| 2597 | if (pAllocator) |
| 2598 | { |
| 2599 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2600 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2601 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2602 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2603 | countingStream->rewind(); |
| 2604 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2605 | uint64_t cgen_var_194; |
| 2606 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_194, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2607 | countingStream->write((uint64_t*)&cgen_var_194, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2608 | uint64_t cgen_var_195; |
| 2609 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_195, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2610 | countingStream->write((uint64_t*)&cgen_var_195, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2611 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2612 | uint64_t cgen_var_196 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2613 | countingStream->putBe64(cgen_var_196); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2614 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2615 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2616 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2617 | } |
| 2618 | } |
| 2619 | uint32_t packetSize_vkDestroyEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2620 | countingStream->rewind(); |
| 2621 | uint32_t opcode_vkDestroyEvent = OP_vkDestroyEvent; |
| 2622 | stream->write(&opcode_vkDestroyEvent, sizeof(uint32_t)); |
| 2623 | stream->write(&packetSize_vkDestroyEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2624 | uint64_t cgen_var_197; |
| 2625 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_197, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2626 | stream->write((uint64_t*)&cgen_var_197, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2627 | uint64_t cgen_var_198; |
| 2628 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_198, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2629 | stream->write((uint64_t*)&cgen_var_198, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2630 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2631 | uint64_t cgen_var_199 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2632 | stream->putBe64(cgen_var_199); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2633 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2634 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2635 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2636 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2637 | resources->destroyMapping()->mapHandles_VkEvent((VkEvent*)&event); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2638 | } |
| 2639 | |
| 2640 | VkResult VkEncoder::vkGetEventStatus( |
| 2641 | VkDevice device, |
| 2642 | VkEvent event) |
| 2643 | { |
| 2644 | auto stream = mImpl->stream(); |
| 2645 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2646 | auto resources = mImpl->resources(); |
| 2647 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2648 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2649 | VkDevice local_device; |
| 2650 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2651 | VkEvent local_event; |
| 2652 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2653 | countingStream->rewind(); |
| 2654 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2655 | uint64_t cgen_var_200; |
| 2656 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_200, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2657 | countingStream->write((uint64_t*)&cgen_var_200, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2658 | uint64_t cgen_var_201; |
| 2659 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_201, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2660 | countingStream->write((uint64_t*)&cgen_var_201, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2661 | } |
| 2662 | uint32_t packetSize_vkGetEventStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2663 | countingStream->rewind(); |
| 2664 | uint32_t opcode_vkGetEventStatus = OP_vkGetEventStatus; |
| 2665 | stream->write(&opcode_vkGetEventStatus, sizeof(uint32_t)); |
| 2666 | stream->write(&packetSize_vkGetEventStatus, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2667 | uint64_t cgen_var_202; |
| 2668 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_202, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2669 | stream->write((uint64_t*)&cgen_var_202, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2670 | uint64_t cgen_var_203; |
| 2671 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_203, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2672 | stream->write((uint64_t*)&cgen_var_203, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2673 | VkResult vkGetEventStatus_VkResult_return = (VkResult)0; |
| 2674 | stream->read(&vkGetEventStatus_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2675 | countingStream->clearPool(); |
| 2676 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2677 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2678 | return vkGetEventStatus_VkResult_return; |
| 2679 | } |
| 2680 | |
| 2681 | VkResult VkEncoder::vkSetEvent( |
| 2682 | VkDevice device, |
| 2683 | VkEvent event) |
| 2684 | { |
| 2685 | auto stream = mImpl->stream(); |
| 2686 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2687 | auto resources = mImpl->resources(); |
| 2688 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2689 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2690 | VkDevice local_device; |
| 2691 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2692 | VkEvent local_event; |
| 2693 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2694 | countingStream->rewind(); |
| 2695 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2696 | uint64_t cgen_var_204; |
| 2697 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_204, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2698 | countingStream->write((uint64_t*)&cgen_var_204, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2699 | uint64_t cgen_var_205; |
| 2700 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_205, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2701 | countingStream->write((uint64_t*)&cgen_var_205, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2702 | } |
| 2703 | uint32_t packetSize_vkSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2704 | countingStream->rewind(); |
| 2705 | uint32_t opcode_vkSetEvent = OP_vkSetEvent; |
| 2706 | stream->write(&opcode_vkSetEvent, sizeof(uint32_t)); |
| 2707 | stream->write(&packetSize_vkSetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2708 | uint64_t cgen_var_206; |
| 2709 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_206, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2710 | stream->write((uint64_t*)&cgen_var_206, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2711 | uint64_t cgen_var_207; |
| 2712 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_207, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2713 | stream->write((uint64_t*)&cgen_var_207, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2714 | VkResult vkSetEvent_VkResult_return = (VkResult)0; |
| 2715 | stream->read(&vkSetEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2716 | countingStream->clearPool(); |
| 2717 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2718 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2719 | return vkSetEvent_VkResult_return; |
| 2720 | } |
| 2721 | |
| 2722 | VkResult VkEncoder::vkResetEvent( |
| 2723 | VkDevice device, |
| 2724 | VkEvent event) |
| 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(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2730 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2731 | VkDevice local_device; |
| 2732 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2733 | VkEvent local_event; |
| 2734 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2735 | countingStream->rewind(); |
| 2736 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2737 | uint64_t cgen_var_208; |
| 2738 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_208, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2739 | countingStream->write((uint64_t*)&cgen_var_208, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2740 | uint64_t cgen_var_209; |
| 2741 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_209, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2742 | countingStream->write((uint64_t*)&cgen_var_209, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2743 | } |
| 2744 | uint32_t packetSize_vkResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2745 | countingStream->rewind(); |
| 2746 | uint32_t opcode_vkResetEvent = OP_vkResetEvent; |
| 2747 | stream->write(&opcode_vkResetEvent, sizeof(uint32_t)); |
| 2748 | stream->write(&packetSize_vkResetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2749 | uint64_t cgen_var_210; |
| 2750 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_210, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2751 | stream->write((uint64_t*)&cgen_var_210, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2752 | uint64_t cgen_var_211; |
| 2753 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_211, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2754 | stream->write((uint64_t*)&cgen_var_211, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2755 | VkResult vkResetEvent_VkResult_return = (VkResult)0; |
| 2756 | stream->read(&vkResetEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2757 | countingStream->clearPool(); |
| 2758 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2759 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2760 | return vkResetEvent_VkResult_return; |
| 2761 | } |
| 2762 | |
| 2763 | VkResult VkEncoder::vkCreateQueryPool( |
| 2764 | VkDevice device, |
| 2765 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 2766 | const VkAllocationCallbacks* pAllocator, |
| 2767 | VkQueryPool* pQueryPool) |
| 2768 | { |
| 2769 | auto stream = mImpl->stream(); |
| 2770 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2771 | auto resources = mImpl->resources(); |
| 2772 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2773 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2774 | VkDevice local_device; |
| 2775 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2776 | VkQueryPoolCreateInfo* local_pCreateInfo; |
| 2777 | local_pCreateInfo = nullptr; |
| 2778 | if (pCreateInfo) |
| 2779 | { |
| 2780 | local_pCreateInfo = (VkQueryPoolCreateInfo*)pool->alloc(sizeof(const VkQueryPoolCreateInfo)); |
| 2781 | deepcopy_VkQueryPoolCreateInfo(pool, pCreateInfo, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| 2782 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2783 | VkAllocationCallbacks* local_pAllocator; |
| 2784 | local_pAllocator = nullptr; |
| 2785 | if (pAllocator) |
| 2786 | { |
| 2787 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2788 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2789 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2790 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2791 | countingStream->rewind(); |
| 2792 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2793 | uint64_t cgen_var_212; |
| 2794 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_212, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2795 | countingStream->write((uint64_t*)&cgen_var_212, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2796 | marshal_VkQueryPoolCreateInfo(countingStream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2797 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2798 | uint64_t cgen_var_213 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2799 | countingStream->putBe64(cgen_var_213); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2800 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2801 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2802 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2803 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2804 | uint64_t cgen_var_214; |
| 2805 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_214, 1); |
| 2806 | countingStream->write((uint64_t*)&cgen_var_214, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2807 | } |
| 2808 | uint32_t packetSize_vkCreateQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2809 | countingStream->rewind(); |
| 2810 | uint32_t opcode_vkCreateQueryPool = OP_vkCreateQueryPool; |
| 2811 | stream->write(&opcode_vkCreateQueryPool, sizeof(uint32_t)); |
| 2812 | stream->write(&packetSize_vkCreateQueryPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2813 | uint64_t cgen_var_215; |
| 2814 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_215, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2815 | stream->write((uint64_t*)&cgen_var_215, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2816 | marshal_VkQueryPoolCreateInfo(stream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2817 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2818 | uint64_t cgen_var_216 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2819 | stream->putBe64(cgen_var_216); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2820 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2821 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2822 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2823 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2824 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2825 | uint64_t cgen_var_217; |
| 2826 | stream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_217, 1); |
| 2827 | stream->write((uint64_t*)&cgen_var_217, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2828 | stream->setHandleMapping(resources->unwrapMapping()); |
| 2829 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2830 | uint64_t cgen_var_218; |
| 2831 | stream->read((uint64_t*)&cgen_var_218, 8); |
| 2832 | stream->handleMapping()->mapHandles_u64_VkQueryPool(&cgen_var_218, (VkQueryPool*)pQueryPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2833 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2834 | VkResult vkCreateQueryPool_VkResult_return = (VkResult)0; |
| 2835 | stream->read(&vkCreateQueryPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2836 | countingStream->clearPool(); |
| 2837 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2838 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2839 | return vkCreateQueryPool_VkResult_return; |
| 2840 | } |
| 2841 | |
| 2842 | void VkEncoder::vkDestroyQueryPool( |
| 2843 | VkDevice device, |
| 2844 | VkQueryPool queryPool, |
| 2845 | const VkAllocationCallbacks* pAllocator) |
| 2846 | { |
| 2847 | auto stream = mImpl->stream(); |
| 2848 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2849 | auto resources = mImpl->resources(); |
| 2850 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2851 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2852 | VkDevice local_device; |
| 2853 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2854 | VkQueryPool local_queryPool; |
| 2855 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2856 | VkAllocationCallbacks* local_pAllocator; |
| 2857 | local_pAllocator = nullptr; |
| 2858 | if (pAllocator) |
| 2859 | { |
| 2860 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2861 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2862 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2863 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2864 | countingStream->rewind(); |
| 2865 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2866 | uint64_t cgen_var_219; |
| 2867 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_219, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2868 | countingStream->write((uint64_t*)&cgen_var_219, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2869 | uint64_t cgen_var_220; |
| 2870 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_220, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2871 | countingStream->write((uint64_t*)&cgen_var_220, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2872 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2873 | uint64_t cgen_var_221 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2874 | countingStream->putBe64(cgen_var_221); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2875 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2876 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2877 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2878 | } |
| 2879 | } |
| 2880 | uint32_t packetSize_vkDestroyQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2881 | countingStream->rewind(); |
| 2882 | uint32_t opcode_vkDestroyQueryPool = OP_vkDestroyQueryPool; |
| 2883 | stream->write(&opcode_vkDestroyQueryPool, sizeof(uint32_t)); |
| 2884 | stream->write(&packetSize_vkDestroyQueryPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2885 | uint64_t cgen_var_222; |
| 2886 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_222, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2887 | stream->write((uint64_t*)&cgen_var_222, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2888 | uint64_t cgen_var_223; |
| 2889 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_223, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2890 | stream->write((uint64_t*)&cgen_var_223, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2891 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2892 | uint64_t cgen_var_224 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2893 | stream->putBe64(cgen_var_224); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2894 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2895 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2896 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2897 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2898 | resources->destroyMapping()->mapHandles_VkQueryPool((VkQueryPool*)&queryPool); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2899 | } |
| 2900 | |
| 2901 | VkResult VkEncoder::vkGetQueryPoolResults( |
| 2902 | VkDevice device, |
| 2903 | VkQueryPool queryPool, |
| 2904 | uint32_t firstQuery, |
| 2905 | uint32_t queryCount, |
| 2906 | size_t dataSize, |
| 2907 | void* pData, |
| 2908 | VkDeviceSize stride, |
| 2909 | VkQueryResultFlags flags) |
| 2910 | { |
| 2911 | auto stream = mImpl->stream(); |
| 2912 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2913 | auto resources = mImpl->resources(); |
| 2914 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2915 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2916 | VkDevice local_device; |
| 2917 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2918 | VkQueryPool local_queryPool; |
| 2919 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2920 | uint32_t local_firstQuery; |
| 2921 | local_firstQuery = firstQuery; |
| 2922 | uint32_t local_queryCount; |
| 2923 | local_queryCount = queryCount; |
| 2924 | size_t local_dataSize; |
| 2925 | local_dataSize = dataSize; |
| 2926 | VkDeviceSize local_stride; |
| 2927 | local_stride = stride; |
| 2928 | VkQueryResultFlags local_flags; |
| 2929 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2930 | countingStream->rewind(); |
| 2931 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2932 | uint64_t cgen_var_225; |
| 2933 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_225, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2934 | countingStream->write((uint64_t*)&cgen_var_225, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2935 | uint64_t cgen_var_226; |
| 2936 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_226, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2937 | countingStream->write((uint64_t*)&cgen_var_226, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2938 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 2939 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| 2940 | countingStream->write((size_t*)&local_dataSize, sizeof(size_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2941 | countingStream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2942 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 2943 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2944 | } |
| 2945 | uint32_t packetSize_vkGetQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2946 | countingStream->rewind(); |
| 2947 | uint32_t opcode_vkGetQueryPoolResults = OP_vkGetQueryPoolResults; |
| 2948 | stream->write(&opcode_vkGetQueryPoolResults, sizeof(uint32_t)); |
| 2949 | stream->write(&packetSize_vkGetQueryPoolResults, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2950 | uint64_t cgen_var_227; |
| 2951 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_227, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2952 | stream->write((uint64_t*)&cgen_var_227, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2953 | uint64_t cgen_var_228; |
| 2954 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_228, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2955 | stream->write((uint64_t*)&cgen_var_228, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2956 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 2957 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| 2958 | stream->write((size_t*)&local_dataSize, sizeof(size_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2959 | stream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2960 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 2961 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2962 | stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| 2963 | VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0; |
| 2964 | stream->read(&vkGetQueryPoolResults_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2965 | countingStream->clearPool(); |
| 2966 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2967 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2968 | return vkGetQueryPoolResults_VkResult_return; |
| 2969 | } |
| 2970 | |
| 2971 | VkResult VkEncoder::vkCreateBuffer( |
| 2972 | VkDevice device, |
| 2973 | const VkBufferCreateInfo* pCreateInfo, |
| 2974 | const VkAllocationCallbacks* pAllocator, |
| 2975 | VkBuffer* pBuffer) |
| 2976 | { |
| 2977 | auto stream = mImpl->stream(); |
| 2978 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2979 | auto resources = mImpl->resources(); |
| 2980 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 2981 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2982 | VkDevice local_device; |
| 2983 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2984 | VkBufferCreateInfo* local_pCreateInfo; |
| 2985 | local_pCreateInfo = nullptr; |
| 2986 | if (pCreateInfo) |
| 2987 | { |
| 2988 | local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo)); |
| 2989 | deepcopy_VkBufferCreateInfo(pool, pCreateInfo, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 2990 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2991 | VkAllocationCallbacks* local_pAllocator; |
| 2992 | local_pAllocator = nullptr; |
| 2993 | if (pAllocator) |
| 2994 | { |
| 2995 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2996 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2997 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2998 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2999 | countingStream->rewind(); |
| 3000 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3001 | uint64_t cgen_var_229; |
| 3002 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_229, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3003 | countingStream->write((uint64_t*)&cgen_var_229, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3004 | marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3005 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3006 | uint64_t cgen_var_230 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3007 | countingStream->putBe64(cgen_var_230); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3008 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3009 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3010 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3011 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3012 | uint64_t cgen_var_231; |
| 3013 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_231, 1); |
| 3014 | countingStream->write((uint64_t*)&cgen_var_231, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3015 | } |
| 3016 | uint32_t packetSize_vkCreateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3017 | countingStream->rewind(); |
| 3018 | uint32_t opcode_vkCreateBuffer = OP_vkCreateBuffer; |
| 3019 | stream->write(&opcode_vkCreateBuffer, sizeof(uint32_t)); |
| 3020 | stream->write(&packetSize_vkCreateBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3021 | uint64_t cgen_var_232; |
| 3022 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_232, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3023 | stream->write((uint64_t*)&cgen_var_232, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3024 | marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3025 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3026 | uint64_t cgen_var_233 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3027 | stream->putBe64(cgen_var_233); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3028 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3029 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3030 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3031 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3032 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3033 | uint64_t cgen_var_234; |
| 3034 | stream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_234, 1); |
| 3035 | stream->write((uint64_t*)&cgen_var_234, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3036 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3037 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3038 | uint64_t cgen_var_235; |
| 3039 | stream->read((uint64_t*)&cgen_var_235, 8); |
| 3040 | stream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_235, (VkBuffer*)pBuffer, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3041 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3042 | VkResult vkCreateBuffer_VkResult_return = (VkResult)0; |
| 3043 | stream->read(&vkCreateBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3044 | countingStream->clearPool(); |
| 3045 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3046 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3047 | return vkCreateBuffer_VkResult_return; |
| 3048 | } |
| 3049 | |
| 3050 | void VkEncoder::vkDestroyBuffer( |
| 3051 | VkDevice device, |
| 3052 | VkBuffer buffer, |
| 3053 | const VkAllocationCallbacks* pAllocator) |
| 3054 | { |
| 3055 | auto stream = mImpl->stream(); |
| 3056 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3057 | auto resources = mImpl->resources(); |
| 3058 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3059 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3060 | VkDevice local_device; |
| 3061 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3062 | VkBuffer local_buffer; |
| 3063 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3064 | VkAllocationCallbacks* local_pAllocator; |
| 3065 | local_pAllocator = nullptr; |
| 3066 | if (pAllocator) |
| 3067 | { |
| 3068 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3069 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3070 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3071 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3072 | countingStream->rewind(); |
| 3073 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3074 | uint64_t cgen_var_236; |
| 3075 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_236, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3076 | countingStream->write((uint64_t*)&cgen_var_236, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3077 | uint64_t cgen_var_237; |
| 3078 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_237, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3079 | countingStream->write((uint64_t*)&cgen_var_237, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3080 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3081 | uint64_t cgen_var_238 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3082 | countingStream->putBe64(cgen_var_238); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3083 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3084 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3085 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3086 | } |
| 3087 | } |
| 3088 | uint32_t packetSize_vkDestroyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3089 | countingStream->rewind(); |
| 3090 | uint32_t opcode_vkDestroyBuffer = OP_vkDestroyBuffer; |
| 3091 | stream->write(&opcode_vkDestroyBuffer, sizeof(uint32_t)); |
| 3092 | stream->write(&packetSize_vkDestroyBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3093 | uint64_t cgen_var_239; |
| 3094 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_239, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3095 | stream->write((uint64_t*)&cgen_var_239, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3096 | uint64_t cgen_var_240; |
| 3097 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_240, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3098 | stream->write((uint64_t*)&cgen_var_240, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3099 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3100 | uint64_t cgen_var_241 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3101 | stream->putBe64(cgen_var_241); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3102 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3103 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3104 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3105 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3106 | resources->destroyMapping()->mapHandles_VkBuffer((VkBuffer*)&buffer); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3107 | } |
| 3108 | |
| 3109 | VkResult VkEncoder::vkCreateBufferView( |
| 3110 | VkDevice device, |
| 3111 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3112 | const VkAllocationCallbacks* pAllocator, |
| 3113 | VkBufferView* pView) |
| 3114 | { |
| 3115 | auto stream = mImpl->stream(); |
| 3116 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3117 | auto resources = mImpl->resources(); |
| 3118 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3119 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3120 | VkDevice local_device; |
| 3121 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3122 | VkBufferViewCreateInfo* local_pCreateInfo; |
| 3123 | local_pCreateInfo = nullptr; |
| 3124 | if (pCreateInfo) |
| 3125 | { |
| 3126 | local_pCreateInfo = (VkBufferViewCreateInfo*)pool->alloc(sizeof(const VkBufferViewCreateInfo)); |
| 3127 | deepcopy_VkBufferViewCreateInfo(pool, pCreateInfo, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| 3128 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3129 | VkAllocationCallbacks* local_pAllocator; |
| 3130 | local_pAllocator = nullptr; |
| 3131 | if (pAllocator) |
| 3132 | { |
| 3133 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3134 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3135 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3136 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3137 | countingStream->rewind(); |
| 3138 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3139 | uint64_t cgen_var_242; |
| 3140 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_242, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3141 | countingStream->write((uint64_t*)&cgen_var_242, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3142 | marshal_VkBufferViewCreateInfo(countingStream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3143 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3144 | uint64_t cgen_var_243 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3145 | countingStream->putBe64(cgen_var_243); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3146 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3147 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3148 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3149 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3150 | uint64_t cgen_var_244; |
| 3151 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_244, 1); |
| 3152 | countingStream->write((uint64_t*)&cgen_var_244, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3153 | } |
| 3154 | uint32_t packetSize_vkCreateBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3155 | countingStream->rewind(); |
| 3156 | uint32_t opcode_vkCreateBufferView = OP_vkCreateBufferView; |
| 3157 | stream->write(&opcode_vkCreateBufferView, sizeof(uint32_t)); |
| 3158 | stream->write(&packetSize_vkCreateBufferView, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3159 | uint64_t cgen_var_245; |
| 3160 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_245, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3161 | stream->write((uint64_t*)&cgen_var_245, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3162 | marshal_VkBufferViewCreateInfo(stream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3163 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3164 | uint64_t cgen_var_246 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3165 | stream->putBe64(cgen_var_246); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3166 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3167 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3168 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3169 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3170 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3171 | uint64_t cgen_var_247; |
| 3172 | stream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_247, 1); |
| 3173 | stream->write((uint64_t*)&cgen_var_247, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3174 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3175 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3176 | uint64_t cgen_var_248; |
| 3177 | stream->read((uint64_t*)&cgen_var_248, 8); |
| 3178 | stream->handleMapping()->mapHandles_u64_VkBufferView(&cgen_var_248, (VkBufferView*)pView, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3179 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3180 | VkResult vkCreateBufferView_VkResult_return = (VkResult)0; |
| 3181 | stream->read(&vkCreateBufferView_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3182 | countingStream->clearPool(); |
| 3183 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3184 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3185 | return vkCreateBufferView_VkResult_return; |
| 3186 | } |
| 3187 | |
| 3188 | void VkEncoder::vkDestroyBufferView( |
| 3189 | VkDevice device, |
| 3190 | VkBufferView bufferView, |
| 3191 | const VkAllocationCallbacks* pAllocator) |
| 3192 | { |
| 3193 | auto stream = mImpl->stream(); |
| 3194 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3195 | auto resources = mImpl->resources(); |
| 3196 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3197 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3198 | VkDevice local_device; |
| 3199 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3200 | VkBufferView local_bufferView; |
| 3201 | local_bufferView = bufferView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3202 | VkAllocationCallbacks* local_pAllocator; |
| 3203 | local_pAllocator = nullptr; |
| 3204 | if (pAllocator) |
| 3205 | { |
| 3206 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3207 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3208 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3209 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3210 | countingStream->rewind(); |
| 3211 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3212 | uint64_t cgen_var_249; |
| 3213 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_249, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3214 | countingStream->write((uint64_t*)&cgen_var_249, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3215 | uint64_t cgen_var_250; |
| 3216 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_250, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3217 | countingStream->write((uint64_t*)&cgen_var_250, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3218 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3219 | uint64_t cgen_var_251 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3220 | countingStream->putBe64(cgen_var_251); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3221 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3222 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3223 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3224 | } |
| 3225 | } |
| 3226 | uint32_t packetSize_vkDestroyBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3227 | countingStream->rewind(); |
| 3228 | uint32_t opcode_vkDestroyBufferView = OP_vkDestroyBufferView; |
| 3229 | stream->write(&opcode_vkDestroyBufferView, sizeof(uint32_t)); |
| 3230 | stream->write(&packetSize_vkDestroyBufferView, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3231 | uint64_t cgen_var_252; |
| 3232 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_252, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3233 | stream->write((uint64_t*)&cgen_var_252, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3234 | uint64_t cgen_var_253; |
| 3235 | stream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_253, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3236 | stream->write((uint64_t*)&cgen_var_253, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3237 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3238 | uint64_t cgen_var_254 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3239 | stream->putBe64(cgen_var_254); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3240 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3241 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3242 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(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 | resources->destroyMapping()->mapHandles_VkBufferView((VkBufferView*)&bufferView); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3245 | } |
| 3246 | |
| 3247 | VkResult VkEncoder::vkCreateImage( |
| 3248 | VkDevice device, |
| 3249 | const VkImageCreateInfo* pCreateInfo, |
| 3250 | const VkAllocationCallbacks* pAllocator, |
| 3251 | VkImage* pImage) |
| 3252 | { |
| 3253 | auto stream = mImpl->stream(); |
| 3254 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3255 | auto resources = mImpl->resources(); |
| 3256 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3257 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3258 | VkDevice local_device; |
| 3259 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3260 | VkImageCreateInfo* local_pCreateInfo; |
| 3261 | local_pCreateInfo = nullptr; |
| 3262 | if (pCreateInfo) |
| 3263 | { |
| 3264 | local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo)); |
| 3265 | deepcopy_VkImageCreateInfo(pool, pCreateInfo, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 3266 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3267 | VkAllocationCallbacks* local_pAllocator; |
| 3268 | local_pAllocator = nullptr; |
| 3269 | if (pAllocator) |
| 3270 | { |
| 3271 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3272 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3273 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3274 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3275 | countingStream->rewind(); |
| 3276 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3277 | uint64_t cgen_var_255; |
| 3278 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_255, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3279 | countingStream->write((uint64_t*)&cgen_var_255, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3280 | marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3281 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3282 | uint64_t cgen_var_256 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3283 | countingStream->putBe64(cgen_var_256); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3284 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3285 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3286 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3287 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3288 | uint64_t cgen_var_257; |
| 3289 | countingStream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_257, 1); |
| 3290 | countingStream->write((uint64_t*)&cgen_var_257, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3291 | } |
| 3292 | uint32_t packetSize_vkCreateImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3293 | countingStream->rewind(); |
| 3294 | uint32_t opcode_vkCreateImage = OP_vkCreateImage; |
| 3295 | stream->write(&opcode_vkCreateImage, sizeof(uint32_t)); |
| 3296 | stream->write(&packetSize_vkCreateImage, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3297 | uint64_t cgen_var_258; |
| 3298 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_258, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3299 | stream->write((uint64_t*)&cgen_var_258, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3300 | marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3301 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3302 | uint64_t cgen_var_259 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3303 | stream->putBe64(cgen_var_259); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 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(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3307 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3308 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3309 | uint64_t cgen_var_260; |
| 3310 | stream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_260, 1); |
| 3311 | stream->write((uint64_t*)&cgen_var_260, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3312 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3313 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3314 | uint64_t cgen_var_261; |
| 3315 | stream->read((uint64_t*)&cgen_var_261, 8); |
| 3316 | stream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_261, (VkImage*)pImage, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3317 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3318 | VkResult vkCreateImage_VkResult_return = (VkResult)0; |
| 3319 | stream->read(&vkCreateImage_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3320 | countingStream->clearPool(); |
| 3321 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3322 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3323 | return vkCreateImage_VkResult_return; |
| 3324 | } |
| 3325 | |
| 3326 | void VkEncoder::vkDestroyImage( |
| 3327 | VkDevice device, |
| 3328 | VkImage image, |
| 3329 | const VkAllocationCallbacks* pAllocator) |
| 3330 | { |
| 3331 | auto stream = mImpl->stream(); |
| 3332 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3333 | auto resources = mImpl->resources(); |
| 3334 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3335 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3336 | VkDevice local_device; |
| 3337 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3338 | VkImage local_image; |
| 3339 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3340 | VkAllocationCallbacks* local_pAllocator; |
| 3341 | local_pAllocator = nullptr; |
| 3342 | if (pAllocator) |
| 3343 | { |
| 3344 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3345 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3346 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3347 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3348 | countingStream->rewind(); |
| 3349 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3350 | uint64_t cgen_var_262; |
| 3351 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_262, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3352 | countingStream->write((uint64_t*)&cgen_var_262, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3353 | uint64_t cgen_var_263; |
| 3354 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_263, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3355 | countingStream->write((uint64_t*)&cgen_var_263, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3356 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3357 | uint64_t cgen_var_264 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3358 | countingStream->putBe64(cgen_var_264); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3359 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3360 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3361 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3362 | } |
| 3363 | } |
| 3364 | uint32_t packetSize_vkDestroyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3365 | countingStream->rewind(); |
| 3366 | uint32_t opcode_vkDestroyImage = OP_vkDestroyImage; |
| 3367 | stream->write(&opcode_vkDestroyImage, sizeof(uint32_t)); |
| 3368 | stream->write(&packetSize_vkDestroyImage, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3369 | uint64_t cgen_var_265; |
| 3370 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_265, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3371 | stream->write((uint64_t*)&cgen_var_265, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3372 | uint64_t cgen_var_266; |
| 3373 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_266, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3374 | stream->write((uint64_t*)&cgen_var_266, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3375 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3376 | uint64_t cgen_var_267 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3377 | stream->putBe64(cgen_var_267); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3378 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3379 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3380 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3381 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3382 | resources->destroyMapping()->mapHandles_VkImage((VkImage*)&image); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3383 | } |
| 3384 | |
| 3385 | void VkEncoder::vkGetImageSubresourceLayout( |
| 3386 | VkDevice device, |
| 3387 | VkImage image, |
| 3388 | const VkImageSubresource* pSubresource, |
| 3389 | VkSubresourceLayout* pLayout) |
| 3390 | { |
| 3391 | auto stream = mImpl->stream(); |
| 3392 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3393 | auto resources = mImpl->resources(); |
| 3394 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3395 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3396 | VkDevice local_device; |
| 3397 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3398 | VkImage local_image; |
| 3399 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3400 | VkImageSubresource* local_pSubresource; |
| 3401 | local_pSubresource = nullptr; |
| 3402 | if (pSubresource) |
| 3403 | { |
| 3404 | local_pSubresource = (VkImageSubresource*)pool->alloc(sizeof(const VkImageSubresource)); |
| 3405 | deepcopy_VkImageSubresource(pool, pSubresource, (VkImageSubresource*)(local_pSubresource)); |
| 3406 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3407 | countingStream->rewind(); |
| 3408 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3409 | uint64_t cgen_var_268; |
| 3410 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_268, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3411 | countingStream->write((uint64_t*)&cgen_var_268, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3412 | uint64_t cgen_var_269; |
| 3413 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_269, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3414 | countingStream->write((uint64_t*)&cgen_var_269, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3415 | marshal_VkImageSubresource(countingStream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3416 | marshal_VkSubresourceLayout(countingStream, (VkSubresourceLayout*)(pLayout)); |
| 3417 | } |
| 3418 | uint32_t packetSize_vkGetImageSubresourceLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3419 | countingStream->rewind(); |
| 3420 | uint32_t opcode_vkGetImageSubresourceLayout = OP_vkGetImageSubresourceLayout; |
| 3421 | stream->write(&opcode_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| 3422 | stream->write(&packetSize_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3423 | uint64_t cgen_var_270; |
| 3424 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_270, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3425 | stream->write((uint64_t*)&cgen_var_270, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3426 | uint64_t cgen_var_271; |
| 3427 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_271, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3428 | stream->write((uint64_t*)&cgen_var_271, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3429 | marshal_VkImageSubresource(stream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3430 | marshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| 3431 | unmarshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| 3432 | } |
| 3433 | |
| 3434 | VkResult VkEncoder::vkCreateImageView( |
| 3435 | VkDevice device, |
| 3436 | const VkImageViewCreateInfo* pCreateInfo, |
| 3437 | const VkAllocationCallbacks* pAllocator, |
| 3438 | VkImageView* pView) |
| 3439 | { |
| 3440 | auto stream = mImpl->stream(); |
| 3441 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3442 | auto resources = mImpl->resources(); |
| 3443 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3444 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3445 | VkDevice local_device; |
| 3446 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3447 | VkImageViewCreateInfo* local_pCreateInfo; |
| 3448 | local_pCreateInfo = nullptr; |
| 3449 | if (pCreateInfo) |
| 3450 | { |
| 3451 | local_pCreateInfo = (VkImageViewCreateInfo*)pool->alloc(sizeof(const VkImageViewCreateInfo)); |
| 3452 | deepcopy_VkImageViewCreateInfo(pool, pCreateInfo, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| 3453 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3454 | VkAllocationCallbacks* local_pAllocator; |
| 3455 | local_pAllocator = nullptr; |
| 3456 | if (pAllocator) |
| 3457 | { |
| 3458 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3459 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3460 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3461 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3462 | countingStream->rewind(); |
| 3463 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3464 | uint64_t cgen_var_272; |
| 3465 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_272, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3466 | countingStream->write((uint64_t*)&cgen_var_272, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3467 | marshal_VkImageViewCreateInfo(countingStream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3468 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3469 | uint64_t cgen_var_273 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3470 | countingStream->putBe64(cgen_var_273); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3471 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3472 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3473 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3474 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3475 | uint64_t cgen_var_274; |
| 3476 | countingStream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_274, 1); |
| 3477 | countingStream->write((uint64_t*)&cgen_var_274, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3478 | } |
| 3479 | uint32_t packetSize_vkCreateImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3480 | countingStream->rewind(); |
| 3481 | uint32_t opcode_vkCreateImageView = OP_vkCreateImageView; |
| 3482 | stream->write(&opcode_vkCreateImageView, sizeof(uint32_t)); |
| 3483 | stream->write(&packetSize_vkCreateImageView, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3484 | uint64_t cgen_var_275; |
| 3485 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_275, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3486 | stream->write((uint64_t*)&cgen_var_275, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3487 | marshal_VkImageViewCreateInfo(stream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3488 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3489 | uint64_t cgen_var_276 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3490 | stream->putBe64(cgen_var_276); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3491 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3492 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3493 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3494 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3495 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3496 | uint64_t cgen_var_277; |
| 3497 | stream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_277, 1); |
| 3498 | stream->write((uint64_t*)&cgen_var_277, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3499 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3500 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3501 | uint64_t cgen_var_278; |
| 3502 | stream->read((uint64_t*)&cgen_var_278, 8); |
| 3503 | stream->handleMapping()->mapHandles_u64_VkImageView(&cgen_var_278, (VkImageView*)pView, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3504 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3505 | VkResult vkCreateImageView_VkResult_return = (VkResult)0; |
| 3506 | stream->read(&vkCreateImageView_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3507 | countingStream->clearPool(); |
| 3508 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3509 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3510 | return vkCreateImageView_VkResult_return; |
| 3511 | } |
| 3512 | |
| 3513 | void VkEncoder::vkDestroyImageView( |
| 3514 | VkDevice device, |
| 3515 | VkImageView imageView, |
| 3516 | const VkAllocationCallbacks* pAllocator) |
| 3517 | { |
| 3518 | auto stream = mImpl->stream(); |
| 3519 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3520 | auto resources = mImpl->resources(); |
| 3521 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3522 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3523 | VkDevice local_device; |
| 3524 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3525 | VkImageView local_imageView; |
| 3526 | local_imageView = imageView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3527 | VkAllocationCallbacks* local_pAllocator; |
| 3528 | local_pAllocator = nullptr; |
| 3529 | if (pAllocator) |
| 3530 | { |
| 3531 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3532 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3533 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3534 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3535 | countingStream->rewind(); |
| 3536 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3537 | uint64_t cgen_var_279; |
| 3538 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_279, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3539 | countingStream->write((uint64_t*)&cgen_var_279, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3540 | uint64_t cgen_var_280; |
| 3541 | countingStream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_280, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3542 | countingStream->write((uint64_t*)&cgen_var_280, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3543 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3544 | uint64_t cgen_var_281 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3545 | countingStream->putBe64(cgen_var_281); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3546 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3547 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3548 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3549 | } |
| 3550 | } |
| 3551 | uint32_t packetSize_vkDestroyImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3552 | countingStream->rewind(); |
| 3553 | uint32_t opcode_vkDestroyImageView = OP_vkDestroyImageView; |
| 3554 | stream->write(&opcode_vkDestroyImageView, sizeof(uint32_t)); |
| 3555 | stream->write(&packetSize_vkDestroyImageView, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3556 | uint64_t cgen_var_282; |
| 3557 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_282, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3558 | stream->write((uint64_t*)&cgen_var_282, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3559 | uint64_t cgen_var_283; |
| 3560 | stream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_283, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3561 | stream->write((uint64_t*)&cgen_var_283, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3562 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3563 | uint64_t cgen_var_284 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3564 | stream->putBe64(cgen_var_284); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3565 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3566 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3567 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3568 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3569 | resources->destroyMapping()->mapHandles_VkImageView((VkImageView*)&imageView); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3570 | } |
| 3571 | |
| 3572 | VkResult VkEncoder::vkCreateShaderModule( |
| 3573 | VkDevice device, |
| 3574 | const VkShaderModuleCreateInfo* pCreateInfo, |
| 3575 | const VkAllocationCallbacks* pAllocator, |
| 3576 | VkShaderModule* pShaderModule) |
| 3577 | { |
| 3578 | auto stream = mImpl->stream(); |
| 3579 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3580 | auto resources = mImpl->resources(); |
| 3581 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3582 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3583 | VkDevice local_device; |
| 3584 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3585 | VkShaderModuleCreateInfo* local_pCreateInfo; |
| 3586 | local_pCreateInfo = nullptr; |
| 3587 | if (pCreateInfo) |
| 3588 | { |
| 3589 | local_pCreateInfo = (VkShaderModuleCreateInfo*)pool->alloc(sizeof(const VkShaderModuleCreateInfo)); |
| 3590 | deepcopy_VkShaderModuleCreateInfo(pool, pCreateInfo, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| 3591 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3592 | VkAllocationCallbacks* local_pAllocator; |
| 3593 | local_pAllocator = nullptr; |
| 3594 | if (pAllocator) |
| 3595 | { |
| 3596 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3597 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3598 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3599 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3600 | countingStream->rewind(); |
| 3601 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3602 | uint64_t cgen_var_285; |
| 3603 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_285, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3604 | countingStream->write((uint64_t*)&cgen_var_285, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3605 | marshal_VkShaderModuleCreateInfo(countingStream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3606 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3607 | uint64_t cgen_var_286 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3608 | countingStream->putBe64(cgen_var_286); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3609 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3610 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3611 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3612 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3613 | uint64_t cgen_var_287; |
| 3614 | countingStream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_287, 1); |
| 3615 | countingStream->write((uint64_t*)&cgen_var_287, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3616 | } |
| 3617 | uint32_t packetSize_vkCreateShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3618 | countingStream->rewind(); |
| 3619 | uint32_t opcode_vkCreateShaderModule = OP_vkCreateShaderModule; |
| 3620 | stream->write(&opcode_vkCreateShaderModule, sizeof(uint32_t)); |
| 3621 | stream->write(&packetSize_vkCreateShaderModule, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3622 | uint64_t cgen_var_288; |
| 3623 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_288, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3624 | stream->write((uint64_t*)&cgen_var_288, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3625 | marshal_VkShaderModuleCreateInfo(stream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3626 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3627 | uint64_t cgen_var_289 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3628 | stream->putBe64(cgen_var_289); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3629 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3630 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3631 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3632 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3633 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3634 | uint64_t cgen_var_290; |
| 3635 | stream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_290, 1); |
| 3636 | stream->write((uint64_t*)&cgen_var_290, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3637 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3638 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3639 | uint64_t cgen_var_291; |
| 3640 | stream->read((uint64_t*)&cgen_var_291, 8); |
| 3641 | stream->handleMapping()->mapHandles_u64_VkShaderModule(&cgen_var_291, (VkShaderModule*)pShaderModule, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3642 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3643 | VkResult vkCreateShaderModule_VkResult_return = (VkResult)0; |
| 3644 | stream->read(&vkCreateShaderModule_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3645 | countingStream->clearPool(); |
| 3646 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3647 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3648 | return vkCreateShaderModule_VkResult_return; |
| 3649 | } |
| 3650 | |
| 3651 | void VkEncoder::vkDestroyShaderModule( |
| 3652 | VkDevice device, |
| 3653 | VkShaderModule shaderModule, |
| 3654 | const VkAllocationCallbacks* pAllocator) |
| 3655 | { |
| 3656 | auto stream = mImpl->stream(); |
| 3657 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3658 | auto resources = mImpl->resources(); |
| 3659 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3660 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3661 | VkDevice local_device; |
| 3662 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3663 | VkShaderModule local_shaderModule; |
| 3664 | local_shaderModule = shaderModule; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3665 | VkAllocationCallbacks* local_pAllocator; |
| 3666 | local_pAllocator = nullptr; |
| 3667 | if (pAllocator) |
| 3668 | { |
| 3669 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3670 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3671 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3672 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3673 | countingStream->rewind(); |
| 3674 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3675 | uint64_t cgen_var_292; |
| 3676 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_292, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3677 | countingStream->write((uint64_t*)&cgen_var_292, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3678 | uint64_t cgen_var_293; |
| 3679 | countingStream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_293, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3680 | countingStream->write((uint64_t*)&cgen_var_293, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3681 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3682 | uint64_t cgen_var_294 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3683 | countingStream->putBe64(cgen_var_294); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3684 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3685 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3686 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3687 | } |
| 3688 | } |
| 3689 | uint32_t packetSize_vkDestroyShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3690 | countingStream->rewind(); |
| 3691 | uint32_t opcode_vkDestroyShaderModule = OP_vkDestroyShaderModule; |
| 3692 | stream->write(&opcode_vkDestroyShaderModule, sizeof(uint32_t)); |
| 3693 | stream->write(&packetSize_vkDestroyShaderModule, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3694 | uint64_t cgen_var_295; |
| 3695 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_295, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3696 | stream->write((uint64_t*)&cgen_var_295, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3697 | uint64_t cgen_var_296; |
| 3698 | stream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_296, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3699 | stream->write((uint64_t*)&cgen_var_296, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3700 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3701 | uint64_t cgen_var_297 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3702 | stream->putBe64(cgen_var_297); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3703 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3704 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3705 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3706 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3707 | resources->destroyMapping()->mapHandles_VkShaderModule((VkShaderModule*)&shaderModule); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3708 | } |
| 3709 | |
| 3710 | VkResult VkEncoder::vkCreatePipelineCache( |
| 3711 | VkDevice device, |
| 3712 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 3713 | const VkAllocationCallbacks* pAllocator, |
| 3714 | VkPipelineCache* pPipelineCache) |
| 3715 | { |
| 3716 | auto stream = mImpl->stream(); |
| 3717 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3718 | auto resources = mImpl->resources(); |
| 3719 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3720 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3721 | VkDevice local_device; |
| 3722 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3723 | VkPipelineCacheCreateInfo* local_pCreateInfo; |
| 3724 | local_pCreateInfo = nullptr; |
| 3725 | if (pCreateInfo) |
| 3726 | { |
| 3727 | local_pCreateInfo = (VkPipelineCacheCreateInfo*)pool->alloc(sizeof(const VkPipelineCacheCreateInfo)); |
| 3728 | deepcopy_VkPipelineCacheCreateInfo(pool, pCreateInfo, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| 3729 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3730 | VkAllocationCallbacks* local_pAllocator; |
| 3731 | local_pAllocator = nullptr; |
| 3732 | if (pAllocator) |
| 3733 | { |
| 3734 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3735 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3736 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3737 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3738 | countingStream->rewind(); |
| 3739 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3740 | uint64_t cgen_var_298; |
| 3741 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_298, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3742 | countingStream->write((uint64_t*)&cgen_var_298, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3743 | marshal_VkPipelineCacheCreateInfo(countingStream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3744 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3745 | uint64_t cgen_var_299 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3746 | countingStream->putBe64(cgen_var_299); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3747 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3748 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3749 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3750 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3751 | uint64_t cgen_var_300; |
| 3752 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_300, 1); |
| 3753 | countingStream->write((uint64_t*)&cgen_var_300, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3754 | } |
| 3755 | uint32_t packetSize_vkCreatePipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3756 | countingStream->rewind(); |
| 3757 | uint32_t opcode_vkCreatePipelineCache = OP_vkCreatePipelineCache; |
| 3758 | stream->write(&opcode_vkCreatePipelineCache, sizeof(uint32_t)); |
| 3759 | stream->write(&packetSize_vkCreatePipelineCache, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3760 | uint64_t cgen_var_301; |
| 3761 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_301, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3762 | stream->write((uint64_t*)&cgen_var_301, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3763 | marshal_VkPipelineCacheCreateInfo(stream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3764 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3765 | uint64_t cgen_var_302 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3766 | stream->putBe64(cgen_var_302); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3767 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3768 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3769 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3770 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3771 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3772 | uint64_t cgen_var_303; |
| 3773 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_303, 1); |
| 3774 | stream->write((uint64_t*)&cgen_var_303, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3775 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3776 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3777 | uint64_t cgen_var_304; |
| 3778 | stream->read((uint64_t*)&cgen_var_304, 8); |
| 3779 | stream->handleMapping()->mapHandles_u64_VkPipelineCache(&cgen_var_304, (VkPipelineCache*)pPipelineCache, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3780 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3781 | VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0; |
| 3782 | stream->read(&vkCreatePipelineCache_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3783 | countingStream->clearPool(); |
| 3784 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3785 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3786 | return vkCreatePipelineCache_VkResult_return; |
| 3787 | } |
| 3788 | |
| 3789 | void VkEncoder::vkDestroyPipelineCache( |
| 3790 | VkDevice device, |
| 3791 | VkPipelineCache pipelineCache, |
| 3792 | const VkAllocationCallbacks* pAllocator) |
| 3793 | { |
| 3794 | auto stream = mImpl->stream(); |
| 3795 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3796 | auto resources = mImpl->resources(); |
| 3797 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3798 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3799 | VkDevice local_device; |
| 3800 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3801 | VkPipelineCache local_pipelineCache; |
| 3802 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3803 | VkAllocationCallbacks* local_pAllocator; |
| 3804 | local_pAllocator = nullptr; |
| 3805 | if (pAllocator) |
| 3806 | { |
| 3807 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3808 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3809 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3810 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3811 | countingStream->rewind(); |
| 3812 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3813 | uint64_t cgen_var_305; |
| 3814 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_305, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3815 | countingStream->write((uint64_t*)&cgen_var_305, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3816 | uint64_t cgen_var_306; |
| 3817 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_306, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3818 | countingStream->write((uint64_t*)&cgen_var_306, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3819 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3820 | uint64_t cgen_var_307 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3821 | countingStream->putBe64(cgen_var_307); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3822 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3823 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3824 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3825 | } |
| 3826 | } |
| 3827 | uint32_t packetSize_vkDestroyPipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3828 | countingStream->rewind(); |
| 3829 | uint32_t opcode_vkDestroyPipelineCache = OP_vkDestroyPipelineCache; |
| 3830 | stream->write(&opcode_vkDestroyPipelineCache, sizeof(uint32_t)); |
| 3831 | stream->write(&packetSize_vkDestroyPipelineCache, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3832 | uint64_t cgen_var_308; |
| 3833 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_308, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3834 | stream->write((uint64_t*)&cgen_var_308, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3835 | uint64_t cgen_var_309; |
| 3836 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_309, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3837 | stream->write((uint64_t*)&cgen_var_309, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3838 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3839 | uint64_t cgen_var_310 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3840 | stream->putBe64(cgen_var_310); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3841 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3842 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3843 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3844 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3845 | resources->destroyMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&pipelineCache); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3846 | } |
| 3847 | |
| 3848 | VkResult VkEncoder::vkGetPipelineCacheData( |
| 3849 | VkDevice device, |
| 3850 | VkPipelineCache pipelineCache, |
| 3851 | size_t* pDataSize, |
| 3852 | void* pData) |
| 3853 | { |
| 3854 | auto stream = mImpl->stream(); |
| 3855 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3856 | auto resources = mImpl->resources(); |
| 3857 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3858 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3859 | VkDevice local_device; |
| 3860 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3861 | VkPipelineCache local_pipelineCache; |
| 3862 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3863 | countingStream->rewind(); |
| 3864 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3865 | uint64_t cgen_var_311; |
| 3866 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_311, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3867 | countingStream->write((uint64_t*)&cgen_var_311, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3868 | uint64_t cgen_var_312; |
| 3869 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_312, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3870 | countingStream->write((uint64_t*)&cgen_var_312, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3871 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3872 | uint64_t cgen_var_313 = (uint64_t)(uintptr_t)pDataSize; |
| 3873 | countingStream->putBe64(cgen_var_313); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3874 | if (pDataSize) |
| 3875 | { |
| 3876 | countingStream->write((size_t*)pDataSize, sizeof(size_t)); |
| 3877 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3878 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3879 | uint64_t cgen_var_314 = (uint64_t)(uintptr_t)pData; |
| 3880 | countingStream->putBe64(cgen_var_314); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3881 | if (pData) |
| 3882 | { |
| 3883 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 3884 | } |
| 3885 | } |
| 3886 | uint32_t packetSize_vkGetPipelineCacheData = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3887 | countingStream->rewind(); |
| 3888 | uint32_t opcode_vkGetPipelineCacheData = OP_vkGetPipelineCacheData; |
| 3889 | stream->write(&opcode_vkGetPipelineCacheData, sizeof(uint32_t)); |
| 3890 | stream->write(&packetSize_vkGetPipelineCacheData, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3891 | uint64_t cgen_var_315; |
| 3892 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_315, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3893 | stream->write((uint64_t*)&cgen_var_315, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3894 | uint64_t cgen_var_316; |
| 3895 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_316, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3896 | stream->write((uint64_t*)&cgen_var_316, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3897 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3898 | uint64_t cgen_var_317 = (uint64_t)(uintptr_t)pDataSize; |
| 3899 | stream->putBe64(cgen_var_317); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3900 | if (pDataSize) |
| 3901 | { |
| 3902 | stream->write((size_t*)pDataSize, sizeof(size_t)); |
| 3903 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3904 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3905 | uint64_t cgen_var_318 = (uint64_t)(uintptr_t)pData; |
| 3906 | stream->putBe64(cgen_var_318); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3907 | if (pData) |
| 3908 | { |
| 3909 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 3910 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3911 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3912 | size_t* check_pDataSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3913 | check_pDataSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3914 | if (pDataSize) |
| 3915 | { |
| 3916 | if (!(check_pDataSize)) |
| 3917 | { |
| 3918 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 3919 | } |
| 3920 | stream->read((size_t*)pDataSize, sizeof(size_t)); |
| 3921 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3922 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3923 | void* check_pData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3924 | check_pData = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3925 | if (pData) |
| 3926 | { |
| 3927 | if (!(check_pData)) |
| 3928 | { |
| 3929 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 3930 | } |
| 3931 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 3932 | } |
| 3933 | VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0; |
| 3934 | stream->read(&vkGetPipelineCacheData_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3935 | countingStream->clearPool(); |
| 3936 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3937 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3938 | return vkGetPipelineCacheData_VkResult_return; |
| 3939 | } |
| 3940 | |
| 3941 | VkResult VkEncoder::vkMergePipelineCaches( |
| 3942 | VkDevice device, |
| 3943 | VkPipelineCache dstCache, |
| 3944 | uint32_t srcCacheCount, |
| 3945 | const VkPipelineCache* pSrcCaches) |
| 3946 | { |
| 3947 | auto stream = mImpl->stream(); |
| 3948 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3949 | auto resources = mImpl->resources(); |
| 3950 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3951 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3952 | VkDevice local_device; |
| 3953 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3954 | VkPipelineCache local_dstCache; |
| 3955 | local_dstCache = dstCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3956 | uint32_t local_srcCacheCount; |
| 3957 | local_srcCacheCount = srcCacheCount; |
| 3958 | VkPipelineCache* local_pSrcCaches; |
| 3959 | local_pSrcCaches = nullptr; |
| 3960 | if (pSrcCaches) |
| 3961 | { |
| 3962 | local_pSrcCaches = (VkPipelineCache*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkPipelineCache)); |
| 3963 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3964 | countingStream->rewind(); |
| 3965 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3966 | uint64_t cgen_var_321; |
| 3967 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_321, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3968 | countingStream->write((uint64_t*)&cgen_var_321, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3969 | uint64_t cgen_var_322; |
| 3970 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_322, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3971 | countingStream->write((uint64_t*)&cgen_var_322, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3972 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3973 | if (((srcCacheCount))) |
| 3974 | { |
| 3975 | uint64_t* cgen_var_323; |
| 3976 | countingStream->alloc((void**)&cgen_var_323, ((srcCacheCount)) * 8); |
| 3977 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_323, ((srcCacheCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3978 | countingStream->write((uint64_t*)cgen_var_323, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3979 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3980 | } |
| 3981 | uint32_t packetSize_vkMergePipelineCaches = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3982 | countingStream->rewind(); |
| 3983 | uint32_t opcode_vkMergePipelineCaches = OP_vkMergePipelineCaches; |
| 3984 | stream->write(&opcode_vkMergePipelineCaches, sizeof(uint32_t)); |
| 3985 | stream->write(&packetSize_vkMergePipelineCaches, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3986 | uint64_t cgen_var_324; |
| 3987 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_324, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3988 | stream->write((uint64_t*)&cgen_var_324, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3989 | uint64_t cgen_var_325; |
| 3990 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_325, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3991 | stream->write((uint64_t*)&cgen_var_325, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3992 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3993 | if (((srcCacheCount))) |
| 3994 | { |
| 3995 | uint64_t* cgen_var_326; |
| 3996 | stream->alloc((void**)&cgen_var_326, ((srcCacheCount)) * 8); |
| 3997 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_326, ((srcCacheCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 3998 | stream->write((uint64_t*)cgen_var_326, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3999 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4000 | VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0; |
| 4001 | stream->read(&vkMergePipelineCaches_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4002 | countingStream->clearPool(); |
| 4003 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4004 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4005 | return vkMergePipelineCaches_VkResult_return; |
| 4006 | } |
| 4007 | |
| 4008 | VkResult VkEncoder::vkCreateGraphicsPipelines( |
| 4009 | VkDevice device, |
| 4010 | VkPipelineCache pipelineCache, |
| 4011 | uint32_t createInfoCount, |
| 4012 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 4013 | const VkAllocationCallbacks* pAllocator, |
| 4014 | VkPipeline* pPipelines) |
| 4015 | { |
| 4016 | auto stream = mImpl->stream(); |
| 4017 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4018 | auto resources = mImpl->resources(); |
| 4019 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4020 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4021 | VkDevice local_device; |
| 4022 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4023 | VkPipelineCache local_pipelineCache; |
| 4024 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4025 | uint32_t local_createInfoCount; |
| 4026 | local_createInfoCount = createInfoCount; |
| 4027 | VkGraphicsPipelineCreateInfo* local_pCreateInfos; |
| 4028 | local_pCreateInfos = nullptr; |
| 4029 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4030 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4031 | local_pCreateInfos = (VkGraphicsPipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkGraphicsPipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4032 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4033 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4034 | deepcopy_VkGraphicsPipelineCreateInfo(pool, pCreateInfos + i, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4035 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4036 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4037 | VkAllocationCallbacks* local_pAllocator; |
| 4038 | local_pAllocator = nullptr; |
| 4039 | if (pAllocator) |
| 4040 | { |
| 4041 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4042 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4043 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4044 | local_pAllocator = nullptr; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4045 | countingStream->rewind(); |
| 4046 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4047 | uint64_t cgen_var_327; |
| 4048 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_327, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4049 | countingStream->write((uint64_t*)&cgen_var_327, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4050 | uint64_t cgen_var_328; |
| 4051 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_328, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4052 | countingStream->write((uint64_t*)&cgen_var_328, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4053 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 4054 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4055 | { |
| 4056 | marshal_VkGraphicsPipelineCreateInfo(countingStream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| 4057 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4058 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4059 | uint64_t cgen_var_329 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4060 | countingStream->putBe64(cgen_var_329); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4061 | if (local_pAllocator) |
| 4062 | { |
| 4063 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4064 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4065 | if (((createInfoCount))) |
| 4066 | { |
| 4067 | uint64_t* cgen_var_330; |
| 4068 | countingStream->alloc((void**)&cgen_var_330, ((createInfoCount)) * 8); |
| 4069 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_330, ((createInfoCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4070 | countingStream->write((uint64_t*)cgen_var_330, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4071 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4072 | } |
| 4073 | uint32_t packetSize_vkCreateGraphicsPipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4074 | countingStream->rewind(); |
| 4075 | uint32_t opcode_vkCreateGraphicsPipelines = OP_vkCreateGraphicsPipelines; |
| 4076 | stream->write(&opcode_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| 4077 | stream->write(&packetSize_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4078 | uint64_t cgen_var_331; |
| 4079 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_331, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4080 | stream->write((uint64_t*)&cgen_var_331, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4081 | uint64_t cgen_var_332; |
| 4082 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_332, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4083 | stream->write((uint64_t*)&cgen_var_332, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4084 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4085 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4086 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4087 | marshal_VkGraphicsPipelineCreateInfo(stream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4088 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4089 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4090 | uint64_t cgen_var_333 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4091 | stream->putBe64(cgen_var_333); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4092 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4093 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4094 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4095 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4096 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4097 | if (((createInfoCount))) |
| 4098 | { |
| 4099 | uint64_t* cgen_var_334; |
| 4100 | stream->alloc((void**)&cgen_var_334, ((createInfoCount)) * 8); |
| 4101 | stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_334, ((createInfoCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4102 | stream->write((uint64_t*)cgen_var_334, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4103 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4104 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4105 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4106 | if (((createInfoCount))) |
| 4107 | { |
| 4108 | uint64_t* cgen_var_335; |
| 4109 | stream->alloc((void**)&cgen_var_335, ((createInfoCount)) * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4110 | stream->read((uint64_t*)cgen_var_335, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4111 | stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_335, (VkPipeline*)pPipelines, ((createInfoCount))); |
| 4112 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4113 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4114 | VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0; |
| 4115 | stream->read(&vkCreateGraphicsPipelines_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4116 | countingStream->clearPool(); |
| 4117 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4118 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4119 | return vkCreateGraphicsPipelines_VkResult_return; |
| 4120 | } |
| 4121 | |
| 4122 | VkResult VkEncoder::vkCreateComputePipelines( |
| 4123 | VkDevice device, |
| 4124 | VkPipelineCache pipelineCache, |
| 4125 | uint32_t createInfoCount, |
| 4126 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 4127 | const VkAllocationCallbacks* pAllocator, |
| 4128 | VkPipeline* pPipelines) |
| 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(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4134 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4135 | VkDevice local_device; |
| 4136 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4137 | VkPipelineCache local_pipelineCache; |
| 4138 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4139 | uint32_t local_createInfoCount; |
| 4140 | local_createInfoCount = createInfoCount; |
| 4141 | VkComputePipelineCreateInfo* local_pCreateInfos; |
| 4142 | local_pCreateInfos = nullptr; |
| 4143 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4144 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4145 | local_pCreateInfos = (VkComputePipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkComputePipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4146 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4147 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4148 | deepcopy_VkComputePipelineCreateInfo(pool, pCreateInfos + i, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4149 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4150 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4151 | VkAllocationCallbacks* local_pAllocator; |
| 4152 | local_pAllocator = nullptr; |
| 4153 | if (pAllocator) |
| 4154 | { |
| 4155 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4156 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4157 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4158 | local_pAllocator = nullptr; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4159 | countingStream->rewind(); |
| 4160 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4161 | uint64_t cgen_var_336; |
| 4162 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_336, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4163 | countingStream->write((uint64_t*)&cgen_var_336, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4164 | uint64_t cgen_var_337; |
| 4165 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_337, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4166 | countingStream->write((uint64_t*)&cgen_var_337, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4167 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 4168 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4169 | { |
| 4170 | marshal_VkComputePipelineCreateInfo(countingStream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| 4171 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4172 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4173 | uint64_t cgen_var_338 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4174 | countingStream->putBe64(cgen_var_338); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4175 | if (local_pAllocator) |
| 4176 | { |
| 4177 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4178 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4179 | if (((createInfoCount))) |
| 4180 | { |
| 4181 | uint64_t* cgen_var_339; |
| 4182 | countingStream->alloc((void**)&cgen_var_339, ((createInfoCount)) * 8); |
| 4183 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_339, ((createInfoCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4184 | countingStream->write((uint64_t*)cgen_var_339, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4185 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4186 | } |
| 4187 | uint32_t packetSize_vkCreateComputePipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4188 | countingStream->rewind(); |
| 4189 | uint32_t opcode_vkCreateComputePipelines = OP_vkCreateComputePipelines; |
| 4190 | stream->write(&opcode_vkCreateComputePipelines, sizeof(uint32_t)); |
| 4191 | stream->write(&packetSize_vkCreateComputePipelines, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4192 | uint64_t cgen_var_340; |
| 4193 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_340, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4194 | stream->write((uint64_t*)&cgen_var_340, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4195 | uint64_t cgen_var_341; |
| 4196 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_341, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4197 | stream->write((uint64_t*)&cgen_var_341, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4198 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4199 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4200 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4201 | marshal_VkComputePipelineCreateInfo(stream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4202 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4203 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4204 | uint64_t cgen_var_342 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4205 | stream->putBe64(cgen_var_342); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4206 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4207 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4208 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4209 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4210 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4211 | if (((createInfoCount))) |
| 4212 | { |
| 4213 | uint64_t* cgen_var_343; |
| 4214 | stream->alloc((void**)&cgen_var_343, ((createInfoCount)) * 8); |
| 4215 | stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_343, ((createInfoCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4216 | stream->write((uint64_t*)cgen_var_343, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4217 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4218 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4219 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4220 | if (((createInfoCount))) |
| 4221 | { |
| 4222 | uint64_t* cgen_var_344; |
| 4223 | stream->alloc((void**)&cgen_var_344, ((createInfoCount)) * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4224 | stream->read((uint64_t*)cgen_var_344, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4225 | stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_344, (VkPipeline*)pPipelines, ((createInfoCount))); |
| 4226 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4227 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4228 | VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0; |
| 4229 | stream->read(&vkCreateComputePipelines_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4230 | countingStream->clearPool(); |
| 4231 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4232 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4233 | return vkCreateComputePipelines_VkResult_return; |
| 4234 | } |
| 4235 | |
| 4236 | void VkEncoder::vkDestroyPipeline( |
| 4237 | VkDevice device, |
| 4238 | VkPipeline pipeline, |
| 4239 | const VkAllocationCallbacks* pAllocator) |
| 4240 | { |
| 4241 | auto stream = mImpl->stream(); |
| 4242 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4243 | auto resources = mImpl->resources(); |
| 4244 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4245 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4246 | VkDevice local_device; |
| 4247 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4248 | VkPipeline local_pipeline; |
| 4249 | local_pipeline = pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4250 | VkAllocationCallbacks* local_pAllocator; |
| 4251 | local_pAllocator = nullptr; |
| 4252 | if (pAllocator) |
| 4253 | { |
| 4254 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4255 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4256 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4257 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4258 | countingStream->rewind(); |
| 4259 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4260 | uint64_t cgen_var_345; |
| 4261 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_345, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4262 | countingStream->write((uint64_t*)&cgen_var_345, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4263 | uint64_t cgen_var_346; |
| 4264 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_346, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4265 | countingStream->write((uint64_t*)&cgen_var_346, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4266 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4267 | uint64_t cgen_var_347 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4268 | countingStream->putBe64(cgen_var_347); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4269 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4270 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4271 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4272 | } |
| 4273 | } |
| 4274 | uint32_t packetSize_vkDestroyPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4275 | countingStream->rewind(); |
| 4276 | uint32_t opcode_vkDestroyPipeline = OP_vkDestroyPipeline; |
| 4277 | stream->write(&opcode_vkDestroyPipeline, sizeof(uint32_t)); |
| 4278 | stream->write(&packetSize_vkDestroyPipeline, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4279 | uint64_t cgen_var_348; |
| 4280 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_348, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4281 | stream->write((uint64_t*)&cgen_var_348, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4282 | uint64_t cgen_var_349; |
| 4283 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_349, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4284 | stream->write((uint64_t*)&cgen_var_349, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4285 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4286 | uint64_t cgen_var_350 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4287 | stream->putBe64(cgen_var_350); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4288 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4289 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4290 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4291 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4292 | resources->destroyMapping()->mapHandles_VkPipeline((VkPipeline*)&pipeline); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4293 | } |
| 4294 | |
| 4295 | VkResult VkEncoder::vkCreatePipelineLayout( |
| 4296 | VkDevice device, |
| 4297 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 4298 | const VkAllocationCallbacks* pAllocator, |
| 4299 | VkPipelineLayout* pPipelineLayout) |
| 4300 | { |
| 4301 | auto stream = mImpl->stream(); |
| 4302 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4303 | auto resources = mImpl->resources(); |
| 4304 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4305 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4306 | VkDevice local_device; |
| 4307 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4308 | VkPipelineLayoutCreateInfo* local_pCreateInfo; |
| 4309 | local_pCreateInfo = nullptr; |
| 4310 | if (pCreateInfo) |
| 4311 | { |
| 4312 | local_pCreateInfo = (VkPipelineLayoutCreateInfo*)pool->alloc(sizeof(const VkPipelineLayoutCreateInfo)); |
| 4313 | deepcopy_VkPipelineLayoutCreateInfo(pool, pCreateInfo, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| 4314 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4315 | VkAllocationCallbacks* local_pAllocator; |
| 4316 | local_pAllocator = nullptr; |
| 4317 | if (pAllocator) |
| 4318 | { |
| 4319 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4320 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4321 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4322 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4323 | countingStream->rewind(); |
| 4324 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4325 | uint64_t cgen_var_351; |
| 4326 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_351, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4327 | countingStream->write((uint64_t*)&cgen_var_351, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4328 | marshal_VkPipelineLayoutCreateInfo(countingStream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4329 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4330 | uint64_t cgen_var_352 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4331 | countingStream->putBe64(cgen_var_352); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4332 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4333 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4334 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4335 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4336 | uint64_t cgen_var_353; |
| 4337 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_353, 1); |
| 4338 | countingStream->write((uint64_t*)&cgen_var_353, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4339 | } |
| 4340 | uint32_t packetSize_vkCreatePipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4341 | countingStream->rewind(); |
| 4342 | uint32_t opcode_vkCreatePipelineLayout = OP_vkCreatePipelineLayout; |
| 4343 | stream->write(&opcode_vkCreatePipelineLayout, sizeof(uint32_t)); |
| 4344 | stream->write(&packetSize_vkCreatePipelineLayout, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4345 | uint64_t cgen_var_354; |
| 4346 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_354, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4347 | stream->write((uint64_t*)&cgen_var_354, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4348 | marshal_VkPipelineLayoutCreateInfo(stream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4349 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4350 | uint64_t cgen_var_355 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4351 | stream->putBe64(cgen_var_355); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4352 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4353 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4354 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4355 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4356 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4357 | uint64_t cgen_var_356; |
| 4358 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_356, 1); |
| 4359 | stream->write((uint64_t*)&cgen_var_356, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4360 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4361 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4362 | uint64_t cgen_var_357; |
| 4363 | stream->read((uint64_t*)&cgen_var_357, 8); |
| 4364 | stream->handleMapping()->mapHandles_u64_VkPipelineLayout(&cgen_var_357, (VkPipelineLayout*)pPipelineLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4365 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4366 | VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0; |
| 4367 | stream->read(&vkCreatePipelineLayout_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4368 | countingStream->clearPool(); |
| 4369 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4370 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4371 | return vkCreatePipelineLayout_VkResult_return; |
| 4372 | } |
| 4373 | |
| 4374 | void VkEncoder::vkDestroyPipelineLayout( |
| 4375 | VkDevice device, |
| 4376 | VkPipelineLayout pipelineLayout, |
| 4377 | const VkAllocationCallbacks* pAllocator) |
| 4378 | { |
| 4379 | auto stream = mImpl->stream(); |
| 4380 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4381 | auto resources = mImpl->resources(); |
| 4382 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4383 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4384 | VkDevice local_device; |
| 4385 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4386 | VkPipelineLayout local_pipelineLayout; |
| 4387 | local_pipelineLayout = pipelineLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4388 | VkAllocationCallbacks* local_pAllocator; |
| 4389 | local_pAllocator = nullptr; |
| 4390 | if (pAllocator) |
| 4391 | { |
| 4392 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4393 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4394 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4395 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4396 | countingStream->rewind(); |
| 4397 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4398 | uint64_t cgen_var_358; |
| 4399 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_358, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4400 | countingStream->write((uint64_t*)&cgen_var_358, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4401 | uint64_t cgen_var_359; |
| 4402 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_359, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4403 | countingStream->write((uint64_t*)&cgen_var_359, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4404 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4405 | uint64_t cgen_var_360 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4406 | countingStream->putBe64(cgen_var_360); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4407 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4408 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4409 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4410 | } |
| 4411 | } |
| 4412 | uint32_t packetSize_vkDestroyPipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4413 | countingStream->rewind(); |
| 4414 | uint32_t opcode_vkDestroyPipelineLayout = OP_vkDestroyPipelineLayout; |
| 4415 | stream->write(&opcode_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| 4416 | stream->write(&packetSize_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4417 | uint64_t cgen_var_361; |
| 4418 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_361, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4419 | stream->write((uint64_t*)&cgen_var_361, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4420 | uint64_t cgen_var_362; |
| 4421 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_362, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4422 | stream->write((uint64_t*)&cgen_var_362, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4423 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4424 | uint64_t cgen_var_363 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4425 | stream->putBe64(cgen_var_363); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4426 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4427 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4428 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4429 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4430 | resources->destroyMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&pipelineLayout); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4431 | } |
| 4432 | |
| 4433 | VkResult VkEncoder::vkCreateSampler( |
| 4434 | VkDevice device, |
| 4435 | const VkSamplerCreateInfo* pCreateInfo, |
| 4436 | const VkAllocationCallbacks* pAllocator, |
| 4437 | VkSampler* pSampler) |
| 4438 | { |
| 4439 | auto stream = mImpl->stream(); |
| 4440 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4441 | auto resources = mImpl->resources(); |
| 4442 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4443 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4444 | VkDevice local_device; |
| 4445 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4446 | VkSamplerCreateInfo* local_pCreateInfo; |
| 4447 | local_pCreateInfo = nullptr; |
| 4448 | if (pCreateInfo) |
| 4449 | { |
| 4450 | local_pCreateInfo = (VkSamplerCreateInfo*)pool->alloc(sizeof(const VkSamplerCreateInfo)); |
| 4451 | deepcopy_VkSamplerCreateInfo(pool, pCreateInfo, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| 4452 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4453 | VkAllocationCallbacks* local_pAllocator; |
| 4454 | local_pAllocator = nullptr; |
| 4455 | if (pAllocator) |
| 4456 | { |
| 4457 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4458 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4459 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4460 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4461 | countingStream->rewind(); |
| 4462 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4463 | uint64_t cgen_var_364; |
| 4464 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_364, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4465 | countingStream->write((uint64_t*)&cgen_var_364, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4466 | marshal_VkSamplerCreateInfo(countingStream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4467 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4468 | uint64_t cgen_var_365 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4469 | countingStream->putBe64(cgen_var_365); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4470 | if (local_pAllocator) |
| 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 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4473 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4474 | uint64_t cgen_var_366; |
| 4475 | countingStream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_366, 1); |
| 4476 | countingStream->write((uint64_t*)&cgen_var_366, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4477 | } |
| 4478 | uint32_t packetSize_vkCreateSampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4479 | countingStream->rewind(); |
| 4480 | uint32_t opcode_vkCreateSampler = OP_vkCreateSampler; |
| 4481 | stream->write(&opcode_vkCreateSampler, sizeof(uint32_t)); |
| 4482 | stream->write(&packetSize_vkCreateSampler, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4483 | uint64_t cgen_var_367; |
| 4484 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_367, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4485 | stream->write((uint64_t*)&cgen_var_367, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4486 | marshal_VkSamplerCreateInfo(stream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4487 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4488 | uint64_t cgen_var_368 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4489 | stream->putBe64(cgen_var_368); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4490 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4491 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4492 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4493 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4494 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4495 | uint64_t cgen_var_369; |
| 4496 | stream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_369, 1); |
| 4497 | stream->write((uint64_t*)&cgen_var_369, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4498 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4499 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4500 | uint64_t cgen_var_370; |
| 4501 | stream->read((uint64_t*)&cgen_var_370, 8); |
| 4502 | stream->handleMapping()->mapHandles_u64_VkSampler(&cgen_var_370, (VkSampler*)pSampler, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4503 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4504 | VkResult vkCreateSampler_VkResult_return = (VkResult)0; |
| 4505 | stream->read(&vkCreateSampler_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4506 | countingStream->clearPool(); |
| 4507 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4508 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4509 | return vkCreateSampler_VkResult_return; |
| 4510 | } |
| 4511 | |
| 4512 | void VkEncoder::vkDestroySampler( |
| 4513 | VkDevice device, |
| 4514 | VkSampler sampler, |
| 4515 | const VkAllocationCallbacks* pAllocator) |
| 4516 | { |
| 4517 | auto stream = mImpl->stream(); |
| 4518 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4519 | auto resources = mImpl->resources(); |
| 4520 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4521 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4522 | VkDevice local_device; |
| 4523 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4524 | VkSampler local_sampler; |
| 4525 | local_sampler = sampler; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4526 | VkAllocationCallbacks* local_pAllocator; |
| 4527 | local_pAllocator = nullptr; |
| 4528 | if (pAllocator) |
| 4529 | { |
| 4530 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4531 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4532 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4533 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4534 | countingStream->rewind(); |
| 4535 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4536 | uint64_t cgen_var_371; |
| 4537 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_371, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4538 | countingStream->write((uint64_t*)&cgen_var_371, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4539 | uint64_t cgen_var_372; |
| 4540 | countingStream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_372, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4541 | countingStream->write((uint64_t*)&cgen_var_372, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4542 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4543 | uint64_t cgen_var_373 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4544 | countingStream->putBe64(cgen_var_373); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4545 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4546 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4547 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4548 | } |
| 4549 | } |
| 4550 | uint32_t packetSize_vkDestroySampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4551 | countingStream->rewind(); |
| 4552 | uint32_t opcode_vkDestroySampler = OP_vkDestroySampler; |
| 4553 | stream->write(&opcode_vkDestroySampler, sizeof(uint32_t)); |
| 4554 | stream->write(&packetSize_vkDestroySampler, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4555 | uint64_t cgen_var_374; |
| 4556 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_374, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4557 | stream->write((uint64_t*)&cgen_var_374, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4558 | uint64_t cgen_var_375; |
| 4559 | stream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_375, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4560 | stream->write((uint64_t*)&cgen_var_375, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4561 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4562 | uint64_t cgen_var_376 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4563 | stream->putBe64(cgen_var_376); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4564 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4565 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4566 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4567 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4568 | resources->destroyMapping()->mapHandles_VkSampler((VkSampler*)&sampler); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4569 | } |
| 4570 | |
| 4571 | VkResult VkEncoder::vkCreateDescriptorSetLayout( |
| 4572 | VkDevice device, |
| 4573 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 4574 | const VkAllocationCallbacks* pAllocator, |
| 4575 | VkDescriptorSetLayout* pSetLayout) |
| 4576 | { |
| 4577 | auto stream = mImpl->stream(); |
| 4578 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4579 | auto resources = mImpl->resources(); |
| 4580 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4581 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4582 | VkDevice local_device; |
| 4583 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4584 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| 4585 | local_pCreateInfo = nullptr; |
| 4586 | if (pCreateInfo) |
| 4587 | { |
| 4588 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 4589 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 4590 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4591 | VkAllocationCallbacks* local_pAllocator; |
| 4592 | local_pAllocator = nullptr; |
| 4593 | if (pAllocator) |
| 4594 | { |
| 4595 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4596 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4597 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4598 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4599 | countingStream->rewind(); |
| 4600 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4601 | uint64_t cgen_var_377; |
| 4602 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_377, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4603 | countingStream->write((uint64_t*)&cgen_var_377, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4604 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4605 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4606 | uint64_t cgen_var_378 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4607 | countingStream->putBe64(cgen_var_378); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4608 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4609 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4610 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4611 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4612 | uint64_t cgen_var_379; |
| 4613 | countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_379, 1); |
| 4614 | countingStream->write((uint64_t*)&cgen_var_379, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4615 | } |
| 4616 | uint32_t packetSize_vkCreateDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4617 | countingStream->rewind(); |
| 4618 | uint32_t opcode_vkCreateDescriptorSetLayout = OP_vkCreateDescriptorSetLayout; |
| 4619 | stream->write(&opcode_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| 4620 | stream->write(&packetSize_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4621 | uint64_t cgen_var_380; |
| 4622 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_380, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4623 | stream->write((uint64_t*)&cgen_var_380, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4624 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4625 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4626 | uint64_t cgen_var_381 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4627 | stream->putBe64(cgen_var_381); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4628 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4629 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4630 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4631 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4632 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4633 | uint64_t cgen_var_382; |
| 4634 | stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_382, 1); |
| 4635 | stream->write((uint64_t*)&cgen_var_382, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4636 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4637 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4638 | uint64_t cgen_var_383; |
| 4639 | stream->read((uint64_t*)&cgen_var_383, 8); |
| 4640 | stream->handleMapping()->mapHandles_u64_VkDescriptorSetLayout(&cgen_var_383, (VkDescriptorSetLayout*)pSetLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4641 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4642 | VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0; |
| 4643 | stream->read(&vkCreateDescriptorSetLayout_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4644 | countingStream->clearPool(); |
| 4645 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4646 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4647 | return vkCreateDescriptorSetLayout_VkResult_return; |
| 4648 | } |
| 4649 | |
| 4650 | void VkEncoder::vkDestroyDescriptorSetLayout( |
| 4651 | VkDevice device, |
| 4652 | VkDescriptorSetLayout descriptorSetLayout, |
| 4653 | const VkAllocationCallbacks* pAllocator) |
| 4654 | { |
| 4655 | auto stream = mImpl->stream(); |
| 4656 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4657 | auto resources = mImpl->resources(); |
| 4658 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4659 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4660 | VkDevice local_device; |
| 4661 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4662 | VkDescriptorSetLayout local_descriptorSetLayout; |
| 4663 | local_descriptorSetLayout = descriptorSetLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4664 | VkAllocationCallbacks* local_pAllocator; |
| 4665 | local_pAllocator = nullptr; |
| 4666 | if (pAllocator) |
| 4667 | { |
| 4668 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4669 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4670 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4671 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4672 | countingStream->rewind(); |
| 4673 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4674 | uint64_t cgen_var_384; |
| 4675 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_384, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4676 | countingStream->write((uint64_t*)&cgen_var_384, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4677 | uint64_t cgen_var_385; |
| 4678 | countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_385, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4679 | countingStream->write((uint64_t*)&cgen_var_385, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4680 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4681 | uint64_t cgen_var_386 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4682 | countingStream->putBe64(cgen_var_386); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4683 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4684 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4685 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4686 | } |
| 4687 | } |
| 4688 | uint32_t packetSize_vkDestroyDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4689 | countingStream->rewind(); |
| 4690 | uint32_t opcode_vkDestroyDescriptorSetLayout = OP_vkDestroyDescriptorSetLayout; |
| 4691 | stream->write(&opcode_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| 4692 | stream->write(&packetSize_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4693 | uint64_t cgen_var_387; |
| 4694 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_387, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4695 | stream->write((uint64_t*)&cgen_var_387, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4696 | uint64_t cgen_var_388; |
| 4697 | stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_388, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4698 | stream->write((uint64_t*)&cgen_var_388, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4699 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4700 | uint64_t cgen_var_389 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4701 | stream->putBe64(cgen_var_389); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4702 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4703 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4704 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4705 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4706 | resources->destroyMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)&descriptorSetLayout); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4707 | } |
| 4708 | |
| 4709 | VkResult VkEncoder::vkCreateDescriptorPool( |
| 4710 | VkDevice device, |
| 4711 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 4712 | const VkAllocationCallbacks* pAllocator, |
| 4713 | VkDescriptorPool* pDescriptorPool) |
| 4714 | { |
| 4715 | auto stream = mImpl->stream(); |
| 4716 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4717 | auto resources = mImpl->resources(); |
| 4718 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4719 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4720 | VkDevice local_device; |
| 4721 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4722 | VkDescriptorPoolCreateInfo* local_pCreateInfo; |
| 4723 | local_pCreateInfo = nullptr; |
| 4724 | if (pCreateInfo) |
| 4725 | { |
| 4726 | local_pCreateInfo = (VkDescriptorPoolCreateInfo*)pool->alloc(sizeof(const VkDescriptorPoolCreateInfo)); |
| 4727 | deepcopy_VkDescriptorPoolCreateInfo(pool, pCreateInfo, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| 4728 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4729 | VkAllocationCallbacks* local_pAllocator; |
| 4730 | local_pAllocator = nullptr; |
| 4731 | if (pAllocator) |
| 4732 | { |
| 4733 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4734 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4735 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4736 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4737 | countingStream->rewind(); |
| 4738 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4739 | uint64_t cgen_var_390; |
| 4740 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_390, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4741 | countingStream->write((uint64_t*)&cgen_var_390, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4742 | marshal_VkDescriptorPoolCreateInfo(countingStream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4743 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4744 | uint64_t cgen_var_391 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4745 | countingStream->putBe64(cgen_var_391); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4746 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4747 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4748 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4749 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4750 | uint64_t cgen_var_392; |
| 4751 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_392, 1); |
| 4752 | countingStream->write((uint64_t*)&cgen_var_392, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4753 | } |
| 4754 | uint32_t packetSize_vkCreateDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4755 | countingStream->rewind(); |
| 4756 | uint32_t opcode_vkCreateDescriptorPool = OP_vkCreateDescriptorPool; |
| 4757 | stream->write(&opcode_vkCreateDescriptorPool, sizeof(uint32_t)); |
| 4758 | stream->write(&packetSize_vkCreateDescriptorPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4759 | uint64_t cgen_var_393; |
| 4760 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_393, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4761 | stream->write((uint64_t*)&cgen_var_393, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4762 | marshal_VkDescriptorPoolCreateInfo(stream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4763 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4764 | uint64_t cgen_var_394 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4765 | stream->putBe64(cgen_var_394); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4766 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4767 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4768 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4769 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4770 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4771 | uint64_t cgen_var_395; |
| 4772 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_395, 1); |
| 4773 | stream->write((uint64_t*)&cgen_var_395, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4774 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4775 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4776 | uint64_t cgen_var_396; |
| 4777 | stream->read((uint64_t*)&cgen_var_396, 8); |
| 4778 | stream->handleMapping()->mapHandles_u64_VkDescriptorPool(&cgen_var_396, (VkDescriptorPool*)pDescriptorPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4779 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4780 | VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0; |
| 4781 | stream->read(&vkCreateDescriptorPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4782 | countingStream->clearPool(); |
| 4783 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4784 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4785 | return vkCreateDescriptorPool_VkResult_return; |
| 4786 | } |
| 4787 | |
| 4788 | void VkEncoder::vkDestroyDescriptorPool( |
| 4789 | VkDevice device, |
| 4790 | VkDescriptorPool descriptorPool, |
| 4791 | const VkAllocationCallbacks* pAllocator) |
| 4792 | { |
| 4793 | auto stream = mImpl->stream(); |
| 4794 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4795 | auto resources = mImpl->resources(); |
| 4796 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4797 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4798 | VkDevice local_device; |
| 4799 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4800 | VkDescriptorPool local_descriptorPool; |
| 4801 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4802 | VkAllocationCallbacks* local_pAllocator; |
| 4803 | local_pAllocator = nullptr; |
| 4804 | if (pAllocator) |
| 4805 | { |
| 4806 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4807 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4808 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4809 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4810 | countingStream->rewind(); |
| 4811 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4812 | uint64_t cgen_var_397; |
| 4813 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_397, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4814 | countingStream->write((uint64_t*)&cgen_var_397, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4815 | uint64_t cgen_var_398; |
| 4816 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_398, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4817 | countingStream->write((uint64_t*)&cgen_var_398, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4818 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4819 | uint64_t cgen_var_399 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4820 | countingStream->putBe64(cgen_var_399); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4821 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4822 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4823 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4824 | } |
| 4825 | } |
| 4826 | uint32_t packetSize_vkDestroyDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4827 | countingStream->rewind(); |
| 4828 | uint32_t opcode_vkDestroyDescriptorPool = OP_vkDestroyDescriptorPool; |
| 4829 | stream->write(&opcode_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| 4830 | stream->write(&packetSize_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4831 | uint64_t cgen_var_400; |
| 4832 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_400, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4833 | stream->write((uint64_t*)&cgen_var_400, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4834 | uint64_t cgen_var_401; |
| 4835 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_401, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4836 | stream->write((uint64_t*)&cgen_var_401, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4837 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4838 | uint64_t cgen_var_402 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4839 | stream->putBe64(cgen_var_402); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4840 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4841 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4842 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4843 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4844 | resources->destroyMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&descriptorPool); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4845 | } |
| 4846 | |
| 4847 | VkResult VkEncoder::vkResetDescriptorPool( |
| 4848 | VkDevice device, |
| 4849 | VkDescriptorPool descriptorPool, |
| 4850 | VkDescriptorPoolResetFlags flags) |
| 4851 | { |
| 4852 | auto stream = mImpl->stream(); |
| 4853 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4854 | auto resources = mImpl->resources(); |
| 4855 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4856 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4857 | VkDevice local_device; |
| 4858 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4859 | VkDescriptorPool local_descriptorPool; |
| 4860 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4861 | VkDescriptorPoolResetFlags local_flags; |
| 4862 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4863 | countingStream->rewind(); |
| 4864 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4865 | uint64_t cgen_var_403; |
| 4866 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_403, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4867 | countingStream->write((uint64_t*)&cgen_var_403, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4868 | uint64_t cgen_var_404; |
| 4869 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_404, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4870 | countingStream->write((uint64_t*)&cgen_var_404, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4871 | countingStream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4872 | } |
| 4873 | uint32_t packetSize_vkResetDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4874 | countingStream->rewind(); |
| 4875 | uint32_t opcode_vkResetDescriptorPool = OP_vkResetDescriptorPool; |
| 4876 | stream->write(&opcode_vkResetDescriptorPool, sizeof(uint32_t)); |
| 4877 | stream->write(&packetSize_vkResetDescriptorPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4878 | uint64_t cgen_var_405; |
| 4879 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_405, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4880 | stream->write((uint64_t*)&cgen_var_405, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4881 | uint64_t cgen_var_406; |
| 4882 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_406, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4883 | stream->write((uint64_t*)&cgen_var_406, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4884 | stream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4885 | VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0; |
| 4886 | stream->read(&vkResetDescriptorPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4887 | countingStream->clearPool(); |
| 4888 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4889 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4890 | return vkResetDescriptorPool_VkResult_return; |
| 4891 | } |
| 4892 | |
| 4893 | VkResult VkEncoder::vkAllocateDescriptorSets( |
| 4894 | VkDevice device, |
| 4895 | const VkDescriptorSetAllocateInfo* pAllocateInfo, |
| 4896 | VkDescriptorSet* pDescriptorSets) |
| 4897 | { |
| 4898 | auto stream = mImpl->stream(); |
| 4899 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4900 | auto resources = mImpl->resources(); |
| 4901 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4902 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4903 | VkDevice local_device; |
| 4904 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4905 | VkDescriptorSetAllocateInfo* local_pAllocateInfo; |
| 4906 | local_pAllocateInfo = nullptr; |
| 4907 | if (pAllocateInfo) |
| 4908 | { |
| 4909 | local_pAllocateInfo = (VkDescriptorSetAllocateInfo*)pool->alloc(sizeof(const VkDescriptorSetAllocateInfo)); |
| 4910 | deepcopy_VkDescriptorSetAllocateInfo(pool, pAllocateInfo, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| 4911 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4912 | countingStream->rewind(); |
| 4913 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4914 | uint64_t cgen_var_407; |
| 4915 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_407, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4916 | countingStream->write((uint64_t*)&cgen_var_407, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4917 | marshal_VkDescriptorSetAllocateInfo(countingStream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4918 | if (pAllocateInfo->descriptorSetCount) |
| 4919 | { |
| 4920 | uint64_t* cgen_var_408; |
| 4921 | countingStream->alloc((void**)&cgen_var_408, pAllocateInfo->descriptorSetCount * 8); |
| 4922 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_408, pAllocateInfo->descriptorSetCount); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4923 | countingStream->write((uint64_t*)cgen_var_408, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4924 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4925 | } |
| 4926 | uint32_t packetSize_vkAllocateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4927 | countingStream->rewind(); |
| 4928 | uint32_t opcode_vkAllocateDescriptorSets = OP_vkAllocateDescriptorSets; |
| 4929 | stream->write(&opcode_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| 4930 | stream->write(&packetSize_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4931 | uint64_t cgen_var_409; |
| 4932 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_409, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4933 | stream->write((uint64_t*)&cgen_var_409, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4934 | marshal_VkDescriptorSetAllocateInfo(stream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4935 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4936 | if (pAllocateInfo->descriptorSetCount) |
| 4937 | { |
| 4938 | uint64_t* cgen_var_410; |
| 4939 | stream->alloc((void**)&cgen_var_410, pAllocateInfo->descriptorSetCount * 8); |
| 4940 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_410, pAllocateInfo->descriptorSetCount); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4941 | stream->write((uint64_t*)cgen_var_410, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4942 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4943 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4944 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4945 | if (pAllocateInfo->descriptorSetCount) |
| 4946 | { |
| 4947 | uint64_t* cgen_var_411; |
| 4948 | stream->alloc((void**)&cgen_var_411, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4949 | stream->read((uint64_t*)cgen_var_411, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4950 | stream->handleMapping()->mapHandles_u64_VkDescriptorSet(cgen_var_411, (VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount); |
| 4951 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4952 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4953 | VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0; |
| 4954 | stream->read(&vkAllocateDescriptorSets_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4955 | countingStream->clearPool(); |
| 4956 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4957 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4958 | return vkAllocateDescriptorSets_VkResult_return; |
| 4959 | } |
| 4960 | |
| 4961 | VkResult VkEncoder::vkFreeDescriptorSets( |
| 4962 | VkDevice device, |
| 4963 | VkDescriptorPool descriptorPool, |
| 4964 | uint32_t descriptorSetCount, |
| 4965 | const VkDescriptorSet* pDescriptorSets) |
| 4966 | { |
| 4967 | auto stream = mImpl->stream(); |
| 4968 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4969 | auto resources = mImpl->resources(); |
| 4970 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4971 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4972 | VkDevice local_device; |
| 4973 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4974 | VkDescriptorPool local_descriptorPool; |
| 4975 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4976 | uint32_t local_descriptorSetCount; |
| 4977 | local_descriptorSetCount = descriptorSetCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4978 | VkDescriptorSet* local_pDescriptorSets; |
| 4979 | local_pDescriptorSets = nullptr; |
| 4980 | if (pDescriptorSets) |
| 4981 | { |
| 4982 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 4983 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4984 | countingStream->rewind(); |
| 4985 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4986 | uint64_t cgen_var_412; |
| 4987 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_412, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4988 | countingStream->write((uint64_t*)&cgen_var_412, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4989 | uint64_t cgen_var_413; |
| 4990 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_413, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 4991 | countingStream->write((uint64_t*)&cgen_var_413, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4992 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4993 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4994 | uint64_t cgen_var_414 = (uint64_t)(uintptr_t)local_pDescriptorSets; |
| 4995 | countingStream->putBe64(cgen_var_414); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4996 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4997 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4998 | if (((descriptorSetCount))) |
| 4999 | { |
| 5000 | uint64_t* cgen_var_415; |
| 5001 | countingStream->alloc((void**)&cgen_var_415, ((descriptorSetCount)) * 8); |
| 5002 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_415, ((descriptorSetCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5003 | countingStream->write((uint64_t*)cgen_var_415, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5004 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5005 | } |
| 5006 | } |
| 5007 | uint32_t packetSize_vkFreeDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5008 | countingStream->rewind(); |
| 5009 | uint32_t opcode_vkFreeDescriptorSets = OP_vkFreeDescriptorSets; |
| 5010 | stream->write(&opcode_vkFreeDescriptorSets, sizeof(uint32_t)); |
| 5011 | stream->write(&packetSize_vkFreeDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5012 | uint64_t cgen_var_416; |
| 5013 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_416, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5014 | stream->write((uint64_t*)&cgen_var_416, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5015 | uint64_t cgen_var_417; |
| 5016 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_417, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5017 | stream->write((uint64_t*)&cgen_var_417, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5018 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5019 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5020 | uint64_t cgen_var_418 = (uint64_t)(uintptr_t)local_pDescriptorSets; |
| 5021 | stream->putBe64(cgen_var_418); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5022 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5023 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5024 | if (((descriptorSetCount))) |
| 5025 | { |
| 5026 | uint64_t* cgen_var_419; |
| 5027 | stream->alloc((void**)&cgen_var_419, ((descriptorSetCount)) * 8); |
| 5028 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_419, ((descriptorSetCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5029 | stream->write((uint64_t*)cgen_var_419, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5030 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5031 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5032 | if (pDescriptorSets) |
| 5033 | { |
| 5034 | resources->destroyMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount))); |
| 5035 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5036 | VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0; |
| 5037 | stream->read(&vkFreeDescriptorSets_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5038 | countingStream->clearPool(); |
| 5039 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5040 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5041 | return vkFreeDescriptorSets_VkResult_return; |
| 5042 | } |
| 5043 | |
| 5044 | void VkEncoder::vkUpdateDescriptorSets( |
| 5045 | VkDevice device, |
| 5046 | uint32_t descriptorWriteCount, |
| 5047 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 5048 | uint32_t descriptorCopyCount, |
| 5049 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 5050 | { |
| 5051 | auto stream = mImpl->stream(); |
| 5052 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5053 | auto resources = mImpl->resources(); |
| 5054 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5055 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5056 | VkDevice local_device; |
| 5057 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5058 | uint32_t local_descriptorWriteCount; |
| 5059 | local_descriptorWriteCount = descriptorWriteCount; |
| 5060 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| 5061 | local_pDescriptorWrites = nullptr; |
| 5062 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5063 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5064 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5065 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5066 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5067 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5068 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5069 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5070 | uint32_t local_descriptorCopyCount; |
| 5071 | local_descriptorCopyCount = descriptorCopyCount; |
| 5072 | VkCopyDescriptorSet* local_pDescriptorCopies; |
| 5073 | local_pDescriptorCopies = nullptr; |
| 5074 | if (pDescriptorCopies) |
| 5075 | { |
| 5076 | local_pDescriptorCopies = (VkCopyDescriptorSet*)pool->alloc(((descriptorCopyCount)) * sizeof(const VkCopyDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5077 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5078 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5079 | deepcopy_VkCopyDescriptorSet(pool, pDescriptorCopies + i, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| 5080 | } |
| 5081 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5082 | countingStream->rewind(); |
| 5083 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5084 | uint64_t cgen_var_420; |
| 5085 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_420, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5086 | countingStream->write((uint64_t*)&cgen_var_420, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5087 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 5088 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5089 | { |
| 5090 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 5091 | } |
| 5092 | countingStream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| 5093 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5094 | { |
| 5095 | marshal_VkCopyDescriptorSet(countingStream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5096 | } |
| 5097 | } |
| 5098 | uint32_t packetSize_vkUpdateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5099 | countingStream->rewind(); |
| 5100 | uint32_t opcode_vkUpdateDescriptorSets = OP_vkUpdateDescriptorSets; |
| 5101 | stream->write(&opcode_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| 5102 | stream->write(&packetSize_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5103 | uint64_t cgen_var_421; |
| 5104 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_421, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5105 | stream->write((uint64_t*)&cgen_var_421, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5106 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5107 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5108 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5109 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5110 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5111 | stream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5112 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5113 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5114 | marshal_VkCopyDescriptorSet(stream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5115 | } |
| 5116 | } |
| 5117 | |
| 5118 | VkResult VkEncoder::vkCreateFramebuffer( |
| 5119 | VkDevice device, |
| 5120 | const VkFramebufferCreateInfo* pCreateInfo, |
| 5121 | const VkAllocationCallbacks* pAllocator, |
| 5122 | VkFramebuffer* pFramebuffer) |
| 5123 | { |
| 5124 | auto stream = mImpl->stream(); |
| 5125 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5126 | auto resources = mImpl->resources(); |
| 5127 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5128 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5129 | VkDevice local_device; |
| 5130 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5131 | VkFramebufferCreateInfo* local_pCreateInfo; |
| 5132 | local_pCreateInfo = nullptr; |
| 5133 | if (pCreateInfo) |
| 5134 | { |
| 5135 | local_pCreateInfo = (VkFramebufferCreateInfo*)pool->alloc(sizeof(const VkFramebufferCreateInfo)); |
| 5136 | deepcopy_VkFramebufferCreateInfo(pool, pCreateInfo, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| 5137 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5138 | VkAllocationCallbacks* local_pAllocator; |
| 5139 | local_pAllocator = nullptr; |
| 5140 | if (pAllocator) |
| 5141 | { |
| 5142 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5143 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5144 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5145 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5146 | countingStream->rewind(); |
| 5147 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5148 | uint64_t cgen_var_422; |
| 5149 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_422, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5150 | countingStream->write((uint64_t*)&cgen_var_422, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5151 | marshal_VkFramebufferCreateInfo(countingStream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5152 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5153 | uint64_t cgen_var_423 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5154 | countingStream->putBe64(cgen_var_423); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5155 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5156 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5157 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5158 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5159 | uint64_t cgen_var_424; |
| 5160 | countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_424, 1); |
| 5161 | countingStream->write((uint64_t*)&cgen_var_424, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5162 | } |
| 5163 | uint32_t packetSize_vkCreateFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5164 | countingStream->rewind(); |
| 5165 | uint32_t opcode_vkCreateFramebuffer = OP_vkCreateFramebuffer; |
| 5166 | stream->write(&opcode_vkCreateFramebuffer, sizeof(uint32_t)); |
| 5167 | stream->write(&packetSize_vkCreateFramebuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5168 | uint64_t cgen_var_425; |
| 5169 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_425, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5170 | stream->write((uint64_t*)&cgen_var_425, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5171 | marshal_VkFramebufferCreateInfo(stream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5172 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5173 | uint64_t cgen_var_426 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5174 | stream->putBe64(cgen_var_426); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5175 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5176 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5177 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5178 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5179 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5180 | uint64_t cgen_var_427; |
| 5181 | stream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_427, 1); |
| 5182 | stream->write((uint64_t*)&cgen_var_427, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5183 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5184 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5185 | uint64_t cgen_var_428; |
| 5186 | stream->read((uint64_t*)&cgen_var_428, 8); |
| 5187 | stream->handleMapping()->mapHandles_u64_VkFramebuffer(&cgen_var_428, (VkFramebuffer*)pFramebuffer, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5188 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5189 | VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0; |
| 5190 | stream->read(&vkCreateFramebuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5191 | countingStream->clearPool(); |
| 5192 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5193 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5194 | return vkCreateFramebuffer_VkResult_return; |
| 5195 | } |
| 5196 | |
| 5197 | void VkEncoder::vkDestroyFramebuffer( |
| 5198 | VkDevice device, |
| 5199 | VkFramebuffer framebuffer, |
| 5200 | const VkAllocationCallbacks* pAllocator) |
| 5201 | { |
| 5202 | auto stream = mImpl->stream(); |
| 5203 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5204 | auto resources = mImpl->resources(); |
| 5205 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5206 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5207 | VkDevice local_device; |
| 5208 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5209 | VkFramebuffer local_framebuffer; |
| 5210 | local_framebuffer = framebuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5211 | VkAllocationCallbacks* local_pAllocator; |
| 5212 | local_pAllocator = nullptr; |
| 5213 | if (pAllocator) |
| 5214 | { |
| 5215 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5216 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5217 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5218 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5219 | countingStream->rewind(); |
| 5220 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5221 | uint64_t cgen_var_429; |
| 5222 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_429, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5223 | countingStream->write((uint64_t*)&cgen_var_429, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5224 | uint64_t cgen_var_430; |
| 5225 | countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_430, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5226 | countingStream->write((uint64_t*)&cgen_var_430, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5227 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5228 | uint64_t cgen_var_431 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5229 | countingStream->putBe64(cgen_var_431); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5230 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5231 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5232 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5233 | } |
| 5234 | } |
| 5235 | uint32_t packetSize_vkDestroyFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5236 | countingStream->rewind(); |
| 5237 | uint32_t opcode_vkDestroyFramebuffer = OP_vkDestroyFramebuffer; |
| 5238 | stream->write(&opcode_vkDestroyFramebuffer, sizeof(uint32_t)); |
| 5239 | stream->write(&packetSize_vkDestroyFramebuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5240 | uint64_t cgen_var_432; |
| 5241 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_432, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5242 | stream->write((uint64_t*)&cgen_var_432, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5243 | uint64_t cgen_var_433; |
| 5244 | stream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_433, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5245 | stream->write((uint64_t*)&cgen_var_433, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5246 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5247 | uint64_t cgen_var_434 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5248 | stream->putBe64(cgen_var_434); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5249 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5250 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5251 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5252 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5253 | resources->destroyMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&framebuffer); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5254 | } |
| 5255 | |
| 5256 | VkResult VkEncoder::vkCreateRenderPass( |
| 5257 | VkDevice device, |
| 5258 | const VkRenderPassCreateInfo* pCreateInfo, |
| 5259 | const VkAllocationCallbacks* pAllocator, |
| 5260 | VkRenderPass* pRenderPass) |
| 5261 | { |
| 5262 | auto stream = mImpl->stream(); |
| 5263 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5264 | auto resources = mImpl->resources(); |
| 5265 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5266 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5267 | VkDevice local_device; |
| 5268 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5269 | VkRenderPassCreateInfo* local_pCreateInfo; |
| 5270 | local_pCreateInfo = nullptr; |
| 5271 | if (pCreateInfo) |
| 5272 | { |
| 5273 | local_pCreateInfo = (VkRenderPassCreateInfo*)pool->alloc(sizeof(const VkRenderPassCreateInfo)); |
| 5274 | deepcopy_VkRenderPassCreateInfo(pool, pCreateInfo, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| 5275 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5276 | VkAllocationCallbacks* local_pAllocator; |
| 5277 | local_pAllocator = nullptr; |
| 5278 | if (pAllocator) |
| 5279 | { |
| 5280 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5281 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5282 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5283 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5284 | countingStream->rewind(); |
| 5285 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5286 | uint64_t cgen_var_435; |
| 5287 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_435, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5288 | countingStream->write((uint64_t*)&cgen_var_435, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5289 | marshal_VkRenderPassCreateInfo(countingStream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5290 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5291 | uint64_t cgen_var_436 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5292 | countingStream->putBe64(cgen_var_436); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5293 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5294 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5295 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5296 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5297 | uint64_t cgen_var_437; |
| 5298 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_437, 1); |
| 5299 | countingStream->write((uint64_t*)&cgen_var_437, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5300 | } |
| 5301 | uint32_t packetSize_vkCreateRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5302 | countingStream->rewind(); |
| 5303 | uint32_t opcode_vkCreateRenderPass = OP_vkCreateRenderPass; |
| 5304 | stream->write(&opcode_vkCreateRenderPass, sizeof(uint32_t)); |
| 5305 | stream->write(&packetSize_vkCreateRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5306 | uint64_t cgen_var_438; |
| 5307 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_438, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5308 | stream->write((uint64_t*)&cgen_var_438, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5309 | marshal_VkRenderPassCreateInfo(stream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5310 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5311 | uint64_t cgen_var_439 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5312 | stream->putBe64(cgen_var_439); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5313 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5314 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5315 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5316 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5317 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5318 | uint64_t cgen_var_440; |
| 5319 | stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_440, 1); |
| 5320 | stream->write((uint64_t*)&cgen_var_440, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5321 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5322 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5323 | uint64_t cgen_var_441; |
| 5324 | stream->read((uint64_t*)&cgen_var_441, 8); |
| 5325 | stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_441, (VkRenderPass*)pRenderPass, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5326 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5327 | VkResult vkCreateRenderPass_VkResult_return = (VkResult)0; |
| 5328 | stream->read(&vkCreateRenderPass_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5329 | countingStream->clearPool(); |
| 5330 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5331 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5332 | return vkCreateRenderPass_VkResult_return; |
| 5333 | } |
| 5334 | |
| 5335 | void VkEncoder::vkDestroyRenderPass( |
| 5336 | VkDevice device, |
| 5337 | VkRenderPass renderPass, |
| 5338 | const VkAllocationCallbacks* pAllocator) |
| 5339 | { |
| 5340 | auto stream = mImpl->stream(); |
| 5341 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5342 | auto resources = mImpl->resources(); |
| 5343 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5344 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5345 | VkDevice local_device; |
| 5346 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5347 | VkRenderPass local_renderPass; |
| 5348 | local_renderPass = renderPass; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5349 | VkAllocationCallbacks* local_pAllocator; |
| 5350 | local_pAllocator = nullptr; |
| 5351 | if (pAllocator) |
| 5352 | { |
| 5353 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5354 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5355 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5356 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5357 | countingStream->rewind(); |
| 5358 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5359 | uint64_t cgen_var_442; |
| 5360 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_442, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5361 | countingStream->write((uint64_t*)&cgen_var_442, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5362 | uint64_t cgen_var_443; |
| 5363 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_443, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5364 | countingStream->write((uint64_t*)&cgen_var_443, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5365 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5366 | uint64_t cgen_var_444 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5367 | countingStream->putBe64(cgen_var_444); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5368 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5369 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5370 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5371 | } |
| 5372 | } |
| 5373 | uint32_t packetSize_vkDestroyRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5374 | countingStream->rewind(); |
| 5375 | uint32_t opcode_vkDestroyRenderPass = OP_vkDestroyRenderPass; |
| 5376 | stream->write(&opcode_vkDestroyRenderPass, sizeof(uint32_t)); |
| 5377 | stream->write(&packetSize_vkDestroyRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5378 | uint64_t cgen_var_445; |
| 5379 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_445, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5380 | stream->write((uint64_t*)&cgen_var_445, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5381 | uint64_t cgen_var_446; |
| 5382 | stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_446, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5383 | stream->write((uint64_t*)&cgen_var_446, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5384 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5385 | uint64_t cgen_var_447 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5386 | stream->putBe64(cgen_var_447); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5387 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5388 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5389 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5390 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5391 | resources->destroyMapping()->mapHandles_VkRenderPass((VkRenderPass*)&renderPass); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5392 | } |
| 5393 | |
| 5394 | void VkEncoder::vkGetRenderAreaGranularity( |
| 5395 | VkDevice device, |
| 5396 | VkRenderPass renderPass, |
| 5397 | VkExtent2D* pGranularity) |
| 5398 | { |
| 5399 | auto stream = mImpl->stream(); |
| 5400 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5401 | auto resources = mImpl->resources(); |
| 5402 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5403 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5404 | VkDevice local_device; |
| 5405 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5406 | VkRenderPass local_renderPass; |
| 5407 | local_renderPass = renderPass; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5408 | countingStream->rewind(); |
| 5409 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5410 | uint64_t cgen_var_448; |
| 5411 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_448, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5412 | countingStream->write((uint64_t*)&cgen_var_448, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5413 | uint64_t cgen_var_449; |
| 5414 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_449, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5415 | countingStream->write((uint64_t*)&cgen_var_449, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5416 | marshal_VkExtent2D(countingStream, (VkExtent2D*)(pGranularity)); |
| 5417 | } |
| 5418 | uint32_t packetSize_vkGetRenderAreaGranularity = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5419 | countingStream->rewind(); |
| 5420 | uint32_t opcode_vkGetRenderAreaGranularity = OP_vkGetRenderAreaGranularity; |
| 5421 | stream->write(&opcode_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| 5422 | stream->write(&packetSize_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5423 | uint64_t cgen_var_450; |
| 5424 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_450, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5425 | stream->write((uint64_t*)&cgen_var_450, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5426 | uint64_t cgen_var_451; |
| 5427 | stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_451, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5428 | stream->write((uint64_t*)&cgen_var_451, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5429 | marshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| 5430 | unmarshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| 5431 | } |
| 5432 | |
| 5433 | VkResult VkEncoder::vkCreateCommandPool( |
| 5434 | VkDevice device, |
| 5435 | const VkCommandPoolCreateInfo* pCreateInfo, |
| 5436 | const VkAllocationCallbacks* pAllocator, |
| 5437 | VkCommandPool* pCommandPool) |
| 5438 | { |
| 5439 | auto stream = mImpl->stream(); |
| 5440 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5441 | auto resources = mImpl->resources(); |
| 5442 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5443 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5444 | VkDevice local_device; |
| 5445 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5446 | VkCommandPoolCreateInfo* local_pCreateInfo; |
| 5447 | local_pCreateInfo = nullptr; |
| 5448 | if (pCreateInfo) |
| 5449 | { |
| 5450 | local_pCreateInfo = (VkCommandPoolCreateInfo*)pool->alloc(sizeof(const VkCommandPoolCreateInfo)); |
| 5451 | deepcopy_VkCommandPoolCreateInfo(pool, pCreateInfo, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| 5452 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5453 | VkAllocationCallbacks* local_pAllocator; |
| 5454 | local_pAllocator = nullptr; |
| 5455 | if (pAllocator) |
| 5456 | { |
| 5457 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5458 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5459 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5460 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5461 | countingStream->rewind(); |
| 5462 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5463 | uint64_t cgen_var_452; |
| 5464 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_452, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5465 | countingStream->write((uint64_t*)&cgen_var_452, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5466 | marshal_VkCommandPoolCreateInfo(countingStream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5467 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5468 | uint64_t cgen_var_453 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5469 | countingStream->putBe64(cgen_var_453); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5470 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5471 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5472 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5473 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5474 | uint64_t cgen_var_454; |
| 5475 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_454, 1); |
| 5476 | countingStream->write((uint64_t*)&cgen_var_454, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5477 | } |
| 5478 | uint32_t packetSize_vkCreateCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5479 | countingStream->rewind(); |
| 5480 | uint32_t opcode_vkCreateCommandPool = OP_vkCreateCommandPool; |
| 5481 | stream->write(&opcode_vkCreateCommandPool, sizeof(uint32_t)); |
| 5482 | stream->write(&packetSize_vkCreateCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5483 | uint64_t cgen_var_455; |
| 5484 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_455, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5485 | stream->write((uint64_t*)&cgen_var_455, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5486 | marshal_VkCommandPoolCreateInfo(stream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5487 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5488 | uint64_t cgen_var_456 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5489 | stream->putBe64(cgen_var_456); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5490 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5491 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5492 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5493 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5494 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5495 | uint64_t cgen_var_457; |
| 5496 | stream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_457, 1); |
| 5497 | stream->write((uint64_t*)&cgen_var_457, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5498 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5499 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5500 | uint64_t cgen_var_458; |
| 5501 | stream->read((uint64_t*)&cgen_var_458, 8); |
| 5502 | stream->handleMapping()->mapHandles_u64_VkCommandPool(&cgen_var_458, (VkCommandPool*)pCommandPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5503 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5504 | VkResult vkCreateCommandPool_VkResult_return = (VkResult)0; |
| 5505 | stream->read(&vkCreateCommandPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5506 | countingStream->clearPool(); |
| 5507 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5508 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5509 | return vkCreateCommandPool_VkResult_return; |
| 5510 | } |
| 5511 | |
| 5512 | void VkEncoder::vkDestroyCommandPool( |
| 5513 | VkDevice device, |
| 5514 | VkCommandPool commandPool, |
| 5515 | const VkAllocationCallbacks* pAllocator) |
| 5516 | { |
| 5517 | auto stream = mImpl->stream(); |
| 5518 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5519 | auto resources = mImpl->resources(); |
| 5520 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5521 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5522 | VkDevice local_device; |
| 5523 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5524 | VkCommandPool local_commandPool; |
| 5525 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5526 | VkAllocationCallbacks* local_pAllocator; |
| 5527 | local_pAllocator = nullptr; |
| 5528 | if (pAllocator) |
| 5529 | { |
| 5530 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5531 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5532 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5533 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5534 | countingStream->rewind(); |
| 5535 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5536 | uint64_t cgen_var_459; |
| 5537 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_459, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5538 | countingStream->write((uint64_t*)&cgen_var_459, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5539 | uint64_t cgen_var_460; |
| 5540 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_460, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5541 | countingStream->write((uint64_t*)&cgen_var_460, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5542 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5543 | uint64_t cgen_var_461 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5544 | countingStream->putBe64(cgen_var_461); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5545 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5546 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5547 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5548 | } |
| 5549 | } |
| 5550 | uint32_t packetSize_vkDestroyCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5551 | countingStream->rewind(); |
| 5552 | uint32_t opcode_vkDestroyCommandPool = OP_vkDestroyCommandPool; |
| 5553 | stream->write(&opcode_vkDestroyCommandPool, sizeof(uint32_t)); |
| 5554 | stream->write(&packetSize_vkDestroyCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5555 | uint64_t cgen_var_462; |
| 5556 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_462, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5557 | stream->write((uint64_t*)&cgen_var_462, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5558 | uint64_t cgen_var_463; |
| 5559 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_463, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5560 | stream->write((uint64_t*)&cgen_var_463, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5561 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5562 | uint64_t cgen_var_464 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5563 | stream->putBe64(cgen_var_464); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5564 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5565 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5566 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5567 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5568 | resources->destroyMapping()->mapHandles_VkCommandPool((VkCommandPool*)&commandPool); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5569 | } |
| 5570 | |
| 5571 | VkResult VkEncoder::vkResetCommandPool( |
| 5572 | VkDevice device, |
| 5573 | VkCommandPool commandPool, |
| 5574 | VkCommandPoolResetFlags flags) |
| 5575 | { |
| 5576 | auto stream = mImpl->stream(); |
| 5577 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5578 | auto resources = mImpl->resources(); |
| 5579 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5580 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5581 | VkDevice local_device; |
| 5582 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5583 | VkCommandPool local_commandPool; |
| 5584 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5585 | VkCommandPoolResetFlags local_flags; |
| 5586 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5587 | countingStream->rewind(); |
| 5588 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5589 | uint64_t cgen_var_465; |
| 5590 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_465, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5591 | countingStream->write((uint64_t*)&cgen_var_465, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5592 | uint64_t cgen_var_466; |
| 5593 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_466, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5594 | countingStream->write((uint64_t*)&cgen_var_466, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5595 | countingStream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5596 | } |
| 5597 | uint32_t packetSize_vkResetCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5598 | countingStream->rewind(); |
| 5599 | uint32_t opcode_vkResetCommandPool = OP_vkResetCommandPool; |
| 5600 | stream->write(&opcode_vkResetCommandPool, sizeof(uint32_t)); |
| 5601 | stream->write(&packetSize_vkResetCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5602 | uint64_t cgen_var_467; |
| 5603 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_467, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5604 | stream->write((uint64_t*)&cgen_var_467, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5605 | uint64_t cgen_var_468; |
| 5606 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_468, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5607 | stream->write((uint64_t*)&cgen_var_468, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5608 | stream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5609 | VkResult vkResetCommandPool_VkResult_return = (VkResult)0; |
| 5610 | stream->read(&vkResetCommandPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5611 | countingStream->clearPool(); |
| 5612 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5613 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5614 | return vkResetCommandPool_VkResult_return; |
| 5615 | } |
| 5616 | |
| 5617 | VkResult VkEncoder::vkAllocateCommandBuffers( |
| 5618 | VkDevice device, |
| 5619 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 5620 | VkCommandBuffer* pCommandBuffers) |
| 5621 | { |
| 5622 | auto stream = mImpl->stream(); |
| 5623 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5624 | auto resources = mImpl->resources(); |
| 5625 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5626 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5627 | VkDevice local_device; |
| 5628 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5629 | VkCommandBufferAllocateInfo* local_pAllocateInfo; |
| 5630 | local_pAllocateInfo = nullptr; |
| 5631 | if (pAllocateInfo) |
| 5632 | { |
| 5633 | local_pAllocateInfo = (VkCommandBufferAllocateInfo*)pool->alloc(sizeof(const VkCommandBufferAllocateInfo)); |
| 5634 | deepcopy_VkCommandBufferAllocateInfo(pool, pAllocateInfo, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| 5635 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5636 | countingStream->rewind(); |
| 5637 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5638 | uint64_t cgen_var_469; |
| 5639 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_469, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5640 | countingStream->write((uint64_t*)&cgen_var_469, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5641 | marshal_VkCommandBufferAllocateInfo(countingStream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5642 | if (pAllocateInfo->commandBufferCount) |
| 5643 | { |
| 5644 | uint64_t* cgen_var_470; |
| 5645 | countingStream->alloc((void**)&cgen_var_470, pAllocateInfo->commandBufferCount * 8); |
| 5646 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_470, pAllocateInfo->commandBufferCount); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5647 | countingStream->write((uint64_t*)cgen_var_470, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5648 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5649 | } |
| 5650 | uint32_t packetSize_vkAllocateCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5651 | countingStream->rewind(); |
| 5652 | uint32_t opcode_vkAllocateCommandBuffers = OP_vkAllocateCommandBuffers; |
| 5653 | stream->write(&opcode_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| 5654 | stream->write(&packetSize_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5655 | uint64_t cgen_var_471; |
| 5656 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_471, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5657 | stream->write((uint64_t*)&cgen_var_471, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5658 | marshal_VkCommandBufferAllocateInfo(stream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5659 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5660 | if (pAllocateInfo->commandBufferCount) |
| 5661 | { |
| 5662 | uint64_t* cgen_var_472; |
| 5663 | stream->alloc((void**)&cgen_var_472, pAllocateInfo->commandBufferCount * 8); |
| 5664 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_472, pAllocateInfo->commandBufferCount); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5665 | stream->write((uint64_t*)cgen_var_472, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5666 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5667 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5668 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5669 | if (pAllocateInfo->commandBufferCount) |
| 5670 | { |
| 5671 | uint64_t* cgen_var_473; |
| 5672 | stream->alloc((void**)&cgen_var_473, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5673 | stream->read((uint64_t*)cgen_var_473, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5674 | stream->handleMapping()->mapHandles_u64_VkCommandBuffer(cgen_var_473, (VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount); |
| 5675 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5676 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5677 | VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0; |
| 5678 | stream->read(&vkAllocateCommandBuffers_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5679 | countingStream->clearPool(); |
| 5680 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5681 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5682 | return vkAllocateCommandBuffers_VkResult_return; |
| 5683 | } |
| 5684 | |
| 5685 | void VkEncoder::vkFreeCommandBuffers( |
| 5686 | VkDevice device, |
| 5687 | VkCommandPool commandPool, |
| 5688 | uint32_t commandBufferCount, |
| 5689 | const VkCommandBuffer* pCommandBuffers) |
| 5690 | { |
| 5691 | auto stream = mImpl->stream(); |
| 5692 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5693 | auto resources = mImpl->resources(); |
| 5694 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5695 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5696 | VkDevice local_device; |
| 5697 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5698 | VkCommandPool local_commandPool; |
| 5699 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5700 | uint32_t local_commandBufferCount; |
| 5701 | local_commandBufferCount = commandBufferCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5702 | VkCommandBuffer* local_pCommandBuffers; |
| 5703 | local_pCommandBuffers = nullptr; |
| 5704 | if (pCommandBuffers) |
| 5705 | { |
| 5706 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 5707 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5708 | countingStream->rewind(); |
| 5709 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5710 | uint64_t cgen_var_474; |
| 5711 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_474, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5712 | countingStream->write((uint64_t*)&cgen_var_474, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5713 | uint64_t cgen_var_475; |
| 5714 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_475, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5715 | countingStream->write((uint64_t*)&cgen_var_475, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5716 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5717 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5718 | uint64_t cgen_var_476 = (uint64_t)(uintptr_t)local_pCommandBuffers; |
| 5719 | countingStream->putBe64(cgen_var_476); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5720 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5721 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5722 | if (((commandBufferCount))) |
| 5723 | { |
| 5724 | uint64_t* cgen_var_477; |
| 5725 | countingStream->alloc((void**)&cgen_var_477, ((commandBufferCount)) * 8); |
| 5726 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_477, ((commandBufferCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5727 | countingStream->write((uint64_t*)cgen_var_477, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5728 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5729 | } |
| 5730 | } |
| 5731 | uint32_t packetSize_vkFreeCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5732 | countingStream->rewind(); |
| 5733 | uint32_t opcode_vkFreeCommandBuffers = OP_vkFreeCommandBuffers; |
| 5734 | stream->write(&opcode_vkFreeCommandBuffers, sizeof(uint32_t)); |
| 5735 | stream->write(&packetSize_vkFreeCommandBuffers, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5736 | uint64_t cgen_var_478; |
| 5737 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_478, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5738 | stream->write((uint64_t*)&cgen_var_478, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5739 | uint64_t cgen_var_479; |
| 5740 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_479, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5741 | stream->write((uint64_t*)&cgen_var_479, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5742 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5743 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5744 | uint64_t cgen_var_480 = (uint64_t)(uintptr_t)local_pCommandBuffers; |
| 5745 | stream->putBe64(cgen_var_480); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5746 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5747 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5748 | if (((commandBufferCount))) |
| 5749 | { |
| 5750 | uint64_t* cgen_var_481; |
| 5751 | stream->alloc((void**)&cgen_var_481, ((commandBufferCount)) * 8); |
| 5752 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_481, ((commandBufferCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5753 | stream->write((uint64_t*)cgen_var_481, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5754 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5755 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5756 | if (pCommandBuffers) |
| 5757 | { |
| 5758 | resources->destroyMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, ((commandBufferCount))); |
| 5759 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5760 | } |
| 5761 | |
| 5762 | VkResult VkEncoder::vkBeginCommandBuffer( |
| 5763 | VkCommandBuffer commandBuffer, |
| 5764 | const VkCommandBufferBeginInfo* pBeginInfo) |
| 5765 | { |
| 5766 | auto stream = mImpl->stream(); |
| 5767 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5768 | auto resources = mImpl->resources(); |
| 5769 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5770 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5771 | VkCommandBuffer local_commandBuffer; |
| 5772 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5773 | VkCommandBufferBeginInfo* local_pBeginInfo; |
| 5774 | local_pBeginInfo = nullptr; |
| 5775 | if (pBeginInfo) |
| 5776 | { |
| 5777 | local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo)); |
| 5778 | deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 5779 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5780 | countingStream->rewind(); |
| 5781 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5782 | uint64_t cgen_var_482; |
| 5783 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_482, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5784 | countingStream->write((uint64_t*)&cgen_var_482, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5785 | marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5786 | } |
| 5787 | uint32_t packetSize_vkBeginCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5788 | countingStream->rewind(); |
| 5789 | uint32_t opcode_vkBeginCommandBuffer = OP_vkBeginCommandBuffer; |
| 5790 | stream->write(&opcode_vkBeginCommandBuffer, sizeof(uint32_t)); |
| 5791 | stream->write(&packetSize_vkBeginCommandBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5792 | uint64_t cgen_var_483; |
| 5793 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_483, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5794 | stream->write((uint64_t*)&cgen_var_483, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5795 | marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5796 | VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0; |
| 5797 | stream->read(&vkBeginCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5798 | countingStream->clearPool(); |
| 5799 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5800 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5801 | return vkBeginCommandBuffer_VkResult_return; |
| 5802 | } |
| 5803 | |
| 5804 | VkResult VkEncoder::vkEndCommandBuffer( |
| 5805 | VkCommandBuffer commandBuffer) |
| 5806 | { |
| 5807 | auto stream = mImpl->stream(); |
| 5808 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5809 | auto resources = mImpl->resources(); |
| 5810 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5811 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5812 | VkCommandBuffer local_commandBuffer; |
| 5813 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5814 | countingStream->rewind(); |
| 5815 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5816 | uint64_t cgen_var_484; |
| 5817 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_484, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5818 | countingStream->write((uint64_t*)&cgen_var_484, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5819 | } |
| 5820 | uint32_t packetSize_vkEndCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5821 | countingStream->rewind(); |
| 5822 | uint32_t opcode_vkEndCommandBuffer = OP_vkEndCommandBuffer; |
| 5823 | stream->write(&opcode_vkEndCommandBuffer, sizeof(uint32_t)); |
| 5824 | stream->write(&packetSize_vkEndCommandBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5825 | uint64_t cgen_var_485; |
| 5826 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_485, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5827 | stream->write((uint64_t*)&cgen_var_485, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5828 | VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0; |
| 5829 | stream->read(&vkEndCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5830 | countingStream->clearPool(); |
| 5831 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5832 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5833 | return vkEndCommandBuffer_VkResult_return; |
| 5834 | } |
| 5835 | |
| 5836 | VkResult VkEncoder::vkResetCommandBuffer( |
| 5837 | VkCommandBuffer commandBuffer, |
| 5838 | VkCommandBufferResetFlags flags) |
| 5839 | { |
| 5840 | auto stream = mImpl->stream(); |
| 5841 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5842 | auto resources = mImpl->resources(); |
| 5843 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5844 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5845 | VkCommandBuffer local_commandBuffer; |
| 5846 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5847 | VkCommandBufferResetFlags local_flags; |
| 5848 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5849 | countingStream->rewind(); |
| 5850 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5851 | uint64_t cgen_var_486; |
| 5852 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_486, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5853 | countingStream->write((uint64_t*)&cgen_var_486, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5854 | countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5855 | } |
| 5856 | uint32_t packetSize_vkResetCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5857 | countingStream->rewind(); |
| 5858 | uint32_t opcode_vkResetCommandBuffer = OP_vkResetCommandBuffer; |
| 5859 | stream->write(&opcode_vkResetCommandBuffer, sizeof(uint32_t)); |
| 5860 | stream->write(&packetSize_vkResetCommandBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5861 | uint64_t cgen_var_487; |
| 5862 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_487, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5863 | stream->write((uint64_t*)&cgen_var_487, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5864 | stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5865 | VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0; |
| 5866 | stream->read(&vkResetCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5867 | countingStream->clearPool(); |
| 5868 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5869 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5870 | return vkResetCommandBuffer_VkResult_return; |
| 5871 | } |
| 5872 | |
| 5873 | void VkEncoder::vkCmdBindPipeline( |
| 5874 | VkCommandBuffer commandBuffer, |
| 5875 | VkPipelineBindPoint pipelineBindPoint, |
| 5876 | VkPipeline pipeline) |
| 5877 | { |
| 5878 | auto stream = mImpl->stream(); |
| 5879 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5880 | auto resources = mImpl->resources(); |
| 5881 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5882 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5883 | VkCommandBuffer local_commandBuffer; |
| 5884 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5885 | VkPipelineBindPoint local_pipelineBindPoint; |
| 5886 | local_pipelineBindPoint = pipelineBindPoint; |
| 5887 | VkPipeline local_pipeline; |
| 5888 | local_pipeline = pipeline; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5889 | countingStream->rewind(); |
| 5890 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5891 | uint64_t cgen_var_488; |
| 5892 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_488, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5893 | countingStream->write((uint64_t*)&cgen_var_488, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5894 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5895 | uint64_t cgen_var_489; |
| 5896 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_489, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5897 | countingStream->write((uint64_t*)&cgen_var_489, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5898 | } |
| 5899 | uint32_t packetSize_vkCmdBindPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5900 | countingStream->rewind(); |
| 5901 | uint32_t opcode_vkCmdBindPipeline = OP_vkCmdBindPipeline; |
| 5902 | stream->write(&opcode_vkCmdBindPipeline, sizeof(uint32_t)); |
| 5903 | stream->write(&packetSize_vkCmdBindPipeline, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5904 | uint64_t cgen_var_490; |
| 5905 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_490, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5906 | stream->write((uint64_t*)&cgen_var_490, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5907 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5908 | uint64_t cgen_var_491; |
| 5909 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_491, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5910 | stream->write((uint64_t*)&cgen_var_491, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5911 | } |
| 5912 | |
| 5913 | void VkEncoder::vkCmdSetViewport( |
| 5914 | VkCommandBuffer commandBuffer, |
| 5915 | uint32_t firstViewport, |
| 5916 | uint32_t viewportCount, |
| 5917 | const VkViewport* pViewports) |
| 5918 | { |
| 5919 | auto stream = mImpl->stream(); |
| 5920 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5921 | auto resources = mImpl->resources(); |
| 5922 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5923 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5924 | VkCommandBuffer local_commandBuffer; |
| 5925 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5926 | uint32_t local_firstViewport; |
| 5927 | local_firstViewport = firstViewport; |
| 5928 | uint32_t local_viewportCount; |
| 5929 | local_viewportCount = viewportCount; |
| 5930 | VkViewport* local_pViewports; |
| 5931 | local_pViewports = nullptr; |
| 5932 | if (pViewports) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5933 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5934 | local_pViewports = (VkViewport*)pool->alloc(((viewportCount)) * sizeof(const VkViewport)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5935 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 5936 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5937 | deepcopy_VkViewport(pool, pViewports + i, (VkViewport*)(local_pViewports + i)); |
| 5938 | } |
| 5939 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5940 | countingStream->rewind(); |
| 5941 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5942 | uint64_t cgen_var_492; |
| 5943 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_492, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5944 | countingStream->write((uint64_t*)&cgen_var_492, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5945 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 5946 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 5947 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 5948 | { |
| 5949 | marshal_VkViewport(countingStream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5950 | } |
| 5951 | } |
| 5952 | uint32_t packetSize_vkCmdSetViewport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5953 | countingStream->rewind(); |
| 5954 | uint32_t opcode_vkCmdSetViewport = OP_vkCmdSetViewport; |
| 5955 | stream->write(&opcode_vkCmdSetViewport, sizeof(uint32_t)); |
| 5956 | stream->write(&packetSize_vkCmdSetViewport, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5957 | uint64_t cgen_var_493; |
| 5958 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_493, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5959 | stream->write((uint64_t*)&cgen_var_493, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5960 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 5961 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5962 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 5963 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5964 | marshal_VkViewport(stream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5965 | } |
| 5966 | } |
| 5967 | |
| 5968 | void VkEncoder::vkCmdSetScissor( |
| 5969 | VkCommandBuffer commandBuffer, |
| 5970 | uint32_t firstScissor, |
| 5971 | uint32_t scissorCount, |
| 5972 | const VkRect2D* pScissors) |
| 5973 | { |
| 5974 | auto stream = mImpl->stream(); |
| 5975 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5976 | auto resources = mImpl->resources(); |
| 5977 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5978 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5979 | VkCommandBuffer local_commandBuffer; |
| 5980 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5981 | uint32_t local_firstScissor; |
| 5982 | local_firstScissor = firstScissor; |
| 5983 | uint32_t local_scissorCount; |
| 5984 | local_scissorCount = scissorCount; |
| 5985 | VkRect2D* local_pScissors; |
| 5986 | local_pScissors = nullptr; |
| 5987 | if (pScissors) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5988 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5989 | local_pScissors = (VkRect2D*)pool->alloc(((scissorCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5990 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 5991 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5992 | deepcopy_VkRect2D(pool, pScissors + i, (VkRect2D*)(local_pScissors + i)); |
| 5993 | } |
| 5994 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5995 | countingStream->rewind(); |
| 5996 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5997 | uint64_t cgen_var_494; |
| 5998 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_494, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 5999 | countingStream->write((uint64_t*)&cgen_var_494, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6000 | countingStream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 6001 | countingStream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| 6002 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 6003 | { |
| 6004 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6005 | } |
| 6006 | } |
| 6007 | uint32_t packetSize_vkCmdSetScissor = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6008 | countingStream->rewind(); |
| 6009 | uint32_t opcode_vkCmdSetScissor = OP_vkCmdSetScissor; |
| 6010 | stream->write(&opcode_vkCmdSetScissor, sizeof(uint32_t)); |
| 6011 | stream->write(&packetSize_vkCmdSetScissor, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6012 | uint64_t cgen_var_495; |
| 6013 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_495, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6014 | stream->write((uint64_t*)&cgen_var_495, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6015 | stream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 6016 | stream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6017 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 6018 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6019 | marshal_VkRect2D(stream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6020 | } |
| 6021 | } |
| 6022 | |
| 6023 | void VkEncoder::vkCmdSetLineWidth( |
| 6024 | VkCommandBuffer commandBuffer, |
| 6025 | float lineWidth) |
| 6026 | { |
| 6027 | auto stream = mImpl->stream(); |
| 6028 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6029 | auto resources = mImpl->resources(); |
| 6030 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6031 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6032 | VkCommandBuffer local_commandBuffer; |
| 6033 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6034 | float local_lineWidth; |
| 6035 | local_lineWidth = lineWidth; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6036 | countingStream->rewind(); |
| 6037 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6038 | uint64_t cgen_var_496; |
| 6039 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_496, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6040 | countingStream->write((uint64_t*)&cgen_var_496, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6041 | countingStream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6042 | } |
| 6043 | uint32_t packetSize_vkCmdSetLineWidth = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6044 | countingStream->rewind(); |
| 6045 | uint32_t opcode_vkCmdSetLineWidth = OP_vkCmdSetLineWidth; |
| 6046 | stream->write(&opcode_vkCmdSetLineWidth, sizeof(uint32_t)); |
| 6047 | stream->write(&packetSize_vkCmdSetLineWidth, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6048 | uint64_t cgen_var_497; |
| 6049 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_497, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6050 | stream->write((uint64_t*)&cgen_var_497, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6051 | stream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6052 | } |
| 6053 | |
| 6054 | void VkEncoder::vkCmdSetDepthBias( |
| 6055 | VkCommandBuffer commandBuffer, |
| 6056 | float depthBiasConstantFactor, |
| 6057 | float depthBiasClamp, |
| 6058 | float depthBiasSlopeFactor) |
| 6059 | { |
| 6060 | auto stream = mImpl->stream(); |
| 6061 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6062 | auto resources = mImpl->resources(); |
| 6063 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6064 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6065 | VkCommandBuffer local_commandBuffer; |
| 6066 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6067 | float local_depthBiasConstantFactor; |
| 6068 | local_depthBiasConstantFactor = depthBiasConstantFactor; |
| 6069 | float local_depthBiasClamp; |
| 6070 | local_depthBiasClamp = depthBiasClamp; |
| 6071 | float local_depthBiasSlopeFactor; |
| 6072 | local_depthBiasSlopeFactor = depthBiasSlopeFactor; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6073 | countingStream->rewind(); |
| 6074 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6075 | uint64_t cgen_var_498; |
| 6076 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_498, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6077 | countingStream->write((uint64_t*)&cgen_var_498, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6078 | countingStream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 6079 | countingStream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 6080 | countingStream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6081 | } |
| 6082 | uint32_t packetSize_vkCmdSetDepthBias = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6083 | countingStream->rewind(); |
| 6084 | uint32_t opcode_vkCmdSetDepthBias = OP_vkCmdSetDepthBias; |
| 6085 | stream->write(&opcode_vkCmdSetDepthBias, sizeof(uint32_t)); |
| 6086 | stream->write(&packetSize_vkCmdSetDepthBias, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6087 | uint64_t cgen_var_499; |
| 6088 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_499, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6089 | stream->write((uint64_t*)&cgen_var_499, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6090 | stream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 6091 | stream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 6092 | stream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6093 | } |
| 6094 | |
| 6095 | void VkEncoder::vkCmdSetBlendConstants( |
| 6096 | VkCommandBuffer commandBuffer, |
| 6097 | const float blendConstants) |
| 6098 | { |
| 6099 | auto stream = mImpl->stream(); |
| 6100 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6101 | auto resources = mImpl->resources(); |
| 6102 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6103 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6104 | VkCommandBuffer local_commandBuffer; |
| 6105 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6106 | float local_blendConstants[4]; |
| 6107 | memcpy(&local_blendConstants, &blendConstants, 4 * sizeof(const float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6108 | countingStream->rewind(); |
| 6109 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6110 | uint64_t cgen_var_500; |
| 6111 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_500, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6112 | countingStream->write((uint64_t*)&cgen_var_500, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6113 | countingStream->write((float*)&local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6114 | } |
| 6115 | uint32_t packetSize_vkCmdSetBlendConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6116 | countingStream->rewind(); |
| 6117 | uint32_t opcode_vkCmdSetBlendConstants = OP_vkCmdSetBlendConstants; |
| 6118 | stream->write(&opcode_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| 6119 | stream->write(&packetSize_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6120 | uint64_t cgen_var_501; |
| 6121 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_501, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6122 | stream->write((uint64_t*)&cgen_var_501, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6123 | stream->write((float*)&local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6124 | } |
| 6125 | |
| 6126 | void VkEncoder::vkCmdSetDepthBounds( |
| 6127 | VkCommandBuffer commandBuffer, |
| 6128 | float minDepthBounds, |
| 6129 | float maxDepthBounds) |
| 6130 | { |
| 6131 | auto stream = mImpl->stream(); |
| 6132 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6133 | auto resources = mImpl->resources(); |
| 6134 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6135 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6136 | VkCommandBuffer local_commandBuffer; |
| 6137 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6138 | float local_minDepthBounds; |
| 6139 | local_minDepthBounds = minDepthBounds; |
| 6140 | float local_maxDepthBounds; |
| 6141 | local_maxDepthBounds = maxDepthBounds; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6142 | countingStream->rewind(); |
| 6143 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6144 | uint64_t cgen_var_502; |
| 6145 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_502, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6146 | countingStream->write((uint64_t*)&cgen_var_502, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6147 | countingStream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 6148 | countingStream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6149 | } |
| 6150 | uint32_t packetSize_vkCmdSetDepthBounds = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6151 | countingStream->rewind(); |
| 6152 | uint32_t opcode_vkCmdSetDepthBounds = OP_vkCmdSetDepthBounds; |
| 6153 | stream->write(&opcode_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| 6154 | stream->write(&packetSize_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6155 | uint64_t cgen_var_503; |
| 6156 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_503, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6157 | stream->write((uint64_t*)&cgen_var_503, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6158 | stream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 6159 | stream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6160 | } |
| 6161 | |
| 6162 | void VkEncoder::vkCmdSetStencilCompareMask( |
| 6163 | VkCommandBuffer commandBuffer, |
| 6164 | VkStencilFaceFlags faceMask, |
| 6165 | uint32_t compareMask) |
| 6166 | { |
| 6167 | auto stream = mImpl->stream(); |
| 6168 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6169 | auto resources = mImpl->resources(); |
| 6170 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6171 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6172 | VkCommandBuffer local_commandBuffer; |
| 6173 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6174 | VkStencilFaceFlags local_faceMask; |
| 6175 | local_faceMask = faceMask; |
| 6176 | uint32_t local_compareMask; |
| 6177 | local_compareMask = compareMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6178 | countingStream->rewind(); |
| 6179 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6180 | uint64_t cgen_var_504; |
| 6181 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_504, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6182 | countingStream->write((uint64_t*)&cgen_var_504, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6183 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6184 | countingStream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6185 | } |
| 6186 | uint32_t packetSize_vkCmdSetStencilCompareMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6187 | countingStream->rewind(); |
| 6188 | uint32_t opcode_vkCmdSetStencilCompareMask = OP_vkCmdSetStencilCompareMask; |
| 6189 | stream->write(&opcode_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| 6190 | stream->write(&packetSize_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6191 | uint64_t cgen_var_505; |
| 6192 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_505, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6193 | stream->write((uint64_t*)&cgen_var_505, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6194 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6195 | stream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6196 | } |
| 6197 | |
| 6198 | void VkEncoder::vkCmdSetStencilWriteMask( |
| 6199 | VkCommandBuffer commandBuffer, |
| 6200 | VkStencilFaceFlags faceMask, |
| 6201 | uint32_t writeMask) |
| 6202 | { |
| 6203 | auto stream = mImpl->stream(); |
| 6204 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6205 | auto resources = mImpl->resources(); |
| 6206 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6207 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6208 | VkCommandBuffer local_commandBuffer; |
| 6209 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6210 | VkStencilFaceFlags local_faceMask; |
| 6211 | local_faceMask = faceMask; |
| 6212 | uint32_t local_writeMask; |
| 6213 | local_writeMask = writeMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6214 | countingStream->rewind(); |
| 6215 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6216 | uint64_t cgen_var_506; |
| 6217 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_506, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6218 | countingStream->write((uint64_t*)&cgen_var_506, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6219 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6220 | countingStream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6221 | } |
| 6222 | uint32_t packetSize_vkCmdSetStencilWriteMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6223 | countingStream->rewind(); |
| 6224 | uint32_t opcode_vkCmdSetStencilWriteMask = OP_vkCmdSetStencilWriteMask; |
| 6225 | stream->write(&opcode_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| 6226 | stream->write(&packetSize_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6227 | uint64_t cgen_var_507; |
| 6228 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_507, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6229 | stream->write((uint64_t*)&cgen_var_507, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6230 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6231 | stream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6232 | } |
| 6233 | |
| 6234 | void VkEncoder::vkCmdSetStencilReference( |
| 6235 | VkCommandBuffer commandBuffer, |
| 6236 | VkStencilFaceFlags faceMask, |
| 6237 | uint32_t reference) |
| 6238 | { |
| 6239 | auto stream = mImpl->stream(); |
| 6240 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6241 | auto resources = mImpl->resources(); |
| 6242 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6243 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6244 | VkCommandBuffer local_commandBuffer; |
| 6245 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6246 | VkStencilFaceFlags local_faceMask; |
| 6247 | local_faceMask = faceMask; |
| 6248 | uint32_t local_reference; |
| 6249 | local_reference = reference; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6250 | countingStream->rewind(); |
| 6251 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6252 | uint64_t cgen_var_508; |
| 6253 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_508, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6254 | countingStream->write((uint64_t*)&cgen_var_508, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6255 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6256 | countingStream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6257 | } |
| 6258 | uint32_t packetSize_vkCmdSetStencilReference = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6259 | countingStream->rewind(); |
| 6260 | uint32_t opcode_vkCmdSetStencilReference = OP_vkCmdSetStencilReference; |
| 6261 | stream->write(&opcode_vkCmdSetStencilReference, sizeof(uint32_t)); |
| 6262 | stream->write(&packetSize_vkCmdSetStencilReference, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6263 | uint64_t cgen_var_509; |
| 6264 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_509, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6265 | stream->write((uint64_t*)&cgen_var_509, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6266 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6267 | stream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6268 | } |
| 6269 | |
| 6270 | void VkEncoder::vkCmdBindDescriptorSets( |
| 6271 | VkCommandBuffer commandBuffer, |
| 6272 | VkPipelineBindPoint pipelineBindPoint, |
| 6273 | VkPipelineLayout layout, |
| 6274 | uint32_t firstSet, |
| 6275 | uint32_t descriptorSetCount, |
| 6276 | const VkDescriptorSet* pDescriptorSets, |
| 6277 | uint32_t dynamicOffsetCount, |
| 6278 | const uint32_t* pDynamicOffsets) |
| 6279 | { |
| 6280 | auto stream = mImpl->stream(); |
| 6281 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6282 | auto resources = mImpl->resources(); |
| 6283 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6284 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6285 | VkCommandBuffer local_commandBuffer; |
| 6286 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6287 | VkPipelineBindPoint local_pipelineBindPoint; |
| 6288 | local_pipelineBindPoint = pipelineBindPoint; |
| 6289 | VkPipelineLayout local_layout; |
| 6290 | local_layout = layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6291 | uint32_t local_firstSet; |
| 6292 | local_firstSet = firstSet; |
| 6293 | uint32_t local_descriptorSetCount; |
| 6294 | local_descriptorSetCount = descriptorSetCount; |
| 6295 | VkDescriptorSet* local_pDescriptorSets; |
| 6296 | local_pDescriptorSets = nullptr; |
| 6297 | if (pDescriptorSets) |
| 6298 | { |
| 6299 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 6300 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6301 | uint32_t local_dynamicOffsetCount; |
| 6302 | local_dynamicOffsetCount = dynamicOffsetCount; |
| 6303 | uint32_t* local_pDynamicOffsets; |
| 6304 | local_pDynamicOffsets = nullptr; |
| 6305 | if (pDynamicOffsets) |
| 6306 | { |
| 6307 | local_pDynamicOffsets = (uint32_t*)pool->dupArray(pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(const uint32_t)); |
| 6308 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6309 | countingStream->rewind(); |
| 6310 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6311 | uint64_t cgen_var_510; |
| 6312 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_510, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6313 | countingStream->write((uint64_t*)&cgen_var_510, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6314 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6315 | uint64_t cgen_var_511; |
| 6316 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_511, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6317 | countingStream->write((uint64_t*)&cgen_var_511, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6318 | countingStream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 6319 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6320 | if (((descriptorSetCount))) |
| 6321 | { |
| 6322 | uint64_t* cgen_var_512; |
| 6323 | countingStream->alloc((void**)&cgen_var_512, ((descriptorSetCount)) * 8); |
| 6324 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_512, ((descriptorSetCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6325 | countingStream->write((uint64_t*)cgen_var_512, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6326 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6327 | countingStream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 6328 | countingStream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6329 | } |
| 6330 | uint32_t packetSize_vkCmdBindDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6331 | countingStream->rewind(); |
| 6332 | uint32_t opcode_vkCmdBindDescriptorSets = OP_vkCmdBindDescriptorSets; |
| 6333 | stream->write(&opcode_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| 6334 | stream->write(&packetSize_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6335 | uint64_t cgen_var_513; |
| 6336 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_513, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6337 | stream->write((uint64_t*)&cgen_var_513, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6338 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6339 | uint64_t cgen_var_514; |
| 6340 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_514, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6341 | stream->write((uint64_t*)&cgen_var_514, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6342 | stream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 6343 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6344 | if (((descriptorSetCount))) |
| 6345 | { |
| 6346 | uint64_t* cgen_var_515; |
| 6347 | stream->alloc((void**)&cgen_var_515, ((descriptorSetCount)) * 8); |
| 6348 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_515, ((descriptorSetCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6349 | stream->write((uint64_t*)cgen_var_515, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6350 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6351 | stream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 6352 | stream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6353 | } |
| 6354 | |
| 6355 | void VkEncoder::vkCmdBindIndexBuffer( |
| 6356 | VkCommandBuffer commandBuffer, |
| 6357 | VkBuffer buffer, |
| 6358 | VkDeviceSize offset, |
| 6359 | VkIndexType indexType) |
| 6360 | { |
| 6361 | auto stream = mImpl->stream(); |
| 6362 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6363 | auto resources = mImpl->resources(); |
| 6364 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6365 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6366 | VkCommandBuffer local_commandBuffer; |
| 6367 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6368 | VkBuffer local_buffer; |
| 6369 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6370 | VkDeviceSize local_offset; |
| 6371 | local_offset = offset; |
| 6372 | VkIndexType local_indexType; |
| 6373 | local_indexType = indexType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6374 | countingStream->rewind(); |
| 6375 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6376 | uint64_t cgen_var_516; |
| 6377 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_516, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6378 | countingStream->write((uint64_t*)&cgen_var_516, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6379 | uint64_t cgen_var_517; |
| 6380 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_517, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6381 | countingStream->write((uint64_t*)&cgen_var_517, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6382 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 6383 | countingStream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6384 | } |
| 6385 | uint32_t packetSize_vkCmdBindIndexBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6386 | countingStream->rewind(); |
| 6387 | uint32_t opcode_vkCmdBindIndexBuffer = OP_vkCmdBindIndexBuffer; |
| 6388 | stream->write(&opcode_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| 6389 | stream->write(&packetSize_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6390 | uint64_t cgen_var_518; |
| 6391 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_518, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6392 | stream->write((uint64_t*)&cgen_var_518, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6393 | uint64_t cgen_var_519; |
| 6394 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_519, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6395 | stream->write((uint64_t*)&cgen_var_519, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6396 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 6397 | stream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6398 | } |
| 6399 | |
| 6400 | void VkEncoder::vkCmdBindVertexBuffers( |
| 6401 | VkCommandBuffer commandBuffer, |
| 6402 | uint32_t firstBinding, |
| 6403 | uint32_t bindingCount, |
| 6404 | const VkBuffer* pBuffers, |
| 6405 | const VkDeviceSize* pOffsets) |
| 6406 | { |
| 6407 | auto stream = mImpl->stream(); |
| 6408 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6409 | auto resources = mImpl->resources(); |
| 6410 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6411 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6412 | VkCommandBuffer local_commandBuffer; |
| 6413 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6414 | uint32_t local_firstBinding; |
| 6415 | local_firstBinding = firstBinding; |
| 6416 | uint32_t local_bindingCount; |
| 6417 | local_bindingCount = bindingCount; |
| 6418 | VkBuffer* local_pBuffers; |
| 6419 | local_pBuffers = nullptr; |
| 6420 | if (pBuffers) |
| 6421 | { |
| 6422 | local_pBuffers = (VkBuffer*)pool->dupArray(pBuffers, ((bindingCount)) * sizeof(const VkBuffer)); |
| 6423 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6424 | VkDeviceSize* local_pOffsets; |
| 6425 | local_pOffsets = nullptr; |
| 6426 | if (pOffsets) |
| 6427 | { |
| 6428 | local_pOffsets = (VkDeviceSize*)pool->dupArray(pOffsets, ((bindingCount)) * sizeof(const VkDeviceSize)); |
| 6429 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6430 | countingStream->rewind(); |
| 6431 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6432 | uint64_t cgen_var_520; |
| 6433 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_520, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6434 | countingStream->write((uint64_t*)&cgen_var_520, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6435 | countingStream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 6436 | countingStream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6437 | if (((bindingCount))) |
| 6438 | { |
| 6439 | uint64_t* cgen_var_521; |
| 6440 | countingStream->alloc((void**)&cgen_var_521, ((bindingCount)) * 8); |
| 6441 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_521, ((bindingCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6442 | countingStream->write((uint64_t*)cgen_var_521, ((bindingCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6443 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6444 | countingStream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6445 | } |
| 6446 | uint32_t packetSize_vkCmdBindVertexBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6447 | countingStream->rewind(); |
| 6448 | uint32_t opcode_vkCmdBindVertexBuffers = OP_vkCmdBindVertexBuffers; |
| 6449 | stream->write(&opcode_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| 6450 | stream->write(&packetSize_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6451 | uint64_t cgen_var_522; |
| 6452 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_522, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6453 | stream->write((uint64_t*)&cgen_var_522, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6454 | stream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 6455 | stream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6456 | if (((bindingCount))) |
| 6457 | { |
| 6458 | uint64_t* cgen_var_523; |
| 6459 | stream->alloc((void**)&cgen_var_523, ((bindingCount)) * 8); |
| 6460 | stream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_523, ((bindingCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6461 | stream->write((uint64_t*)cgen_var_523, ((bindingCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6462 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6463 | stream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6464 | } |
| 6465 | |
| 6466 | void VkEncoder::vkCmdDraw( |
| 6467 | VkCommandBuffer commandBuffer, |
| 6468 | uint32_t vertexCount, |
| 6469 | uint32_t instanceCount, |
| 6470 | uint32_t firstVertex, |
| 6471 | uint32_t firstInstance) |
| 6472 | { |
| 6473 | auto stream = mImpl->stream(); |
| 6474 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6475 | auto resources = mImpl->resources(); |
| 6476 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6477 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6478 | VkCommandBuffer local_commandBuffer; |
| 6479 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6480 | uint32_t local_vertexCount; |
| 6481 | local_vertexCount = vertexCount; |
| 6482 | uint32_t local_instanceCount; |
| 6483 | local_instanceCount = instanceCount; |
| 6484 | uint32_t local_firstVertex; |
| 6485 | local_firstVertex = firstVertex; |
| 6486 | uint32_t local_firstInstance; |
| 6487 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6488 | countingStream->rewind(); |
| 6489 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6490 | uint64_t cgen_var_524; |
| 6491 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_524, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6492 | countingStream->write((uint64_t*)&cgen_var_524, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6493 | countingStream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 6494 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 6495 | countingStream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 6496 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6497 | } |
| 6498 | uint32_t packetSize_vkCmdDraw = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6499 | countingStream->rewind(); |
| 6500 | uint32_t opcode_vkCmdDraw = OP_vkCmdDraw; |
| 6501 | stream->write(&opcode_vkCmdDraw, sizeof(uint32_t)); |
| 6502 | stream->write(&packetSize_vkCmdDraw, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6503 | uint64_t cgen_var_525; |
| 6504 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_525, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6505 | stream->write((uint64_t*)&cgen_var_525, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6506 | stream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 6507 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 6508 | stream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 6509 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6510 | } |
| 6511 | |
| 6512 | void VkEncoder::vkCmdDrawIndexed( |
| 6513 | VkCommandBuffer commandBuffer, |
| 6514 | uint32_t indexCount, |
| 6515 | uint32_t instanceCount, |
| 6516 | uint32_t firstIndex, |
| 6517 | int32_t vertexOffset, |
| 6518 | uint32_t firstInstance) |
| 6519 | { |
| 6520 | auto stream = mImpl->stream(); |
| 6521 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6522 | auto resources = mImpl->resources(); |
| 6523 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6524 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6525 | VkCommandBuffer local_commandBuffer; |
| 6526 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6527 | uint32_t local_indexCount; |
| 6528 | local_indexCount = indexCount; |
| 6529 | uint32_t local_instanceCount; |
| 6530 | local_instanceCount = instanceCount; |
| 6531 | uint32_t local_firstIndex; |
| 6532 | local_firstIndex = firstIndex; |
| 6533 | int32_t local_vertexOffset; |
| 6534 | local_vertexOffset = vertexOffset; |
| 6535 | uint32_t local_firstInstance; |
| 6536 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6537 | countingStream->rewind(); |
| 6538 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6539 | uint64_t cgen_var_526; |
| 6540 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_526, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6541 | countingStream->write((uint64_t*)&cgen_var_526, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6542 | countingStream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 6543 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 6544 | countingStream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 6545 | countingStream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 6546 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6547 | } |
| 6548 | uint32_t packetSize_vkCmdDrawIndexed = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6549 | countingStream->rewind(); |
| 6550 | uint32_t opcode_vkCmdDrawIndexed = OP_vkCmdDrawIndexed; |
| 6551 | stream->write(&opcode_vkCmdDrawIndexed, sizeof(uint32_t)); |
| 6552 | stream->write(&packetSize_vkCmdDrawIndexed, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6553 | uint64_t cgen_var_527; |
| 6554 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_527, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6555 | stream->write((uint64_t*)&cgen_var_527, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6556 | stream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 6557 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 6558 | stream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 6559 | stream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 6560 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6561 | } |
| 6562 | |
| 6563 | void VkEncoder::vkCmdDrawIndirect( |
| 6564 | VkCommandBuffer commandBuffer, |
| 6565 | VkBuffer buffer, |
| 6566 | VkDeviceSize offset, |
| 6567 | uint32_t drawCount, |
| 6568 | uint32_t stride) |
| 6569 | { |
| 6570 | auto stream = mImpl->stream(); |
| 6571 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6572 | auto resources = mImpl->resources(); |
| 6573 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6574 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6575 | VkCommandBuffer local_commandBuffer; |
| 6576 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6577 | VkBuffer local_buffer; |
| 6578 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6579 | VkDeviceSize local_offset; |
| 6580 | local_offset = offset; |
| 6581 | uint32_t local_drawCount; |
| 6582 | local_drawCount = drawCount; |
| 6583 | uint32_t local_stride; |
| 6584 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6585 | countingStream->rewind(); |
| 6586 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6587 | uint64_t cgen_var_528; |
| 6588 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_528, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6589 | countingStream->write((uint64_t*)&cgen_var_528, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6590 | uint64_t cgen_var_529; |
| 6591 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_529, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6592 | countingStream->write((uint64_t*)&cgen_var_529, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6593 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 6594 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 6595 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6596 | } |
| 6597 | uint32_t packetSize_vkCmdDrawIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6598 | countingStream->rewind(); |
| 6599 | uint32_t opcode_vkCmdDrawIndirect = OP_vkCmdDrawIndirect; |
| 6600 | stream->write(&opcode_vkCmdDrawIndirect, sizeof(uint32_t)); |
| 6601 | stream->write(&packetSize_vkCmdDrawIndirect, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6602 | uint64_t cgen_var_530; |
| 6603 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_530, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6604 | stream->write((uint64_t*)&cgen_var_530, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6605 | uint64_t cgen_var_531; |
| 6606 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_531, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6607 | stream->write((uint64_t*)&cgen_var_531, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6608 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 6609 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 6610 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6611 | } |
| 6612 | |
| 6613 | void VkEncoder::vkCmdDrawIndexedIndirect( |
| 6614 | VkCommandBuffer commandBuffer, |
| 6615 | VkBuffer buffer, |
| 6616 | VkDeviceSize offset, |
| 6617 | uint32_t drawCount, |
| 6618 | uint32_t stride) |
| 6619 | { |
| 6620 | auto stream = mImpl->stream(); |
| 6621 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6622 | auto resources = mImpl->resources(); |
| 6623 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6624 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6625 | VkCommandBuffer local_commandBuffer; |
| 6626 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6627 | VkBuffer local_buffer; |
| 6628 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6629 | VkDeviceSize local_offset; |
| 6630 | local_offset = offset; |
| 6631 | uint32_t local_drawCount; |
| 6632 | local_drawCount = drawCount; |
| 6633 | uint32_t local_stride; |
| 6634 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6635 | countingStream->rewind(); |
| 6636 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6637 | uint64_t cgen_var_532; |
| 6638 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_532, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6639 | countingStream->write((uint64_t*)&cgen_var_532, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6640 | uint64_t cgen_var_533; |
| 6641 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_533, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6642 | countingStream->write((uint64_t*)&cgen_var_533, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6643 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 6644 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 6645 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6646 | } |
| 6647 | uint32_t packetSize_vkCmdDrawIndexedIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6648 | countingStream->rewind(); |
| 6649 | uint32_t opcode_vkCmdDrawIndexedIndirect = OP_vkCmdDrawIndexedIndirect; |
| 6650 | stream->write(&opcode_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| 6651 | stream->write(&packetSize_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6652 | uint64_t cgen_var_534; |
| 6653 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_534, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6654 | stream->write((uint64_t*)&cgen_var_534, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6655 | uint64_t cgen_var_535; |
| 6656 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_535, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6657 | stream->write((uint64_t*)&cgen_var_535, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6658 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 6659 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 6660 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6661 | } |
| 6662 | |
| 6663 | void VkEncoder::vkCmdDispatch( |
| 6664 | VkCommandBuffer commandBuffer, |
| 6665 | uint32_t groupCountX, |
| 6666 | uint32_t groupCountY, |
| 6667 | uint32_t groupCountZ) |
| 6668 | { |
| 6669 | auto stream = mImpl->stream(); |
| 6670 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6671 | auto resources = mImpl->resources(); |
| 6672 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6673 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6674 | VkCommandBuffer local_commandBuffer; |
| 6675 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6676 | uint32_t local_groupCountX; |
| 6677 | local_groupCountX = groupCountX; |
| 6678 | uint32_t local_groupCountY; |
| 6679 | local_groupCountY = groupCountY; |
| 6680 | uint32_t local_groupCountZ; |
| 6681 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6682 | countingStream->rewind(); |
| 6683 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6684 | uint64_t cgen_var_536; |
| 6685 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_536, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6686 | countingStream->write((uint64_t*)&cgen_var_536, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6687 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 6688 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 6689 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6690 | } |
| 6691 | uint32_t packetSize_vkCmdDispatch = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6692 | countingStream->rewind(); |
| 6693 | uint32_t opcode_vkCmdDispatch = OP_vkCmdDispatch; |
| 6694 | stream->write(&opcode_vkCmdDispatch, sizeof(uint32_t)); |
| 6695 | stream->write(&packetSize_vkCmdDispatch, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6696 | uint64_t cgen_var_537; |
| 6697 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_537, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6698 | stream->write((uint64_t*)&cgen_var_537, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6699 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 6700 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 6701 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6702 | } |
| 6703 | |
| 6704 | void VkEncoder::vkCmdDispatchIndirect( |
| 6705 | VkCommandBuffer commandBuffer, |
| 6706 | VkBuffer buffer, |
| 6707 | VkDeviceSize offset) |
| 6708 | { |
| 6709 | auto stream = mImpl->stream(); |
| 6710 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6711 | auto resources = mImpl->resources(); |
| 6712 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6713 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6714 | VkCommandBuffer local_commandBuffer; |
| 6715 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6716 | VkBuffer local_buffer; |
| 6717 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6718 | VkDeviceSize local_offset; |
| 6719 | local_offset = offset; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6720 | countingStream->rewind(); |
| 6721 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6722 | uint64_t cgen_var_538; |
| 6723 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_538, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6724 | countingStream->write((uint64_t*)&cgen_var_538, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6725 | uint64_t cgen_var_539; |
| 6726 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_539, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6727 | countingStream->write((uint64_t*)&cgen_var_539, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6728 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6729 | } |
| 6730 | uint32_t packetSize_vkCmdDispatchIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6731 | countingStream->rewind(); |
| 6732 | uint32_t opcode_vkCmdDispatchIndirect = OP_vkCmdDispatchIndirect; |
| 6733 | stream->write(&opcode_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| 6734 | stream->write(&packetSize_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6735 | uint64_t cgen_var_540; |
| 6736 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_540, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6737 | stream->write((uint64_t*)&cgen_var_540, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6738 | uint64_t cgen_var_541; |
| 6739 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_541, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6740 | stream->write((uint64_t*)&cgen_var_541, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6741 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6742 | } |
| 6743 | |
| 6744 | void VkEncoder::vkCmdCopyBuffer( |
| 6745 | VkCommandBuffer commandBuffer, |
| 6746 | VkBuffer srcBuffer, |
| 6747 | VkBuffer dstBuffer, |
| 6748 | uint32_t regionCount, |
| 6749 | const VkBufferCopy* pRegions) |
| 6750 | { |
| 6751 | auto stream = mImpl->stream(); |
| 6752 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6753 | auto resources = mImpl->resources(); |
| 6754 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6755 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6756 | VkCommandBuffer local_commandBuffer; |
| 6757 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6758 | VkBuffer local_srcBuffer; |
| 6759 | local_srcBuffer = srcBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6760 | VkBuffer local_dstBuffer; |
| 6761 | local_dstBuffer = dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6762 | uint32_t local_regionCount; |
| 6763 | local_regionCount = regionCount; |
| 6764 | VkBufferCopy* local_pRegions; |
| 6765 | local_pRegions = nullptr; |
| 6766 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6767 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6768 | local_pRegions = (VkBufferCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6769 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6770 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6771 | deepcopy_VkBufferCopy(pool, pRegions + i, (VkBufferCopy*)(local_pRegions + i)); |
| 6772 | } |
| 6773 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6774 | countingStream->rewind(); |
| 6775 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6776 | uint64_t cgen_var_542; |
| 6777 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_542, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6778 | countingStream->write((uint64_t*)&cgen_var_542, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6779 | uint64_t cgen_var_543; |
| 6780 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_543, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6781 | countingStream->write((uint64_t*)&cgen_var_543, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6782 | uint64_t cgen_var_544; |
| 6783 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_544, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6784 | countingStream->write((uint64_t*)&cgen_var_544, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6785 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 6786 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6787 | { |
| 6788 | marshal_VkBufferCopy(countingStream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6789 | } |
| 6790 | } |
| 6791 | uint32_t packetSize_vkCmdCopyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6792 | countingStream->rewind(); |
| 6793 | uint32_t opcode_vkCmdCopyBuffer = OP_vkCmdCopyBuffer; |
| 6794 | stream->write(&opcode_vkCmdCopyBuffer, sizeof(uint32_t)); |
| 6795 | stream->write(&packetSize_vkCmdCopyBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6796 | uint64_t cgen_var_545; |
| 6797 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_545, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6798 | stream->write((uint64_t*)&cgen_var_545, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6799 | uint64_t cgen_var_546; |
| 6800 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_546, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6801 | stream->write((uint64_t*)&cgen_var_546, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6802 | uint64_t cgen_var_547; |
| 6803 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_547, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6804 | stream->write((uint64_t*)&cgen_var_547, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6805 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6806 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6807 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6808 | marshal_VkBufferCopy(stream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6809 | } |
| 6810 | } |
| 6811 | |
| 6812 | void VkEncoder::vkCmdCopyImage( |
| 6813 | VkCommandBuffer commandBuffer, |
| 6814 | VkImage srcImage, |
| 6815 | VkImageLayout srcImageLayout, |
| 6816 | VkImage dstImage, |
| 6817 | VkImageLayout dstImageLayout, |
| 6818 | uint32_t regionCount, |
| 6819 | const VkImageCopy* pRegions) |
| 6820 | { |
| 6821 | auto stream = mImpl->stream(); |
| 6822 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6823 | auto resources = mImpl->resources(); |
| 6824 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6825 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6826 | VkCommandBuffer local_commandBuffer; |
| 6827 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6828 | VkImage local_srcImage; |
| 6829 | local_srcImage = srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6830 | VkImageLayout local_srcImageLayout; |
| 6831 | local_srcImageLayout = srcImageLayout; |
| 6832 | VkImage local_dstImage; |
| 6833 | local_dstImage = dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6834 | VkImageLayout local_dstImageLayout; |
| 6835 | local_dstImageLayout = dstImageLayout; |
| 6836 | uint32_t local_regionCount; |
| 6837 | local_regionCount = regionCount; |
| 6838 | VkImageCopy* local_pRegions; |
| 6839 | local_pRegions = nullptr; |
| 6840 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6841 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6842 | local_pRegions = (VkImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6843 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6844 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6845 | deepcopy_VkImageCopy(pool, pRegions + i, (VkImageCopy*)(local_pRegions + i)); |
| 6846 | } |
| 6847 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6848 | countingStream->rewind(); |
| 6849 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6850 | uint64_t cgen_var_548; |
| 6851 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_548, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6852 | countingStream->write((uint64_t*)&cgen_var_548, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6853 | uint64_t cgen_var_549; |
| 6854 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_549, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6855 | countingStream->write((uint64_t*)&cgen_var_549, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6856 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6857 | uint64_t cgen_var_550; |
| 6858 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_550, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6859 | countingStream->write((uint64_t*)&cgen_var_550, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6860 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6861 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 6862 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6863 | { |
| 6864 | marshal_VkImageCopy(countingStream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6865 | } |
| 6866 | } |
| 6867 | uint32_t packetSize_vkCmdCopyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6868 | countingStream->rewind(); |
| 6869 | uint32_t opcode_vkCmdCopyImage = OP_vkCmdCopyImage; |
| 6870 | stream->write(&opcode_vkCmdCopyImage, sizeof(uint32_t)); |
| 6871 | stream->write(&packetSize_vkCmdCopyImage, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6872 | uint64_t cgen_var_551; |
| 6873 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_551, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6874 | stream->write((uint64_t*)&cgen_var_551, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6875 | uint64_t cgen_var_552; |
| 6876 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_552, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6877 | stream->write((uint64_t*)&cgen_var_552, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6878 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6879 | uint64_t cgen_var_553; |
| 6880 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_553, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6881 | stream->write((uint64_t*)&cgen_var_553, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6882 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6883 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6884 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6885 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6886 | marshal_VkImageCopy(stream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6887 | } |
| 6888 | } |
| 6889 | |
| 6890 | void VkEncoder::vkCmdBlitImage( |
| 6891 | VkCommandBuffer commandBuffer, |
| 6892 | VkImage srcImage, |
| 6893 | VkImageLayout srcImageLayout, |
| 6894 | VkImage dstImage, |
| 6895 | VkImageLayout dstImageLayout, |
| 6896 | uint32_t regionCount, |
| 6897 | const VkImageBlit* pRegions, |
| 6898 | VkFilter filter) |
| 6899 | { |
| 6900 | auto stream = mImpl->stream(); |
| 6901 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6902 | auto resources = mImpl->resources(); |
| 6903 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6904 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6905 | VkCommandBuffer local_commandBuffer; |
| 6906 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6907 | VkImage local_srcImage; |
| 6908 | local_srcImage = srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6909 | VkImageLayout local_srcImageLayout; |
| 6910 | local_srcImageLayout = srcImageLayout; |
| 6911 | VkImage local_dstImage; |
| 6912 | local_dstImage = dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6913 | VkImageLayout local_dstImageLayout; |
| 6914 | local_dstImageLayout = dstImageLayout; |
| 6915 | uint32_t local_regionCount; |
| 6916 | local_regionCount = regionCount; |
| 6917 | VkImageBlit* local_pRegions; |
| 6918 | local_pRegions = nullptr; |
| 6919 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6920 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6921 | local_pRegions = (VkImageBlit*)pool->alloc(((regionCount)) * sizeof(const VkImageBlit)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6922 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6923 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6924 | deepcopy_VkImageBlit(pool, pRegions + i, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6925 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6926 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6927 | VkFilter local_filter; |
| 6928 | local_filter = filter; |
| 6929 | countingStream->rewind(); |
| 6930 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6931 | uint64_t cgen_var_554; |
| 6932 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_554, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6933 | countingStream->write((uint64_t*)&cgen_var_554, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6934 | uint64_t cgen_var_555; |
| 6935 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_555, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6936 | countingStream->write((uint64_t*)&cgen_var_555, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6937 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6938 | uint64_t cgen_var_556; |
| 6939 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_556, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6940 | countingStream->write((uint64_t*)&cgen_var_556, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6941 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6942 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 6943 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6944 | { |
| 6945 | marshal_VkImageBlit(countingStream, (VkImageBlit*)(local_pRegions + i)); |
| 6946 | } |
| 6947 | countingStream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6948 | } |
| 6949 | uint32_t packetSize_vkCmdBlitImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6950 | countingStream->rewind(); |
| 6951 | uint32_t opcode_vkCmdBlitImage = OP_vkCmdBlitImage; |
| 6952 | stream->write(&opcode_vkCmdBlitImage, sizeof(uint32_t)); |
| 6953 | stream->write(&packetSize_vkCmdBlitImage, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6954 | uint64_t cgen_var_557; |
| 6955 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_557, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6956 | stream->write((uint64_t*)&cgen_var_557, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6957 | uint64_t cgen_var_558; |
| 6958 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_558, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6959 | stream->write((uint64_t*)&cgen_var_558, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6960 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6961 | uint64_t cgen_var_559; |
| 6962 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_559, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6963 | stream->write((uint64_t*)&cgen_var_559, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6964 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 6965 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6966 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 6967 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6968 | marshal_VkImageBlit(stream, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6969 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6970 | stream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6971 | } |
| 6972 | |
| 6973 | void VkEncoder::vkCmdCopyBufferToImage( |
| 6974 | VkCommandBuffer commandBuffer, |
| 6975 | VkBuffer srcBuffer, |
| 6976 | VkImage dstImage, |
| 6977 | VkImageLayout dstImageLayout, |
| 6978 | uint32_t regionCount, |
| 6979 | const VkBufferImageCopy* pRegions) |
| 6980 | { |
| 6981 | auto stream = mImpl->stream(); |
| 6982 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6983 | auto resources = mImpl->resources(); |
| 6984 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 6985 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6986 | VkCommandBuffer local_commandBuffer; |
| 6987 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6988 | VkBuffer local_srcBuffer; |
| 6989 | local_srcBuffer = srcBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6990 | VkImage local_dstImage; |
| 6991 | local_dstImage = dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6992 | VkImageLayout local_dstImageLayout; |
| 6993 | local_dstImageLayout = dstImageLayout; |
| 6994 | uint32_t local_regionCount; |
| 6995 | local_regionCount = regionCount; |
| 6996 | VkBufferImageCopy* local_pRegions; |
| 6997 | local_pRegions = nullptr; |
| 6998 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6999 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7000 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7001 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7002 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7003 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 7004 | } |
| 7005 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7006 | countingStream->rewind(); |
| 7007 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7008 | uint64_t cgen_var_560; |
| 7009 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_560, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7010 | countingStream->write((uint64_t*)&cgen_var_560, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7011 | uint64_t cgen_var_561; |
| 7012 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_561, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7013 | countingStream->write((uint64_t*)&cgen_var_561, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7014 | uint64_t cgen_var_562; |
| 7015 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_562, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7016 | countingStream->write((uint64_t*)&cgen_var_562, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7017 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7018 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 7019 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7020 | { |
| 7021 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7022 | } |
| 7023 | } |
| 7024 | uint32_t packetSize_vkCmdCopyBufferToImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7025 | countingStream->rewind(); |
| 7026 | uint32_t opcode_vkCmdCopyBufferToImage = OP_vkCmdCopyBufferToImage; |
| 7027 | stream->write(&opcode_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| 7028 | stream->write(&packetSize_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7029 | uint64_t cgen_var_563; |
| 7030 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_563, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7031 | stream->write((uint64_t*)&cgen_var_563, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7032 | uint64_t cgen_var_564; |
| 7033 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_564, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7034 | stream->write((uint64_t*)&cgen_var_564, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7035 | uint64_t cgen_var_565; |
| 7036 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_565, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7037 | stream->write((uint64_t*)&cgen_var_565, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7038 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7039 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7040 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7041 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7042 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7043 | } |
| 7044 | } |
| 7045 | |
| 7046 | void VkEncoder::vkCmdCopyImageToBuffer( |
| 7047 | VkCommandBuffer commandBuffer, |
| 7048 | VkImage srcImage, |
| 7049 | VkImageLayout srcImageLayout, |
| 7050 | VkBuffer dstBuffer, |
| 7051 | uint32_t regionCount, |
| 7052 | const VkBufferImageCopy* pRegions) |
| 7053 | { |
| 7054 | auto stream = mImpl->stream(); |
| 7055 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7056 | auto resources = mImpl->resources(); |
| 7057 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7058 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7059 | VkCommandBuffer local_commandBuffer; |
| 7060 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7061 | VkImage local_srcImage; |
| 7062 | local_srcImage = srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7063 | VkImageLayout local_srcImageLayout; |
| 7064 | local_srcImageLayout = srcImageLayout; |
| 7065 | VkBuffer local_dstBuffer; |
| 7066 | local_dstBuffer = dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7067 | uint32_t local_regionCount; |
| 7068 | local_regionCount = regionCount; |
| 7069 | VkBufferImageCopy* local_pRegions; |
| 7070 | local_pRegions = nullptr; |
| 7071 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7072 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7073 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7074 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7075 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7076 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 7077 | } |
| 7078 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7079 | countingStream->rewind(); |
| 7080 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7081 | uint64_t cgen_var_566; |
| 7082 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_566, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7083 | countingStream->write((uint64_t*)&cgen_var_566, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7084 | uint64_t cgen_var_567; |
| 7085 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_567, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7086 | countingStream->write((uint64_t*)&cgen_var_567, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7087 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7088 | uint64_t cgen_var_568; |
| 7089 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_568, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7090 | countingStream->write((uint64_t*)&cgen_var_568, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7091 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 7092 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7093 | { |
| 7094 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7095 | } |
| 7096 | } |
| 7097 | uint32_t packetSize_vkCmdCopyImageToBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7098 | countingStream->rewind(); |
| 7099 | uint32_t opcode_vkCmdCopyImageToBuffer = OP_vkCmdCopyImageToBuffer; |
| 7100 | stream->write(&opcode_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| 7101 | stream->write(&packetSize_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7102 | uint64_t cgen_var_569; |
| 7103 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_569, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7104 | stream->write((uint64_t*)&cgen_var_569, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7105 | uint64_t cgen_var_570; |
| 7106 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_570, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7107 | stream->write((uint64_t*)&cgen_var_570, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7108 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7109 | uint64_t cgen_var_571; |
| 7110 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_571, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7111 | stream->write((uint64_t*)&cgen_var_571, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7112 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7113 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7114 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7115 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7116 | } |
| 7117 | } |
| 7118 | |
| 7119 | void VkEncoder::vkCmdUpdateBuffer( |
| 7120 | VkCommandBuffer commandBuffer, |
| 7121 | VkBuffer dstBuffer, |
| 7122 | VkDeviceSize dstOffset, |
| 7123 | VkDeviceSize dataSize, |
| 7124 | const void* pData) |
| 7125 | { |
| 7126 | auto stream = mImpl->stream(); |
| 7127 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7128 | auto resources = mImpl->resources(); |
| 7129 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7130 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7131 | VkCommandBuffer local_commandBuffer; |
| 7132 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7133 | VkBuffer local_dstBuffer; |
| 7134 | local_dstBuffer = dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7135 | VkDeviceSize local_dstOffset; |
| 7136 | local_dstOffset = dstOffset; |
| 7137 | VkDeviceSize local_dataSize; |
| 7138 | local_dataSize = dataSize; |
| 7139 | void* local_pData; |
| 7140 | local_pData = nullptr; |
| 7141 | if (pData) |
| 7142 | { |
| 7143 | local_pData = (void*)pool->dupArray(pData, ((dataSize)) * sizeof(const uint8_t)); |
| 7144 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7145 | countingStream->rewind(); |
| 7146 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7147 | uint64_t cgen_var_572; |
| 7148 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_572, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7149 | countingStream->write((uint64_t*)&cgen_var_572, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7150 | uint64_t cgen_var_573; |
| 7151 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_573, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7152 | countingStream->write((uint64_t*)&cgen_var_573, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7153 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 7154 | countingStream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 7155 | countingStream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7156 | } |
| 7157 | uint32_t packetSize_vkCmdUpdateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7158 | countingStream->rewind(); |
| 7159 | uint32_t opcode_vkCmdUpdateBuffer = OP_vkCmdUpdateBuffer; |
| 7160 | stream->write(&opcode_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| 7161 | stream->write(&packetSize_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7162 | uint64_t cgen_var_574; |
| 7163 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_574, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7164 | stream->write((uint64_t*)&cgen_var_574, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7165 | uint64_t cgen_var_575; |
| 7166 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_575, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7167 | stream->write((uint64_t*)&cgen_var_575, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7168 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 7169 | stream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 7170 | stream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7171 | } |
| 7172 | |
| 7173 | void VkEncoder::vkCmdFillBuffer( |
| 7174 | VkCommandBuffer commandBuffer, |
| 7175 | VkBuffer dstBuffer, |
| 7176 | VkDeviceSize dstOffset, |
| 7177 | VkDeviceSize size, |
| 7178 | uint32_t data) |
| 7179 | { |
| 7180 | auto stream = mImpl->stream(); |
| 7181 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7182 | auto resources = mImpl->resources(); |
| 7183 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7184 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7185 | VkCommandBuffer local_commandBuffer; |
| 7186 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7187 | VkBuffer local_dstBuffer; |
| 7188 | local_dstBuffer = dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7189 | VkDeviceSize local_dstOffset; |
| 7190 | local_dstOffset = dstOffset; |
| 7191 | VkDeviceSize local_size; |
| 7192 | local_size = size; |
| 7193 | uint32_t local_data; |
| 7194 | local_data = data; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7195 | countingStream->rewind(); |
| 7196 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7197 | uint64_t cgen_var_576; |
| 7198 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_576, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7199 | countingStream->write((uint64_t*)&cgen_var_576, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7200 | uint64_t cgen_var_577; |
| 7201 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_577, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7202 | countingStream->write((uint64_t*)&cgen_var_577, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7203 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 7204 | countingStream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 7205 | countingStream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7206 | } |
| 7207 | uint32_t packetSize_vkCmdFillBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7208 | countingStream->rewind(); |
| 7209 | uint32_t opcode_vkCmdFillBuffer = OP_vkCmdFillBuffer; |
| 7210 | stream->write(&opcode_vkCmdFillBuffer, sizeof(uint32_t)); |
| 7211 | stream->write(&packetSize_vkCmdFillBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7212 | uint64_t cgen_var_578; |
| 7213 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_578, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7214 | stream->write((uint64_t*)&cgen_var_578, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7215 | uint64_t cgen_var_579; |
| 7216 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_579, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7217 | stream->write((uint64_t*)&cgen_var_579, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7218 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 7219 | stream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 7220 | stream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7221 | } |
| 7222 | |
| 7223 | void VkEncoder::vkCmdClearColorImage( |
| 7224 | VkCommandBuffer commandBuffer, |
| 7225 | VkImage image, |
| 7226 | VkImageLayout imageLayout, |
| 7227 | const VkClearColorValue* pColor, |
| 7228 | uint32_t rangeCount, |
| 7229 | const VkImageSubresourceRange* pRanges) |
| 7230 | { |
| 7231 | auto stream = mImpl->stream(); |
| 7232 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7233 | auto resources = mImpl->resources(); |
| 7234 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7235 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7236 | VkCommandBuffer local_commandBuffer; |
| 7237 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7238 | VkImage local_image; |
| 7239 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7240 | VkImageLayout local_imageLayout; |
| 7241 | local_imageLayout = imageLayout; |
| 7242 | VkClearColorValue* local_pColor; |
| 7243 | local_pColor = nullptr; |
| 7244 | if (pColor) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7245 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7246 | local_pColor = (VkClearColorValue*)pool->alloc(sizeof(const VkClearColorValue)); |
| 7247 | deepcopy_VkClearColorValue(pool, pColor, (VkClearColorValue*)(local_pColor)); |
| 7248 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7249 | uint32_t local_rangeCount; |
| 7250 | local_rangeCount = rangeCount; |
| 7251 | VkImageSubresourceRange* local_pRanges; |
| 7252 | local_pRanges = nullptr; |
| 7253 | if (pRanges) |
| 7254 | { |
| 7255 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7256 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 7257 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7258 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 7259 | } |
| 7260 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7261 | countingStream->rewind(); |
| 7262 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7263 | uint64_t cgen_var_580; |
| 7264 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_580, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7265 | countingStream->write((uint64_t*)&cgen_var_580, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7266 | uint64_t cgen_var_581; |
| 7267 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_581, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7268 | countingStream->write((uint64_t*)&cgen_var_581, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7269 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 7270 | marshal_VkClearColorValue(countingStream, (VkClearColorValue*)(local_pColor)); |
| 7271 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 7272 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 7273 | { |
| 7274 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7275 | } |
| 7276 | } |
| 7277 | uint32_t packetSize_vkCmdClearColorImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7278 | countingStream->rewind(); |
| 7279 | uint32_t opcode_vkCmdClearColorImage = OP_vkCmdClearColorImage; |
| 7280 | stream->write(&opcode_vkCmdClearColorImage, sizeof(uint32_t)); |
| 7281 | stream->write(&packetSize_vkCmdClearColorImage, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7282 | uint64_t cgen_var_582; |
| 7283 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_582, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7284 | stream->write((uint64_t*)&cgen_var_582, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7285 | uint64_t cgen_var_583; |
| 7286 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_583, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7287 | stream->write((uint64_t*)&cgen_var_583, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7288 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 7289 | marshal_VkClearColorValue(stream, (VkClearColorValue*)(local_pColor)); |
| 7290 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7291 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 7292 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7293 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7294 | } |
| 7295 | } |
| 7296 | |
| 7297 | void VkEncoder::vkCmdClearDepthStencilImage( |
| 7298 | VkCommandBuffer commandBuffer, |
| 7299 | VkImage image, |
| 7300 | VkImageLayout imageLayout, |
| 7301 | const VkClearDepthStencilValue* pDepthStencil, |
| 7302 | uint32_t rangeCount, |
| 7303 | const VkImageSubresourceRange* pRanges) |
| 7304 | { |
| 7305 | auto stream = mImpl->stream(); |
| 7306 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7307 | auto resources = mImpl->resources(); |
| 7308 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7309 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7310 | VkCommandBuffer local_commandBuffer; |
| 7311 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7312 | VkImage local_image; |
| 7313 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7314 | VkImageLayout local_imageLayout; |
| 7315 | local_imageLayout = imageLayout; |
| 7316 | VkClearDepthStencilValue* local_pDepthStencil; |
| 7317 | local_pDepthStencil = nullptr; |
| 7318 | if (pDepthStencil) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7319 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7320 | local_pDepthStencil = (VkClearDepthStencilValue*)pool->alloc(sizeof(const VkClearDepthStencilValue)); |
| 7321 | deepcopy_VkClearDepthStencilValue(pool, pDepthStencil, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 7322 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7323 | uint32_t local_rangeCount; |
| 7324 | local_rangeCount = rangeCount; |
| 7325 | VkImageSubresourceRange* local_pRanges; |
| 7326 | local_pRanges = nullptr; |
| 7327 | if (pRanges) |
| 7328 | { |
| 7329 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7330 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 7331 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7332 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 7333 | } |
| 7334 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7335 | countingStream->rewind(); |
| 7336 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7337 | uint64_t cgen_var_584; |
| 7338 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_584, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7339 | countingStream->write((uint64_t*)&cgen_var_584, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7340 | uint64_t cgen_var_585; |
| 7341 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_585, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7342 | countingStream->write((uint64_t*)&cgen_var_585, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7343 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 7344 | marshal_VkClearDepthStencilValue(countingStream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 7345 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 7346 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 7347 | { |
| 7348 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7349 | } |
| 7350 | } |
| 7351 | uint32_t packetSize_vkCmdClearDepthStencilImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7352 | countingStream->rewind(); |
| 7353 | uint32_t opcode_vkCmdClearDepthStencilImage = OP_vkCmdClearDepthStencilImage; |
| 7354 | stream->write(&opcode_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| 7355 | stream->write(&packetSize_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7356 | uint64_t cgen_var_586; |
| 7357 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_586, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7358 | stream->write((uint64_t*)&cgen_var_586, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7359 | uint64_t cgen_var_587; |
| 7360 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_587, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7361 | stream->write((uint64_t*)&cgen_var_587, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7362 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 7363 | marshal_VkClearDepthStencilValue(stream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 7364 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7365 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 7366 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7367 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7368 | } |
| 7369 | } |
| 7370 | |
| 7371 | void VkEncoder::vkCmdClearAttachments( |
| 7372 | VkCommandBuffer commandBuffer, |
| 7373 | uint32_t attachmentCount, |
| 7374 | const VkClearAttachment* pAttachments, |
| 7375 | uint32_t rectCount, |
| 7376 | const VkClearRect* pRects) |
| 7377 | { |
| 7378 | auto stream = mImpl->stream(); |
| 7379 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7380 | auto resources = mImpl->resources(); |
| 7381 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7382 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7383 | VkCommandBuffer local_commandBuffer; |
| 7384 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7385 | uint32_t local_attachmentCount; |
| 7386 | local_attachmentCount = attachmentCount; |
| 7387 | VkClearAttachment* local_pAttachments; |
| 7388 | local_pAttachments = nullptr; |
| 7389 | if (pAttachments) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7390 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7391 | local_pAttachments = (VkClearAttachment*)pool->alloc(((attachmentCount)) * sizeof(const VkClearAttachment)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7392 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 7393 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7394 | deepcopy_VkClearAttachment(pool, pAttachments + i, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7395 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7396 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7397 | uint32_t local_rectCount; |
| 7398 | local_rectCount = rectCount; |
| 7399 | VkClearRect* local_pRects; |
| 7400 | local_pRects = nullptr; |
| 7401 | if (pRects) |
| 7402 | { |
| 7403 | local_pRects = (VkClearRect*)pool->alloc(((rectCount)) * sizeof(const VkClearRect)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7404 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 7405 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7406 | deepcopy_VkClearRect(pool, pRects + i, (VkClearRect*)(local_pRects + i)); |
| 7407 | } |
| 7408 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7409 | countingStream->rewind(); |
| 7410 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7411 | uint64_t cgen_var_588; |
| 7412 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_588, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7413 | countingStream->write((uint64_t*)&cgen_var_588, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7414 | countingStream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| 7415 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 7416 | { |
| 7417 | marshal_VkClearAttachment(countingStream, (VkClearAttachment*)(local_pAttachments + i)); |
| 7418 | } |
| 7419 | countingStream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| 7420 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 7421 | { |
| 7422 | marshal_VkClearRect(countingStream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7423 | } |
| 7424 | } |
| 7425 | uint32_t packetSize_vkCmdClearAttachments = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7426 | countingStream->rewind(); |
| 7427 | uint32_t opcode_vkCmdClearAttachments = OP_vkCmdClearAttachments; |
| 7428 | stream->write(&opcode_vkCmdClearAttachments, sizeof(uint32_t)); |
| 7429 | stream->write(&packetSize_vkCmdClearAttachments, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7430 | uint64_t cgen_var_589; |
| 7431 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_589, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7432 | stream->write((uint64_t*)&cgen_var_589, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7433 | stream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7434 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 7435 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7436 | marshal_VkClearAttachment(stream, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7437 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7438 | stream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7439 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 7440 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7441 | marshal_VkClearRect(stream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7442 | } |
| 7443 | } |
| 7444 | |
| 7445 | void VkEncoder::vkCmdResolveImage( |
| 7446 | VkCommandBuffer commandBuffer, |
| 7447 | VkImage srcImage, |
| 7448 | VkImageLayout srcImageLayout, |
| 7449 | VkImage dstImage, |
| 7450 | VkImageLayout dstImageLayout, |
| 7451 | uint32_t regionCount, |
| 7452 | const VkImageResolve* pRegions) |
| 7453 | { |
| 7454 | auto stream = mImpl->stream(); |
| 7455 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7456 | auto resources = mImpl->resources(); |
| 7457 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7458 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7459 | VkCommandBuffer local_commandBuffer; |
| 7460 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7461 | VkImage local_srcImage; |
| 7462 | local_srcImage = srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7463 | VkImageLayout local_srcImageLayout; |
| 7464 | local_srcImageLayout = srcImageLayout; |
| 7465 | VkImage local_dstImage; |
| 7466 | local_dstImage = dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7467 | VkImageLayout local_dstImageLayout; |
| 7468 | local_dstImageLayout = dstImageLayout; |
| 7469 | uint32_t local_regionCount; |
| 7470 | local_regionCount = regionCount; |
| 7471 | VkImageResolve* local_pRegions; |
| 7472 | local_pRegions = nullptr; |
| 7473 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7474 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7475 | local_pRegions = (VkImageResolve*)pool->alloc(((regionCount)) * sizeof(const VkImageResolve)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7476 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7477 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7478 | deepcopy_VkImageResolve(pool, pRegions + i, (VkImageResolve*)(local_pRegions + i)); |
| 7479 | } |
| 7480 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7481 | countingStream->rewind(); |
| 7482 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7483 | uint64_t cgen_var_590; |
| 7484 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_590, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7485 | countingStream->write((uint64_t*)&cgen_var_590, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7486 | uint64_t cgen_var_591; |
| 7487 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_591, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7488 | countingStream->write((uint64_t*)&cgen_var_591, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7489 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7490 | uint64_t cgen_var_592; |
| 7491 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_592, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7492 | countingStream->write((uint64_t*)&cgen_var_592, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7493 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7494 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 7495 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7496 | { |
| 7497 | marshal_VkImageResolve(countingStream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7498 | } |
| 7499 | } |
| 7500 | uint32_t packetSize_vkCmdResolveImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7501 | countingStream->rewind(); |
| 7502 | uint32_t opcode_vkCmdResolveImage = OP_vkCmdResolveImage; |
| 7503 | stream->write(&opcode_vkCmdResolveImage, sizeof(uint32_t)); |
| 7504 | stream->write(&packetSize_vkCmdResolveImage, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7505 | uint64_t cgen_var_593; |
| 7506 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_593, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7507 | stream->write((uint64_t*)&cgen_var_593, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7508 | uint64_t cgen_var_594; |
| 7509 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_594, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7510 | stream->write((uint64_t*)&cgen_var_594, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7511 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7512 | uint64_t cgen_var_595; |
| 7513 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_595, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7514 | stream->write((uint64_t*)&cgen_var_595, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7515 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7516 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7517 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7518 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7519 | marshal_VkImageResolve(stream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7520 | } |
| 7521 | } |
| 7522 | |
| 7523 | void VkEncoder::vkCmdSetEvent( |
| 7524 | VkCommandBuffer commandBuffer, |
| 7525 | VkEvent event, |
| 7526 | VkPipelineStageFlags stageMask) |
| 7527 | { |
| 7528 | auto stream = mImpl->stream(); |
| 7529 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7530 | auto resources = mImpl->resources(); |
| 7531 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7532 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7533 | VkCommandBuffer local_commandBuffer; |
| 7534 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7535 | VkEvent local_event; |
| 7536 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7537 | VkPipelineStageFlags local_stageMask; |
| 7538 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7539 | countingStream->rewind(); |
| 7540 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7541 | uint64_t cgen_var_596; |
| 7542 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_596, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7543 | countingStream->write((uint64_t*)&cgen_var_596, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7544 | uint64_t cgen_var_597; |
| 7545 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_597, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7546 | countingStream->write((uint64_t*)&cgen_var_597, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7547 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7548 | } |
| 7549 | uint32_t packetSize_vkCmdSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7550 | countingStream->rewind(); |
| 7551 | uint32_t opcode_vkCmdSetEvent = OP_vkCmdSetEvent; |
| 7552 | stream->write(&opcode_vkCmdSetEvent, sizeof(uint32_t)); |
| 7553 | stream->write(&packetSize_vkCmdSetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7554 | uint64_t cgen_var_598; |
| 7555 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_598, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7556 | stream->write((uint64_t*)&cgen_var_598, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7557 | uint64_t cgen_var_599; |
| 7558 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_599, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7559 | stream->write((uint64_t*)&cgen_var_599, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7560 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7561 | } |
| 7562 | |
| 7563 | void VkEncoder::vkCmdResetEvent( |
| 7564 | VkCommandBuffer commandBuffer, |
| 7565 | VkEvent event, |
| 7566 | VkPipelineStageFlags stageMask) |
| 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(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7572 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7573 | VkCommandBuffer local_commandBuffer; |
| 7574 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7575 | VkEvent local_event; |
| 7576 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7577 | VkPipelineStageFlags local_stageMask; |
| 7578 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7579 | countingStream->rewind(); |
| 7580 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7581 | uint64_t cgen_var_600; |
| 7582 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_600, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7583 | countingStream->write((uint64_t*)&cgen_var_600, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7584 | uint64_t cgen_var_601; |
| 7585 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_601, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7586 | countingStream->write((uint64_t*)&cgen_var_601, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7587 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7588 | } |
| 7589 | uint32_t packetSize_vkCmdResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7590 | countingStream->rewind(); |
| 7591 | uint32_t opcode_vkCmdResetEvent = OP_vkCmdResetEvent; |
| 7592 | stream->write(&opcode_vkCmdResetEvent, sizeof(uint32_t)); |
| 7593 | stream->write(&packetSize_vkCmdResetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7594 | uint64_t cgen_var_602; |
| 7595 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_602, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7596 | stream->write((uint64_t*)&cgen_var_602, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7597 | uint64_t cgen_var_603; |
| 7598 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_603, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7599 | stream->write((uint64_t*)&cgen_var_603, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7600 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7601 | } |
| 7602 | |
| 7603 | void VkEncoder::vkCmdWaitEvents( |
| 7604 | VkCommandBuffer commandBuffer, |
| 7605 | uint32_t eventCount, |
| 7606 | const VkEvent* pEvents, |
| 7607 | VkPipelineStageFlags srcStageMask, |
| 7608 | VkPipelineStageFlags dstStageMask, |
| 7609 | uint32_t memoryBarrierCount, |
| 7610 | const VkMemoryBarrier* pMemoryBarriers, |
| 7611 | uint32_t bufferMemoryBarrierCount, |
| 7612 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 7613 | uint32_t imageMemoryBarrierCount, |
| 7614 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 7615 | { |
| 7616 | auto stream = mImpl->stream(); |
| 7617 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7618 | auto resources = mImpl->resources(); |
| 7619 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7620 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7621 | VkCommandBuffer local_commandBuffer; |
| 7622 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7623 | uint32_t local_eventCount; |
| 7624 | local_eventCount = eventCount; |
| 7625 | VkEvent* local_pEvents; |
| 7626 | local_pEvents = nullptr; |
| 7627 | if (pEvents) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7628 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7629 | local_pEvents = (VkEvent*)pool->dupArray(pEvents, ((eventCount)) * sizeof(const VkEvent)); |
| 7630 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7631 | VkPipelineStageFlags local_srcStageMask; |
| 7632 | local_srcStageMask = srcStageMask; |
| 7633 | VkPipelineStageFlags local_dstStageMask; |
| 7634 | local_dstStageMask = dstStageMask; |
| 7635 | uint32_t local_memoryBarrierCount; |
| 7636 | local_memoryBarrierCount = memoryBarrierCount; |
| 7637 | VkMemoryBarrier* local_pMemoryBarriers; |
| 7638 | local_pMemoryBarriers = nullptr; |
| 7639 | if (pMemoryBarriers) |
| 7640 | { |
| 7641 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7642 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 7643 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7644 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7645 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7646 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7647 | uint32_t local_bufferMemoryBarrierCount; |
| 7648 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| 7649 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 7650 | local_pBufferMemoryBarriers = nullptr; |
| 7651 | if (pBufferMemoryBarriers) |
| 7652 | { |
| 7653 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7654 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 7655 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7656 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7657 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7658 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7659 | uint32_t local_imageMemoryBarrierCount; |
| 7660 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| 7661 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 7662 | local_pImageMemoryBarriers = nullptr; |
| 7663 | if (pImageMemoryBarriers) |
| 7664 | { |
| 7665 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7666 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 7667 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7668 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 7669 | } |
| 7670 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7671 | countingStream->rewind(); |
| 7672 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7673 | uint64_t cgen_var_604; |
| 7674 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_604, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7675 | countingStream->write((uint64_t*)&cgen_var_604, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7676 | countingStream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7677 | if (((eventCount))) |
| 7678 | { |
| 7679 | uint64_t* cgen_var_605; |
| 7680 | countingStream->alloc((void**)&cgen_var_605, ((eventCount)) * 8); |
| 7681 | countingStream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_605, ((eventCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7682 | countingStream->write((uint64_t*)cgen_var_605, ((eventCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7683 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7684 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 7685 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 7686 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 7687 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 7688 | { |
| 7689 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 7690 | } |
| 7691 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 7692 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 7693 | { |
| 7694 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 7695 | } |
| 7696 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 7697 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 7698 | { |
| 7699 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7700 | } |
| 7701 | } |
| 7702 | uint32_t packetSize_vkCmdWaitEvents = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7703 | countingStream->rewind(); |
| 7704 | uint32_t opcode_vkCmdWaitEvents = OP_vkCmdWaitEvents; |
| 7705 | stream->write(&opcode_vkCmdWaitEvents, sizeof(uint32_t)); |
| 7706 | stream->write(&packetSize_vkCmdWaitEvents, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7707 | uint64_t cgen_var_606; |
| 7708 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_606, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7709 | stream->write((uint64_t*)&cgen_var_606, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7710 | stream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7711 | if (((eventCount))) |
| 7712 | { |
| 7713 | uint64_t* cgen_var_607; |
| 7714 | stream->alloc((void**)&cgen_var_607, ((eventCount)) * 8); |
| 7715 | stream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_607, ((eventCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7716 | stream->write((uint64_t*)cgen_var_607, ((eventCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7717 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7718 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 7719 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 7720 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7721 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 7722 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7723 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7724 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7725 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7726 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 7727 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7728 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7729 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7730 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7731 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 7732 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7733 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7734 | } |
| 7735 | } |
| 7736 | |
| 7737 | void VkEncoder::vkCmdPipelineBarrier( |
| 7738 | VkCommandBuffer commandBuffer, |
| 7739 | VkPipelineStageFlags srcStageMask, |
| 7740 | VkPipelineStageFlags dstStageMask, |
| 7741 | VkDependencyFlags dependencyFlags, |
| 7742 | uint32_t memoryBarrierCount, |
| 7743 | const VkMemoryBarrier* pMemoryBarriers, |
| 7744 | uint32_t bufferMemoryBarrierCount, |
| 7745 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 7746 | uint32_t imageMemoryBarrierCount, |
| 7747 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 7748 | { |
| 7749 | auto stream = mImpl->stream(); |
| 7750 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7751 | auto resources = mImpl->resources(); |
| 7752 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7753 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7754 | VkCommandBuffer local_commandBuffer; |
| 7755 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7756 | VkPipelineStageFlags local_srcStageMask; |
| 7757 | local_srcStageMask = srcStageMask; |
| 7758 | VkPipelineStageFlags local_dstStageMask; |
| 7759 | local_dstStageMask = dstStageMask; |
| 7760 | VkDependencyFlags local_dependencyFlags; |
| 7761 | local_dependencyFlags = dependencyFlags; |
| 7762 | uint32_t local_memoryBarrierCount; |
| 7763 | local_memoryBarrierCount = memoryBarrierCount; |
| 7764 | VkMemoryBarrier* local_pMemoryBarriers; |
| 7765 | local_pMemoryBarriers = nullptr; |
| 7766 | if (pMemoryBarriers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7767 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7768 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7769 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 7770 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7771 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7772 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7773 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7774 | uint32_t local_bufferMemoryBarrierCount; |
| 7775 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| 7776 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 7777 | local_pBufferMemoryBarriers = nullptr; |
| 7778 | if (pBufferMemoryBarriers) |
| 7779 | { |
| 7780 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7781 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 7782 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7783 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7784 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7785 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7786 | uint32_t local_imageMemoryBarrierCount; |
| 7787 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| 7788 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 7789 | local_pImageMemoryBarriers = nullptr; |
| 7790 | if (pImageMemoryBarriers) |
| 7791 | { |
| 7792 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7793 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 7794 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7795 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 7796 | } |
| 7797 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7798 | countingStream->rewind(); |
| 7799 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7800 | uint64_t cgen_var_608; |
| 7801 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_608, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7802 | countingStream->write((uint64_t*)&cgen_var_608, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7803 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 7804 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 7805 | countingStream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 7806 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 7807 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 7808 | { |
| 7809 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 7810 | } |
| 7811 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 7812 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 7813 | { |
| 7814 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 7815 | } |
| 7816 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 7817 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 7818 | { |
| 7819 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7820 | } |
| 7821 | } |
| 7822 | uint32_t packetSize_vkCmdPipelineBarrier = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7823 | countingStream->rewind(); |
| 7824 | uint32_t opcode_vkCmdPipelineBarrier = OP_vkCmdPipelineBarrier; |
| 7825 | stream->write(&opcode_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| 7826 | stream->write(&packetSize_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7827 | uint64_t cgen_var_609; |
| 7828 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_609, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7829 | stream->write((uint64_t*)&cgen_var_609, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7830 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 7831 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 7832 | stream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 7833 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7834 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 7835 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7836 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7837 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7838 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7839 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 7840 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7841 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7842 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7843 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7844 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 7845 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7846 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7847 | } |
| 7848 | } |
| 7849 | |
| 7850 | void VkEncoder::vkCmdBeginQuery( |
| 7851 | VkCommandBuffer commandBuffer, |
| 7852 | VkQueryPool queryPool, |
| 7853 | uint32_t query, |
| 7854 | VkQueryControlFlags flags) |
| 7855 | { |
| 7856 | auto stream = mImpl->stream(); |
| 7857 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7858 | auto resources = mImpl->resources(); |
| 7859 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7860 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7861 | VkCommandBuffer local_commandBuffer; |
| 7862 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7863 | VkQueryPool local_queryPool; |
| 7864 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7865 | uint32_t local_query; |
| 7866 | local_query = query; |
| 7867 | VkQueryControlFlags local_flags; |
| 7868 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7869 | countingStream->rewind(); |
| 7870 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7871 | uint64_t cgen_var_610; |
| 7872 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_610, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7873 | countingStream->write((uint64_t*)&cgen_var_610, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7874 | uint64_t cgen_var_611; |
| 7875 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_611, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7876 | countingStream->write((uint64_t*)&cgen_var_611, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7877 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 7878 | countingStream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7879 | } |
| 7880 | uint32_t packetSize_vkCmdBeginQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7881 | countingStream->rewind(); |
| 7882 | uint32_t opcode_vkCmdBeginQuery = OP_vkCmdBeginQuery; |
| 7883 | stream->write(&opcode_vkCmdBeginQuery, sizeof(uint32_t)); |
| 7884 | stream->write(&packetSize_vkCmdBeginQuery, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7885 | uint64_t cgen_var_612; |
| 7886 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_612, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7887 | stream->write((uint64_t*)&cgen_var_612, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7888 | uint64_t cgen_var_613; |
| 7889 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_613, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7890 | stream->write((uint64_t*)&cgen_var_613, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7891 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 7892 | stream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7893 | } |
| 7894 | |
| 7895 | void VkEncoder::vkCmdEndQuery( |
| 7896 | VkCommandBuffer commandBuffer, |
| 7897 | VkQueryPool queryPool, |
| 7898 | uint32_t query) |
| 7899 | { |
| 7900 | auto stream = mImpl->stream(); |
| 7901 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7902 | auto resources = mImpl->resources(); |
| 7903 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7904 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7905 | VkCommandBuffer local_commandBuffer; |
| 7906 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7907 | VkQueryPool local_queryPool; |
| 7908 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7909 | uint32_t local_query; |
| 7910 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7911 | countingStream->rewind(); |
| 7912 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7913 | uint64_t cgen_var_614; |
| 7914 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_614, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7915 | countingStream->write((uint64_t*)&cgen_var_614, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7916 | uint64_t cgen_var_615; |
| 7917 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_615, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7918 | countingStream->write((uint64_t*)&cgen_var_615, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7919 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7920 | } |
| 7921 | uint32_t packetSize_vkCmdEndQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7922 | countingStream->rewind(); |
| 7923 | uint32_t opcode_vkCmdEndQuery = OP_vkCmdEndQuery; |
| 7924 | stream->write(&opcode_vkCmdEndQuery, sizeof(uint32_t)); |
| 7925 | stream->write(&packetSize_vkCmdEndQuery, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7926 | uint64_t cgen_var_616; |
| 7927 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_616, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7928 | stream->write((uint64_t*)&cgen_var_616, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7929 | uint64_t cgen_var_617; |
| 7930 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_617, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7931 | stream->write((uint64_t*)&cgen_var_617, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7932 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7933 | } |
| 7934 | |
| 7935 | void VkEncoder::vkCmdResetQueryPool( |
| 7936 | VkCommandBuffer commandBuffer, |
| 7937 | VkQueryPool queryPool, |
| 7938 | uint32_t firstQuery, |
| 7939 | uint32_t queryCount) |
| 7940 | { |
| 7941 | auto stream = mImpl->stream(); |
| 7942 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7943 | auto resources = mImpl->resources(); |
| 7944 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7945 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7946 | VkCommandBuffer local_commandBuffer; |
| 7947 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7948 | VkQueryPool local_queryPool; |
| 7949 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7950 | uint32_t local_firstQuery; |
| 7951 | local_firstQuery = firstQuery; |
| 7952 | uint32_t local_queryCount; |
| 7953 | local_queryCount = queryCount; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7954 | countingStream->rewind(); |
| 7955 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7956 | uint64_t cgen_var_618; |
| 7957 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_618, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7958 | countingStream->write((uint64_t*)&cgen_var_618, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7959 | uint64_t cgen_var_619; |
| 7960 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_619, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7961 | countingStream->write((uint64_t*)&cgen_var_619, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7962 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 7963 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7964 | } |
| 7965 | uint32_t packetSize_vkCmdResetQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7966 | countingStream->rewind(); |
| 7967 | uint32_t opcode_vkCmdResetQueryPool = OP_vkCmdResetQueryPool; |
| 7968 | stream->write(&opcode_vkCmdResetQueryPool, sizeof(uint32_t)); |
| 7969 | stream->write(&packetSize_vkCmdResetQueryPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7970 | uint64_t cgen_var_620; |
| 7971 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_620, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7972 | stream->write((uint64_t*)&cgen_var_620, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7973 | uint64_t cgen_var_621; |
| 7974 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_621, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7975 | stream->write((uint64_t*)&cgen_var_621, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7976 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 7977 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7978 | } |
| 7979 | |
| 7980 | void VkEncoder::vkCmdWriteTimestamp( |
| 7981 | VkCommandBuffer commandBuffer, |
| 7982 | VkPipelineStageFlagBits pipelineStage, |
| 7983 | VkQueryPool queryPool, |
| 7984 | uint32_t query) |
| 7985 | { |
| 7986 | auto stream = mImpl->stream(); |
| 7987 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7988 | auto resources = mImpl->resources(); |
| 7989 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 7990 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7991 | VkCommandBuffer local_commandBuffer; |
| 7992 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7993 | VkPipelineStageFlagBits local_pipelineStage; |
| 7994 | local_pipelineStage = pipelineStage; |
| 7995 | VkQueryPool local_queryPool; |
| 7996 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7997 | uint32_t local_query; |
| 7998 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7999 | countingStream->rewind(); |
| 8000 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8001 | uint64_t cgen_var_622; |
| 8002 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_622, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8003 | countingStream->write((uint64_t*)&cgen_var_622, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8004 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8005 | uint64_t cgen_var_623; |
| 8006 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_623, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8007 | countingStream->write((uint64_t*)&cgen_var_623, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8008 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8009 | } |
| 8010 | uint32_t packetSize_vkCmdWriteTimestamp = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8011 | countingStream->rewind(); |
| 8012 | uint32_t opcode_vkCmdWriteTimestamp = OP_vkCmdWriteTimestamp; |
| 8013 | stream->write(&opcode_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| 8014 | stream->write(&packetSize_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8015 | uint64_t cgen_var_624; |
| 8016 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_624, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8017 | stream->write((uint64_t*)&cgen_var_624, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8018 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8019 | uint64_t cgen_var_625; |
| 8020 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_625, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8021 | stream->write((uint64_t*)&cgen_var_625, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8022 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8023 | } |
| 8024 | |
| 8025 | void VkEncoder::vkCmdCopyQueryPoolResults( |
| 8026 | VkCommandBuffer commandBuffer, |
| 8027 | VkQueryPool queryPool, |
| 8028 | uint32_t firstQuery, |
| 8029 | uint32_t queryCount, |
| 8030 | VkBuffer dstBuffer, |
| 8031 | VkDeviceSize dstOffset, |
| 8032 | VkDeviceSize stride, |
| 8033 | VkQueryResultFlags flags) |
| 8034 | { |
| 8035 | auto stream = mImpl->stream(); |
| 8036 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8037 | auto resources = mImpl->resources(); |
| 8038 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8039 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8040 | VkCommandBuffer local_commandBuffer; |
| 8041 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8042 | VkQueryPool local_queryPool; |
| 8043 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8044 | uint32_t local_firstQuery; |
| 8045 | local_firstQuery = firstQuery; |
| 8046 | uint32_t local_queryCount; |
| 8047 | local_queryCount = queryCount; |
| 8048 | VkBuffer local_dstBuffer; |
| 8049 | local_dstBuffer = dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8050 | VkDeviceSize local_dstOffset; |
| 8051 | local_dstOffset = dstOffset; |
| 8052 | VkDeviceSize local_stride; |
| 8053 | local_stride = stride; |
| 8054 | VkQueryResultFlags local_flags; |
| 8055 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8056 | countingStream->rewind(); |
| 8057 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8058 | uint64_t cgen_var_626; |
| 8059 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_626, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8060 | countingStream->write((uint64_t*)&cgen_var_626, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8061 | uint64_t cgen_var_627; |
| 8062 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_627, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8063 | countingStream->write((uint64_t*)&cgen_var_627, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8064 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 8065 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8066 | uint64_t cgen_var_628; |
| 8067 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_628, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8068 | countingStream->write((uint64_t*)&cgen_var_628, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8069 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8070 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 8071 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8072 | } |
| 8073 | uint32_t packetSize_vkCmdCopyQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8074 | countingStream->rewind(); |
| 8075 | uint32_t opcode_vkCmdCopyQueryPoolResults = OP_vkCmdCopyQueryPoolResults; |
| 8076 | stream->write(&opcode_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| 8077 | stream->write(&packetSize_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8078 | uint64_t cgen_var_629; |
| 8079 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_629, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8080 | stream->write((uint64_t*)&cgen_var_629, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8081 | uint64_t cgen_var_630; |
| 8082 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_630, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8083 | stream->write((uint64_t*)&cgen_var_630, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8084 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 8085 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8086 | uint64_t cgen_var_631; |
| 8087 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_631, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8088 | stream->write((uint64_t*)&cgen_var_631, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8089 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8090 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 8091 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8092 | } |
| 8093 | |
| 8094 | void VkEncoder::vkCmdPushConstants( |
| 8095 | VkCommandBuffer commandBuffer, |
| 8096 | VkPipelineLayout layout, |
| 8097 | VkShaderStageFlags stageFlags, |
| 8098 | uint32_t offset, |
| 8099 | uint32_t size, |
| 8100 | const void* pValues) |
| 8101 | { |
| 8102 | auto stream = mImpl->stream(); |
| 8103 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8104 | auto resources = mImpl->resources(); |
| 8105 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8106 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8107 | VkCommandBuffer local_commandBuffer; |
| 8108 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8109 | VkPipelineLayout local_layout; |
| 8110 | local_layout = layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8111 | VkShaderStageFlags local_stageFlags; |
| 8112 | local_stageFlags = stageFlags; |
| 8113 | uint32_t local_offset; |
| 8114 | local_offset = offset; |
| 8115 | uint32_t local_size; |
| 8116 | local_size = size; |
| 8117 | void* local_pValues; |
| 8118 | local_pValues = nullptr; |
| 8119 | if (pValues) |
| 8120 | { |
| 8121 | local_pValues = (void*)pool->dupArray(pValues, ((size)) * sizeof(const uint8_t)); |
| 8122 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8123 | countingStream->rewind(); |
| 8124 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8125 | uint64_t cgen_var_632; |
| 8126 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_632, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8127 | countingStream->write((uint64_t*)&cgen_var_632, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8128 | uint64_t cgen_var_633; |
| 8129 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_633, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8130 | countingStream->write((uint64_t*)&cgen_var_633, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8131 | countingStream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 8132 | countingStream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 8133 | countingStream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 8134 | countingStream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8135 | } |
| 8136 | uint32_t packetSize_vkCmdPushConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8137 | countingStream->rewind(); |
| 8138 | uint32_t opcode_vkCmdPushConstants = OP_vkCmdPushConstants; |
| 8139 | stream->write(&opcode_vkCmdPushConstants, sizeof(uint32_t)); |
| 8140 | stream->write(&packetSize_vkCmdPushConstants, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8141 | uint64_t cgen_var_634; |
| 8142 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_634, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8143 | stream->write((uint64_t*)&cgen_var_634, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8144 | uint64_t cgen_var_635; |
| 8145 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_635, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8146 | stream->write((uint64_t*)&cgen_var_635, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8147 | stream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 8148 | stream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 8149 | stream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 8150 | stream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8151 | } |
| 8152 | |
| 8153 | void VkEncoder::vkCmdBeginRenderPass( |
| 8154 | VkCommandBuffer commandBuffer, |
| 8155 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 8156 | VkSubpassContents contents) |
| 8157 | { |
| 8158 | auto stream = mImpl->stream(); |
| 8159 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8160 | auto resources = mImpl->resources(); |
| 8161 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8162 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8163 | VkCommandBuffer local_commandBuffer; |
| 8164 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8165 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| 8166 | local_pRenderPassBegin = nullptr; |
| 8167 | if (pRenderPassBegin) |
| 8168 | { |
| 8169 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 8170 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 8171 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8172 | VkSubpassContents local_contents; |
| 8173 | local_contents = contents; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8174 | countingStream->rewind(); |
| 8175 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8176 | uint64_t cgen_var_636; |
| 8177 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_636, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8178 | countingStream->write((uint64_t*)&cgen_var_636, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8179 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 8180 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8181 | } |
| 8182 | uint32_t packetSize_vkCmdBeginRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8183 | countingStream->rewind(); |
| 8184 | uint32_t opcode_vkCmdBeginRenderPass = OP_vkCmdBeginRenderPass; |
| 8185 | stream->write(&opcode_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| 8186 | stream->write(&packetSize_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8187 | uint64_t cgen_var_637; |
| 8188 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_637, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8189 | stream->write((uint64_t*)&cgen_var_637, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8190 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 8191 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8192 | } |
| 8193 | |
| 8194 | void VkEncoder::vkCmdNextSubpass( |
| 8195 | VkCommandBuffer commandBuffer, |
| 8196 | VkSubpassContents contents) |
| 8197 | { |
| 8198 | auto stream = mImpl->stream(); |
| 8199 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8200 | auto resources = mImpl->resources(); |
| 8201 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8202 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8203 | VkCommandBuffer local_commandBuffer; |
| 8204 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8205 | VkSubpassContents local_contents; |
| 8206 | local_contents = contents; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8207 | countingStream->rewind(); |
| 8208 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8209 | uint64_t cgen_var_638; |
| 8210 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_638, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8211 | countingStream->write((uint64_t*)&cgen_var_638, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8212 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8213 | } |
| 8214 | uint32_t packetSize_vkCmdNextSubpass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8215 | countingStream->rewind(); |
| 8216 | uint32_t opcode_vkCmdNextSubpass = OP_vkCmdNextSubpass; |
| 8217 | stream->write(&opcode_vkCmdNextSubpass, sizeof(uint32_t)); |
| 8218 | stream->write(&packetSize_vkCmdNextSubpass, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8219 | uint64_t cgen_var_639; |
| 8220 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_639, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8221 | stream->write((uint64_t*)&cgen_var_639, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8222 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8223 | } |
| 8224 | |
| 8225 | void VkEncoder::vkCmdEndRenderPass( |
| 8226 | VkCommandBuffer commandBuffer) |
| 8227 | { |
| 8228 | auto stream = mImpl->stream(); |
| 8229 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8230 | auto resources = mImpl->resources(); |
| 8231 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8232 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8233 | VkCommandBuffer local_commandBuffer; |
| 8234 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8235 | countingStream->rewind(); |
| 8236 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8237 | uint64_t cgen_var_640; |
| 8238 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_640, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8239 | countingStream->write((uint64_t*)&cgen_var_640, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8240 | } |
| 8241 | uint32_t packetSize_vkCmdEndRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8242 | countingStream->rewind(); |
| 8243 | uint32_t opcode_vkCmdEndRenderPass = OP_vkCmdEndRenderPass; |
| 8244 | stream->write(&opcode_vkCmdEndRenderPass, sizeof(uint32_t)); |
| 8245 | stream->write(&packetSize_vkCmdEndRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8246 | uint64_t cgen_var_641; |
| 8247 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_641, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8248 | stream->write((uint64_t*)&cgen_var_641, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8249 | } |
| 8250 | |
| 8251 | void VkEncoder::vkCmdExecuteCommands( |
| 8252 | VkCommandBuffer commandBuffer, |
| 8253 | uint32_t commandBufferCount, |
| 8254 | const VkCommandBuffer* pCommandBuffers) |
| 8255 | { |
| 8256 | auto stream = mImpl->stream(); |
| 8257 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8258 | auto resources = mImpl->resources(); |
| 8259 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8260 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8261 | VkCommandBuffer local_commandBuffer; |
| 8262 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8263 | uint32_t local_commandBufferCount; |
| 8264 | local_commandBufferCount = commandBufferCount; |
| 8265 | VkCommandBuffer* local_pCommandBuffers; |
| 8266 | local_pCommandBuffers = nullptr; |
| 8267 | if (pCommandBuffers) |
| 8268 | { |
| 8269 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 8270 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8271 | countingStream->rewind(); |
| 8272 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8273 | uint64_t cgen_var_642; |
| 8274 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_642, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8275 | countingStream->write((uint64_t*)&cgen_var_642, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8276 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8277 | if (((commandBufferCount))) |
| 8278 | { |
| 8279 | uint64_t* cgen_var_643; |
| 8280 | countingStream->alloc((void**)&cgen_var_643, ((commandBufferCount)) * 8); |
| 8281 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_643, ((commandBufferCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8282 | countingStream->write((uint64_t*)cgen_var_643, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8283 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8284 | } |
| 8285 | uint32_t packetSize_vkCmdExecuteCommands = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8286 | countingStream->rewind(); |
| 8287 | uint32_t opcode_vkCmdExecuteCommands = OP_vkCmdExecuteCommands; |
| 8288 | stream->write(&opcode_vkCmdExecuteCommands, sizeof(uint32_t)); |
| 8289 | stream->write(&packetSize_vkCmdExecuteCommands, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8290 | uint64_t cgen_var_644; |
| 8291 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_644, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8292 | stream->write((uint64_t*)&cgen_var_644, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8293 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8294 | if (((commandBufferCount))) |
| 8295 | { |
| 8296 | uint64_t* cgen_var_645; |
| 8297 | stream->alloc((void**)&cgen_var_645, ((commandBufferCount)) * 8); |
| 8298 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_645, ((commandBufferCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8299 | stream->write((uint64_t*)cgen_var_645, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8300 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8301 | } |
| 8302 | |
| 8303 | #endif |
| 8304 | #ifdef VK_VERSION_1_1 |
| 8305 | VkResult VkEncoder::vkEnumerateInstanceVersion( |
| 8306 | uint32_t* pApiVersion) |
| 8307 | { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8308 | VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 8309 | vkEnumerateInstanceVersion_VkResult_return = goldfish_vkEnumerateInstanceVersion(pApiVersion); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8310 | return vkEnumerateInstanceVersion_VkResult_return; |
| 8311 | } |
| 8312 | |
| 8313 | VkResult VkEncoder::vkBindBufferMemory2( |
| 8314 | VkDevice device, |
| 8315 | uint32_t bindInfoCount, |
| 8316 | const VkBindBufferMemoryInfo* pBindInfos) |
| 8317 | { |
| 8318 | auto stream = mImpl->stream(); |
| 8319 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8320 | auto resources = mImpl->resources(); |
| 8321 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8322 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8323 | VkDevice local_device; |
| 8324 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8325 | uint32_t local_bindInfoCount; |
| 8326 | local_bindInfoCount = bindInfoCount; |
| 8327 | VkBindBufferMemoryInfo* local_pBindInfos; |
| 8328 | local_pBindInfos = nullptr; |
| 8329 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8330 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8331 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8332 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 8333 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8334 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 8335 | } |
| 8336 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8337 | countingStream->rewind(); |
| 8338 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8339 | uint64_t cgen_var_646; |
| 8340 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_646, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8341 | countingStream->write((uint64_t*)&cgen_var_646, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8342 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 8343 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 8344 | { |
| 8345 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8346 | } |
| 8347 | } |
| 8348 | uint32_t packetSize_vkBindBufferMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8349 | countingStream->rewind(); |
| 8350 | uint32_t opcode_vkBindBufferMemory2 = OP_vkBindBufferMemory2; |
| 8351 | stream->write(&opcode_vkBindBufferMemory2, sizeof(uint32_t)); |
| 8352 | stream->write(&packetSize_vkBindBufferMemory2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8353 | uint64_t cgen_var_647; |
| 8354 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_647, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8355 | stream->write((uint64_t*)&cgen_var_647, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8356 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8357 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 8358 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8359 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8360 | } |
| 8361 | VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0; |
| 8362 | stream->read(&vkBindBufferMemory2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8363 | countingStream->clearPool(); |
| 8364 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8365 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8366 | return vkBindBufferMemory2_VkResult_return; |
| 8367 | } |
| 8368 | |
| 8369 | VkResult VkEncoder::vkBindImageMemory2( |
| 8370 | VkDevice device, |
| 8371 | uint32_t bindInfoCount, |
| 8372 | const VkBindImageMemoryInfo* pBindInfos) |
| 8373 | { |
| 8374 | auto stream = mImpl->stream(); |
| 8375 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8376 | auto resources = mImpl->resources(); |
| 8377 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8378 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8379 | VkDevice local_device; |
| 8380 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8381 | uint32_t local_bindInfoCount; |
| 8382 | local_bindInfoCount = bindInfoCount; |
| 8383 | VkBindImageMemoryInfo* local_pBindInfos; |
| 8384 | local_pBindInfos = nullptr; |
| 8385 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8386 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8387 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8388 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 8389 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8390 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 8391 | } |
| 8392 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8393 | countingStream->rewind(); |
| 8394 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8395 | uint64_t cgen_var_648; |
| 8396 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_648, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8397 | countingStream->write((uint64_t*)&cgen_var_648, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8398 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 8399 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 8400 | { |
| 8401 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8402 | } |
| 8403 | } |
| 8404 | uint32_t packetSize_vkBindImageMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8405 | countingStream->rewind(); |
| 8406 | uint32_t opcode_vkBindImageMemory2 = OP_vkBindImageMemory2; |
| 8407 | stream->write(&opcode_vkBindImageMemory2, sizeof(uint32_t)); |
| 8408 | stream->write(&packetSize_vkBindImageMemory2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8409 | uint64_t cgen_var_649; |
| 8410 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_649, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8411 | stream->write((uint64_t*)&cgen_var_649, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8412 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8413 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 8414 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8415 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8416 | } |
| 8417 | VkResult vkBindImageMemory2_VkResult_return = (VkResult)0; |
| 8418 | stream->read(&vkBindImageMemory2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8419 | countingStream->clearPool(); |
| 8420 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8421 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8422 | return vkBindImageMemory2_VkResult_return; |
| 8423 | } |
| 8424 | |
| 8425 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeatures( |
| 8426 | VkDevice device, |
| 8427 | uint32_t heapIndex, |
| 8428 | uint32_t localDeviceIndex, |
| 8429 | uint32_t remoteDeviceIndex, |
| 8430 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 8431 | { |
| 8432 | auto stream = mImpl->stream(); |
| 8433 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8434 | auto resources = mImpl->resources(); |
| 8435 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8436 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8437 | VkDevice local_device; |
| 8438 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8439 | uint32_t local_heapIndex; |
| 8440 | local_heapIndex = heapIndex; |
| 8441 | uint32_t local_localDeviceIndex; |
| 8442 | local_localDeviceIndex = localDeviceIndex; |
| 8443 | uint32_t local_remoteDeviceIndex; |
| 8444 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8445 | countingStream->rewind(); |
| 8446 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8447 | uint64_t cgen_var_650; |
| 8448 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_650, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8449 | countingStream->write((uint64_t*)&cgen_var_650, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8450 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 8451 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 8452 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8453 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 8454 | } |
| 8455 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8456 | countingStream->rewind(); |
| 8457 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeatures = OP_vkGetDeviceGroupPeerMemoryFeatures; |
| 8458 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| 8459 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8460 | uint64_t cgen_var_651; |
| 8461 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_651, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8462 | stream->write((uint64_t*)&cgen_var_651, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8463 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 8464 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 8465 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8466 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 8467 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 8468 | } |
| 8469 | |
| 8470 | void VkEncoder::vkCmdSetDeviceMask( |
| 8471 | VkCommandBuffer commandBuffer, |
| 8472 | uint32_t deviceMask) |
| 8473 | { |
| 8474 | auto stream = mImpl->stream(); |
| 8475 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8476 | auto resources = mImpl->resources(); |
| 8477 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8478 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8479 | VkCommandBuffer local_commandBuffer; |
| 8480 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8481 | uint32_t local_deviceMask; |
| 8482 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8483 | countingStream->rewind(); |
| 8484 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8485 | uint64_t cgen_var_652; |
| 8486 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_652, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8487 | countingStream->write((uint64_t*)&cgen_var_652, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8488 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8489 | } |
| 8490 | uint32_t packetSize_vkCmdSetDeviceMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8491 | countingStream->rewind(); |
| 8492 | uint32_t opcode_vkCmdSetDeviceMask = OP_vkCmdSetDeviceMask; |
| 8493 | stream->write(&opcode_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| 8494 | stream->write(&packetSize_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8495 | uint64_t cgen_var_653; |
| 8496 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_653, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8497 | stream->write((uint64_t*)&cgen_var_653, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8498 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8499 | } |
| 8500 | |
| 8501 | void VkEncoder::vkCmdDispatchBase( |
| 8502 | VkCommandBuffer commandBuffer, |
| 8503 | uint32_t baseGroupX, |
| 8504 | uint32_t baseGroupY, |
| 8505 | uint32_t baseGroupZ, |
| 8506 | uint32_t groupCountX, |
| 8507 | uint32_t groupCountY, |
| 8508 | uint32_t groupCountZ) |
| 8509 | { |
| 8510 | auto stream = mImpl->stream(); |
| 8511 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8512 | auto resources = mImpl->resources(); |
| 8513 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8514 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8515 | VkCommandBuffer local_commandBuffer; |
| 8516 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8517 | uint32_t local_baseGroupX; |
| 8518 | local_baseGroupX = baseGroupX; |
| 8519 | uint32_t local_baseGroupY; |
| 8520 | local_baseGroupY = baseGroupY; |
| 8521 | uint32_t local_baseGroupZ; |
| 8522 | local_baseGroupZ = baseGroupZ; |
| 8523 | uint32_t local_groupCountX; |
| 8524 | local_groupCountX = groupCountX; |
| 8525 | uint32_t local_groupCountY; |
| 8526 | local_groupCountY = groupCountY; |
| 8527 | uint32_t local_groupCountZ; |
| 8528 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8529 | countingStream->rewind(); |
| 8530 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8531 | uint64_t cgen_var_654; |
| 8532 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_654, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8533 | countingStream->write((uint64_t*)&cgen_var_654, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8534 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 8535 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 8536 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 8537 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 8538 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 8539 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8540 | } |
| 8541 | uint32_t packetSize_vkCmdDispatchBase = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8542 | countingStream->rewind(); |
| 8543 | uint32_t opcode_vkCmdDispatchBase = OP_vkCmdDispatchBase; |
| 8544 | stream->write(&opcode_vkCmdDispatchBase, sizeof(uint32_t)); |
| 8545 | stream->write(&packetSize_vkCmdDispatchBase, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8546 | uint64_t cgen_var_655; |
| 8547 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_655, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8548 | stream->write((uint64_t*)&cgen_var_655, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8549 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 8550 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 8551 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 8552 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 8553 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 8554 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8555 | } |
| 8556 | |
| 8557 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroups( |
| 8558 | VkInstance instance, |
| 8559 | uint32_t* pPhysicalDeviceGroupCount, |
| 8560 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 8561 | { |
| 8562 | auto stream = mImpl->stream(); |
| 8563 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8564 | auto resources = mImpl->resources(); |
| 8565 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8566 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8567 | VkInstance local_instance; |
| 8568 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8569 | countingStream->rewind(); |
| 8570 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8571 | uint64_t cgen_var_656; |
| 8572 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_656, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8573 | countingStream->write((uint64_t*)&cgen_var_656, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8574 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8575 | uint64_t cgen_var_657 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 8576 | countingStream->putBe64(cgen_var_657); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8577 | if (pPhysicalDeviceGroupCount) |
| 8578 | { |
| 8579 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 8580 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8581 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8582 | uint64_t cgen_var_658 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 8583 | countingStream->putBe64(cgen_var_658); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8584 | if (pPhysicalDeviceGroupProperties) |
| 8585 | { |
| 8586 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 8587 | { |
| 8588 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 8589 | } |
| 8590 | } |
| 8591 | } |
| 8592 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroups = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8593 | countingStream->rewind(); |
| 8594 | uint32_t opcode_vkEnumeratePhysicalDeviceGroups = OP_vkEnumeratePhysicalDeviceGroups; |
| 8595 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| 8596 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8597 | uint64_t cgen_var_659; |
| 8598 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_659, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8599 | stream->write((uint64_t*)&cgen_var_659, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8600 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8601 | uint64_t cgen_var_660 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 8602 | stream->putBe64(cgen_var_660); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8603 | if (pPhysicalDeviceGroupCount) |
| 8604 | { |
| 8605 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 8606 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8607 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8608 | uint64_t cgen_var_661 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 8609 | stream->putBe64(cgen_var_661); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8610 | if (pPhysicalDeviceGroupProperties) |
| 8611 | { |
| 8612 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 8613 | { |
| 8614 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 8615 | } |
| 8616 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8617 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8618 | uint32_t* check_pPhysicalDeviceGroupCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8619 | check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8620 | if (pPhysicalDeviceGroupCount) |
| 8621 | { |
| 8622 | if (!(check_pPhysicalDeviceGroupCount)) |
| 8623 | { |
| 8624 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 8625 | } |
| 8626 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 8627 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8628 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8629 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8630 | check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8631 | if (pPhysicalDeviceGroupProperties) |
| 8632 | { |
| 8633 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 8634 | { |
| 8635 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 8636 | } |
| 8637 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 8638 | { |
| 8639 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 8640 | } |
| 8641 | } |
| 8642 | VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0; |
| 8643 | stream->read(&vkEnumeratePhysicalDeviceGroups_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8644 | countingStream->clearPool(); |
| 8645 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8646 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8647 | return vkEnumeratePhysicalDeviceGroups_VkResult_return; |
| 8648 | } |
| 8649 | |
| 8650 | void VkEncoder::vkGetImageMemoryRequirements2( |
| 8651 | VkDevice device, |
| 8652 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 8653 | VkMemoryRequirements2* pMemoryRequirements) |
| 8654 | { |
| 8655 | auto stream = mImpl->stream(); |
| 8656 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8657 | auto resources = mImpl->resources(); |
| 8658 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8659 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8660 | VkDevice local_device; |
| 8661 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8662 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| 8663 | local_pInfo = nullptr; |
| 8664 | if (pInfo) |
| 8665 | { |
| 8666 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 8667 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 8668 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8669 | countingStream->rewind(); |
| 8670 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8671 | uint64_t cgen_var_664; |
| 8672 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_664, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8673 | countingStream->write((uint64_t*)&cgen_var_664, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8674 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8675 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 8676 | } |
| 8677 | uint32_t packetSize_vkGetImageMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8678 | countingStream->rewind(); |
| 8679 | uint32_t opcode_vkGetImageMemoryRequirements2 = OP_vkGetImageMemoryRequirements2; |
| 8680 | stream->write(&opcode_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| 8681 | stream->write(&packetSize_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8682 | uint64_t cgen_var_665; |
| 8683 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_665, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8684 | stream->write((uint64_t*)&cgen_var_665, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8685 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8686 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 8687 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 8688 | } |
| 8689 | |
| 8690 | void VkEncoder::vkGetBufferMemoryRequirements2( |
| 8691 | VkDevice device, |
| 8692 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 8693 | VkMemoryRequirements2* pMemoryRequirements) |
| 8694 | { |
| 8695 | auto stream = mImpl->stream(); |
| 8696 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8697 | auto resources = mImpl->resources(); |
| 8698 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8699 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8700 | VkDevice local_device; |
| 8701 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8702 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| 8703 | local_pInfo = nullptr; |
| 8704 | if (pInfo) |
| 8705 | { |
| 8706 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 8707 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 8708 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8709 | countingStream->rewind(); |
| 8710 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8711 | uint64_t cgen_var_666; |
| 8712 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_666, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8713 | countingStream->write((uint64_t*)&cgen_var_666, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8714 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8715 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 8716 | } |
| 8717 | uint32_t packetSize_vkGetBufferMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8718 | countingStream->rewind(); |
| 8719 | uint32_t opcode_vkGetBufferMemoryRequirements2 = OP_vkGetBufferMemoryRequirements2; |
| 8720 | stream->write(&opcode_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| 8721 | stream->write(&packetSize_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8722 | uint64_t cgen_var_667; |
| 8723 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_667, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8724 | stream->write((uint64_t*)&cgen_var_667, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8725 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8726 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 8727 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 8728 | } |
| 8729 | |
| 8730 | void VkEncoder::vkGetImageSparseMemoryRequirements2( |
| 8731 | VkDevice device, |
| 8732 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 8733 | uint32_t* pSparseMemoryRequirementCount, |
| 8734 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 8735 | { |
| 8736 | auto stream = mImpl->stream(); |
| 8737 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8738 | auto resources = mImpl->resources(); |
| 8739 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8740 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8741 | VkDevice local_device; |
| 8742 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8743 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| 8744 | local_pInfo = nullptr; |
| 8745 | if (pInfo) |
| 8746 | { |
| 8747 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 8748 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 8749 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8750 | countingStream->rewind(); |
| 8751 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8752 | uint64_t cgen_var_668; |
| 8753 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_668, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8754 | countingStream->write((uint64_t*)&cgen_var_668, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8755 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8756 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8757 | uint64_t cgen_var_669 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 8758 | countingStream->putBe64(cgen_var_669); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8759 | if (pSparseMemoryRequirementCount) |
| 8760 | { |
| 8761 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 8762 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8763 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8764 | uint64_t cgen_var_670 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 8765 | countingStream->putBe64(cgen_var_670); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8766 | if (pSparseMemoryRequirements) |
| 8767 | { |
| 8768 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 8769 | { |
| 8770 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 8771 | } |
| 8772 | } |
| 8773 | } |
| 8774 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8775 | countingStream->rewind(); |
| 8776 | uint32_t opcode_vkGetImageSparseMemoryRequirements2 = OP_vkGetImageSparseMemoryRequirements2; |
| 8777 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| 8778 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8779 | uint64_t cgen_var_671; |
| 8780 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_671, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8781 | stream->write((uint64_t*)&cgen_var_671, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8782 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8783 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8784 | uint64_t cgen_var_672 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 8785 | stream->putBe64(cgen_var_672); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8786 | if (pSparseMemoryRequirementCount) |
| 8787 | { |
| 8788 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 8789 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8790 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8791 | uint64_t cgen_var_673 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 8792 | stream->putBe64(cgen_var_673); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8793 | if (pSparseMemoryRequirements) |
| 8794 | { |
| 8795 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 8796 | { |
| 8797 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 8798 | } |
| 8799 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8800 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8801 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8802 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8803 | if (pSparseMemoryRequirementCount) |
| 8804 | { |
| 8805 | if (!(check_pSparseMemoryRequirementCount)) |
| 8806 | { |
| 8807 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 8808 | } |
| 8809 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 8810 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8811 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8812 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8813 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8814 | if (pSparseMemoryRequirements) |
| 8815 | { |
| 8816 | if (!(check_pSparseMemoryRequirements)) |
| 8817 | { |
| 8818 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 8819 | } |
| 8820 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 8821 | { |
| 8822 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 8823 | } |
| 8824 | } |
| 8825 | } |
| 8826 | |
| 8827 | void VkEncoder::vkGetPhysicalDeviceFeatures2( |
| 8828 | VkPhysicalDevice physicalDevice, |
| 8829 | VkPhysicalDeviceFeatures2* pFeatures) |
| 8830 | { |
| 8831 | auto stream = mImpl->stream(); |
| 8832 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8833 | auto resources = mImpl->resources(); |
| 8834 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8835 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8836 | VkPhysicalDevice local_physicalDevice; |
| 8837 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8838 | countingStream->rewind(); |
| 8839 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8840 | uint64_t cgen_var_676; |
| 8841 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_676, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8842 | countingStream->write((uint64_t*)&cgen_var_676, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8843 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 8844 | } |
| 8845 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8846 | countingStream->rewind(); |
| 8847 | uint32_t opcode_vkGetPhysicalDeviceFeatures2 = OP_vkGetPhysicalDeviceFeatures2; |
| 8848 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| 8849 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8850 | uint64_t cgen_var_677; |
| 8851 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_677, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8852 | stream->write((uint64_t*)&cgen_var_677, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8853 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 8854 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 8855 | } |
| 8856 | |
| 8857 | void VkEncoder::vkGetPhysicalDeviceProperties2( |
| 8858 | VkPhysicalDevice physicalDevice, |
| 8859 | VkPhysicalDeviceProperties2* pProperties) |
| 8860 | { |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 8861 | goldfish_vkGetPhysicalDeviceProperties2(physicalDevice, pProperties); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8862 | } |
| 8863 | |
| 8864 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2( |
| 8865 | VkPhysicalDevice physicalDevice, |
| 8866 | VkFormat format, |
| 8867 | VkFormatProperties2* pFormatProperties) |
| 8868 | { |
| 8869 | auto stream = mImpl->stream(); |
| 8870 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8871 | auto resources = mImpl->resources(); |
| 8872 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8873 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8874 | VkPhysicalDevice local_physicalDevice; |
| 8875 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8876 | VkFormat local_format; |
| 8877 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8878 | countingStream->rewind(); |
| 8879 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8880 | uint64_t cgen_var_678; |
| 8881 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_678, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8882 | countingStream->write((uint64_t*)&cgen_var_678, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8883 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8884 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 8885 | } |
| 8886 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8887 | countingStream->rewind(); |
| 8888 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2 = OP_vkGetPhysicalDeviceFormatProperties2; |
| 8889 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| 8890 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8891 | uint64_t cgen_var_679; |
| 8892 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_679, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8893 | stream->write((uint64_t*)&cgen_var_679, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8894 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8895 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| 8896 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| 8897 | } |
| 8898 | |
| 8899 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2( |
| 8900 | VkPhysicalDevice physicalDevice, |
| 8901 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 8902 | VkImageFormatProperties2* pImageFormatProperties) |
| 8903 | { |
| 8904 | auto stream = mImpl->stream(); |
| 8905 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8906 | auto resources = mImpl->resources(); |
| 8907 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8908 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8909 | VkPhysicalDevice local_physicalDevice; |
| 8910 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8911 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| 8912 | local_pImageFormatInfo = nullptr; |
| 8913 | if (pImageFormatInfo) |
| 8914 | { |
| 8915 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 8916 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 8917 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8918 | countingStream->rewind(); |
| 8919 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8920 | uint64_t cgen_var_680; |
| 8921 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_680, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8922 | countingStream->write((uint64_t*)&cgen_var_680, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8923 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8924 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 8925 | } |
| 8926 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8927 | countingStream->rewind(); |
| 8928 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2 = OP_vkGetPhysicalDeviceImageFormatProperties2; |
| 8929 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| 8930 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8931 | uint64_t cgen_var_681; |
| 8932 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_681, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8933 | stream->write((uint64_t*)&cgen_var_681, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8934 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8935 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 8936 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 8937 | VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0; |
| 8938 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8939 | countingStream->clearPool(); |
| 8940 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8941 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8942 | return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return; |
| 8943 | } |
| 8944 | |
| 8945 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2( |
| 8946 | VkPhysicalDevice physicalDevice, |
| 8947 | uint32_t* pQueueFamilyPropertyCount, |
| 8948 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 8949 | { |
| 8950 | auto stream = mImpl->stream(); |
| 8951 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8952 | auto resources = mImpl->resources(); |
| 8953 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8954 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8955 | VkPhysicalDevice local_physicalDevice; |
| 8956 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8957 | countingStream->rewind(); |
| 8958 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8959 | uint64_t cgen_var_682; |
| 8960 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_682, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8961 | countingStream->write((uint64_t*)&cgen_var_682, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8962 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8963 | uint64_t cgen_var_683 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 8964 | countingStream->putBe64(cgen_var_683); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8965 | if (pQueueFamilyPropertyCount) |
| 8966 | { |
| 8967 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 8968 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8969 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8970 | uint64_t cgen_var_684 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 8971 | countingStream->putBe64(cgen_var_684); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8972 | if (pQueueFamilyProperties) |
| 8973 | { |
| 8974 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 8975 | { |
| 8976 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 8977 | } |
| 8978 | } |
| 8979 | } |
| 8980 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8981 | countingStream->rewind(); |
| 8982 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2 = OP_vkGetPhysicalDeviceQueueFamilyProperties2; |
| 8983 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| 8984 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8985 | uint64_t cgen_var_685; |
| 8986 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_685, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 8987 | stream->write((uint64_t*)&cgen_var_685, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8988 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8989 | uint64_t cgen_var_686 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 8990 | stream->putBe64(cgen_var_686); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8991 | if (pQueueFamilyPropertyCount) |
| 8992 | { |
| 8993 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 8994 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 8995 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8996 | uint64_t cgen_var_687 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 8997 | stream->putBe64(cgen_var_687); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8998 | if (pQueueFamilyProperties) |
| 8999 | { |
| 9000 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 9001 | { |
| 9002 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 9003 | } |
| 9004 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9005 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9006 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9007 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9008 | if (pQueueFamilyPropertyCount) |
| 9009 | { |
| 9010 | if (!(check_pQueueFamilyPropertyCount)) |
| 9011 | { |
| 9012 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 9013 | } |
| 9014 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 9015 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9016 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9017 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9018 | check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9019 | if (pQueueFamilyProperties) |
| 9020 | { |
| 9021 | if (!(check_pQueueFamilyProperties)) |
| 9022 | { |
| 9023 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 9024 | } |
| 9025 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 9026 | { |
| 9027 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 9028 | } |
| 9029 | } |
| 9030 | } |
| 9031 | |
| 9032 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2( |
| 9033 | VkPhysicalDevice physicalDevice, |
| 9034 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 9035 | { |
| 9036 | auto stream = mImpl->stream(); |
| 9037 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9038 | auto resources = mImpl->resources(); |
| 9039 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9040 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9041 | VkPhysicalDevice local_physicalDevice; |
| 9042 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9043 | countingStream->rewind(); |
| 9044 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9045 | uint64_t cgen_var_690; |
| 9046 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_690, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9047 | countingStream->write((uint64_t*)&cgen_var_690, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9048 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 9049 | } |
| 9050 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9051 | countingStream->rewind(); |
| 9052 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2 = OP_vkGetPhysicalDeviceMemoryProperties2; |
| 9053 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| 9054 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9055 | uint64_t cgen_var_691; |
| 9056 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_691, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9057 | stream->write((uint64_t*)&cgen_var_691, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9058 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 9059 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 9060 | } |
| 9061 | |
| 9062 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2( |
| 9063 | VkPhysicalDevice physicalDevice, |
| 9064 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 9065 | uint32_t* pPropertyCount, |
| 9066 | VkSparseImageFormatProperties2* pProperties) |
| 9067 | { |
| 9068 | auto stream = mImpl->stream(); |
| 9069 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9070 | auto resources = mImpl->resources(); |
| 9071 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9072 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9073 | VkPhysicalDevice local_physicalDevice; |
| 9074 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9075 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| 9076 | local_pFormatInfo = nullptr; |
| 9077 | if (pFormatInfo) |
| 9078 | { |
| 9079 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 9080 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 9081 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9082 | countingStream->rewind(); |
| 9083 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9084 | uint64_t cgen_var_692; |
| 9085 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_692, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9086 | countingStream->write((uint64_t*)&cgen_var_692, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9087 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9088 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9089 | uint64_t cgen_var_693 = (uint64_t)(uintptr_t)pPropertyCount; |
| 9090 | countingStream->putBe64(cgen_var_693); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9091 | if (pPropertyCount) |
| 9092 | { |
| 9093 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9094 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9095 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9096 | uint64_t cgen_var_694 = (uint64_t)(uintptr_t)pProperties; |
| 9097 | countingStream->putBe64(cgen_var_694); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9098 | if (pProperties) |
| 9099 | { |
| 9100 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9101 | { |
| 9102 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 9103 | } |
| 9104 | } |
| 9105 | } |
| 9106 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9107 | countingStream->rewind(); |
| 9108 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2 = OP_vkGetPhysicalDeviceSparseImageFormatProperties2; |
| 9109 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| 9110 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9111 | uint64_t cgen_var_695; |
| 9112 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_695, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9113 | stream->write((uint64_t*)&cgen_var_695, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9114 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9115 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9116 | uint64_t cgen_var_696 = (uint64_t)(uintptr_t)pPropertyCount; |
| 9117 | stream->putBe64(cgen_var_696); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9118 | if (pPropertyCount) |
| 9119 | { |
| 9120 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9121 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9122 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9123 | uint64_t cgen_var_697 = (uint64_t)(uintptr_t)pProperties; |
| 9124 | stream->putBe64(cgen_var_697); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9125 | if (pProperties) |
| 9126 | { |
| 9127 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9128 | { |
| 9129 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 9130 | } |
| 9131 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9132 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9133 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9134 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9135 | if (pPropertyCount) |
| 9136 | { |
| 9137 | if (!(check_pPropertyCount)) |
| 9138 | { |
| 9139 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 9140 | } |
| 9141 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 9142 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9143 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9144 | VkSparseImageFormatProperties2* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9145 | check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9146 | if (pProperties) |
| 9147 | { |
| 9148 | if (!(check_pProperties)) |
| 9149 | { |
| 9150 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 9151 | } |
| 9152 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 9153 | { |
| 9154 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 9155 | } |
| 9156 | } |
| 9157 | } |
| 9158 | |
| 9159 | void VkEncoder::vkTrimCommandPool( |
| 9160 | VkDevice device, |
| 9161 | VkCommandPool commandPool, |
| 9162 | VkCommandPoolTrimFlags flags) |
| 9163 | { |
| 9164 | auto stream = mImpl->stream(); |
| 9165 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9166 | auto resources = mImpl->resources(); |
| 9167 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9168 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9169 | VkDevice local_device; |
| 9170 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9171 | VkCommandPool local_commandPool; |
| 9172 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9173 | VkCommandPoolTrimFlags local_flags; |
| 9174 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9175 | countingStream->rewind(); |
| 9176 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9177 | uint64_t cgen_var_700; |
| 9178 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_700, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9179 | countingStream->write((uint64_t*)&cgen_var_700, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9180 | uint64_t cgen_var_701; |
| 9181 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_701, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9182 | countingStream->write((uint64_t*)&cgen_var_701, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9183 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9184 | } |
| 9185 | uint32_t packetSize_vkTrimCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9186 | countingStream->rewind(); |
| 9187 | uint32_t opcode_vkTrimCommandPool = OP_vkTrimCommandPool; |
| 9188 | stream->write(&opcode_vkTrimCommandPool, sizeof(uint32_t)); |
| 9189 | stream->write(&packetSize_vkTrimCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9190 | uint64_t cgen_var_702; |
| 9191 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_702, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9192 | stream->write((uint64_t*)&cgen_var_702, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9193 | uint64_t cgen_var_703; |
| 9194 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_703, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9195 | stream->write((uint64_t*)&cgen_var_703, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9196 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9197 | } |
| 9198 | |
| 9199 | void VkEncoder::vkGetDeviceQueue2( |
| 9200 | VkDevice device, |
| 9201 | const VkDeviceQueueInfo2* pQueueInfo, |
| 9202 | VkQueue* pQueue) |
| 9203 | { |
| 9204 | auto stream = mImpl->stream(); |
| 9205 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9206 | auto resources = mImpl->resources(); |
| 9207 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9208 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9209 | VkDevice local_device; |
| 9210 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9211 | VkDeviceQueueInfo2* local_pQueueInfo; |
| 9212 | local_pQueueInfo = nullptr; |
| 9213 | if (pQueueInfo) |
| 9214 | { |
| 9215 | local_pQueueInfo = (VkDeviceQueueInfo2*)pool->alloc(sizeof(const VkDeviceQueueInfo2)); |
| 9216 | deepcopy_VkDeviceQueueInfo2(pool, pQueueInfo, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| 9217 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9218 | countingStream->rewind(); |
| 9219 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9220 | uint64_t cgen_var_704; |
| 9221 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_704, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9222 | countingStream->write((uint64_t*)&cgen_var_704, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9223 | marshal_VkDeviceQueueInfo2(countingStream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9224 | uint64_t cgen_var_705; |
| 9225 | countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_705, 1); |
| 9226 | countingStream->write((uint64_t*)&cgen_var_705, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9227 | } |
| 9228 | uint32_t packetSize_vkGetDeviceQueue2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9229 | countingStream->rewind(); |
| 9230 | uint32_t opcode_vkGetDeviceQueue2 = OP_vkGetDeviceQueue2; |
| 9231 | stream->write(&opcode_vkGetDeviceQueue2, sizeof(uint32_t)); |
| 9232 | stream->write(&packetSize_vkGetDeviceQueue2, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9233 | uint64_t cgen_var_706; |
| 9234 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_706, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9235 | stream->write((uint64_t*)&cgen_var_706, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9236 | marshal_VkDeviceQueueInfo2(stream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9237 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9238 | uint64_t cgen_var_707; |
| 9239 | stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_707, 1); |
| 9240 | stream->write((uint64_t*)&cgen_var_707, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9241 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9242 | uint64_t cgen_var_708; |
| 9243 | stream->read((uint64_t*)&cgen_var_708, 8); |
| 9244 | stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_708, (VkQueue*)pQueue, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9245 | } |
| 9246 | |
| 9247 | VkResult VkEncoder::vkCreateSamplerYcbcrConversion( |
| 9248 | VkDevice device, |
| 9249 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 9250 | const VkAllocationCallbacks* pAllocator, |
| 9251 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 9252 | { |
| 9253 | auto stream = mImpl->stream(); |
| 9254 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9255 | auto resources = mImpl->resources(); |
| 9256 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9257 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9258 | VkDevice local_device; |
| 9259 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9260 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| 9261 | local_pCreateInfo = nullptr; |
| 9262 | if (pCreateInfo) |
| 9263 | { |
| 9264 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 9265 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 9266 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9267 | VkAllocationCallbacks* local_pAllocator; |
| 9268 | local_pAllocator = nullptr; |
| 9269 | if (pAllocator) |
| 9270 | { |
| 9271 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 9272 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 9273 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 9274 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9275 | countingStream->rewind(); |
| 9276 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9277 | uint64_t cgen_var_709; |
| 9278 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_709, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9279 | countingStream->write((uint64_t*)&cgen_var_709, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9280 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9281 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9282 | uint64_t cgen_var_710 = (uint64_t)(uintptr_t)local_pAllocator; |
| 9283 | countingStream->putBe64(cgen_var_710); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9284 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9285 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9286 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9287 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9288 | uint64_t cgen_var_711; |
| 9289 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_711, 1); |
| 9290 | countingStream->write((uint64_t*)&cgen_var_711, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9291 | } |
| 9292 | uint32_t packetSize_vkCreateSamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9293 | countingStream->rewind(); |
| 9294 | uint32_t opcode_vkCreateSamplerYcbcrConversion = OP_vkCreateSamplerYcbcrConversion; |
| 9295 | stream->write(&opcode_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| 9296 | stream->write(&packetSize_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9297 | uint64_t cgen_var_712; |
| 9298 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_712, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9299 | stream->write((uint64_t*)&cgen_var_712, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9300 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9301 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9302 | uint64_t cgen_var_713 = (uint64_t)(uintptr_t)local_pAllocator; |
| 9303 | stream->putBe64(cgen_var_713); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9304 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9305 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9306 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9307 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9308 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9309 | uint64_t cgen_var_714; |
| 9310 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_714, 1); |
| 9311 | stream->write((uint64_t*)&cgen_var_714, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9312 | stream->setHandleMapping(resources->unwrapMapping()); |
| 9313 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9314 | uint64_t cgen_var_715; |
| 9315 | stream->read((uint64_t*)&cgen_var_715, 8); |
| 9316 | stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_715, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9317 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9318 | VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0; |
| 9319 | stream->read(&vkCreateSamplerYcbcrConversion_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9320 | countingStream->clearPool(); |
| 9321 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9322 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9323 | return vkCreateSamplerYcbcrConversion_VkResult_return; |
| 9324 | } |
| 9325 | |
| 9326 | void VkEncoder::vkDestroySamplerYcbcrConversion( |
| 9327 | VkDevice device, |
| 9328 | VkSamplerYcbcrConversion ycbcrConversion, |
| 9329 | const VkAllocationCallbacks* pAllocator) |
| 9330 | { |
| 9331 | auto stream = mImpl->stream(); |
| 9332 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9333 | auto resources = mImpl->resources(); |
| 9334 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9335 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9336 | VkDevice local_device; |
| 9337 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 9338 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| 9339 | local_ycbcrConversion = ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9340 | VkAllocationCallbacks* local_pAllocator; |
| 9341 | local_pAllocator = nullptr; |
| 9342 | if (pAllocator) |
| 9343 | { |
| 9344 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 9345 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 9346 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 9347 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9348 | countingStream->rewind(); |
| 9349 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9350 | uint64_t cgen_var_716; |
| 9351 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_716, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9352 | countingStream->write((uint64_t*)&cgen_var_716, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9353 | uint64_t cgen_var_717; |
| 9354 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_717, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9355 | countingStream->write((uint64_t*)&cgen_var_717, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9356 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9357 | uint64_t cgen_var_718 = (uint64_t)(uintptr_t)local_pAllocator; |
| 9358 | countingStream->putBe64(cgen_var_718); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9359 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9360 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9361 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9362 | } |
| 9363 | } |
| 9364 | uint32_t packetSize_vkDestroySamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9365 | countingStream->rewind(); |
| 9366 | uint32_t opcode_vkDestroySamplerYcbcrConversion = OP_vkDestroySamplerYcbcrConversion; |
| 9367 | stream->write(&opcode_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| 9368 | stream->write(&packetSize_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9369 | uint64_t cgen_var_719; |
| 9370 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_719, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9371 | stream->write((uint64_t*)&cgen_var_719, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9372 | uint64_t cgen_var_720; |
| 9373 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_720, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9374 | stream->write((uint64_t*)&cgen_var_720, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9375 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9376 | uint64_t cgen_var_721 = (uint64_t)(uintptr_t)local_pAllocator; |
| 9377 | stream->putBe64(cgen_var_721); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9378 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9379 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9380 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9381 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9382 | resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9383 | } |
| 9384 | |
| 9385 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplate( |
| 9386 | VkDevice device, |
| 9387 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 9388 | const VkAllocationCallbacks* pAllocator, |
| 9389 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 9390 | { |
| 9391 | auto stream = mImpl->stream(); |
| 9392 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9393 | auto resources = mImpl->resources(); |
| 9394 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9395 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9396 | VkDevice local_device; |
| 9397 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9398 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| 9399 | local_pCreateInfo = nullptr; |
| 9400 | if (pCreateInfo) |
| 9401 | { |
| 9402 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 9403 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 9404 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9405 | VkAllocationCallbacks* local_pAllocator; |
| 9406 | local_pAllocator = nullptr; |
| 9407 | if (pAllocator) |
| 9408 | { |
| 9409 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 9410 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 9411 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 9412 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9413 | countingStream->rewind(); |
| 9414 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9415 | uint64_t cgen_var_722; |
| 9416 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_722, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9417 | countingStream->write((uint64_t*)&cgen_var_722, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9418 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9419 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9420 | uint64_t cgen_var_723 = (uint64_t)(uintptr_t)local_pAllocator; |
| 9421 | countingStream->putBe64(cgen_var_723); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9422 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9423 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9424 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9425 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9426 | uint64_t cgen_var_724; |
| 9427 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_724, 1); |
| 9428 | countingStream->write((uint64_t*)&cgen_var_724, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9429 | } |
| 9430 | uint32_t packetSize_vkCreateDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9431 | countingStream->rewind(); |
| 9432 | uint32_t opcode_vkCreateDescriptorUpdateTemplate = OP_vkCreateDescriptorUpdateTemplate; |
| 9433 | stream->write(&opcode_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 9434 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9435 | uint64_t cgen_var_725; |
| 9436 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_725, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9437 | stream->write((uint64_t*)&cgen_var_725, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9438 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9439 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9440 | uint64_t cgen_var_726 = (uint64_t)(uintptr_t)local_pAllocator; |
| 9441 | stream->putBe64(cgen_var_726); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9442 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9443 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9444 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9445 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9446 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9447 | uint64_t cgen_var_727; |
| 9448 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_727, 1); |
| 9449 | stream->write((uint64_t*)&cgen_var_727, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9450 | stream->setHandleMapping(resources->unwrapMapping()); |
| 9451 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9452 | uint64_t cgen_var_728; |
| 9453 | stream->read((uint64_t*)&cgen_var_728, 8); |
| 9454 | stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_728, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9455 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9456 | VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0; |
| 9457 | stream->read(&vkCreateDescriptorUpdateTemplate_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9458 | countingStream->clearPool(); |
| 9459 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9460 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9461 | return vkCreateDescriptorUpdateTemplate_VkResult_return; |
| 9462 | } |
| 9463 | |
| 9464 | void VkEncoder::vkDestroyDescriptorUpdateTemplate( |
| 9465 | VkDevice device, |
| 9466 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 9467 | const VkAllocationCallbacks* pAllocator) |
| 9468 | { |
| 9469 | auto stream = mImpl->stream(); |
| 9470 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9471 | auto resources = mImpl->resources(); |
| 9472 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9473 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9474 | VkDevice local_device; |
| 9475 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 9476 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 9477 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9478 | VkAllocationCallbacks* local_pAllocator; |
| 9479 | local_pAllocator = nullptr; |
| 9480 | if (pAllocator) |
| 9481 | { |
| 9482 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 9483 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 9484 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 9485 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9486 | countingStream->rewind(); |
| 9487 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9488 | uint64_t cgen_var_729; |
| 9489 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_729, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9490 | countingStream->write((uint64_t*)&cgen_var_729, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9491 | uint64_t cgen_var_730; |
| 9492 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_730, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9493 | countingStream->write((uint64_t*)&cgen_var_730, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9494 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9495 | uint64_t cgen_var_731 = (uint64_t)(uintptr_t)local_pAllocator; |
| 9496 | countingStream->putBe64(cgen_var_731); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9497 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9498 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9499 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9500 | } |
| 9501 | } |
| 9502 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9503 | countingStream->rewind(); |
| 9504 | uint32_t opcode_vkDestroyDescriptorUpdateTemplate = OP_vkDestroyDescriptorUpdateTemplate; |
| 9505 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 9506 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9507 | uint64_t cgen_var_732; |
| 9508 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_732, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9509 | stream->write((uint64_t*)&cgen_var_732, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9510 | uint64_t cgen_var_733; |
| 9511 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_733, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9512 | stream->write((uint64_t*)&cgen_var_733, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9513 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9514 | uint64_t cgen_var_734 = (uint64_t)(uintptr_t)local_pAllocator; |
| 9515 | stream->putBe64(cgen_var_734); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9516 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9517 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9518 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9519 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9520 | resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9521 | } |
| 9522 | |
| 9523 | void VkEncoder::vkUpdateDescriptorSetWithTemplate( |
| 9524 | VkDevice device, |
| 9525 | VkDescriptorSet descriptorSet, |
| 9526 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 9527 | const void* pData) |
| 9528 | { |
| 9529 | auto stream = mImpl->stream(); |
| 9530 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9531 | auto resources = mImpl->resources(); |
| 9532 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9533 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9534 | VkDevice local_device; |
| 9535 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9536 | VkDescriptorSet local_descriptorSet; |
| 9537 | local_descriptorSet = descriptorSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9538 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 9539 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9540 | void* local_pData; |
| 9541 | local_pData = nullptr; |
| 9542 | if (pData) |
| 9543 | { |
| 9544 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 9545 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9546 | countingStream->rewind(); |
| 9547 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9548 | uint64_t cgen_var_735; |
| 9549 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_735, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9550 | countingStream->write((uint64_t*)&cgen_var_735, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9551 | uint64_t cgen_var_736; |
| 9552 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_736, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9553 | countingStream->write((uint64_t*)&cgen_var_736, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9554 | uint64_t cgen_var_737; |
| 9555 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_737, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9556 | countingStream->write((uint64_t*)&cgen_var_737, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9557 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9558 | uint64_t cgen_var_738 = (uint64_t)(uintptr_t)local_pData; |
| 9559 | countingStream->putBe64(cgen_var_738); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9560 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9561 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9562 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9563 | } |
| 9564 | } |
| 9565 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9566 | countingStream->rewind(); |
| 9567 | uint32_t opcode_vkUpdateDescriptorSetWithTemplate = OP_vkUpdateDescriptorSetWithTemplate; |
| 9568 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t)); |
| 9569 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9570 | uint64_t cgen_var_739; |
| 9571 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_739, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9572 | stream->write((uint64_t*)&cgen_var_739, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9573 | uint64_t cgen_var_740; |
| 9574 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_740, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9575 | stream->write((uint64_t*)&cgen_var_740, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9576 | uint64_t cgen_var_741; |
| 9577 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_741, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9578 | stream->write((uint64_t*)&cgen_var_741, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9579 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9580 | uint64_t cgen_var_742 = (uint64_t)(uintptr_t)local_pData; |
| 9581 | stream->putBe64(cgen_var_742); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9582 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9583 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9584 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9585 | } |
| 9586 | } |
| 9587 | |
| 9588 | void VkEncoder::vkGetPhysicalDeviceExternalBufferProperties( |
| 9589 | VkPhysicalDevice physicalDevice, |
| 9590 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 9591 | VkExternalBufferProperties* pExternalBufferProperties) |
| 9592 | { |
| 9593 | auto stream = mImpl->stream(); |
| 9594 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9595 | auto resources = mImpl->resources(); |
| 9596 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9597 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9598 | VkPhysicalDevice local_physicalDevice; |
| 9599 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9600 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| 9601 | local_pExternalBufferInfo = nullptr; |
| 9602 | if (pExternalBufferInfo) |
| 9603 | { |
| 9604 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 9605 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 9606 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9607 | countingStream->rewind(); |
| 9608 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9609 | uint64_t cgen_var_743; |
| 9610 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_743, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9611 | countingStream->write((uint64_t*)&cgen_var_743, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9612 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9613 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 9614 | } |
| 9615 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9616 | countingStream->rewind(); |
| 9617 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferProperties = OP_vkGetPhysicalDeviceExternalBufferProperties; |
| 9618 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t)); |
| 9619 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9620 | uint64_t cgen_var_744; |
| 9621 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_744, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9622 | stream->write((uint64_t*)&cgen_var_744, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9623 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9624 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 9625 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 9626 | } |
| 9627 | |
| 9628 | void VkEncoder::vkGetPhysicalDeviceExternalFenceProperties( |
| 9629 | VkPhysicalDevice physicalDevice, |
| 9630 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 9631 | VkExternalFenceProperties* pExternalFenceProperties) |
| 9632 | { |
| 9633 | auto stream = mImpl->stream(); |
| 9634 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9635 | auto resources = mImpl->resources(); |
| 9636 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9637 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9638 | VkPhysicalDevice local_physicalDevice; |
| 9639 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9640 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| 9641 | local_pExternalFenceInfo = nullptr; |
| 9642 | if (pExternalFenceInfo) |
| 9643 | { |
| 9644 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 9645 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 9646 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9647 | countingStream->rewind(); |
| 9648 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9649 | uint64_t cgen_var_745; |
| 9650 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_745, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9651 | countingStream->write((uint64_t*)&cgen_var_745, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9652 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9653 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 9654 | } |
| 9655 | uint32_t packetSize_vkGetPhysicalDeviceExternalFenceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9656 | countingStream->rewind(); |
| 9657 | uint32_t opcode_vkGetPhysicalDeviceExternalFenceProperties = OP_vkGetPhysicalDeviceExternalFenceProperties; |
| 9658 | stream->write(&opcode_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t)); |
| 9659 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9660 | uint64_t cgen_var_746; |
| 9661 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_746, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9662 | stream->write((uint64_t*)&cgen_var_746, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9663 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9664 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 9665 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 9666 | } |
| 9667 | |
| 9668 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphoreProperties( |
| 9669 | VkPhysicalDevice physicalDevice, |
| 9670 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 9671 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 9672 | { |
| 9673 | auto stream = mImpl->stream(); |
| 9674 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9675 | auto resources = mImpl->resources(); |
| 9676 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9677 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9678 | VkPhysicalDevice local_physicalDevice; |
| 9679 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9680 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| 9681 | local_pExternalSemaphoreInfo = nullptr; |
| 9682 | if (pExternalSemaphoreInfo) |
| 9683 | { |
| 9684 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 9685 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 9686 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9687 | countingStream->rewind(); |
| 9688 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9689 | uint64_t cgen_var_747; |
| 9690 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_747, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9691 | countingStream->write((uint64_t*)&cgen_var_747, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9692 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9693 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 9694 | } |
| 9695 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9696 | countingStream->rewind(); |
| 9697 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphoreProperties = OP_vkGetPhysicalDeviceExternalSemaphoreProperties; |
| 9698 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t)); |
| 9699 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9700 | uint64_t cgen_var_748; |
| 9701 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_748, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9702 | stream->write((uint64_t*)&cgen_var_748, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9703 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9704 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 9705 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 9706 | } |
| 9707 | |
| 9708 | void VkEncoder::vkGetDescriptorSetLayoutSupport( |
| 9709 | VkDevice device, |
| 9710 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 9711 | VkDescriptorSetLayoutSupport* pSupport) |
| 9712 | { |
| 9713 | auto stream = mImpl->stream(); |
| 9714 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9715 | auto resources = mImpl->resources(); |
| 9716 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9717 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9718 | VkDevice local_device; |
| 9719 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9720 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| 9721 | local_pCreateInfo = nullptr; |
| 9722 | if (pCreateInfo) |
| 9723 | { |
| 9724 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 9725 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 9726 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9727 | countingStream->rewind(); |
| 9728 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9729 | uint64_t cgen_var_749; |
| 9730 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_749, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9731 | countingStream->write((uint64_t*)&cgen_var_749, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9732 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9733 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 9734 | } |
| 9735 | uint32_t packetSize_vkGetDescriptorSetLayoutSupport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9736 | countingStream->rewind(); |
| 9737 | uint32_t opcode_vkGetDescriptorSetLayoutSupport = OP_vkGetDescriptorSetLayoutSupport; |
| 9738 | stream->write(&opcode_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t)); |
| 9739 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9740 | uint64_t cgen_var_750; |
| 9741 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_750, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9742 | stream->write((uint64_t*)&cgen_var_750, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9743 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9744 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 9745 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 9746 | } |
| 9747 | |
| 9748 | #endif |
| 9749 | #ifdef VK_KHR_surface |
| 9750 | void VkEncoder::vkDestroySurfaceKHR( |
| 9751 | VkInstance instance, |
| 9752 | VkSurfaceKHR surface, |
| 9753 | const VkAllocationCallbacks* pAllocator) |
| 9754 | { |
| 9755 | auto stream = mImpl->stream(); |
| 9756 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9757 | auto resources = mImpl->resources(); |
| 9758 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9759 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9760 | VkInstance local_instance; |
| 9761 | local_instance = instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 9762 | VkSurfaceKHR local_surface; |
| 9763 | local_surface = surface; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9764 | VkAllocationCallbacks* local_pAllocator; |
| 9765 | local_pAllocator = nullptr; |
| 9766 | if (pAllocator) |
| 9767 | { |
| 9768 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 9769 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 9770 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 9771 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9772 | countingStream->rewind(); |
| 9773 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9774 | uint64_t cgen_var_751; |
| 9775 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_751, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9776 | countingStream->write((uint64_t*)&cgen_var_751, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9777 | uint64_t cgen_var_752; |
| 9778 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_752, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9779 | countingStream->write((uint64_t*)&cgen_var_752, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9780 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9781 | uint64_t cgen_var_753 = (uint64_t)(uintptr_t)local_pAllocator; |
| 9782 | countingStream->putBe64(cgen_var_753); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9783 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9784 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9785 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9786 | } |
| 9787 | } |
| 9788 | uint32_t packetSize_vkDestroySurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9789 | countingStream->rewind(); |
| 9790 | uint32_t opcode_vkDestroySurfaceKHR = OP_vkDestroySurfaceKHR; |
| 9791 | stream->write(&opcode_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| 9792 | stream->write(&packetSize_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9793 | uint64_t cgen_var_754; |
| 9794 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_754, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9795 | stream->write((uint64_t*)&cgen_var_754, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9796 | uint64_t cgen_var_755; |
| 9797 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_755, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9798 | stream->write((uint64_t*)&cgen_var_755, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9799 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9800 | uint64_t cgen_var_756 = (uint64_t)(uintptr_t)local_pAllocator; |
| 9801 | stream->putBe64(cgen_var_756); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9802 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9803 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9804 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9805 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9806 | resources->destroyMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&surface); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9807 | } |
| 9808 | |
| 9809 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceSupportKHR( |
| 9810 | VkPhysicalDevice physicalDevice, |
| 9811 | uint32_t queueFamilyIndex, |
| 9812 | VkSurfaceKHR surface, |
| 9813 | VkBool32* pSupported) |
| 9814 | { |
| 9815 | auto stream = mImpl->stream(); |
| 9816 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9817 | auto resources = mImpl->resources(); |
| 9818 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9819 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9820 | VkPhysicalDevice local_physicalDevice; |
| 9821 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9822 | uint32_t local_queueFamilyIndex; |
| 9823 | local_queueFamilyIndex = queueFamilyIndex; |
| 9824 | VkSurfaceKHR local_surface; |
| 9825 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9826 | countingStream->rewind(); |
| 9827 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9828 | uint64_t cgen_var_757; |
| 9829 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_757, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9830 | countingStream->write((uint64_t*)&cgen_var_757, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9831 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9832 | uint64_t cgen_var_758; |
| 9833 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_758, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9834 | countingStream->write((uint64_t*)&cgen_var_758, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9835 | countingStream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| 9836 | } |
| 9837 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9838 | countingStream->rewind(); |
| 9839 | uint32_t opcode_vkGetPhysicalDeviceSurfaceSupportKHR = OP_vkGetPhysicalDeviceSurfaceSupportKHR; |
| 9840 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| 9841 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9842 | uint64_t cgen_var_759; |
| 9843 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_759, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9844 | stream->write((uint64_t*)&cgen_var_759, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9845 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9846 | uint64_t cgen_var_760; |
| 9847 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_760, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9848 | stream->write((uint64_t*)&cgen_var_760, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9849 | stream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| 9850 | stream->read((VkBool32*)pSupported, sizeof(VkBool32)); |
| 9851 | VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0; |
| 9852 | stream->read(&vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9853 | countingStream->clearPool(); |
| 9854 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9855 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9856 | return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return; |
| 9857 | } |
| 9858 | |
| 9859 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilitiesKHR( |
| 9860 | VkPhysicalDevice physicalDevice, |
| 9861 | VkSurfaceKHR surface, |
| 9862 | VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) |
| 9863 | { |
| 9864 | auto stream = mImpl->stream(); |
| 9865 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9866 | auto resources = mImpl->resources(); |
| 9867 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9868 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9869 | VkPhysicalDevice local_physicalDevice; |
| 9870 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9871 | VkSurfaceKHR local_surface; |
| 9872 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9873 | countingStream->rewind(); |
| 9874 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9875 | uint64_t cgen_var_761; |
| 9876 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_761, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9877 | countingStream->write((uint64_t*)&cgen_var_761, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9878 | uint64_t cgen_var_762; |
| 9879 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_762, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9880 | countingStream->write((uint64_t*)&cgen_var_762, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9881 | marshal_VkSurfaceCapabilitiesKHR(countingStream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 9882 | } |
| 9883 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9884 | countingStream->rewind(); |
| 9885 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR; |
| 9886 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| 9887 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9888 | uint64_t cgen_var_763; |
| 9889 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_763, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9890 | stream->write((uint64_t*)&cgen_var_763, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9891 | uint64_t cgen_var_764; |
| 9892 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_764, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9893 | stream->write((uint64_t*)&cgen_var_764, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9894 | marshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 9895 | unmarshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 9896 | VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 9897 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9898 | countingStream->clearPool(); |
| 9899 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9900 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9901 | return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return; |
| 9902 | } |
| 9903 | |
| 9904 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormatsKHR( |
| 9905 | VkPhysicalDevice physicalDevice, |
| 9906 | VkSurfaceKHR surface, |
| 9907 | uint32_t* pSurfaceFormatCount, |
| 9908 | VkSurfaceFormatKHR* pSurfaceFormats) |
| 9909 | { |
| 9910 | auto stream = mImpl->stream(); |
| 9911 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9912 | auto resources = mImpl->resources(); |
| 9913 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9914 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9915 | VkPhysicalDevice local_physicalDevice; |
| 9916 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9917 | VkSurfaceKHR local_surface; |
| 9918 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9919 | countingStream->rewind(); |
| 9920 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9921 | uint64_t cgen_var_765; |
| 9922 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_765, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9923 | countingStream->write((uint64_t*)&cgen_var_765, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9924 | uint64_t cgen_var_766; |
| 9925 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_766, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9926 | countingStream->write((uint64_t*)&cgen_var_766, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9927 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9928 | uint64_t cgen_var_767 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 9929 | countingStream->putBe64(cgen_var_767); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9930 | if (pSurfaceFormatCount) |
| 9931 | { |
| 9932 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 9933 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9934 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9935 | uint64_t cgen_var_768 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 9936 | countingStream->putBe64(cgen_var_768); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9937 | if (pSurfaceFormats) |
| 9938 | { |
| 9939 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 9940 | { |
| 9941 | marshal_VkSurfaceFormatKHR(countingStream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 9942 | } |
| 9943 | } |
| 9944 | } |
| 9945 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9946 | countingStream->rewind(); |
| 9947 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormatsKHR = OP_vkGetPhysicalDeviceSurfaceFormatsKHR; |
| 9948 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| 9949 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9950 | uint64_t cgen_var_769; |
| 9951 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_769, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9952 | stream->write((uint64_t*)&cgen_var_769, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9953 | uint64_t cgen_var_770; |
| 9954 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_770, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 9955 | stream->write((uint64_t*)&cgen_var_770, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9956 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9957 | uint64_t cgen_var_771 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 9958 | stream->putBe64(cgen_var_771); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9959 | if (pSurfaceFormatCount) |
| 9960 | { |
| 9961 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 9962 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9963 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9964 | uint64_t cgen_var_772 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 9965 | stream->putBe64(cgen_var_772); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9966 | if (pSurfaceFormats) |
| 9967 | { |
| 9968 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 9969 | { |
| 9970 | marshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 9971 | } |
| 9972 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9973 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9974 | uint32_t* check_pSurfaceFormatCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9975 | check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9976 | if (pSurfaceFormatCount) |
| 9977 | { |
| 9978 | if (!(check_pSurfaceFormatCount)) |
| 9979 | { |
| 9980 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 9981 | } |
| 9982 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 9983 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9984 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9985 | VkSurfaceFormatKHR* check_pSurfaceFormats; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9986 | check_pSurfaceFormats = (VkSurfaceFormatKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9987 | if (pSurfaceFormats) |
| 9988 | { |
| 9989 | if (!(check_pSurfaceFormats)) |
| 9990 | { |
| 9991 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 9992 | } |
| 9993 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 9994 | { |
| 9995 | unmarshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 9996 | } |
| 9997 | } |
| 9998 | VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0; |
| 9999 | stream->read(&vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10000 | countingStream->clearPool(); |
| 10001 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10002 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10003 | return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return; |
| 10004 | } |
| 10005 | |
| 10006 | VkResult VkEncoder::vkGetPhysicalDeviceSurfacePresentModesKHR( |
| 10007 | VkPhysicalDevice physicalDevice, |
| 10008 | VkSurfaceKHR surface, |
| 10009 | uint32_t* pPresentModeCount, |
| 10010 | VkPresentModeKHR* pPresentModes) |
| 10011 | { |
| 10012 | auto stream = mImpl->stream(); |
| 10013 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10014 | auto resources = mImpl->resources(); |
| 10015 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10016 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10017 | VkPhysicalDevice local_physicalDevice; |
| 10018 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10019 | VkSurfaceKHR local_surface; |
| 10020 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10021 | countingStream->rewind(); |
| 10022 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10023 | uint64_t cgen_var_775; |
| 10024 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_775, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10025 | countingStream->write((uint64_t*)&cgen_var_775, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10026 | uint64_t cgen_var_776; |
| 10027 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_776, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10028 | countingStream->write((uint64_t*)&cgen_var_776, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10029 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10030 | uint64_t cgen_var_777 = (uint64_t)(uintptr_t)pPresentModeCount; |
| 10031 | countingStream->putBe64(cgen_var_777); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10032 | if (pPresentModeCount) |
| 10033 | { |
| 10034 | countingStream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 10035 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10036 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10037 | uint64_t cgen_var_778 = (uint64_t)(uintptr_t)pPresentModes; |
| 10038 | countingStream->putBe64(cgen_var_778); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10039 | if (pPresentModes) |
| 10040 | { |
| 10041 | countingStream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 10042 | } |
| 10043 | } |
| 10044 | uint32_t packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10045 | countingStream->rewind(); |
| 10046 | uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModesKHR = OP_vkGetPhysicalDeviceSurfacePresentModesKHR; |
| 10047 | stream->write(&opcode_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| 10048 | stream->write(&packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10049 | uint64_t cgen_var_779; |
| 10050 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_779, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10051 | stream->write((uint64_t*)&cgen_var_779, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10052 | uint64_t cgen_var_780; |
| 10053 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_780, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10054 | stream->write((uint64_t*)&cgen_var_780, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10055 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10056 | uint64_t cgen_var_781 = (uint64_t)(uintptr_t)pPresentModeCount; |
| 10057 | stream->putBe64(cgen_var_781); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10058 | if (pPresentModeCount) |
| 10059 | { |
| 10060 | stream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 10061 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10062 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10063 | uint64_t cgen_var_782 = (uint64_t)(uintptr_t)pPresentModes; |
| 10064 | stream->putBe64(cgen_var_782); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10065 | if (pPresentModes) |
| 10066 | { |
| 10067 | stream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 10068 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10069 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10070 | uint32_t* check_pPresentModeCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10071 | check_pPresentModeCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10072 | if (pPresentModeCount) |
| 10073 | { |
| 10074 | if (!(check_pPresentModeCount)) |
| 10075 | { |
| 10076 | fprintf(stderr, "fatal: pPresentModeCount inconsistent between guest and host\n"); |
| 10077 | } |
| 10078 | stream->read((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 10079 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10080 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10081 | VkPresentModeKHR* check_pPresentModes; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10082 | check_pPresentModes = (VkPresentModeKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10083 | if (pPresentModes) |
| 10084 | { |
| 10085 | if (!(check_pPresentModes)) |
| 10086 | { |
| 10087 | fprintf(stderr, "fatal: pPresentModes inconsistent between guest and host\n"); |
| 10088 | } |
| 10089 | stream->read((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 10090 | } |
| 10091 | VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 10092 | stream->read(&vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10093 | countingStream->clearPool(); |
| 10094 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10095 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10096 | return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return; |
| 10097 | } |
| 10098 | |
| 10099 | #endif |
| 10100 | #ifdef VK_KHR_swapchain |
| 10101 | VkResult VkEncoder::vkCreateSwapchainKHR( |
| 10102 | VkDevice device, |
| 10103 | const VkSwapchainCreateInfoKHR* pCreateInfo, |
| 10104 | const VkAllocationCallbacks* pAllocator, |
| 10105 | VkSwapchainKHR* pSwapchain) |
| 10106 | { |
| 10107 | auto stream = mImpl->stream(); |
| 10108 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10109 | auto resources = mImpl->resources(); |
| 10110 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10111 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10112 | VkDevice local_device; |
| 10113 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10114 | VkSwapchainCreateInfoKHR* local_pCreateInfo; |
| 10115 | local_pCreateInfo = nullptr; |
| 10116 | if (pCreateInfo) |
| 10117 | { |
| 10118 | local_pCreateInfo = (VkSwapchainCreateInfoKHR*)pool->alloc(sizeof(const VkSwapchainCreateInfoKHR)); |
| 10119 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfo, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| 10120 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10121 | VkAllocationCallbacks* local_pAllocator; |
| 10122 | local_pAllocator = nullptr; |
| 10123 | if (pAllocator) |
| 10124 | { |
| 10125 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10126 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10127 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10128 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10129 | countingStream->rewind(); |
| 10130 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10131 | uint64_t cgen_var_785; |
| 10132 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_785, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10133 | countingStream->write((uint64_t*)&cgen_var_785, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10134 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10135 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10136 | uint64_t cgen_var_786 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10137 | countingStream->putBe64(cgen_var_786); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10138 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10139 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10140 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10141 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10142 | uint64_t cgen_var_787; |
| 10143 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_787, 1); |
| 10144 | countingStream->write((uint64_t*)&cgen_var_787, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10145 | } |
| 10146 | uint32_t packetSize_vkCreateSwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10147 | countingStream->rewind(); |
| 10148 | uint32_t opcode_vkCreateSwapchainKHR = OP_vkCreateSwapchainKHR; |
| 10149 | stream->write(&opcode_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| 10150 | stream->write(&packetSize_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10151 | uint64_t cgen_var_788; |
| 10152 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_788, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10153 | stream->write((uint64_t*)&cgen_var_788, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10154 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10155 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10156 | uint64_t cgen_var_789 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10157 | stream->putBe64(cgen_var_789); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10158 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10159 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10160 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10161 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10162 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10163 | uint64_t cgen_var_790; |
| 10164 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_790, 1); |
| 10165 | stream->write((uint64_t*)&cgen_var_790, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10166 | stream->setHandleMapping(resources->unwrapMapping()); |
| 10167 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10168 | uint64_t cgen_var_791; |
| 10169 | stream->read((uint64_t*)&cgen_var_791, 8); |
| 10170 | stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(&cgen_var_791, (VkSwapchainKHR*)pSwapchain, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10171 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10172 | VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0; |
| 10173 | stream->read(&vkCreateSwapchainKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10174 | countingStream->clearPool(); |
| 10175 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10176 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10177 | return vkCreateSwapchainKHR_VkResult_return; |
| 10178 | } |
| 10179 | |
| 10180 | void VkEncoder::vkDestroySwapchainKHR( |
| 10181 | VkDevice device, |
| 10182 | VkSwapchainKHR swapchain, |
| 10183 | const VkAllocationCallbacks* pAllocator) |
| 10184 | { |
| 10185 | auto stream = mImpl->stream(); |
| 10186 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10187 | auto resources = mImpl->resources(); |
| 10188 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10189 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10190 | VkDevice local_device; |
| 10191 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10192 | VkSwapchainKHR local_swapchain; |
| 10193 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10194 | VkAllocationCallbacks* local_pAllocator; |
| 10195 | local_pAllocator = nullptr; |
| 10196 | if (pAllocator) |
| 10197 | { |
| 10198 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10199 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10200 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10201 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10202 | countingStream->rewind(); |
| 10203 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10204 | uint64_t cgen_var_792; |
| 10205 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_792, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10206 | countingStream->write((uint64_t*)&cgen_var_792, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10207 | uint64_t cgen_var_793; |
| 10208 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_793, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10209 | countingStream->write((uint64_t*)&cgen_var_793, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10210 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10211 | uint64_t cgen_var_794 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10212 | countingStream->putBe64(cgen_var_794); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10213 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10214 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10215 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10216 | } |
| 10217 | } |
| 10218 | uint32_t packetSize_vkDestroySwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10219 | countingStream->rewind(); |
| 10220 | uint32_t opcode_vkDestroySwapchainKHR = OP_vkDestroySwapchainKHR; |
| 10221 | stream->write(&opcode_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| 10222 | stream->write(&packetSize_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10223 | uint64_t cgen_var_795; |
| 10224 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_795, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10225 | stream->write((uint64_t*)&cgen_var_795, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10226 | uint64_t cgen_var_796; |
| 10227 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_796, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10228 | stream->write((uint64_t*)&cgen_var_796, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10229 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10230 | uint64_t cgen_var_797 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10231 | stream->putBe64(cgen_var_797); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10232 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10233 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10234 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10235 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10236 | resources->destroyMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&swapchain); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10237 | } |
| 10238 | |
| 10239 | VkResult VkEncoder::vkGetSwapchainImagesKHR( |
| 10240 | VkDevice device, |
| 10241 | VkSwapchainKHR swapchain, |
| 10242 | uint32_t* pSwapchainImageCount, |
| 10243 | VkImage* pSwapchainImages) |
| 10244 | { |
| 10245 | auto stream = mImpl->stream(); |
| 10246 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10247 | auto resources = mImpl->resources(); |
| 10248 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10249 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10250 | VkDevice local_device; |
| 10251 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10252 | VkSwapchainKHR local_swapchain; |
| 10253 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10254 | countingStream->rewind(); |
| 10255 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10256 | uint64_t cgen_var_798; |
| 10257 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_798, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10258 | countingStream->write((uint64_t*)&cgen_var_798, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10259 | uint64_t cgen_var_799; |
| 10260 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_799, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10261 | countingStream->write((uint64_t*)&cgen_var_799, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10262 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10263 | uint64_t cgen_var_800 = (uint64_t)(uintptr_t)pSwapchainImageCount; |
| 10264 | countingStream->putBe64(cgen_var_800); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10265 | if (pSwapchainImageCount) |
| 10266 | { |
| 10267 | countingStream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 10268 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10269 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10270 | uint64_t cgen_var_801 = (uint64_t)(uintptr_t)pSwapchainImages; |
| 10271 | countingStream->putBe64(cgen_var_801); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10272 | if (pSwapchainImages) |
| 10273 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10274 | if ((*(pSwapchainImageCount))) |
| 10275 | { |
| 10276 | uint64_t* cgen_var_802; |
| 10277 | countingStream->alloc((void**)&cgen_var_802, (*(pSwapchainImageCount)) * 8); |
| 10278 | countingStream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_802, (*(pSwapchainImageCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10279 | countingStream->write((uint64_t*)cgen_var_802, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10280 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10281 | } |
| 10282 | } |
| 10283 | uint32_t packetSize_vkGetSwapchainImagesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10284 | countingStream->rewind(); |
| 10285 | uint32_t opcode_vkGetSwapchainImagesKHR = OP_vkGetSwapchainImagesKHR; |
| 10286 | stream->write(&opcode_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| 10287 | stream->write(&packetSize_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10288 | uint64_t cgen_var_803; |
| 10289 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_803, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10290 | stream->write((uint64_t*)&cgen_var_803, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10291 | uint64_t cgen_var_804; |
| 10292 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_804, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10293 | stream->write((uint64_t*)&cgen_var_804, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10294 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10295 | uint64_t cgen_var_805 = (uint64_t)(uintptr_t)pSwapchainImageCount; |
| 10296 | stream->putBe64(cgen_var_805); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10297 | if (pSwapchainImageCount) |
| 10298 | { |
| 10299 | stream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 10300 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10301 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10302 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10303 | uint64_t cgen_var_806 = (uint64_t)(uintptr_t)pSwapchainImages; |
| 10304 | stream->putBe64(cgen_var_806); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10305 | if (pSwapchainImages) |
| 10306 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10307 | if ((*(pSwapchainImageCount))) |
| 10308 | { |
| 10309 | uint64_t* cgen_var_807; |
| 10310 | stream->alloc((void**)&cgen_var_807, (*(pSwapchainImageCount)) * 8); |
| 10311 | stream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_807, (*(pSwapchainImageCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10312 | stream->write((uint64_t*)cgen_var_807, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10313 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10314 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10315 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10316 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10317 | uint32_t* check_pSwapchainImageCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10318 | check_pSwapchainImageCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10319 | if (pSwapchainImageCount) |
| 10320 | { |
| 10321 | if (!(check_pSwapchainImageCount)) |
| 10322 | { |
| 10323 | fprintf(stderr, "fatal: pSwapchainImageCount inconsistent between guest and host\n"); |
| 10324 | } |
| 10325 | stream->read((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 10326 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10327 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10328 | VkImage* check_pSwapchainImages; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10329 | check_pSwapchainImages = (VkImage*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10330 | if (pSwapchainImages) |
| 10331 | { |
| 10332 | if (!(check_pSwapchainImages)) |
| 10333 | { |
| 10334 | fprintf(stderr, "fatal: pSwapchainImages inconsistent between guest and host\n"); |
| 10335 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10336 | if ((*(pSwapchainImageCount))) |
| 10337 | { |
| 10338 | uint64_t* cgen_var_810; |
| 10339 | stream->alloc((void**)&cgen_var_810, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10340 | stream->read((uint64_t*)cgen_var_810, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10341 | stream->handleMapping()->mapHandles_u64_VkImage(cgen_var_810, (VkImage*)pSwapchainImages, (*(pSwapchainImageCount))); |
| 10342 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10343 | } |
| 10344 | VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0; |
| 10345 | stream->read(&vkGetSwapchainImagesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10346 | countingStream->clearPool(); |
| 10347 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10348 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10349 | return vkGetSwapchainImagesKHR_VkResult_return; |
| 10350 | } |
| 10351 | |
| 10352 | VkResult VkEncoder::vkAcquireNextImageKHR( |
| 10353 | VkDevice device, |
| 10354 | VkSwapchainKHR swapchain, |
| 10355 | uint64_t timeout, |
| 10356 | VkSemaphore semaphore, |
| 10357 | VkFence fence, |
| 10358 | uint32_t* pImageIndex) |
| 10359 | { |
| 10360 | auto stream = mImpl->stream(); |
| 10361 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10362 | auto resources = mImpl->resources(); |
| 10363 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10364 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10365 | VkDevice local_device; |
| 10366 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10367 | VkSwapchainKHR local_swapchain; |
| 10368 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10369 | uint64_t local_timeout; |
| 10370 | local_timeout = timeout; |
| 10371 | VkSemaphore local_semaphore; |
| 10372 | local_semaphore = semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10373 | VkFence local_fence; |
| 10374 | local_fence = fence; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10375 | countingStream->rewind(); |
| 10376 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10377 | uint64_t cgen_var_811; |
| 10378 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_811, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10379 | countingStream->write((uint64_t*)&cgen_var_811, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10380 | uint64_t cgen_var_812; |
| 10381 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_812, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10382 | countingStream->write((uint64_t*)&cgen_var_812, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10383 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10384 | uint64_t cgen_var_813; |
| 10385 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_813, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10386 | countingStream->write((uint64_t*)&cgen_var_813, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10387 | uint64_t cgen_var_814; |
| 10388 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_814, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10389 | countingStream->write((uint64_t*)&cgen_var_814, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10390 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 10391 | } |
| 10392 | uint32_t packetSize_vkAcquireNextImageKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10393 | countingStream->rewind(); |
| 10394 | uint32_t opcode_vkAcquireNextImageKHR = OP_vkAcquireNextImageKHR; |
| 10395 | stream->write(&opcode_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| 10396 | stream->write(&packetSize_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10397 | uint64_t cgen_var_815; |
| 10398 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_815, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10399 | stream->write((uint64_t*)&cgen_var_815, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10400 | uint64_t cgen_var_816; |
| 10401 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_816, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10402 | stream->write((uint64_t*)&cgen_var_816, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10403 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10404 | uint64_t cgen_var_817; |
| 10405 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_817, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10406 | stream->write((uint64_t*)&cgen_var_817, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10407 | uint64_t cgen_var_818; |
| 10408 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_818, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10409 | stream->write((uint64_t*)&cgen_var_818, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10410 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 10411 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 10412 | VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0; |
| 10413 | stream->read(&vkAcquireNextImageKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10414 | countingStream->clearPool(); |
| 10415 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10416 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10417 | return vkAcquireNextImageKHR_VkResult_return; |
| 10418 | } |
| 10419 | |
| 10420 | VkResult VkEncoder::vkQueuePresentKHR( |
| 10421 | VkQueue queue, |
| 10422 | const VkPresentInfoKHR* pPresentInfo) |
| 10423 | { |
| 10424 | auto stream = mImpl->stream(); |
| 10425 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10426 | auto resources = mImpl->resources(); |
| 10427 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10428 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10429 | VkQueue local_queue; |
| 10430 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10431 | VkPresentInfoKHR* local_pPresentInfo; |
| 10432 | local_pPresentInfo = nullptr; |
| 10433 | if (pPresentInfo) |
| 10434 | { |
| 10435 | local_pPresentInfo = (VkPresentInfoKHR*)pool->alloc(sizeof(const VkPresentInfoKHR)); |
| 10436 | deepcopy_VkPresentInfoKHR(pool, pPresentInfo, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| 10437 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10438 | countingStream->rewind(); |
| 10439 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10440 | uint64_t cgen_var_819; |
| 10441 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_819, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10442 | countingStream->write((uint64_t*)&cgen_var_819, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10443 | marshal_VkPresentInfoKHR(countingStream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10444 | } |
| 10445 | uint32_t packetSize_vkQueuePresentKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10446 | countingStream->rewind(); |
| 10447 | uint32_t opcode_vkQueuePresentKHR = OP_vkQueuePresentKHR; |
| 10448 | stream->write(&opcode_vkQueuePresentKHR, sizeof(uint32_t)); |
| 10449 | stream->write(&packetSize_vkQueuePresentKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10450 | uint64_t cgen_var_820; |
| 10451 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_820, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10452 | stream->write((uint64_t*)&cgen_var_820, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10453 | marshal_VkPresentInfoKHR(stream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10454 | VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0; |
| 10455 | stream->read(&vkQueuePresentKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10456 | countingStream->clearPool(); |
| 10457 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10458 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10459 | return vkQueuePresentKHR_VkResult_return; |
| 10460 | } |
| 10461 | |
| 10462 | VkResult VkEncoder::vkGetDeviceGroupPresentCapabilitiesKHR( |
| 10463 | VkDevice device, |
| 10464 | VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) |
| 10465 | { |
| 10466 | auto stream = mImpl->stream(); |
| 10467 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10468 | auto resources = mImpl->resources(); |
| 10469 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10470 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10471 | VkDevice local_device; |
| 10472 | local_device = device; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10473 | countingStream->rewind(); |
| 10474 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10475 | uint64_t cgen_var_821; |
| 10476 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_821, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10477 | countingStream->write((uint64_t*)&cgen_var_821, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10478 | marshal_VkDeviceGroupPresentCapabilitiesKHR(countingStream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 10479 | } |
| 10480 | uint32_t packetSize_vkGetDeviceGroupPresentCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10481 | countingStream->rewind(); |
| 10482 | uint32_t opcode_vkGetDeviceGroupPresentCapabilitiesKHR = OP_vkGetDeviceGroupPresentCapabilitiesKHR; |
| 10483 | stream->write(&opcode_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| 10484 | stream->write(&packetSize_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10485 | uint64_t cgen_var_822; |
| 10486 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_822, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10487 | stream->write((uint64_t*)&cgen_var_822, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10488 | marshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 10489 | unmarshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 10490 | VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 10491 | stream->read(&vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10492 | countingStream->clearPool(); |
| 10493 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10494 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10495 | return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return; |
| 10496 | } |
| 10497 | |
| 10498 | VkResult VkEncoder::vkGetDeviceGroupSurfacePresentModesKHR( |
| 10499 | VkDevice device, |
| 10500 | VkSurfaceKHR surface, |
| 10501 | VkDeviceGroupPresentModeFlagsKHR* pModes) |
| 10502 | { |
| 10503 | auto stream = mImpl->stream(); |
| 10504 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10505 | auto resources = mImpl->resources(); |
| 10506 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10507 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10508 | VkDevice local_device; |
| 10509 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10510 | VkSurfaceKHR local_surface; |
| 10511 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10512 | countingStream->rewind(); |
| 10513 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10514 | uint64_t cgen_var_823; |
| 10515 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_823, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10516 | countingStream->write((uint64_t*)&cgen_var_823, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10517 | uint64_t cgen_var_824; |
| 10518 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_824, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10519 | countingStream->write((uint64_t*)&cgen_var_824, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10520 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10521 | uint64_t cgen_var_825 = (uint64_t)(uintptr_t)pModes; |
| 10522 | countingStream->putBe64(cgen_var_825); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10523 | if (pModes) |
| 10524 | { |
| 10525 | countingStream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 10526 | } |
| 10527 | } |
| 10528 | uint32_t packetSize_vkGetDeviceGroupSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10529 | countingStream->rewind(); |
| 10530 | uint32_t opcode_vkGetDeviceGroupSurfacePresentModesKHR = OP_vkGetDeviceGroupSurfacePresentModesKHR; |
| 10531 | stream->write(&opcode_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| 10532 | stream->write(&packetSize_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10533 | uint64_t cgen_var_826; |
| 10534 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_826, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10535 | stream->write((uint64_t*)&cgen_var_826, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10536 | uint64_t cgen_var_827; |
| 10537 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_827, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10538 | stream->write((uint64_t*)&cgen_var_827, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10539 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10540 | uint64_t cgen_var_828 = (uint64_t)(uintptr_t)pModes; |
| 10541 | stream->putBe64(cgen_var_828); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10542 | if (pModes) |
| 10543 | { |
| 10544 | stream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 10545 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10546 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10547 | VkDeviceGroupPresentModeFlagsKHR* check_pModes; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10548 | check_pModes = (VkDeviceGroupPresentModeFlagsKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10549 | if (pModes) |
| 10550 | { |
| 10551 | if (!(check_pModes)) |
| 10552 | { |
| 10553 | fprintf(stderr, "fatal: pModes inconsistent between guest and host\n"); |
| 10554 | } |
| 10555 | stream->read((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 10556 | } |
| 10557 | VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 10558 | stream->read(&vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10559 | countingStream->clearPool(); |
| 10560 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10561 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10562 | return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return; |
| 10563 | } |
| 10564 | |
| 10565 | VkResult VkEncoder::vkGetPhysicalDevicePresentRectanglesKHR( |
| 10566 | VkPhysicalDevice physicalDevice, |
| 10567 | VkSurfaceKHR surface, |
| 10568 | uint32_t* pRectCount, |
| 10569 | VkRect2D* pRects) |
| 10570 | { |
| 10571 | auto stream = mImpl->stream(); |
| 10572 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10573 | auto resources = mImpl->resources(); |
| 10574 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10575 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10576 | VkPhysicalDevice local_physicalDevice; |
| 10577 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10578 | VkSurfaceKHR local_surface; |
| 10579 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10580 | countingStream->rewind(); |
| 10581 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10582 | uint64_t cgen_var_830; |
| 10583 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_830, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10584 | countingStream->write((uint64_t*)&cgen_var_830, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10585 | uint64_t cgen_var_831; |
| 10586 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_831, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10587 | countingStream->write((uint64_t*)&cgen_var_831, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10588 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10589 | uint64_t cgen_var_832 = (uint64_t)(uintptr_t)pRectCount; |
| 10590 | countingStream->putBe64(cgen_var_832); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10591 | if (pRectCount) |
| 10592 | { |
| 10593 | countingStream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 10594 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10595 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10596 | uint64_t cgen_var_833 = (uint64_t)(uintptr_t)pRects; |
| 10597 | countingStream->putBe64(cgen_var_833); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10598 | if (pRects) |
| 10599 | { |
| 10600 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 10601 | { |
| 10602 | marshal_VkRect2D(countingStream, (VkRect2D*)(pRects + i)); |
| 10603 | } |
| 10604 | } |
| 10605 | } |
| 10606 | uint32_t packetSize_vkGetPhysicalDevicePresentRectanglesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10607 | countingStream->rewind(); |
| 10608 | uint32_t opcode_vkGetPhysicalDevicePresentRectanglesKHR = OP_vkGetPhysicalDevicePresentRectanglesKHR; |
| 10609 | stream->write(&opcode_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| 10610 | stream->write(&packetSize_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10611 | uint64_t cgen_var_834; |
| 10612 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_834, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10613 | stream->write((uint64_t*)&cgen_var_834, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10614 | uint64_t cgen_var_835; |
| 10615 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_835, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10616 | stream->write((uint64_t*)&cgen_var_835, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10617 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10618 | uint64_t cgen_var_836 = (uint64_t)(uintptr_t)pRectCount; |
| 10619 | stream->putBe64(cgen_var_836); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10620 | if (pRectCount) |
| 10621 | { |
| 10622 | stream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 10623 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10624 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10625 | uint64_t cgen_var_837 = (uint64_t)(uintptr_t)pRects; |
| 10626 | stream->putBe64(cgen_var_837); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10627 | if (pRects) |
| 10628 | { |
| 10629 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 10630 | { |
| 10631 | marshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 10632 | } |
| 10633 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10634 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10635 | uint32_t* check_pRectCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10636 | check_pRectCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10637 | if (pRectCount) |
| 10638 | { |
| 10639 | if (!(check_pRectCount)) |
| 10640 | { |
| 10641 | fprintf(stderr, "fatal: pRectCount inconsistent between guest and host\n"); |
| 10642 | } |
| 10643 | stream->read((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 10644 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10645 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10646 | VkRect2D* check_pRects; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10647 | check_pRects = (VkRect2D*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10648 | if (pRects) |
| 10649 | { |
| 10650 | if (!(check_pRects)) |
| 10651 | { |
| 10652 | fprintf(stderr, "fatal: pRects inconsistent between guest and host\n"); |
| 10653 | } |
| 10654 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 10655 | { |
| 10656 | unmarshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 10657 | } |
| 10658 | } |
| 10659 | VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0; |
| 10660 | stream->read(&vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10661 | countingStream->clearPool(); |
| 10662 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10663 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10664 | return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return; |
| 10665 | } |
| 10666 | |
| 10667 | VkResult VkEncoder::vkAcquireNextImage2KHR( |
| 10668 | VkDevice device, |
| 10669 | const VkAcquireNextImageInfoKHR* pAcquireInfo, |
| 10670 | uint32_t* pImageIndex) |
| 10671 | { |
| 10672 | auto stream = mImpl->stream(); |
| 10673 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10674 | auto resources = mImpl->resources(); |
| 10675 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10676 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10677 | VkDevice local_device; |
| 10678 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10679 | VkAcquireNextImageInfoKHR* local_pAcquireInfo; |
| 10680 | local_pAcquireInfo = nullptr; |
| 10681 | if (pAcquireInfo) |
| 10682 | { |
| 10683 | local_pAcquireInfo = (VkAcquireNextImageInfoKHR*)pool->alloc(sizeof(const VkAcquireNextImageInfoKHR)); |
| 10684 | deepcopy_VkAcquireNextImageInfoKHR(pool, pAcquireInfo, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| 10685 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10686 | countingStream->rewind(); |
| 10687 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10688 | uint64_t cgen_var_840; |
| 10689 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_840, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10690 | countingStream->write((uint64_t*)&cgen_var_840, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10691 | marshal_VkAcquireNextImageInfoKHR(countingStream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10692 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 10693 | } |
| 10694 | uint32_t packetSize_vkAcquireNextImage2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10695 | countingStream->rewind(); |
| 10696 | uint32_t opcode_vkAcquireNextImage2KHR = OP_vkAcquireNextImage2KHR; |
| 10697 | stream->write(&opcode_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| 10698 | stream->write(&packetSize_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10699 | uint64_t cgen_var_841; |
| 10700 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_841, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10701 | stream->write((uint64_t*)&cgen_var_841, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10702 | marshal_VkAcquireNextImageInfoKHR(stream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10703 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 10704 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 10705 | VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0; |
| 10706 | stream->read(&vkAcquireNextImage2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10707 | countingStream->clearPool(); |
| 10708 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10709 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10710 | return vkAcquireNextImage2KHR_VkResult_return; |
| 10711 | } |
| 10712 | |
| 10713 | #endif |
| 10714 | #ifdef VK_KHR_display |
| 10715 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPropertiesKHR( |
| 10716 | VkPhysicalDevice physicalDevice, |
| 10717 | uint32_t* pPropertyCount, |
| 10718 | VkDisplayPropertiesKHR* pProperties) |
| 10719 | { |
| 10720 | auto stream = mImpl->stream(); |
| 10721 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10722 | auto resources = mImpl->resources(); |
| 10723 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10724 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10725 | VkPhysicalDevice local_physicalDevice; |
| 10726 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10727 | countingStream->rewind(); |
| 10728 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10729 | uint64_t cgen_var_842; |
| 10730 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_842, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10731 | countingStream->write((uint64_t*)&cgen_var_842, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10732 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10733 | uint64_t cgen_var_843 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10734 | countingStream->putBe64(cgen_var_843); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10735 | if (pPropertyCount) |
| 10736 | { |
| 10737 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10738 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10739 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10740 | uint64_t cgen_var_844 = (uint64_t)(uintptr_t)pProperties; |
| 10741 | countingStream->putBe64(cgen_var_844); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10742 | if (pProperties) |
| 10743 | { |
| 10744 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10745 | { |
| 10746 | marshal_VkDisplayPropertiesKHR(countingStream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 10747 | } |
| 10748 | } |
| 10749 | } |
| 10750 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10751 | countingStream->rewind(); |
| 10752 | uint32_t opcode_vkGetPhysicalDeviceDisplayPropertiesKHR = OP_vkGetPhysicalDeviceDisplayPropertiesKHR; |
| 10753 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| 10754 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10755 | uint64_t cgen_var_845; |
| 10756 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_845, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10757 | stream->write((uint64_t*)&cgen_var_845, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10758 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10759 | uint64_t cgen_var_846 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10760 | stream->putBe64(cgen_var_846); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10761 | if (pPropertyCount) |
| 10762 | { |
| 10763 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10764 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10765 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10766 | uint64_t cgen_var_847 = (uint64_t)(uintptr_t)pProperties; |
| 10767 | stream->putBe64(cgen_var_847); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10768 | if (pProperties) |
| 10769 | { |
| 10770 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10771 | { |
| 10772 | marshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 10773 | } |
| 10774 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10775 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10776 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10777 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10778 | if (pPropertyCount) |
| 10779 | { |
| 10780 | if (!(check_pPropertyCount)) |
| 10781 | { |
| 10782 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 10783 | } |
| 10784 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10785 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10786 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10787 | VkDisplayPropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10788 | check_pProperties = (VkDisplayPropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10789 | if (pProperties) |
| 10790 | { |
| 10791 | if (!(check_pProperties)) |
| 10792 | { |
| 10793 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 10794 | } |
| 10795 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10796 | { |
| 10797 | unmarshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 10798 | } |
| 10799 | } |
| 10800 | VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0; |
| 10801 | stream->read(&vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10802 | countingStream->clearPool(); |
| 10803 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10804 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10805 | return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return; |
| 10806 | } |
| 10807 | |
| 10808 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlanePropertiesKHR( |
| 10809 | VkPhysicalDevice physicalDevice, |
| 10810 | uint32_t* pPropertyCount, |
| 10811 | VkDisplayPlanePropertiesKHR* pProperties) |
| 10812 | { |
| 10813 | auto stream = mImpl->stream(); |
| 10814 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10815 | auto resources = mImpl->resources(); |
| 10816 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10817 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10818 | VkPhysicalDevice local_physicalDevice; |
| 10819 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10820 | countingStream->rewind(); |
| 10821 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10822 | uint64_t cgen_var_850; |
| 10823 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_850, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10824 | countingStream->write((uint64_t*)&cgen_var_850, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10825 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10826 | uint64_t cgen_var_851 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10827 | countingStream->putBe64(cgen_var_851); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10828 | if (pPropertyCount) |
| 10829 | { |
| 10830 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10831 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10832 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10833 | uint64_t cgen_var_852 = (uint64_t)(uintptr_t)pProperties; |
| 10834 | countingStream->putBe64(cgen_var_852); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10835 | if (pProperties) |
| 10836 | { |
| 10837 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10838 | { |
| 10839 | marshal_VkDisplayPlanePropertiesKHR(countingStream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 10840 | } |
| 10841 | } |
| 10842 | } |
| 10843 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10844 | countingStream->rewind(); |
| 10845 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR; |
| 10846 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| 10847 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10848 | uint64_t cgen_var_853; |
| 10849 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_853, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10850 | stream->write((uint64_t*)&cgen_var_853, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10851 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10852 | uint64_t cgen_var_854 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10853 | stream->putBe64(cgen_var_854); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10854 | if (pPropertyCount) |
| 10855 | { |
| 10856 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10857 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10858 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10859 | uint64_t cgen_var_855 = (uint64_t)(uintptr_t)pProperties; |
| 10860 | stream->putBe64(cgen_var_855); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10861 | if (pProperties) |
| 10862 | { |
| 10863 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10864 | { |
| 10865 | marshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 10866 | } |
| 10867 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10868 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10869 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10870 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10871 | if (pPropertyCount) |
| 10872 | { |
| 10873 | if (!(check_pPropertyCount)) |
| 10874 | { |
| 10875 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 10876 | } |
| 10877 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10878 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10879 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10880 | VkDisplayPlanePropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10881 | check_pProperties = (VkDisplayPlanePropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10882 | if (pProperties) |
| 10883 | { |
| 10884 | if (!(check_pProperties)) |
| 10885 | { |
| 10886 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 10887 | } |
| 10888 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10889 | { |
| 10890 | unmarshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 10891 | } |
| 10892 | } |
| 10893 | VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0; |
| 10894 | stream->read(&vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10895 | countingStream->clearPool(); |
| 10896 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10897 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10898 | return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return; |
| 10899 | } |
| 10900 | |
| 10901 | VkResult VkEncoder::vkGetDisplayPlaneSupportedDisplaysKHR( |
| 10902 | VkPhysicalDevice physicalDevice, |
| 10903 | uint32_t planeIndex, |
| 10904 | uint32_t* pDisplayCount, |
| 10905 | VkDisplayKHR* pDisplays) |
| 10906 | { |
| 10907 | auto stream = mImpl->stream(); |
| 10908 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10909 | auto resources = mImpl->resources(); |
| 10910 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10911 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10912 | VkPhysicalDevice local_physicalDevice; |
| 10913 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10914 | uint32_t local_planeIndex; |
| 10915 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10916 | countingStream->rewind(); |
| 10917 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10918 | uint64_t cgen_var_858; |
| 10919 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_858, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10920 | countingStream->write((uint64_t*)&cgen_var_858, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10921 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10922 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10923 | uint64_t cgen_var_859 = (uint64_t)(uintptr_t)pDisplayCount; |
| 10924 | countingStream->putBe64(cgen_var_859); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10925 | if (pDisplayCount) |
| 10926 | { |
| 10927 | countingStream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 10928 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10929 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10930 | uint64_t cgen_var_860 = (uint64_t)(uintptr_t)pDisplays; |
| 10931 | countingStream->putBe64(cgen_var_860); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10932 | if (pDisplays) |
| 10933 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10934 | if ((*(pDisplayCount))) |
| 10935 | { |
| 10936 | uint64_t* cgen_var_861; |
| 10937 | countingStream->alloc((void**)&cgen_var_861, (*(pDisplayCount)) * 8); |
| 10938 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_861, (*(pDisplayCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10939 | countingStream->write((uint64_t*)cgen_var_861, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10940 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10941 | } |
| 10942 | } |
| 10943 | uint32_t packetSize_vkGetDisplayPlaneSupportedDisplaysKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10944 | countingStream->rewind(); |
| 10945 | uint32_t opcode_vkGetDisplayPlaneSupportedDisplaysKHR = OP_vkGetDisplayPlaneSupportedDisplaysKHR; |
| 10946 | stream->write(&opcode_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| 10947 | stream->write(&packetSize_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10948 | uint64_t cgen_var_862; |
| 10949 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_862, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10950 | stream->write((uint64_t*)&cgen_var_862, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10951 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10952 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10953 | uint64_t cgen_var_863 = (uint64_t)(uintptr_t)pDisplayCount; |
| 10954 | stream->putBe64(cgen_var_863); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10955 | if (pDisplayCount) |
| 10956 | { |
| 10957 | stream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 10958 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10959 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10960 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10961 | uint64_t cgen_var_864 = (uint64_t)(uintptr_t)pDisplays; |
| 10962 | stream->putBe64(cgen_var_864); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10963 | if (pDisplays) |
| 10964 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10965 | if ((*(pDisplayCount))) |
| 10966 | { |
| 10967 | uint64_t* cgen_var_865; |
| 10968 | stream->alloc((void**)&cgen_var_865, (*(pDisplayCount)) * 8); |
| 10969 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_865, (*(pDisplayCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10970 | stream->write((uint64_t*)cgen_var_865, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10971 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10972 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10973 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10974 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10975 | uint32_t* check_pDisplayCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10976 | check_pDisplayCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10977 | if (pDisplayCount) |
| 10978 | { |
| 10979 | if (!(check_pDisplayCount)) |
| 10980 | { |
| 10981 | fprintf(stderr, "fatal: pDisplayCount inconsistent between guest and host\n"); |
| 10982 | } |
| 10983 | stream->read((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 10984 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10985 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10986 | VkDisplayKHR* check_pDisplays; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10987 | check_pDisplays = (VkDisplayKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10988 | if (pDisplays) |
| 10989 | { |
| 10990 | if (!(check_pDisplays)) |
| 10991 | { |
| 10992 | fprintf(stderr, "fatal: pDisplays inconsistent between guest and host\n"); |
| 10993 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10994 | if ((*(pDisplayCount))) |
| 10995 | { |
| 10996 | uint64_t* cgen_var_868; |
| 10997 | stream->alloc((void**)&cgen_var_868, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 10998 | stream->read((uint64_t*)cgen_var_868, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10999 | stream->handleMapping()->mapHandles_u64_VkDisplayKHR(cgen_var_868, (VkDisplayKHR*)pDisplays, (*(pDisplayCount))); |
| 11000 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11001 | } |
| 11002 | VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0; |
| 11003 | stream->read(&vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11004 | countingStream->clearPool(); |
| 11005 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11006 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11007 | return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return; |
| 11008 | } |
| 11009 | |
| 11010 | VkResult VkEncoder::vkGetDisplayModePropertiesKHR( |
| 11011 | VkPhysicalDevice physicalDevice, |
| 11012 | VkDisplayKHR display, |
| 11013 | uint32_t* pPropertyCount, |
| 11014 | VkDisplayModePropertiesKHR* pProperties) |
| 11015 | { |
| 11016 | auto stream = mImpl->stream(); |
| 11017 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11018 | auto resources = mImpl->resources(); |
| 11019 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11020 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11021 | VkPhysicalDevice local_physicalDevice; |
| 11022 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11023 | VkDisplayKHR local_display; |
| 11024 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11025 | countingStream->rewind(); |
| 11026 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11027 | uint64_t cgen_var_869; |
| 11028 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_869, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11029 | countingStream->write((uint64_t*)&cgen_var_869, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11030 | uint64_t cgen_var_870; |
| 11031 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_870, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11032 | countingStream->write((uint64_t*)&cgen_var_870, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11033 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11034 | uint64_t cgen_var_871 = (uint64_t)(uintptr_t)pPropertyCount; |
| 11035 | countingStream->putBe64(cgen_var_871); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11036 | if (pPropertyCount) |
| 11037 | { |
| 11038 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11039 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11040 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11041 | uint64_t cgen_var_872 = (uint64_t)(uintptr_t)pProperties; |
| 11042 | countingStream->putBe64(cgen_var_872); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11043 | if (pProperties) |
| 11044 | { |
| 11045 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11046 | { |
| 11047 | marshal_VkDisplayModePropertiesKHR(countingStream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 11048 | } |
| 11049 | } |
| 11050 | } |
| 11051 | uint32_t packetSize_vkGetDisplayModePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11052 | countingStream->rewind(); |
| 11053 | uint32_t opcode_vkGetDisplayModePropertiesKHR = OP_vkGetDisplayModePropertiesKHR; |
| 11054 | stream->write(&opcode_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| 11055 | stream->write(&packetSize_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11056 | uint64_t cgen_var_873; |
| 11057 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_873, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11058 | stream->write((uint64_t*)&cgen_var_873, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11059 | uint64_t cgen_var_874; |
| 11060 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_874, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11061 | stream->write((uint64_t*)&cgen_var_874, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11062 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11063 | uint64_t cgen_var_875 = (uint64_t)(uintptr_t)pPropertyCount; |
| 11064 | stream->putBe64(cgen_var_875); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11065 | if (pPropertyCount) |
| 11066 | { |
| 11067 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11068 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11069 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11070 | uint64_t cgen_var_876 = (uint64_t)(uintptr_t)pProperties; |
| 11071 | stream->putBe64(cgen_var_876); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11072 | if (pProperties) |
| 11073 | { |
| 11074 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11075 | { |
| 11076 | marshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 11077 | } |
| 11078 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11079 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11080 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11081 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11082 | if (pPropertyCount) |
| 11083 | { |
| 11084 | if (!(check_pPropertyCount)) |
| 11085 | { |
| 11086 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 11087 | } |
| 11088 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11089 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11090 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11091 | VkDisplayModePropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11092 | check_pProperties = (VkDisplayModePropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11093 | if (pProperties) |
| 11094 | { |
| 11095 | if (!(check_pProperties)) |
| 11096 | { |
| 11097 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 11098 | } |
| 11099 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11100 | { |
| 11101 | unmarshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 11102 | } |
| 11103 | } |
| 11104 | VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0; |
| 11105 | stream->read(&vkGetDisplayModePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11106 | countingStream->clearPool(); |
| 11107 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11108 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11109 | return vkGetDisplayModePropertiesKHR_VkResult_return; |
| 11110 | } |
| 11111 | |
| 11112 | VkResult VkEncoder::vkCreateDisplayModeKHR( |
| 11113 | VkPhysicalDevice physicalDevice, |
| 11114 | VkDisplayKHR display, |
| 11115 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
| 11116 | const VkAllocationCallbacks* pAllocator, |
| 11117 | VkDisplayModeKHR* pMode) |
| 11118 | { |
| 11119 | auto stream = mImpl->stream(); |
| 11120 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11121 | auto resources = mImpl->resources(); |
| 11122 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11123 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11124 | VkPhysicalDevice local_physicalDevice; |
| 11125 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11126 | VkDisplayKHR local_display; |
| 11127 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11128 | VkDisplayModeCreateInfoKHR* local_pCreateInfo; |
| 11129 | local_pCreateInfo = nullptr; |
| 11130 | if (pCreateInfo) |
| 11131 | { |
| 11132 | local_pCreateInfo = (VkDisplayModeCreateInfoKHR*)pool->alloc(sizeof(const VkDisplayModeCreateInfoKHR)); |
| 11133 | deepcopy_VkDisplayModeCreateInfoKHR(pool, pCreateInfo, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| 11134 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11135 | VkAllocationCallbacks* local_pAllocator; |
| 11136 | local_pAllocator = nullptr; |
| 11137 | if (pAllocator) |
| 11138 | { |
| 11139 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11140 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11141 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11142 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11143 | countingStream->rewind(); |
| 11144 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11145 | uint64_t cgen_var_879; |
| 11146 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_879, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11147 | countingStream->write((uint64_t*)&cgen_var_879, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11148 | uint64_t cgen_var_880; |
| 11149 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_880, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11150 | countingStream->write((uint64_t*)&cgen_var_880, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11151 | marshal_VkDisplayModeCreateInfoKHR(countingStream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11152 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11153 | uint64_t cgen_var_881 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11154 | countingStream->putBe64(cgen_var_881); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11155 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11156 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11157 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11158 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11159 | uint64_t cgen_var_882; |
| 11160 | countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_882, 1); |
| 11161 | countingStream->write((uint64_t*)&cgen_var_882, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11162 | } |
| 11163 | uint32_t packetSize_vkCreateDisplayModeKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11164 | countingStream->rewind(); |
| 11165 | uint32_t opcode_vkCreateDisplayModeKHR = OP_vkCreateDisplayModeKHR; |
| 11166 | stream->write(&opcode_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| 11167 | stream->write(&packetSize_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11168 | uint64_t cgen_var_883; |
| 11169 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_883, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11170 | stream->write((uint64_t*)&cgen_var_883, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11171 | uint64_t cgen_var_884; |
| 11172 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_884, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11173 | stream->write((uint64_t*)&cgen_var_884, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11174 | marshal_VkDisplayModeCreateInfoKHR(stream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11175 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11176 | uint64_t cgen_var_885 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11177 | stream->putBe64(cgen_var_885); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11178 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11179 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11180 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11181 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11182 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11183 | uint64_t cgen_var_886; |
| 11184 | stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_886, 1); |
| 11185 | stream->write((uint64_t*)&cgen_var_886, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11186 | stream->setHandleMapping(resources->unwrapMapping()); |
| 11187 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11188 | uint64_t cgen_var_887; |
| 11189 | stream->read((uint64_t*)&cgen_var_887, 8); |
| 11190 | stream->handleMapping()->mapHandles_u64_VkDisplayModeKHR(&cgen_var_887, (VkDisplayModeKHR*)pMode, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11191 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11192 | VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0; |
| 11193 | stream->read(&vkCreateDisplayModeKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11194 | countingStream->clearPool(); |
| 11195 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11196 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11197 | return vkCreateDisplayModeKHR_VkResult_return; |
| 11198 | } |
| 11199 | |
| 11200 | VkResult VkEncoder::vkGetDisplayPlaneCapabilitiesKHR( |
| 11201 | VkPhysicalDevice physicalDevice, |
| 11202 | VkDisplayModeKHR mode, |
| 11203 | uint32_t planeIndex, |
| 11204 | VkDisplayPlaneCapabilitiesKHR* pCapabilities) |
| 11205 | { |
| 11206 | auto stream = mImpl->stream(); |
| 11207 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11208 | auto resources = mImpl->resources(); |
| 11209 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11210 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11211 | VkPhysicalDevice local_physicalDevice; |
| 11212 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11213 | VkDisplayModeKHR local_mode; |
| 11214 | local_mode = mode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11215 | uint32_t local_planeIndex; |
| 11216 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11217 | countingStream->rewind(); |
| 11218 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11219 | uint64_t cgen_var_888; |
| 11220 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_888, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11221 | countingStream->write((uint64_t*)&cgen_var_888, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11222 | uint64_t cgen_var_889; |
| 11223 | countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_889, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11224 | countingStream->write((uint64_t*)&cgen_var_889, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11225 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11226 | marshal_VkDisplayPlaneCapabilitiesKHR(countingStream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 11227 | } |
| 11228 | uint32_t packetSize_vkGetDisplayPlaneCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11229 | countingStream->rewind(); |
| 11230 | uint32_t opcode_vkGetDisplayPlaneCapabilitiesKHR = OP_vkGetDisplayPlaneCapabilitiesKHR; |
| 11231 | stream->write(&opcode_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| 11232 | stream->write(&packetSize_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11233 | uint64_t cgen_var_890; |
| 11234 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_890, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11235 | stream->write((uint64_t*)&cgen_var_890, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11236 | uint64_t cgen_var_891; |
| 11237 | stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_891, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11238 | stream->write((uint64_t*)&cgen_var_891, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11239 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11240 | marshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 11241 | unmarshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 11242 | VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 11243 | stream->read(&vkGetDisplayPlaneCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11244 | countingStream->clearPool(); |
| 11245 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11246 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11247 | return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return; |
| 11248 | } |
| 11249 | |
| 11250 | VkResult VkEncoder::vkCreateDisplayPlaneSurfaceKHR( |
| 11251 | VkInstance instance, |
| 11252 | const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, |
| 11253 | const VkAllocationCallbacks* pAllocator, |
| 11254 | VkSurfaceKHR* pSurface) |
| 11255 | { |
| 11256 | auto stream = mImpl->stream(); |
| 11257 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11258 | auto resources = mImpl->resources(); |
| 11259 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11260 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11261 | VkInstance local_instance; |
| 11262 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11263 | VkDisplaySurfaceCreateInfoKHR* local_pCreateInfo; |
| 11264 | local_pCreateInfo = nullptr; |
| 11265 | if (pCreateInfo) |
| 11266 | { |
| 11267 | local_pCreateInfo = (VkDisplaySurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkDisplaySurfaceCreateInfoKHR)); |
| 11268 | deepcopy_VkDisplaySurfaceCreateInfoKHR(pool, pCreateInfo, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 11269 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11270 | VkAllocationCallbacks* local_pAllocator; |
| 11271 | local_pAllocator = nullptr; |
| 11272 | if (pAllocator) |
| 11273 | { |
| 11274 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11275 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11276 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11277 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11278 | countingStream->rewind(); |
| 11279 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11280 | uint64_t cgen_var_892; |
| 11281 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_892, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11282 | countingStream->write((uint64_t*)&cgen_var_892, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11283 | marshal_VkDisplaySurfaceCreateInfoKHR(countingStream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11284 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11285 | uint64_t cgen_var_893 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11286 | countingStream->putBe64(cgen_var_893); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11287 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11288 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11289 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11290 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11291 | uint64_t cgen_var_894; |
| 11292 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_894, 1); |
| 11293 | countingStream->write((uint64_t*)&cgen_var_894, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11294 | } |
| 11295 | uint32_t packetSize_vkCreateDisplayPlaneSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11296 | countingStream->rewind(); |
| 11297 | uint32_t opcode_vkCreateDisplayPlaneSurfaceKHR = OP_vkCreateDisplayPlaneSurfaceKHR; |
| 11298 | stream->write(&opcode_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| 11299 | stream->write(&packetSize_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11300 | uint64_t cgen_var_895; |
| 11301 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_895, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11302 | stream->write((uint64_t*)&cgen_var_895, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11303 | marshal_VkDisplaySurfaceCreateInfoKHR(stream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11304 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11305 | uint64_t cgen_var_896 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11306 | stream->putBe64(cgen_var_896); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11307 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11308 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11309 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11310 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11311 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11312 | uint64_t cgen_var_897; |
| 11313 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_897, 1); |
| 11314 | stream->write((uint64_t*)&cgen_var_897, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11315 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11316 | uint64_t cgen_var_898; |
| 11317 | stream->read((uint64_t*)&cgen_var_898, 8); |
| 11318 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_898, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11319 | VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0; |
| 11320 | stream->read(&vkCreateDisplayPlaneSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11321 | countingStream->clearPool(); |
| 11322 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11323 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11324 | return vkCreateDisplayPlaneSurfaceKHR_VkResult_return; |
| 11325 | } |
| 11326 | |
| 11327 | #endif |
| 11328 | #ifdef VK_KHR_display_swapchain |
| 11329 | VkResult VkEncoder::vkCreateSharedSwapchainsKHR( |
| 11330 | VkDevice device, |
| 11331 | uint32_t swapchainCount, |
| 11332 | const VkSwapchainCreateInfoKHR* pCreateInfos, |
| 11333 | const VkAllocationCallbacks* pAllocator, |
| 11334 | VkSwapchainKHR* pSwapchains) |
| 11335 | { |
| 11336 | auto stream = mImpl->stream(); |
| 11337 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11338 | auto resources = mImpl->resources(); |
| 11339 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11340 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11341 | VkDevice local_device; |
| 11342 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11343 | uint32_t local_swapchainCount; |
| 11344 | local_swapchainCount = swapchainCount; |
| 11345 | VkSwapchainCreateInfoKHR* local_pCreateInfos; |
| 11346 | local_pCreateInfos = nullptr; |
| 11347 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11348 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11349 | local_pCreateInfos = (VkSwapchainCreateInfoKHR*)pool->alloc(((swapchainCount)) * sizeof(const VkSwapchainCreateInfoKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11350 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 11351 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11352 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfos + i, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11353 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11354 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11355 | VkAllocationCallbacks* local_pAllocator; |
| 11356 | local_pAllocator = nullptr; |
| 11357 | if (pAllocator) |
| 11358 | { |
| 11359 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11360 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11361 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11362 | local_pAllocator = nullptr; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11363 | countingStream->rewind(); |
| 11364 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11365 | uint64_t cgen_var_899; |
| 11366 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_899, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11367 | countingStream->write((uint64_t*)&cgen_var_899, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11368 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| 11369 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 11370 | { |
| 11371 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| 11372 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11373 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11374 | uint64_t cgen_var_900 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11375 | countingStream->putBe64(cgen_var_900); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11376 | if (local_pAllocator) |
| 11377 | { |
| 11378 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11379 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11380 | if (((swapchainCount))) |
| 11381 | { |
| 11382 | uint64_t* cgen_var_901; |
| 11383 | countingStream->alloc((void**)&cgen_var_901, ((swapchainCount)) * 8); |
| 11384 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_901, ((swapchainCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11385 | countingStream->write((uint64_t*)cgen_var_901, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11386 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11387 | } |
| 11388 | uint32_t packetSize_vkCreateSharedSwapchainsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11389 | countingStream->rewind(); |
| 11390 | uint32_t opcode_vkCreateSharedSwapchainsKHR = OP_vkCreateSharedSwapchainsKHR; |
| 11391 | stream->write(&opcode_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| 11392 | stream->write(&packetSize_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11393 | uint64_t cgen_var_902; |
| 11394 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_902, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11395 | stream->write((uint64_t*)&cgen_var_902, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11396 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11397 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 11398 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11399 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11400 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11401 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11402 | uint64_t cgen_var_903 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11403 | stream->putBe64(cgen_var_903); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11404 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11405 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11406 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11407 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11408 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11409 | if (((swapchainCount))) |
| 11410 | { |
| 11411 | uint64_t* cgen_var_904; |
| 11412 | stream->alloc((void**)&cgen_var_904, ((swapchainCount)) * 8); |
| 11413 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_904, ((swapchainCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11414 | stream->write((uint64_t*)cgen_var_904, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11415 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11416 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11417 | if (((swapchainCount))) |
| 11418 | { |
| 11419 | uint64_t* cgen_var_905; |
| 11420 | stream->alloc((void**)&cgen_var_905, ((swapchainCount)) * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11421 | stream->read((uint64_t*)cgen_var_905, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11422 | stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(cgen_var_905, (VkSwapchainKHR*)pSwapchains, ((swapchainCount))); |
| 11423 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11424 | VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0; |
| 11425 | stream->read(&vkCreateSharedSwapchainsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11426 | countingStream->clearPool(); |
| 11427 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11428 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11429 | return vkCreateSharedSwapchainsKHR_VkResult_return; |
| 11430 | } |
| 11431 | |
| 11432 | #endif |
| 11433 | #ifdef VK_KHR_xlib_surface |
| 11434 | VkResult VkEncoder::vkCreateXlibSurfaceKHR( |
| 11435 | VkInstance instance, |
| 11436 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, |
| 11437 | const VkAllocationCallbacks* pAllocator, |
| 11438 | VkSurfaceKHR* pSurface) |
| 11439 | { |
| 11440 | auto stream = mImpl->stream(); |
| 11441 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11442 | auto resources = mImpl->resources(); |
| 11443 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11444 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11445 | VkInstance local_instance; |
| 11446 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11447 | VkXlibSurfaceCreateInfoKHR* local_pCreateInfo; |
| 11448 | local_pCreateInfo = nullptr; |
| 11449 | if (pCreateInfo) |
| 11450 | { |
| 11451 | local_pCreateInfo = (VkXlibSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXlibSurfaceCreateInfoKHR)); |
| 11452 | deepcopy_VkXlibSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 11453 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11454 | VkAllocationCallbacks* local_pAllocator; |
| 11455 | local_pAllocator = nullptr; |
| 11456 | if (pAllocator) |
| 11457 | { |
| 11458 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11459 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11460 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11461 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11462 | countingStream->rewind(); |
| 11463 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11464 | uint64_t cgen_var_906; |
| 11465 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_906, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11466 | countingStream->write((uint64_t*)&cgen_var_906, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11467 | marshal_VkXlibSurfaceCreateInfoKHR(countingStream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11468 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11469 | uint64_t cgen_var_907 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11470 | countingStream->putBe64(cgen_var_907); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11471 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11472 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11473 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11474 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11475 | uint64_t cgen_var_908; |
| 11476 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_908, 1); |
| 11477 | countingStream->write((uint64_t*)&cgen_var_908, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11478 | } |
| 11479 | uint32_t packetSize_vkCreateXlibSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11480 | countingStream->rewind(); |
| 11481 | uint32_t opcode_vkCreateXlibSurfaceKHR = OP_vkCreateXlibSurfaceKHR; |
| 11482 | stream->write(&opcode_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| 11483 | stream->write(&packetSize_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11484 | uint64_t cgen_var_909; |
| 11485 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_909, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11486 | stream->write((uint64_t*)&cgen_var_909, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11487 | marshal_VkXlibSurfaceCreateInfoKHR(stream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11488 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11489 | uint64_t cgen_var_910 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11490 | stream->putBe64(cgen_var_910); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11491 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11492 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11493 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11494 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11495 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11496 | uint64_t cgen_var_911; |
| 11497 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_911, 1); |
| 11498 | stream->write((uint64_t*)&cgen_var_911, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11499 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11500 | uint64_t cgen_var_912; |
| 11501 | stream->read((uint64_t*)&cgen_var_912, 8); |
| 11502 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_912, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11503 | VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0; |
| 11504 | stream->read(&vkCreateXlibSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11505 | countingStream->clearPool(); |
| 11506 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11507 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11508 | return vkCreateXlibSurfaceKHR_VkResult_return; |
| 11509 | } |
| 11510 | |
| 11511 | VkBool32 VkEncoder::vkGetPhysicalDeviceXlibPresentationSupportKHR( |
| 11512 | VkPhysicalDevice physicalDevice, |
| 11513 | uint32_t queueFamilyIndex, |
| 11514 | Display* dpy, |
| 11515 | VisualID visualID) |
| 11516 | { |
| 11517 | auto stream = mImpl->stream(); |
| 11518 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11519 | auto resources = mImpl->resources(); |
| 11520 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11521 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11522 | VkPhysicalDevice local_physicalDevice; |
| 11523 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11524 | uint32_t local_queueFamilyIndex; |
| 11525 | local_queueFamilyIndex = queueFamilyIndex; |
| 11526 | VisualID local_visualID; |
| 11527 | local_visualID = visualID; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11528 | countingStream->rewind(); |
| 11529 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11530 | uint64_t cgen_var_913; |
| 11531 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_913, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11532 | countingStream->write((uint64_t*)&cgen_var_913, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11533 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11534 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11535 | countingStream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11536 | } |
| 11537 | uint32_t packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11538 | countingStream->rewind(); |
| 11539 | uint32_t opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR = OP_vkGetPhysicalDeviceXlibPresentationSupportKHR; |
| 11540 | stream->write(&opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| 11541 | stream->write(&packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11542 | uint64_t cgen_var_914; |
| 11543 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_914, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11544 | stream->write((uint64_t*)&cgen_var_914, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11545 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11546 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11547 | stream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11548 | stream->read((Display*)dpy, sizeof(Display)); |
| 11549 | VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 11550 | stream->read(&vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11551 | countingStream->clearPool(); |
| 11552 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11553 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11554 | return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return; |
| 11555 | } |
| 11556 | |
| 11557 | #endif |
| 11558 | #ifdef VK_KHR_xcb_surface |
| 11559 | VkResult VkEncoder::vkCreateXcbSurfaceKHR( |
| 11560 | VkInstance instance, |
| 11561 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, |
| 11562 | const VkAllocationCallbacks* pAllocator, |
| 11563 | VkSurfaceKHR* pSurface) |
| 11564 | { |
| 11565 | auto stream = mImpl->stream(); |
| 11566 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11567 | auto resources = mImpl->resources(); |
| 11568 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11569 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11570 | VkInstance local_instance; |
| 11571 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11572 | VkXcbSurfaceCreateInfoKHR* local_pCreateInfo; |
| 11573 | local_pCreateInfo = nullptr; |
| 11574 | if (pCreateInfo) |
| 11575 | { |
| 11576 | local_pCreateInfo = (VkXcbSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXcbSurfaceCreateInfoKHR)); |
| 11577 | deepcopy_VkXcbSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 11578 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11579 | VkAllocationCallbacks* local_pAllocator; |
| 11580 | local_pAllocator = nullptr; |
| 11581 | if (pAllocator) |
| 11582 | { |
| 11583 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11584 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11585 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11586 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11587 | countingStream->rewind(); |
| 11588 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11589 | uint64_t cgen_var_915; |
| 11590 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_915, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11591 | countingStream->write((uint64_t*)&cgen_var_915, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11592 | marshal_VkXcbSurfaceCreateInfoKHR(countingStream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11593 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11594 | uint64_t cgen_var_916 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11595 | countingStream->putBe64(cgen_var_916); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11596 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11597 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11598 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11599 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11600 | uint64_t cgen_var_917; |
| 11601 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_917, 1); |
| 11602 | countingStream->write((uint64_t*)&cgen_var_917, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11603 | } |
| 11604 | uint32_t packetSize_vkCreateXcbSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11605 | countingStream->rewind(); |
| 11606 | uint32_t opcode_vkCreateXcbSurfaceKHR = OP_vkCreateXcbSurfaceKHR; |
| 11607 | stream->write(&opcode_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| 11608 | stream->write(&packetSize_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11609 | uint64_t cgen_var_918; |
| 11610 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_918, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11611 | stream->write((uint64_t*)&cgen_var_918, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11612 | marshal_VkXcbSurfaceCreateInfoKHR(stream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11613 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11614 | uint64_t cgen_var_919 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11615 | stream->putBe64(cgen_var_919); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11616 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11617 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11618 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11619 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11620 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11621 | uint64_t cgen_var_920; |
| 11622 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_920, 1); |
| 11623 | stream->write((uint64_t*)&cgen_var_920, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11624 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11625 | uint64_t cgen_var_921; |
| 11626 | stream->read((uint64_t*)&cgen_var_921, 8); |
| 11627 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_921, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11628 | VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0; |
| 11629 | stream->read(&vkCreateXcbSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11630 | countingStream->clearPool(); |
| 11631 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11632 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11633 | return vkCreateXcbSurfaceKHR_VkResult_return; |
| 11634 | } |
| 11635 | |
| 11636 | VkBool32 VkEncoder::vkGetPhysicalDeviceXcbPresentationSupportKHR( |
| 11637 | VkPhysicalDevice physicalDevice, |
| 11638 | uint32_t queueFamilyIndex, |
| 11639 | xcb_connection_t* connection, |
| 11640 | xcb_visualid_t visual_id) |
| 11641 | { |
| 11642 | auto stream = mImpl->stream(); |
| 11643 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11644 | auto resources = mImpl->resources(); |
| 11645 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11646 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11647 | VkPhysicalDevice local_physicalDevice; |
| 11648 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11649 | uint32_t local_queueFamilyIndex; |
| 11650 | local_queueFamilyIndex = queueFamilyIndex; |
| 11651 | xcb_visualid_t local_visual_id; |
| 11652 | local_visual_id = visual_id; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11653 | countingStream->rewind(); |
| 11654 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11655 | uint64_t cgen_var_922; |
| 11656 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_922, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11657 | countingStream->write((uint64_t*)&cgen_var_922, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11658 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11659 | countingStream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11660 | countingStream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11661 | } |
| 11662 | uint32_t packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11663 | countingStream->rewind(); |
| 11664 | uint32_t opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR = OP_vkGetPhysicalDeviceXcbPresentationSupportKHR; |
| 11665 | stream->write(&opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| 11666 | stream->write(&packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11667 | uint64_t cgen_var_923; |
| 11668 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_923, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11669 | stream->write((uint64_t*)&cgen_var_923, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11670 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11671 | stream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11672 | stream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11673 | stream->read((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| 11674 | VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 11675 | stream->read(&vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11676 | countingStream->clearPool(); |
| 11677 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11678 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11679 | return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return; |
| 11680 | } |
| 11681 | |
| 11682 | #endif |
| 11683 | #ifdef VK_KHR_wayland_surface |
| 11684 | VkResult VkEncoder::vkCreateWaylandSurfaceKHR( |
| 11685 | VkInstance instance, |
| 11686 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, |
| 11687 | const VkAllocationCallbacks* pAllocator, |
| 11688 | VkSurfaceKHR* pSurface) |
| 11689 | { |
| 11690 | auto stream = mImpl->stream(); |
| 11691 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11692 | auto resources = mImpl->resources(); |
| 11693 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11694 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11695 | VkInstance local_instance; |
| 11696 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11697 | VkWaylandSurfaceCreateInfoKHR* local_pCreateInfo; |
| 11698 | local_pCreateInfo = nullptr; |
| 11699 | if (pCreateInfo) |
| 11700 | { |
| 11701 | local_pCreateInfo = (VkWaylandSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWaylandSurfaceCreateInfoKHR)); |
| 11702 | deepcopy_VkWaylandSurfaceCreateInfoKHR(pool, pCreateInfo, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 11703 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11704 | VkAllocationCallbacks* local_pAllocator; |
| 11705 | local_pAllocator = nullptr; |
| 11706 | if (pAllocator) |
| 11707 | { |
| 11708 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11709 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11710 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11711 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11712 | countingStream->rewind(); |
| 11713 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11714 | uint64_t cgen_var_924; |
| 11715 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_924, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11716 | countingStream->write((uint64_t*)&cgen_var_924, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11717 | marshal_VkWaylandSurfaceCreateInfoKHR(countingStream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11718 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11719 | uint64_t cgen_var_925 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11720 | countingStream->putBe64(cgen_var_925); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11721 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11722 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11723 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11724 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11725 | uint64_t cgen_var_926; |
| 11726 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_926, 1); |
| 11727 | countingStream->write((uint64_t*)&cgen_var_926, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11728 | } |
| 11729 | uint32_t packetSize_vkCreateWaylandSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11730 | countingStream->rewind(); |
| 11731 | uint32_t opcode_vkCreateWaylandSurfaceKHR = OP_vkCreateWaylandSurfaceKHR; |
| 11732 | stream->write(&opcode_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| 11733 | stream->write(&packetSize_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11734 | uint64_t cgen_var_927; |
| 11735 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_927, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11736 | stream->write((uint64_t*)&cgen_var_927, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11737 | marshal_VkWaylandSurfaceCreateInfoKHR(stream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11738 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11739 | uint64_t cgen_var_928 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11740 | stream->putBe64(cgen_var_928); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11741 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11742 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11743 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11744 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11745 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11746 | uint64_t cgen_var_929; |
| 11747 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_929, 1); |
| 11748 | stream->write((uint64_t*)&cgen_var_929, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11749 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11750 | uint64_t cgen_var_930; |
| 11751 | stream->read((uint64_t*)&cgen_var_930, 8); |
| 11752 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_930, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11753 | VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0; |
| 11754 | stream->read(&vkCreateWaylandSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11755 | countingStream->clearPool(); |
| 11756 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11757 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11758 | return vkCreateWaylandSurfaceKHR_VkResult_return; |
| 11759 | } |
| 11760 | |
| 11761 | VkBool32 VkEncoder::vkGetPhysicalDeviceWaylandPresentationSupportKHR( |
| 11762 | VkPhysicalDevice physicalDevice, |
| 11763 | uint32_t queueFamilyIndex, |
| 11764 | wl_display* display) |
| 11765 | { |
| 11766 | auto stream = mImpl->stream(); |
| 11767 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11768 | auto resources = mImpl->resources(); |
| 11769 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11770 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11771 | VkPhysicalDevice local_physicalDevice; |
| 11772 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11773 | uint32_t local_queueFamilyIndex; |
| 11774 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11775 | countingStream->rewind(); |
| 11776 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11777 | uint64_t cgen_var_931; |
| 11778 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_931, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11779 | countingStream->write((uint64_t*)&cgen_var_931, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11780 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11781 | countingStream->write((wl_display*)display, sizeof(wl_display)); |
| 11782 | } |
| 11783 | uint32_t packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11784 | countingStream->rewind(); |
| 11785 | uint32_t opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR = OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR; |
| 11786 | stream->write(&opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| 11787 | stream->write(&packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11788 | uint64_t cgen_var_932; |
| 11789 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_932, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11790 | stream->write((uint64_t*)&cgen_var_932, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11791 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11792 | stream->write((wl_display*)display, sizeof(wl_display)); |
| 11793 | stream->read((wl_display*)display, sizeof(wl_display)); |
| 11794 | VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 11795 | stream->read(&vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11796 | countingStream->clearPool(); |
| 11797 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11798 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11799 | return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return; |
| 11800 | } |
| 11801 | |
| 11802 | #endif |
| 11803 | #ifdef VK_KHR_mir_surface |
| 11804 | VkResult VkEncoder::vkCreateMirSurfaceKHR( |
| 11805 | VkInstance instance, |
| 11806 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, |
| 11807 | const VkAllocationCallbacks* pAllocator, |
| 11808 | VkSurfaceKHR* pSurface) |
| 11809 | { |
| 11810 | auto stream = mImpl->stream(); |
| 11811 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11812 | auto resources = mImpl->resources(); |
| 11813 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11814 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11815 | VkInstance local_instance; |
| 11816 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11817 | VkMirSurfaceCreateInfoKHR* local_pCreateInfo; |
| 11818 | local_pCreateInfo = nullptr; |
| 11819 | if (pCreateInfo) |
| 11820 | { |
| 11821 | local_pCreateInfo = (VkMirSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkMirSurfaceCreateInfoKHR)); |
| 11822 | deepcopy_VkMirSurfaceCreateInfoKHR(pool, pCreateInfo, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 11823 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11824 | VkAllocationCallbacks* local_pAllocator; |
| 11825 | local_pAllocator = nullptr; |
| 11826 | if (pAllocator) |
| 11827 | { |
| 11828 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11829 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11830 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11831 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11832 | countingStream->rewind(); |
| 11833 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11834 | uint64_t cgen_var_933; |
| 11835 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_933, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11836 | countingStream->write((uint64_t*)&cgen_var_933, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11837 | marshal_VkMirSurfaceCreateInfoKHR(countingStream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11838 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11839 | uint64_t cgen_var_934 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11840 | countingStream->putBe64(cgen_var_934); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11841 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11842 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11843 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11844 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11845 | uint64_t cgen_var_935; |
| 11846 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_935, 1); |
| 11847 | countingStream->write((uint64_t*)&cgen_var_935, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11848 | } |
| 11849 | uint32_t packetSize_vkCreateMirSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11850 | countingStream->rewind(); |
| 11851 | uint32_t opcode_vkCreateMirSurfaceKHR = OP_vkCreateMirSurfaceKHR; |
| 11852 | stream->write(&opcode_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| 11853 | stream->write(&packetSize_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11854 | uint64_t cgen_var_936; |
| 11855 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_936, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11856 | stream->write((uint64_t*)&cgen_var_936, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11857 | marshal_VkMirSurfaceCreateInfoKHR(stream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11858 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11859 | uint64_t cgen_var_937 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11860 | stream->putBe64(cgen_var_937); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11861 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11862 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11863 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11864 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11865 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11866 | uint64_t cgen_var_938; |
| 11867 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_938, 1); |
| 11868 | stream->write((uint64_t*)&cgen_var_938, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11869 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11870 | uint64_t cgen_var_939; |
| 11871 | stream->read((uint64_t*)&cgen_var_939, 8); |
| 11872 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_939, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11873 | VkResult vkCreateMirSurfaceKHR_VkResult_return = (VkResult)0; |
| 11874 | stream->read(&vkCreateMirSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11875 | countingStream->clearPool(); |
| 11876 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11877 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11878 | return vkCreateMirSurfaceKHR_VkResult_return; |
| 11879 | } |
| 11880 | |
| 11881 | VkBool32 VkEncoder::vkGetPhysicalDeviceMirPresentationSupportKHR( |
| 11882 | VkPhysicalDevice physicalDevice, |
| 11883 | uint32_t queueFamilyIndex, |
| 11884 | MirConnection* connection) |
| 11885 | { |
| 11886 | auto stream = mImpl->stream(); |
| 11887 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11888 | auto resources = mImpl->resources(); |
| 11889 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11890 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11891 | VkPhysicalDevice local_physicalDevice; |
| 11892 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11893 | uint32_t local_queueFamilyIndex; |
| 11894 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11895 | countingStream->rewind(); |
| 11896 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11897 | uint64_t cgen_var_940; |
| 11898 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_940, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11899 | countingStream->write((uint64_t*)&cgen_var_940, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11900 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11901 | countingStream->write((MirConnection*)connection, sizeof(MirConnection)); |
| 11902 | } |
| 11903 | uint32_t packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11904 | countingStream->rewind(); |
| 11905 | uint32_t opcode_vkGetPhysicalDeviceMirPresentationSupportKHR = OP_vkGetPhysicalDeviceMirPresentationSupportKHR; |
| 11906 | stream->write(&opcode_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| 11907 | stream->write(&packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11908 | uint64_t cgen_var_941; |
| 11909 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_941, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11910 | stream->write((uint64_t*)&cgen_var_941, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11911 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11912 | stream->write((MirConnection*)connection, sizeof(MirConnection)); |
| 11913 | stream->read((MirConnection*)connection, sizeof(MirConnection)); |
| 11914 | VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 11915 | stream->read(&vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11916 | countingStream->clearPool(); |
| 11917 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11918 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11919 | return vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return; |
| 11920 | } |
| 11921 | |
| 11922 | #endif |
| 11923 | #ifdef VK_KHR_android_surface |
| 11924 | VkResult VkEncoder::vkCreateAndroidSurfaceKHR( |
| 11925 | VkInstance instance, |
| 11926 | const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
| 11927 | const VkAllocationCallbacks* pAllocator, |
| 11928 | VkSurfaceKHR* pSurface) |
| 11929 | { |
| 11930 | auto stream = mImpl->stream(); |
| 11931 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11932 | auto resources = mImpl->resources(); |
| 11933 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11934 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11935 | VkInstance local_instance; |
| 11936 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11937 | VkAndroidSurfaceCreateInfoKHR* local_pCreateInfo; |
| 11938 | local_pCreateInfo = nullptr; |
| 11939 | if (pCreateInfo) |
| 11940 | { |
| 11941 | local_pCreateInfo = (VkAndroidSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkAndroidSurfaceCreateInfoKHR)); |
| 11942 | deepcopy_VkAndroidSurfaceCreateInfoKHR(pool, pCreateInfo, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 11943 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11944 | VkAllocationCallbacks* local_pAllocator; |
| 11945 | local_pAllocator = nullptr; |
| 11946 | if (pAllocator) |
| 11947 | { |
| 11948 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11949 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11950 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11951 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11952 | countingStream->rewind(); |
| 11953 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11954 | uint64_t cgen_var_942; |
| 11955 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_942, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11956 | countingStream->write((uint64_t*)&cgen_var_942, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11957 | marshal_VkAndroidSurfaceCreateInfoKHR(countingStream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11958 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11959 | uint64_t cgen_var_943 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11960 | countingStream->putBe64(cgen_var_943); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11961 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11962 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11963 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11964 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11965 | uint64_t cgen_var_944; |
| 11966 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_944, 1); |
| 11967 | countingStream->write((uint64_t*)&cgen_var_944, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11968 | } |
| 11969 | uint32_t packetSize_vkCreateAndroidSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11970 | countingStream->rewind(); |
| 11971 | uint32_t opcode_vkCreateAndroidSurfaceKHR = OP_vkCreateAndroidSurfaceKHR; |
| 11972 | stream->write(&opcode_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| 11973 | stream->write(&packetSize_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11974 | uint64_t cgen_var_945; |
| 11975 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_945, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11976 | stream->write((uint64_t*)&cgen_var_945, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11977 | marshal_VkAndroidSurfaceCreateInfoKHR(stream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11978 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11979 | uint64_t cgen_var_946 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11980 | stream->putBe64(cgen_var_946); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11981 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11982 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11983 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11984 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11985 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11986 | uint64_t cgen_var_947; |
| 11987 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_947, 1); |
| 11988 | stream->write((uint64_t*)&cgen_var_947, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11989 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11990 | uint64_t cgen_var_948; |
| 11991 | stream->read((uint64_t*)&cgen_var_948, 8); |
| 11992 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_948, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11993 | VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0; |
| 11994 | stream->read(&vkCreateAndroidSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11995 | countingStream->clearPool(); |
| 11996 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 11997 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11998 | return vkCreateAndroidSurfaceKHR_VkResult_return; |
| 11999 | } |
| 12000 | |
| 12001 | #endif |
| 12002 | #ifdef VK_KHR_win32_surface |
| 12003 | VkResult VkEncoder::vkCreateWin32SurfaceKHR( |
| 12004 | VkInstance instance, |
| 12005 | const VkWin32SurfaceCreateInfoKHR* pCreateInfo, |
| 12006 | const VkAllocationCallbacks* pAllocator, |
| 12007 | VkSurfaceKHR* pSurface) |
| 12008 | { |
| 12009 | auto stream = mImpl->stream(); |
| 12010 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12011 | auto resources = mImpl->resources(); |
| 12012 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12013 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12014 | VkInstance local_instance; |
| 12015 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12016 | VkWin32SurfaceCreateInfoKHR* local_pCreateInfo; |
| 12017 | local_pCreateInfo = nullptr; |
| 12018 | if (pCreateInfo) |
| 12019 | { |
| 12020 | local_pCreateInfo = (VkWin32SurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWin32SurfaceCreateInfoKHR)); |
| 12021 | deepcopy_VkWin32SurfaceCreateInfoKHR(pool, pCreateInfo, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 12022 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12023 | VkAllocationCallbacks* local_pAllocator; |
| 12024 | local_pAllocator = nullptr; |
| 12025 | if (pAllocator) |
| 12026 | { |
| 12027 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12028 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12029 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12030 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12031 | countingStream->rewind(); |
| 12032 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12033 | uint64_t cgen_var_949; |
| 12034 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_949, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12035 | countingStream->write((uint64_t*)&cgen_var_949, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12036 | marshal_VkWin32SurfaceCreateInfoKHR(countingStream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12037 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12038 | uint64_t cgen_var_950 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12039 | countingStream->putBe64(cgen_var_950); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12040 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12041 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12042 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12043 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12044 | uint64_t cgen_var_951; |
| 12045 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_951, 1); |
| 12046 | countingStream->write((uint64_t*)&cgen_var_951, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12047 | } |
| 12048 | uint32_t packetSize_vkCreateWin32SurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12049 | countingStream->rewind(); |
| 12050 | uint32_t opcode_vkCreateWin32SurfaceKHR = OP_vkCreateWin32SurfaceKHR; |
| 12051 | stream->write(&opcode_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| 12052 | stream->write(&packetSize_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12053 | uint64_t cgen_var_952; |
| 12054 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_952, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12055 | stream->write((uint64_t*)&cgen_var_952, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12056 | marshal_VkWin32SurfaceCreateInfoKHR(stream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12057 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12058 | uint64_t cgen_var_953 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12059 | stream->putBe64(cgen_var_953); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12060 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12061 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12062 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12063 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12064 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12065 | uint64_t cgen_var_954; |
| 12066 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_954, 1); |
| 12067 | stream->write((uint64_t*)&cgen_var_954, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12068 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12069 | uint64_t cgen_var_955; |
| 12070 | stream->read((uint64_t*)&cgen_var_955, 8); |
| 12071 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_955, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12072 | VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0; |
| 12073 | stream->read(&vkCreateWin32SurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12074 | countingStream->clearPool(); |
| 12075 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12076 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12077 | return vkCreateWin32SurfaceKHR_VkResult_return; |
| 12078 | } |
| 12079 | |
| 12080 | VkBool32 VkEncoder::vkGetPhysicalDeviceWin32PresentationSupportKHR( |
| 12081 | VkPhysicalDevice physicalDevice, |
| 12082 | uint32_t queueFamilyIndex) |
| 12083 | { |
| 12084 | auto stream = mImpl->stream(); |
| 12085 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12086 | auto resources = mImpl->resources(); |
| 12087 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12088 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12089 | VkPhysicalDevice local_physicalDevice; |
| 12090 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12091 | uint32_t local_queueFamilyIndex; |
| 12092 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12093 | countingStream->rewind(); |
| 12094 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12095 | uint64_t cgen_var_956; |
| 12096 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_956, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12097 | countingStream->write((uint64_t*)&cgen_var_956, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12098 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12099 | } |
| 12100 | uint32_t packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12101 | countingStream->rewind(); |
| 12102 | uint32_t opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR = OP_vkGetPhysicalDeviceWin32PresentationSupportKHR; |
| 12103 | stream->write(&opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| 12104 | stream->write(&packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12105 | uint64_t cgen_var_957; |
| 12106 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_957, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12107 | stream->write((uint64_t*)&cgen_var_957, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12108 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12109 | VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 12110 | stream->read(&vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12111 | countingStream->clearPool(); |
| 12112 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12113 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12114 | return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return; |
| 12115 | } |
| 12116 | |
| 12117 | #endif |
| 12118 | #ifdef VK_KHR_sampler_mirror_clamp_to_edge |
| 12119 | #endif |
| 12120 | #ifdef VK_KHR_multiview |
| 12121 | #endif |
| 12122 | #ifdef VK_KHR_get_physical_device_properties2 |
| 12123 | void VkEncoder::vkGetPhysicalDeviceFeatures2KHR( |
| 12124 | VkPhysicalDevice physicalDevice, |
| 12125 | VkPhysicalDeviceFeatures2* pFeatures) |
| 12126 | { |
| 12127 | auto stream = mImpl->stream(); |
| 12128 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12129 | auto resources = mImpl->resources(); |
| 12130 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12131 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12132 | VkPhysicalDevice local_physicalDevice; |
| 12133 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12134 | countingStream->rewind(); |
| 12135 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12136 | uint64_t cgen_var_958; |
| 12137 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_958, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12138 | countingStream->write((uint64_t*)&cgen_var_958, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12139 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 12140 | } |
| 12141 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12142 | countingStream->rewind(); |
| 12143 | uint32_t opcode_vkGetPhysicalDeviceFeatures2KHR = OP_vkGetPhysicalDeviceFeatures2KHR; |
| 12144 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| 12145 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12146 | uint64_t cgen_var_959; |
| 12147 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_959, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12148 | stream->write((uint64_t*)&cgen_var_959, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12149 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 12150 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 12151 | } |
| 12152 | |
| 12153 | void VkEncoder::vkGetPhysicalDeviceProperties2KHR( |
| 12154 | VkPhysicalDevice physicalDevice, |
| 12155 | VkPhysicalDeviceProperties2* pProperties) |
| 12156 | { |
| 12157 | auto stream = mImpl->stream(); |
| 12158 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12159 | auto resources = mImpl->resources(); |
| 12160 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12161 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12162 | VkPhysicalDevice local_physicalDevice; |
| 12163 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12164 | countingStream->rewind(); |
| 12165 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12166 | uint64_t cgen_var_960; |
| 12167 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_960, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12168 | countingStream->write((uint64_t*)&cgen_var_960, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12169 | marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 12170 | } |
| 12171 | uint32_t packetSize_vkGetPhysicalDeviceProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12172 | countingStream->rewind(); |
| 12173 | uint32_t opcode_vkGetPhysicalDeviceProperties2KHR = OP_vkGetPhysicalDeviceProperties2KHR; |
| 12174 | stream->write(&opcode_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| 12175 | stream->write(&packetSize_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12176 | uint64_t cgen_var_961; |
| 12177 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_961, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12178 | stream->write((uint64_t*)&cgen_var_961, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12179 | marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 12180 | unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 12181 | } |
| 12182 | |
| 12183 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2KHR( |
| 12184 | VkPhysicalDevice physicalDevice, |
| 12185 | VkFormat format, |
| 12186 | VkFormatProperties2* pFormatProperties) |
| 12187 | { |
| 12188 | auto stream = mImpl->stream(); |
| 12189 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12190 | auto resources = mImpl->resources(); |
| 12191 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12192 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12193 | VkPhysicalDevice local_physicalDevice; |
| 12194 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12195 | VkFormat local_format; |
| 12196 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12197 | countingStream->rewind(); |
| 12198 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12199 | uint64_t cgen_var_962; |
| 12200 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_962, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12201 | countingStream->write((uint64_t*)&cgen_var_962, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12202 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12203 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 12204 | } |
| 12205 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12206 | countingStream->rewind(); |
| 12207 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2KHR = OP_vkGetPhysicalDeviceFormatProperties2KHR; |
| 12208 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| 12209 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12210 | uint64_t cgen_var_963; |
| 12211 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_963, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12212 | stream->write((uint64_t*)&cgen_var_963, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12213 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12214 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| 12215 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| 12216 | } |
| 12217 | |
| 12218 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2KHR( |
| 12219 | VkPhysicalDevice physicalDevice, |
| 12220 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 12221 | VkImageFormatProperties2* pImageFormatProperties) |
| 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(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12227 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12228 | VkPhysicalDevice local_physicalDevice; |
| 12229 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12230 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| 12231 | local_pImageFormatInfo = nullptr; |
| 12232 | if (pImageFormatInfo) |
| 12233 | { |
| 12234 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 12235 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 12236 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12237 | countingStream->rewind(); |
| 12238 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12239 | uint64_t cgen_var_964; |
| 12240 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_964, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12241 | countingStream->write((uint64_t*)&cgen_var_964, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12242 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12243 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 12244 | } |
| 12245 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12246 | countingStream->rewind(); |
| 12247 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2KHR = OP_vkGetPhysicalDeviceImageFormatProperties2KHR; |
| 12248 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| 12249 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12250 | uint64_t cgen_var_965; |
| 12251 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_965, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12252 | stream->write((uint64_t*)&cgen_var_965, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12253 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12254 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 12255 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 12256 | VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0; |
| 12257 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12258 | countingStream->clearPool(); |
| 12259 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12260 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12261 | return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return; |
| 12262 | } |
| 12263 | |
| 12264 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2KHR( |
| 12265 | VkPhysicalDevice physicalDevice, |
| 12266 | uint32_t* pQueueFamilyPropertyCount, |
| 12267 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 12268 | { |
| 12269 | auto stream = mImpl->stream(); |
| 12270 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12271 | auto resources = mImpl->resources(); |
| 12272 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12273 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12274 | VkPhysicalDevice local_physicalDevice; |
| 12275 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12276 | countingStream->rewind(); |
| 12277 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12278 | uint64_t cgen_var_966; |
| 12279 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_966, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12280 | countingStream->write((uint64_t*)&cgen_var_966, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12281 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12282 | uint64_t cgen_var_967 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 12283 | countingStream->putBe64(cgen_var_967); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12284 | if (pQueueFamilyPropertyCount) |
| 12285 | { |
| 12286 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 12287 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12288 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12289 | uint64_t cgen_var_968 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 12290 | countingStream->putBe64(cgen_var_968); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12291 | if (pQueueFamilyProperties) |
| 12292 | { |
| 12293 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 12294 | { |
| 12295 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 12296 | } |
| 12297 | } |
| 12298 | } |
| 12299 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12300 | countingStream->rewind(); |
| 12301 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR = OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR; |
| 12302 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| 12303 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12304 | uint64_t cgen_var_969; |
| 12305 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_969, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12306 | stream->write((uint64_t*)&cgen_var_969, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12307 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12308 | uint64_t cgen_var_970 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 12309 | stream->putBe64(cgen_var_970); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12310 | if (pQueueFamilyPropertyCount) |
| 12311 | { |
| 12312 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 12313 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12314 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12315 | uint64_t cgen_var_971 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 12316 | stream->putBe64(cgen_var_971); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12317 | if (pQueueFamilyProperties) |
| 12318 | { |
| 12319 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 12320 | { |
| 12321 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 12322 | } |
| 12323 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12324 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12325 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12326 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12327 | if (pQueueFamilyPropertyCount) |
| 12328 | { |
| 12329 | if (!(check_pQueueFamilyPropertyCount)) |
| 12330 | { |
| 12331 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 12332 | } |
| 12333 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 12334 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12335 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12336 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12337 | check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12338 | if (pQueueFamilyProperties) |
| 12339 | { |
| 12340 | if (!(check_pQueueFamilyProperties)) |
| 12341 | { |
| 12342 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 12343 | } |
| 12344 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 12345 | { |
| 12346 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 12347 | } |
| 12348 | } |
| 12349 | } |
| 12350 | |
| 12351 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2KHR( |
| 12352 | VkPhysicalDevice physicalDevice, |
| 12353 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 12354 | { |
| 12355 | auto stream = mImpl->stream(); |
| 12356 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12357 | auto resources = mImpl->resources(); |
| 12358 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12359 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12360 | VkPhysicalDevice local_physicalDevice; |
| 12361 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12362 | countingStream->rewind(); |
| 12363 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12364 | uint64_t cgen_var_974; |
| 12365 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_974, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12366 | countingStream->write((uint64_t*)&cgen_var_974, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12367 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 12368 | } |
| 12369 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12370 | countingStream->rewind(); |
| 12371 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2KHR = OP_vkGetPhysicalDeviceMemoryProperties2KHR; |
| 12372 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| 12373 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12374 | uint64_t cgen_var_975; |
| 12375 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_975, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12376 | stream->write((uint64_t*)&cgen_var_975, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12377 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 12378 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 12379 | } |
| 12380 | |
| 12381 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 12382 | VkPhysicalDevice physicalDevice, |
| 12383 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 12384 | uint32_t* pPropertyCount, |
| 12385 | VkSparseImageFormatProperties2* pProperties) |
| 12386 | { |
| 12387 | auto stream = mImpl->stream(); |
| 12388 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12389 | auto resources = mImpl->resources(); |
| 12390 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12391 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12392 | VkPhysicalDevice local_physicalDevice; |
| 12393 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12394 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| 12395 | local_pFormatInfo = nullptr; |
| 12396 | if (pFormatInfo) |
| 12397 | { |
| 12398 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 12399 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 12400 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12401 | countingStream->rewind(); |
| 12402 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12403 | uint64_t cgen_var_976; |
| 12404 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_976, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12405 | countingStream->write((uint64_t*)&cgen_var_976, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12406 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12407 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12408 | uint64_t cgen_var_977 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12409 | countingStream->putBe64(cgen_var_977); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12410 | if (pPropertyCount) |
| 12411 | { |
| 12412 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12413 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12414 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12415 | uint64_t cgen_var_978 = (uint64_t)(uintptr_t)pProperties; |
| 12416 | countingStream->putBe64(cgen_var_978); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12417 | if (pProperties) |
| 12418 | { |
| 12419 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12420 | { |
| 12421 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 12422 | } |
| 12423 | } |
| 12424 | } |
| 12425 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12426 | countingStream->rewind(); |
| 12427 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR; |
| 12428 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| 12429 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12430 | uint64_t cgen_var_979; |
| 12431 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_979, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12432 | stream->write((uint64_t*)&cgen_var_979, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12433 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12434 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12435 | uint64_t cgen_var_980 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12436 | stream->putBe64(cgen_var_980); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12437 | if (pPropertyCount) |
| 12438 | { |
| 12439 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12440 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12441 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12442 | uint64_t cgen_var_981 = (uint64_t)(uintptr_t)pProperties; |
| 12443 | stream->putBe64(cgen_var_981); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12444 | if (pProperties) |
| 12445 | { |
| 12446 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12447 | { |
| 12448 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 12449 | } |
| 12450 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12451 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12452 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12453 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12454 | if (pPropertyCount) |
| 12455 | { |
| 12456 | if (!(check_pPropertyCount)) |
| 12457 | { |
| 12458 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12459 | } |
| 12460 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12461 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12462 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12463 | VkSparseImageFormatProperties2* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12464 | check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12465 | if (pProperties) |
| 12466 | { |
| 12467 | if (!(check_pProperties)) |
| 12468 | { |
| 12469 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12470 | } |
| 12471 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12472 | { |
| 12473 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 12474 | } |
| 12475 | } |
| 12476 | } |
| 12477 | |
| 12478 | #endif |
| 12479 | #ifdef VK_KHR_device_group |
| 12480 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeaturesKHR( |
| 12481 | VkDevice device, |
| 12482 | uint32_t heapIndex, |
| 12483 | uint32_t localDeviceIndex, |
| 12484 | uint32_t remoteDeviceIndex, |
| 12485 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 12486 | { |
| 12487 | auto stream = mImpl->stream(); |
| 12488 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12489 | auto resources = mImpl->resources(); |
| 12490 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12491 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12492 | VkDevice local_device; |
| 12493 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12494 | uint32_t local_heapIndex; |
| 12495 | local_heapIndex = heapIndex; |
| 12496 | uint32_t local_localDeviceIndex; |
| 12497 | local_localDeviceIndex = localDeviceIndex; |
| 12498 | uint32_t local_remoteDeviceIndex; |
| 12499 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12500 | countingStream->rewind(); |
| 12501 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12502 | uint64_t cgen_var_984; |
| 12503 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_984, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12504 | countingStream->write((uint64_t*)&cgen_var_984, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12505 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 12506 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 12507 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12508 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 12509 | } |
| 12510 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12511 | countingStream->rewind(); |
| 12512 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR = OP_vkGetDeviceGroupPeerMemoryFeaturesKHR; |
| 12513 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| 12514 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12515 | uint64_t cgen_var_985; |
| 12516 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_985, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12517 | stream->write((uint64_t*)&cgen_var_985, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12518 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 12519 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 12520 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12521 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 12522 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 12523 | } |
| 12524 | |
| 12525 | void VkEncoder::vkCmdSetDeviceMaskKHR( |
| 12526 | VkCommandBuffer commandBuffer, |
| 12527 | uint32_t deviceMask) |
| 12528 | { |
| 12529 | auto stream = mImpl->stream(); |
| 12530 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12531 | auto resources = mImpl->resources(); |
| 12532 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12533 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12534 | VkCommandBuffer local_commandBuffer; |
| 12535 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12536 | uint32_t local_deviceMask; |
| 12537 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12538 | countingStream->rewind(); |
| 12539 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12540 | uint64_t cgen_var_986; |
| 12541 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_986, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12542 | countingStream->write((uint64_t*)&cgen_var_986, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12543 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12544 | } |
| 12545 | uint32_t packetSize_vkCmdSetDeviceMaskKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12546 | countingStream->rewind(); |
| 12547 | uint32_t opcode_vkCmdSetDeviceMaskKHR = OP_vkCmdSetDeviceMaskKHR; |
| 12548 | stream->write(&opcode_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| 12549 | stream->write(&packetSize_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12550 | uint64_t cgen_var_987; |
| 12551 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_987, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12552 | stream->write((uint64_t*)&cgen_var_987, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12553 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12554 | } |
| 12555 | |
| 12556 | void VkEncoder::vkCmdDispatchBaseKHR( |
| 12557 | VkCommandBuffer commandBuffer, |
| 12558 | uint32_t baseGroupX, |
| 12559 | uint32_t baseGroupY, |
| 12560 | uint32_t baseGroupZ, |
| 12561 | uint32_t groupCountX, |
| 12562 | uint32_t groupCountY, |
| 12563 | uint32_t groupCountZ) |
| 12564 | { |
| 12565 | auto stream = mImpl->stream(); |
| 12566 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12567 | auto resources = mImpl->resources(); |
| 12568 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12569 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12570 | VkCommandBuffer local_commandBuffer; |
| 12571 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12572 | uint32_t local_baseGroupX; |
| 12573 | local_baseGroupX = baseGroupX; |
| 12574 | uint32_t local_baseGroupY; |
| 12575 | local_baseGroupY = baseGroupY; |
| 12576 | uint32_t local_baseGroupZ; |
| 12577 | local_baseGroupZ = baseGroupZ; |
| 12578 | uint32_t local_groupCountX; |
| 12579 | local_groupCountX = groupCountX; |
| 12580 | uint32_t local_groupCountY; |
| 12581 | local_groupCountY = groupCountY; |
| 12582 | uint32_t local_groupCountZ; |
| 12583 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12584 | countingStream->rewind(); |
| 12585 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12586 | uint64_t cgen_var_988; |
| 12587 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_988, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12588 | countingStream->write((uint64_t*)&cgen_var_988, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12589 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 12590 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 12591 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 12592 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 12593 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 12594 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12595 | } |
| 12596 | uint32_t packetSize_vkCmdDispatchBaseKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12597 | countingStream->rewind(); |
| 12598 | uint32_t opcode_vkCmdDispatchBaseKHR = OP_vkCmdDispatchBaseKHR; |
| 12599 | stream->write(&opcode_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| 12600 | stream->write(&packetSize_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12601 | uint64_t cgen_var_989; |
| 12602 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_989, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12603 | stream->write((uint64_t*)&cgen_var_989, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12604 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 12605 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 12606 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 12607 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 12608 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 12609 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12610 | } |
| 12611 | |
| 12612 | #endif |
| 12613 | #ifdef VK_KHR_shader_draw_parameters |
| 12614 | #endif |
| 12615 | #ifdef VK_KHR_maintenance1 |
| 12616 | void VkEncoder::vkTrimCommandPoolKHR( |
| 12617 | VkDevice device, |
| 12618 | VkCommandPool commandPool, |
| 12619 | VkCommandPoolTrimFlags flags) |
| 12620 | { |
| 12621 | auto stream = mImpl->stream(); |
| 12622 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12623 | auto resources = mImpl->resources(); |
| 12624 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12625 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12626 | VkDevice local_device; |
| 12627 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12628 | VkCommandPool local_commandPool; |
| 12629 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12630 | VkCommandPoolTrimFlags local_flags; |
| 12631 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12632 | countingStream->rewind(); |
| 12633 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12634 | uint64_t cgen_var_990; |
| 12635 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_990, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12636 | countingStream->write((uint64_t*)&cgen_var_990, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12637 | uint64_t cgen_var_991; |
| 12638 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_991, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12639 | countingStream->write((uint64_t*)&cgen_var_991, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12640 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12641 | } |
| 12642 | uint32_t packetSize_vkTrimCommandPoolKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12643 | countingStream->rewind(); |
| 12644 | uint32_t opcode_vkTrimCommandPoolKHR = OP_vkTrimCommandPoolKHR; |
| 12645 | stream->write(&opcode_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| 12646 | stream->write(&packetSize_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12647 | uint64_t cgen_var_992; |
| 12648 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_992, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12649 | stream->write((uint64_t*)&cgen_var_992, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12650 | uint64_t cgen_var_993; |
| 12651 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_993, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12652 | stream->write((uint64_t*)&cgen_var_993, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12653 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12654 | } |
| 12655 | |
| 12656 | #endif |
| 12657 | #ifdef VK_KHR_device_group_creation |
| 12658 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroupsKHR( |
| 12659 | VkInstance instance, |
| 12660 | uint32_t* pPhysicalDeviceGroupCount, |
| 12661 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 12662 | { |
| 12663 | auto stream = mImpl->stream(); |
| 12664 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12665 | auto resources = mImpl->resources(); |
| 12666 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12667 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12668 | VkInstance local_instance; |
| 12669 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12670 | countingStream->rewind(); |
| 12671 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12672 | uint64_t cgen_var_994; |
| 12673 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_994, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12674 | countingStream->write((uint64_t*)&cgen_var_994, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12675 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12676 | uint64_t cgen_var_995 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 12677 | countingStream->putBe64(cgen_var_995); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12678 | if (pPhysicalDeviceGroupCount) |
| 12679 | { |
| 12680 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 12681 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12682 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12683 | uint64_t cgen_var_996 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 12684 | countingStream->putBe64(cgen_var_996); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12685 | if (pPhysicalDeviceGroupProperties) |
| 12686 | { |
| 12687 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 12688 | { |
| 12689 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 12690 | } |
| 12691 | } |
| 12692 | } |
| 12693 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroupsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12694 | countingStream->rewind(); |
| 12695 | uint32_t opcode_vkEnumeratePhysicalDeviceGroupsKHR = OP_vkEnumeratePhysicalDeviceGroupsKHR; |
| 12696 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| 12697 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12698 | uint64_t cgen_var_997; |
| 12699 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_997, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12700 | stream->write((uint64_t*)&cgen_var_997, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12701 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12702 | uint64_t cgen_var_998 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 12703 | stream->putBe64(cgen_var_998); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12704 | if (pPhysicalDeviceGroupCount) |
| 12705 | { |
| 12706 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 12707 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12708 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12709 | uint64_t cgen_var_999 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 12710 | stream->putBe64(cgen_var_999); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12711 | if (pPhysicalDeviceGroupProperties) |
| 12712 | { |
| 12713 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 12714 | { |
| 12715 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 12716 | } |
| 12717 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12718 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12719 | uint32_t* check_pPhysicalDeviceGroupCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12720 | check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12721 | if (pPhysicalDeviceGroupCount) |
| 12722 | { |
| 12723 | if (!(check_pPhysicalDeviceGroupCount)) |
| 12724 | { |
| 12725 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 12726 | } |
| 12727 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 12728 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12729 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12730 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12731 | check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12732 | if (pPhysicalDeviceGroupProperties) |
| 12733 | { |
| 12734 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 12735 | { |
| 12736 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 12737 | } |
| 12738 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 12739 | { |
| 12740 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 12741 | } |
| 12742 | } |
| 12743 | VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0; |
| 12744 | stream->read(&vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12745 | countingStream->clearPool(); |
| 12746 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12747 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12748 | return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return; |
| 12749 | } |
| 12750 | |
| 12751 | #endif |
| 12752 | #ifdef VK_KHR_external_memory_capabilities |
| 12753 | void VkEncoder::vkGetPhysicalDeviceExternalBufferPropertiesKHR( |
| 12754 | VkPhysicalDevice physicalDevice, |
| 12755 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 12756 | VkExternalBufferProperties* pExternalBufferProperties) |
| 12757 | { |
| 12758 | auto stream = mImpl->stream(); |
| 12759 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12760 | auto resources = mImpl->resources(); |
| 12761 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12762 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12763 | VkPhysicalDevice local_physicalDevice; |
| 12764 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12765 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| 12766 | local_pExternalBufferInfo = nullptr; |
| 12767 | if (pExternalBufferInfo) |
| 12768 | { |
| 12769 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 12770 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 12771 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12772 | countingStream->rewind(); |
| 12773 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12774 | uint64_t cgen_var_1002; |
| 12775 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1002, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12776 | countingStream->write((uint64_t*)&cgen_var_1002, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12777 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12778 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 12779 | } |
| 12780 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12781 | countingStream->rewind(); |
| 12782 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR = OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR; |
| 12783 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| 12784 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12785 | uint64_t cgen_var_1003; |
| 12786 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1003, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12787 | stream->write((uint64_t*)&cgen_var_1003, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12788 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12789 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 12790 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 12791 | } |
| 12792 | |
| 12793 | #endif |
| 12794 | #ifdef VK_KHR_external_memory |
| 12795 | #endif |
| 12796 | #ifdef VK_KHR_external_memory_win32 |
| 12797 | VkResult VkEncoder::vkGetMemoryWin32HandleKHR( |
| 12798 | VkDevice device, |
| 12799 | const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 12800 | HANDLE* pHandle) |
| 12801 | { |
| 12802 | auto stream = mImpl->stream(); |
| 12803 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12804 | auto resources = mImpl->resources(); |
| 12805 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12806 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12807 | VkDevice local_device; |
| 12808 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12809 | VkMemoryGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| 12810 | local_pGetWin32HandleInfo = nullptr; |
| 12811 | if (pGetWin32HandleInfo) |
| 12812 | { |
| 12813 | local_pGetWin32HandleInfo = (VkMemoryGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkMemoryGetWin32HandleInfoKHR)); |
| 12814 | deepcopy_VkMemoryGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 12815 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12816 | countingStream->rewind(); |
| 12817 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12818 | uint64_t cgen_var_1004; |
| 12819 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1004, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12820 | countingStream->write((uint64_t*)&cgen_var_1004, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12821 | marshal_VkMemoryGetWin32HandleInfoKHR(countingStream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12822 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 12823 | } |
| 12824 | uint32_t packetSize_vkGetMemoryWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12825 | countingStream->rewind(); |
| 12826 | uint32_t opcode_vkGetMemoryWin32HandleKHR = OP_vkGetMemoryWin32HandleKHR; |
| 12827 | stream->write(&opcode_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| 12828 | stream->write(&packetSize_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12829 | uint64_t cgen_var_1005; |
| 12830 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1005, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12831 | stream->write((uint64_t*)&cgen_var_1005, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12832 | marshal_VkMemoryGetWin32HandleInfoKHR(stream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12833 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 12834 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 12835 | VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0; |
| 12836 | stream->read(&vkGetMemoryWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12837 | countingStream->clearPool(); |
| 12838 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12839 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12840 | return vkGetMemoryWin32HandleKHR_VkResult_return; |
| 12841 | } |
| 12842 | |
| 12843 | VkResult VkEncoder::vkGetMemoryWin32HandlePropertiesKHR( |
| 12844 | VkDevice device, |
| 12845 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 12846 | HANDLE handle, |
| 12847 | VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) |
| 12848 | { |
| 12849 | auto stream = mImpl->stream(); |
| 12850 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12851 | auto resources = mImpl->resources(); |
| 12852 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12853 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12854 | VkDevice local_device; |
| 12855 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12856 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| 12857 | local_handleType = handleType; |
| 12858 | HANDLE local_handle; |
| 12859 | local_handle = handle; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12860 | countingStream->rewind(); |
| 12861 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12862 | uint64_t cgen_var_1006; |
| 12863 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1006, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12864 | countingStream->write((uint64_t*)&cgen_var_1006, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12865 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 12866 | countingStream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12867 | marshal_VkMemoryWin32HandlePropertiesKHR(countingStream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 12868 | } |
| 12869 | uint32_t packetSize_vkGetMemoryWin32HandlePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12870 | countingStream->rewind(); |
| 12871 | uint32_t opcode_vkGetMemoryWin32HandlePropertiesKHR = OP_vkGetMemoryWin32HandlePropertiesKHR; |
| 12872 | stream->write(&opcode_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| 12873 | stream->write(&packetSize_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12874 | uint64_t cgen_var_1007; |
| 12875 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1007, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12876 | stream->write((uint64_t*)&cgen_var_1007, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12877 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 12878 | stream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12879 | marshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 12880 | unmarshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 12881 | VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0; |
| 12882 | stream->read(&vkGetMemoryWin32HandlePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12883 | countingStream->clearPool(); |
| 12884 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12885 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12886 | return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return; |
| 12887 | } |
| 12888 | |
| 12889 | #endif |
| 12890 | #ifdef VK_KHR_external_memory_fd |
| 12891 | VkResult VkEncoder::vkGetMemoryFdKHR( |
| 12892 | VkDevice device, |
| 12893 | const VkMemoryGetFdInfoKHR* pGetFdInfo, |
| 12894 | int* pFd) |
| 12895 | { |
| 12896 | auto stream = mImpl->stream(); |
| 12897 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12898 | auto resources = mImpl->resources(); |
| 12899 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12900 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12901 | VkDevice local_device; |
| 12902 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12903 | VkMemoryGetFdInfoKHR* local_pGetFdInfo; |
| 12904 | local_pGetFdInfo = nullptr; |
| 12905 | if (pGetFdInfo) |
| 12906 | { |
| 12907 | local_pGetFdInfo = (VkMemoryGetFdInfoKHR*)pool->alloc(sizeof(const VkMemoryGetFdInfoKHR)); |
| 12908 | deepcopy_VkMemoryGetFdInfoKHR(pool, pGetFdInfo, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| 12909 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12910 | countingStream->rewind(); |
| 12911 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12912 | uint64_t cgen_var_1008; |
| 12913 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1008, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12914 | countingStream->write((uint64_t*)&cgen_var_1008, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12915 | marshal_VkMemoryGetFdInfoKHR(countingStream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12916 | countingStream->write((int*)pFd, sizeof(int)); |
| 12917 | } |
| 12918 | uint32_t packetSize_vkGetMemoryFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12919 | countingStream->rewind(); |
| 12920 | uint32_t opcode_vkGetMemoryFdKHR = OP_vkGetMemoryFdKHR; |
| 12921 | stream->write(&opcode_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| 12922 | stream->write(&packetSize_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12923 | uint64_t cgen_var_1009; |
| 12924 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1009, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12925 | stream->write((uint64_t*)&cgen_var_1009, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12926 | marshal_VkMemoryGetFdInfoKHR(stream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12927 | stream->write((int*)pFd, sizeof(int)); |
| 12928 | stream->read((int*)pFd, sizeof(int)); |
| 12929 | VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0; |
| 12930 | stream->read(&vkGetMemoryFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12931 | countingStream->clearPool(); |
| 12932 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12933 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12934 | return vkGetMemoryFdKHR_VkResult_return; |
| 12935 | } |
| 12936 | |
| 12937 | VkResult VkEncoder::vkGetMemoryFdPropertiesKHR( |
| 12938 | VkDevice device, |
| 12939 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 12940 | int fd, |
| 12941 | VkMemoryFdPropertiesKHR* pMemoryFdProperties) |
| 12942 | { |
| 12943 | auto stream = mImpl->stream(); |
| 12944 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12945 | auto resources = mImpl->resources(); |
| 12946 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12947 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12948 | VkDevice local_device; |
| 12949 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12950 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| 12951 | local_handleType = handleType; |
| 12952 | int local_fd; |
| 12953 | local_fd = fd; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12954 | countingStream->rewind(); |
| 12955 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12956 | uint64_t cgen_var_1010; |
| 12957 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1010, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12958 | countingStream->write((uint64_t*)&cgen_var_1010, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12959 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 12960 | countingStream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12961 | marshal_VkMemoryFdPropertiesKHR(countingStream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 12962 | } |
| 12963 | uint32_t packetSize_vkGetMemoryFdPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12964 | countingStream->rewind(); |
| 12965 | uint32_t opcode_vkGetMemoryFdPropertiesKHR = OP_vkGetMemoryFdPropertiesKHR; |
| 12966 | stream->write(&opcode_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| 12967 | stream->write(&packetSize_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12968 | uint64_t cgen_var_1011; |
| 12969 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1011, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12970 | stream->write((uint64_t*)&cgen_var_1011, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12971 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 12972 | stream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12973 | marshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 12974 | unmarshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 12975 | VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0; |
| 12976 | stream->read(&vkGetMemoryFdPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12977 | countingStream->clearPool(); |
| 12978 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12979 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12980 | return vkGetMemoryFdPropertiesKHR_VkResult_return; |
| 12981 | } |
| 12982 | |
| 12983 | #endif |
| 12984 | #ifdef VK_KHR_win32_keyed_mutex |
| 12985 | #endif |
| 12986 | #ifdef VK_KHR_external_semaphore_capabilities |
| 12987 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( |
| 12988 | VkPhysicalDevice physicalDevice, |
| 12989 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 12990 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 12991 | { |
| 12992 | auto stream = mImpl->stream(); |
| 12993 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12994 | auto resources = mImpl->resources(); |
| 12995 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 12996 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12997 | VkPhysicalDevice local_physicalDevice; |
| 12998 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12999 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| 13000 | local_pExternalSemaphoreInfo = nullptr; |
| 13001 | if (pExternalSemaphoreInfo) |
| 13002 | { |
| 13003 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 13004 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 13005 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13006 | countingStream->rewind(); |
| 13007 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13008 | uint64_t cgen_var_1012; |
| 13009 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1012, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13010 | countingStream->write((uint64_t*)&cgen_var_1012, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13011 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13012 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 13013 | } |
| 13014 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13015 | countingStream->rewind(); |
| 13016 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; |
| 13017 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| 13018 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13019 | uint64_t cgen_var_1013; |
| 13020 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1013, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13021 | stream->write((uint64_t*)&cgen_var_1013, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13022 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13023 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 13024 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 13025 | } |
| 13026 | |
| 13027 | #endif |
| 13028 | #ifdef VK_KHR_external_semaphore |
| 13029 | #endif |
| 13030 | #ifdef VK_KHR_external_semaphore_win32 |
| 13031 | VkResult VkEncoder::vkImportSemaphoreWin32HandleKHR( |
| 13032 | VkDevice device, |
| 13033 | const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) |
| 13034 | { |
| 13035 | auto stream = mImpl->stream(); |
| 13036 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13037 | auto resources = mImpl->resources(); |
| 13038 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13039 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13040 | VkDevice local_device; |
| 13041 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13042 | VkImportSemaphoreWin32HandleInfoKHR* local_pImportSemaphoreWin32HandleInfo; |
| 13043 | local_pImportSemaphoreWin32HandleInfo = nullptr; |
| 13044 | if (pImportSemaphoreWin32HandleInfo) |
| 13045 | { |
| 13046 | local_pImportSemaphoreWin32HandleInfo = (VkImportSemaphoreWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreWin32HandleInfoKHR)); |
| 13047 | deepcopy_VkImportSemaphoreWin32HandleInfoKHR(pool, pImportSemaphoreWin32HandleInfo, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| 13048 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13049 | countingStream->rewind(); |
| 13050 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13051 | uint64_t cgen_var_1014; |
| 13052 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1014, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13053 | countingStream->write((uint64_t*)&cgen_var_1014, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13054 | marshal_VkImportSemaphoreWin32HandleInfoKHR(countingStream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13055 | } |
| 13056 | uint32_t packetSize_vkImportSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13057 | countingStream->rewind(); |
| 13058 | uint32_t opcode_vkImportSemaphoreWin32HandleKHR = OP_vkImportSemaphoreWin32HandleKHR; |
| 13059 | stream->write(&opcode_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 13060 | stream->write(&packetSize_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13061 | uint64_t cgen_var_1015; |
| 13062 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1015, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13063 | stream->write((uint64_t*)&cgen_var_1015, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13064 | marshal_VkImportSemaphoreWin32HandleInfoKHR(stream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13065 | VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 13066 | stream->read(&vkImportSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13067 | countingStream->clearPool(); |
| 13068 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13069 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13070 | return vkImportSemaphoreWin32HandleKHR_VkResult_return; |
| 13071 | } |
| 13072 | |
| 13073 | VkResult VkEncoder::vkGetSemaphoreWin32HandleKHR( |
| 13074 | VkDevice device, |
| 13075 | const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 13076 | HANDLE* pHandle) |
| 13077 | { |
| 13078 | auto stream = mImpl->stream(); |
| 13079 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13080 | auto resources = mImpl->resources(); |
| 13081 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13082 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13083 | VkDevice local_device; |
| 13084 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13085 | VkSemaphoreGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| 13086 | local_pGetWin32HandleInfo = nullptr; |
| 13087 | if (pGetWin32HandleInfo) |
| 13088 | { |
| 13089 | local_pGetWin32HandleInfo = (VkSemaphoreGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetWin32HandleInfoKHR)); |
| 13090 | deepcopy_VkSemaphoreGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 13091 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13092 | countingStream->rewind(); |
| 13093 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13094 | uint64_t cgen_var_1016; |
| 13095 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1016, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13096 | countingStream->write((uint64_t*)&cgen_var_1016, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13097 | marshal_VkSemaphoreGetWin32HandleInfoKHR(countingStream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13098 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 13099 | } |
| 13100 | uint32_t packetSize_vkGetSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13101 | countingStream->rewind(); |
| 13102 | uint32_t opcode_vkGetSemaphoreWin32HandleKHR = OP_vkGetSemaphoreWin32HandleKHR; |
| 13103 | stream->write(&opcode_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 13104 | stream->write(&packetSize_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13105 | uint64_t cgen_var_1017; |
| 13106 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1017, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13107 | stream->write((uint64_t*)&cgen_var_1017, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13108 | marshal_VkSemaphoreGetWin32HandleInfoKHR(stream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13109 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 13110 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 13111 | VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 13112 | stream->read(&vkGetSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13113 | countingStream->clearPool(); |
| 13114 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13115 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13116 | return vkGetSemaphoreWin32HandleKHR_VkResult_return; |
| 13117 | } |
| 13118 | |
| 13119 | #endif |
| 13120 | #ifdef VK_KHR_external_semaphore_fd |
| 13121 | VkResult VkEncoder::vkImportSemaphoreFdKHR( |
| 13122 | VkDevice device, |
| 13123 | const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) |
| 13124 | { |
| 13125 | auto stream = mImpl->stream(); |
| 13126 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13127 | auto resources = mImpl->resources(); |
| 13128 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13129 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13130 | VkDevice local_device; |
| 13131 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13132 | VkImportSemaphoreFdInfoKHR* local_pImportSemaphoreFdInfo; |
| 13133 | local_pImportSemaphoreFdInfo = nullptr; |
| 13134 | if (pImportSemaphoreFdInfo) |
| 13135 | { |
| 13136 | local_pImportSemaphoreFdInfo = (VkImportSemaphoreFdInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreFdInfoKHR)); |
| 13137 | deepcopy_VkImportSemaphoreFdInfoKHR(pool, pImportSemaphoreFdInfo, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| 13138 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13139 | countingStream->rewind(); |
| 13140 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13141 | uint64_t cgen_var_1018; |
| 13142 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1018, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13143 | countingStream->write((uint64_t*)&cgen_var_1018, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13144 | marshal_VkImportSemaphoreFdInfoKHR(countingStream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13145 | } |
| 13146 | uint32_t packetSize_vkImportSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13147 | countingStream->rewind(); |
| 13148 | uint32_t opcode_vkImportSemaphoreFdKHR = OP_vkImportSemaphoreFdKHR; |
| 13149 | stream->write(&opcode_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| 13150 | stream->write(&packetSize_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13151 | uint64_t cgen_var_1019; |
| 13152 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1019, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13153 | stream->write((uint64_t*)&cgen_var_1019, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13154 | marshal_VkImportSemaphoreFdInfoKHR(stream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13155 | VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 13156 | stream->read(&vkImportSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13157 | countingStream->clearPool(); |
| 13158 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13159 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13160 | return vkImportSemaphoreFdKHR_VkResult_return; |
| 13161 | } |
| 13162 | |
| 13163 | VkResult VkEncoder::vkGetSemaphoreFdKHR( |
| 13164 | VkDevice device, |
| 13165 | const VkSemaphoreGetFdInfoKHR* pGetFdInfo, |
| 13166 | int* pFd) |
| 13167 | { |
| 13168 | auto stream = mImpl->stream(); |
| 13169 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13170 | auto resources = mImpl->resources(); |
| 13171 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13172 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13173 | VkDevice local_device; |
| 13174 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13175 | VkSemaphoreGetFdInfoKHR* local_pGetFdInfo; |
| 13176 | local_pGetFdInfo = nullptr; |
| 13177 | if (pGetFdInfo) |
| 13178 | { |
| 13179 | local_pGetFdInfo = (VkSemaphoreGetFdInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetFdInfoKHR)); |
| 13180 | deepcopy_VkSemaphoreGetFdInfoKHR(pool, pGetFdInfo, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| 13181 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13182 | countingStream->rewind(); |
| 13183 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13184 | uint64_t cgen_var_1020; |
| 13185 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1020, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13186 | countingStream->write((uint64_t*)&cgen_var_1020, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13187 | marshal_VkSemaphoreGetFdInfoKHR(countingStream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13188 | countingStream->write((int*)pFd, sizeof(int)); |
| 13189 | } |
| 13190 | uint32_t packetSize_vkGetSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13191 | countingStream->rewind(); |
| 13192 | uint32_t opcode_vkGetSemaphoreFdKHR = OP_vkGetSemaphoreFdKHR; |
| 13193 | stream->write(&opcode_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| 13194 | stream->write(&packetSize_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13195 | uint64_t cgen_var_1021; |
| 13196 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1021, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13197 | stream->write((uint64_t*)&cgen_var_1021, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13198 | marshal_VkSemaphoreGetFdInfoKHR(stream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13199 | stream->write((int*)pFd, sizeof(int)); |
| 13200 | stream->read((int*)pFd, sizeof(int)); |
| 13201 | VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 13202 | stream->read(&vkGetSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13203 | countingStream->clearPool(); |
| 13204 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13205 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13206 | return vkGetSemaphoreFdKHR_VkResult_return; |
| 13207 | } |
| 13208 | |
| 13209 | #endif |
| 13210 | #ifdef VK_KHR_push_descriptor |
| 13211 | void VkEncoder::vkCmdPushDescriptorSetKHR( |
| 13212 | VkCommandBuffer commandBuffer, |
| 13213 | VkPipelineBindPoint pipelineBindPoint, |
| 13214 | VkPipelineLayout layout, |
| 13215 | uint32_t set, |
| 13216 | uint32_t descriptorWriteCount, |
| 13217 | const VkWriteDescriptorSet* pDescriptorWrites) |
| 13218 | { |
| 13219 | auto stream = mImpl->stream(); |
| 13220 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13221 | auto resources = mImpl->resources(); |
| 13222 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13223 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13224 | VkCommandBuffer local_commandBuffer; |
| 13225 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13226 | VkPipelineBindPoint local_pipelineBindPoint; |
| 13227 | local_pipelineBindPoint = pipelineBindPoint; |
| 13228 | VkPipelineLayout local_layout; |
| 13229 | local_layout = layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13230 | uint32_t local_set; |
| 13231 | local_set = set; |
| 13232 | uint32_t local_descriptorWriteCount; |
| 13233 | local_descriptorWriteCount = descriptorWriteCount; |
| 13234 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| 13235 | local_pDescriptorWrites = nullptr; |
| 13236 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13237 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13238 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13239 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 13240 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13241 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 13242 | } |
| 13243 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13244 | countingStream->rewind(); |
| 13245 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13246 | uint64_t cgen_var_1022; |
| 13247 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1022, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13248 | countingStream->write((uint64_t*)&cgen_var_1022, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13249 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13250 | uint64_t cgen_var_1023; |
| 13251 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1023, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13252 | countingStream->write((uint64_t*)&cgen_var_1023, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13253 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 13254 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 13255 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 13256 | { |
| 13257 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13258 | } |
| 13259 | } |
| 13260 | uint32_t packetSize_vkCmdPushDescriptorSetKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13261 | countingStream->rewind(); |
| 13262 | uint32_t opcode_vkCmdPushDescriptorSetKHR = OP_vkCmdPushDescriptorSetKHR; |
| 13263 | stream->write(&opcode_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| 13264 | stream->write(&packetSize_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13265 | uint64_t cgen_var_1024; |
| 13266 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1024, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13267 | stream->write((uint64_t*)&cgen_var_1024, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13268 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13269 | uint64_t cgen_var_1025; |
| 13270 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1025, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13271 | stream->write((uint64_t*)&cgen_var_1025, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13272 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 13273 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13274 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 13275 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13276 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13277 | } |
| 13278 | } |
| 13279 | |
| 13280 | void VkEncoder::vkCmdPushDescriptorSetWithTemplateKHR( |
| 13281 | VkCommandBuffer commandBuffer, |
| 13282 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 13283 | VkPipelineLayout layout, |
| 13284 | uint32_t set, |
| 13285 | const void* pData) |
| 13286 | { |
| 13287 | auto stream = mImpl->stream(); |
| 13288 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13289 | auto resources = mImpl->resources(); |
| 13290 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13291 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13292 | VkCommandBuffer local_commandBuffer; |
| 13293 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13294 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 13295 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13296 | VkPipelineLayout local_layout; |
| 13297 | local_layout = layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13298 | uint32_t local_set; |
| 13299 | local_set = set; |
| 13300 | void* local_pData; |
| 13301 | local_pData = nullptr; |
| 13302 | if (pData) |
| 13303 | { |
| 13304 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 13305 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13306 | countingStream->rewind(); |
| 13307 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13308 | uint64_t cgen_var_1026; |
| 13309 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1026, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13310 | countingStream->write((uint64_t*)&cgen_var_1026, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13311 | uint64_t cgen_var_1027; |
| 13312 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1027, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13313 | countingStream->write((uint64_t*)&cgen_var_1027, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13314 | uint64_t cgen_var_1028; |
| 13315 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1028, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13316 | countingStream->write((uint64_t*)&cgen_var_1028, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13317 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13318 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13319 | uint64_t cgen_var_1029 = (uint64_t)(uintptr_t)local_pData; |
| 13320 | countingStream->putBe64(cgen_var_1029); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13321 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13322 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13323 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13324 | } |
| 13325 | } |
| 13326 | uint32_t packetSize_vkCmdPushDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13327 | countingStream->rewind(); |
| 13328 | uint32_t opcode_vkCmdPushDescriptorSetWithTemplateKHR = OP_vkCmdPushDescriptorSetWithTemplateKHR; |
| 13329 | stream->write(&opcode_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 13330 | stream->write(&packetSize_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13331 | uint64_t cgen_var_1030; |
| 13332 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1030, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13333 | stream->write((uint64_t*)&cgen_var_1030, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13334 | uint64_t cgen_var_1031; |
| 13335 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1031, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13336 | stream->write((uint64_t*)&cgen_var_1031, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13337 | uint64_t cgen_var_1032; |
| 13338 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1032, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13339 | stream->write((uint64_t*)&cgen_var_1032, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13340 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13341 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13342 | uint64_t cgen_var_1033 = (uint64_t)(uintptr_t)local_pData; |
| 13343 | stream->putBe64(cgen_var_1033); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13344 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13345 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13346 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13347 | } |
| 13348 | } |
| 13349 | |
| 13350 | #endif |
| 13351 | #ifdef VK_KHR_16bit_storage |
| 13352 | #endif |
| 13353 | #ifdef VK_KHR_incremental_present |
| 13354 | #endif |
| 13355 | #ifdef VK_KHR_descriptor_update_template |
| 13356 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplateKHR( |
| 13357 | VkDevice device, |
| 13358 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 13359 | const VkAllocationCallbacks* pAllocator, |
| 13360 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 13361 | { |
| 13362 | auto stream = mImpl->stream(); |
| 13363 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13364 | auto resources = mImpl->resources(); |
| 13365 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13366 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13367 | VkDevice local_device; |
| 13368 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13369 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| 13370 | local_pCreateInfo = nullptr; |
| 13371 | if (pCreateInfo) |
| 13372 | { |
| 13373 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 13374 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 13375 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13376 | VkAllocationCallbacks* local_pAllocator; |
| 13377 | local_pAllocator = nullptr; |
| 13378 | if (pAllocator) |
| 13379 | { |
| 13380 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13381 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13382 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13383 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13384 | countingStream->rewind(); |
| 13385 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13386 | uint64_t cgen_var_1034; |
| 13387 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1034, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13388 | countingStream->write((uint64_t*)&cgen_var_1034, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13389 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13390 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13391 | uint64_t cgen_var_1035 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13392 | countingStream->putBe64(cgen_var_1035); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13393 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13394 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13395 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13396 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13397 | uint64_t cgen_var_1036; |
| 13398 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1036, 1); |
| 13399 | countingStream->write((uint64_t*)&cgen_var_1036, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13400 | } |
| 13401 | uint32_t packetSize_vkCreateDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13402 | countingStream->rewind(); |
| 13403 | uint32_t opcode_vkCreateDescriptorUpdateTemplateKHR = OP_vkCreateDescriptorUpdateTemplateKHR; |
| 13404 | stream->write(&opcode_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 13405 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13406 | uint64_t cgen_var_1037; |
| 13407 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1037, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13408 | stream->write((uint64_t*)&cgen_var_1037, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13409 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13410 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13411 | uint64_t cgen_var_1038 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13412 | stream->putBe64(cgen_var_1038); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13413 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13414 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13415 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13416 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13417 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13418 | uint64_t cgen_var_1039; |
| 13419 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1039, 1); |
| 13420 | stream->write((uint64_t*)&cgen_var_1039, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13421 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13422 | uint64_t cgen_var_1040; |
| 13423 | stream->read((uint64_t*)&cgen_var_1040, 8); |
| 13424 | stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_1040, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13425 | VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0; |
| 13426 | stream->read(&vkCreateDescriptorUpdateTemplateKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13427 | countingStream->clearPool(); |
| 13428 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13429 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13430 | return vkCreateDescriptorUpdateTemplateKHR_VkResult_return; |
| 13431 | } |
| 13432 | |
| 13433 | void VkEncoder::vkDestroyDescriptorUpdateTemplateKHR( |
| 13434 | VkDevice device, |
| 13435 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 13436 | const VkAllocationCallbacks* pAllocator) |
| 13437 | { |
| 13438 | auto stream = mImpl->stream(); |
| 13439 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13440 | auto resources = mImpl->resources(); |
| 13441 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13442 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13443 | VkDevice local_device; |
| 13444 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13445 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 13446 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13447 | VkAllocationCallbacks* local_pAllocator; |
| 13448 | local_pAllocator = nullptr; |
| 13449 | if (pAllocator) |
| 13450 | { |
| 13451 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13452 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13453 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13454 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13455 | countingStream->rewind(); |
| 13456 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13457 | uint64_t cgen_var_1041; |
| 13458 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1041, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13459 | countingStream->write((uint64_t*)&cgen_var_1041, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13460 | uint64_t cgen_var_1042; |
| 13461 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1042, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13462 | countingStream->write((uint64_t*)&cgen_var_1042, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13463 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13464 | uint64_t cgen_var_1043 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13465 | countingStream->putBe64(cgen_var_1043); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13466 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13467 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13468 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13469 | } |
| 13470 | } |
| 13471 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13472 | countingStream->rewind(); |
| 13473 | uint32_t opcode_vkDestroyDescriptorUpdateTemplateKHR = OP_vkDestroyDescriptorUpdateTemplateKHR; |
| 13474 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 13475 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13476 | uint64_t cgen_var_1044; |
| 13477 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1044, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13478 | stream->write((uint64_t*)&cgen_var_1044, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13479 | uint64_t cgen_var_1045; |
| 13480 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1045, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13481 | stream->write((uint64_t*)&cgen_var_1045, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13482 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13483 | uint64_t cgen_var_1046 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13484 | stream->putBe64(cgen_var_1046); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13485 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13486 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13487 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13488 | } |
| 13489 | } |
| 13490 | |
| 13491 | void VkEncoder::vkUpdateDescriptorSetWithTemplateKHR( |
| 13492 | VkDevice device, |
| 13493 | VkDescriptorSet descriptorSet, |
| 13494 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 13495 | const void* pData) |
| 13496 | { |
| 13497 | auto stream = mImpl->stream(); |
| 13498 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13499 | auto resources = mImpl->resources(); |
| 13500 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13501 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13502 | VkDevice local_device; |
| 13503 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13504 | VkDescriptorSet local_descriptorSet; |
| 13505 | local_descriptorSet = descriptorSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13506 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 13507 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13508 | void* local_pData; |
| 13509 | local_pData = nullptr; |
| 13510 | if (pData) |
| 13511 | { |
| 13512 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 13513 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13514 | countingStream->rewind(); |
| 13515 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13516 | uint64_t cgen_var_1047; |
| 13517 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1047, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13518 | countingStream->write((uint64_t*)&cgen_var_1047, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13519 | uint64_t cgen_var_1048; |
| 13520 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1048, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13521 | countingStream->write((uint64_t*)&cgen_var_1048, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13522 | uint64_t cgen_var_1049; |
| 13523 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1049, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13524 | countingStream->write((uint64_t*)&cgen_var_1049, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13525 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13526 | uint64_t cgen_var_1050 = (uint64_t)(uintptr_t)local_pData; |
| 13527 | countingStream->putBe64(cgen_var_1050); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13528 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13529 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13530 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13531 | } |
| 13532 | } |
| 13533 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13534 | countingStream->rewind(); |
| 13535 | uint32_t opcode_vkUpdateDescriptorSetWithTemplateKHR = OP_vkUpdateDescriptorSetWithTemplateKHR; |
| 13536 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 13537 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13538 | uint64_t cgen_var_1051; |
| 13539 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1051, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13540 | stream->write((uint64_t*)&cgen_var_1051, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13541 | uint64_t cgen_var_1052; |
| 13542 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1052, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13543 | stream->write((uint64_t*)&cgen_var_1052, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13544 | uint64_t cgen_var_1053; |
| 13545 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1053, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13546 | stream->write((uint64_t*)&cgen_var_1053, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13547 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13548 | uint64_t cgen_var_1054 = (uint64_t)(uintptr_t)local_pData; |
| 13549 | stream->putBe64(cgen_var_1054); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13550 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13551 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13552 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13553 | } |
| 13554 | } |
| 13555 | |
| 13556 | #endif |
| 13557 | #ifdef VK_KHR_create_renderpass2 |
| 13558 | VkResult VkEncoder::vkCreateRenderPass2KHR( |
| 13559 | VkDevice device, |
| 13560 | const VkRenderPassCreateInfo2KHR* pCreateInfo, |
| 13561 | const VkAllocationCallbacks* pAllocator, |
| 13562 | VkRenderPass* pRenderPass) |
| 13563 | { |
| 13564 | auto stream = mImpl->stream(); |
| 13565 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13566 | auto resources = mImpl->resources(); |
| 13567 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13568 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13569 | VkDevice local_device; |
| 13570 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13571 | VkRenderPassCreateInfo2KHR* local_pCreateInfo; |
| 13572 | local_pCreateInfo = nullptr; |
| 13573 | if (pCreateInfo) |
| 13574 | { |
| 13575 | local_pCreateInfo = (VkRenderPassCreateInfo2KHR*)pool->alloc(sizeof(const VkRenderPassCreateInfo2KHR)); |
| 13576 | deepcopy_VkRenderPassCreateInfo2KHR(pool, pCreateInfo, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| 13577 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13578 | VkAllocationCallbacks* local_pAllocator; |
| 13579 | local_pAllocator = nullptr; |
| 13580 | if (pAllocator) |
| 13581 | { |
| 13582 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13583 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13584 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13585 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13586 | countingStream->rewind(); |
| 13587 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13588 | uint64_t cgen_var_1055; |
| 13589 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1055, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13590 | countingStream->write((uint64_t*)&cgen_var_1055, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13591 | marshal_VkRenderPassCreateInfo2KHR(countingStream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13592 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13593 | uint64_t cgen_var_1056 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13594 | countingStream->putBe64(cgen_var_1056); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13595 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13596 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13597 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13598 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13599 | uint64_t cgen_var_1057; |
| 13600 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1057, 1); |
| 13601 | countingStream->write((uint64_t*)&cgen_var_1057, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13602 | } |
| 13603 | uint32_t packetSize_vkCreateRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13604 | countingStream->rewind(); |
| 13605 | uint32_t opcode_vkCreateRenderPass2KHR = OP_vkCreateRenderPass2KHR; |
| 13606 | stream->write(&opcode_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| 13607 | stream->write(&packetSize_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13608 | uint64_t cgen_var_1058; |
| 13609 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1058, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13610 | stream->write((uint64_t*)&cgen_var_1058, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13611 | marshal_VkRenderPassCreateInfo2KHR(stream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13612 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13613 | uint64_t cgen_var_1059 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13614 | stream->putBe64(cgen_var_1059); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13615 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13616 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13617 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13618 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13619 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13620 | uint64_t cgen_var_1060; |
| 13621 | stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1060, 1); |
| 13622 | stream->write((uint64_t*)&cgen_var_1060, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13623 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13624 | uint64_t cgen_var_1061; |
| 13625 | stream->read((uint64_t*)&cgen_var_1061, 8); |
| 13626 | stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_1061, (VkRenderPass*)pRenderPass, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13627 | VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0; |
| 13628 | stream->read(&vkCreateRenderPass2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13629 | countingStream->clearPool(); |
| 13630 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13631 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13632 | return vkCreateRenderPass2KHR_VkResult_return; |
| 13633 | } |
| 13634 | |
| 13635 | void VkEncoder::vkCmdBeginRenderPass2KHR( |
| 13636 | VkCommandBuffer commandBuffer, |
| 13637 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 13638 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo) |
| 13639 | { |
| 13640 | auto stream = mImpl->stream(); |
| 13641 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13642 | auto resources = mImpl->resources(); |
| 13643 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13644 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13645 | VkCommandBuffer local_commandBuffer; |
| 13646 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13647 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| 13648 | local_pRenderPassBegin = nullptr; |
| 13649 | if (pRenderPassBegin) |
| 13650 | { |
| 13651 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 13652 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 13653 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13654 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| 13655 | local_pSubpassBeginInfo = nullptr; |
| 13656 | if (pSubpassBeginInfo) |
| 13657 | { |
| 13658 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 13659 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 13660 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13661 | countingStream->rewind(); |
| 13662 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13663 | uint64_t cgen_var_1062; |
| 13664 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1062, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13665 | countingStream->write((uint64_t*)&cgen_var_1062, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13666 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 13667 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13668 | } |
| 13669 | uint32_t packetSize_vkCmdBeginRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13670 | countingStream->rewind(); |
| 13671 | uint32_t opcode_vkCmdBeginRenderPass2KHR = OP_vkCmdBeginRenderPass2KHR; |
| 13672 | stream->write(&opcode_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| 13673 | stream->write(&packetSize_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13674 | uint64_t cgen_var_1063; |
| 13675 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1063, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13676 | stream->write((uint64_t*)&cgen_var_1063, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13677 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 13678 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13679 | } |
| 13680 | |
| 13681 | void VkEncoder::vkCmdNextSubpass2KHR( |
| 13682 | VkCommandBuffer commandBuffer, |
| 13683 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo, |
| 13684 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 13685 | { |
| 13686 | auto stream = mImpl->stream(); |
| 13687 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13688 | auto resources = mImpl->resources(); |
| 13689 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13690 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13691 | VkCommandBuffer local_commandBuffer; |
| 13692 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13693 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| 13694 | local_pSubpassBeginInfo = nullptr; |
| 13695 | if (pSubpassBeginInfo) |
| 13696 | { |
| 13697 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 13698 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 13699 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13700 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| 13701 | local_pSubpassEndInfo = nullptr; |
| 13702 | if (pSubpassEndInfo) |
| 13703 | { |
| 13704 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 13705 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 13706 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13707 | countingStream->rewind(); |
| 13708 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13709 | uint64_t cgen_var_1064; |
| 13710 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1064, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13711 | countingStream->write((uint64_t*)&cgen_var_1064, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13712 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 13713 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13714 | } |
| 13715 | uint32_t packetSize_vkCmdNextSubpass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13716 | countingStream->rewind(); |
| 13717 | uint32_t opcode_vkCmdNextSubpass2KHR = OP_vkCmdNextSubpass2KHR; |
| 13718 | stream->write(&opcode_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| 13719 | stream->write(&packetSize_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13720 | uint64_t cgen_var_1065; |
| 13721 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1065, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13722 | stream->write((uint64_t*)&cgen_var_1065, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13723 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 13724 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13725 | } |
| 13726 | |
| 13727 | void VkEncoder::vkCmdEndRenderPass2KHR( |
| 13728 | VkCommandBuffer commandBuffer, |
| 13729 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 13730 | { |
| 13731 | auto stream = mImpl->stream(); |
| 13732 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13733 | auto resources = mImpl->resources(); |
| 13734 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13735 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13736 | VkCommandBuffer local_commandBuffer; |
| 13737 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13738 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| 13739 | local_pSubpassEndInfo = nullptr; |
| 13740 | if (pSubpassEndInfo) |
| 13741 | { |
| 13742 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 13743 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 13744 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13745 | countingStream->rewind(); |
| 13746 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13747 | uint64_t cgen_var_1066; |
| 13748 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1066, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13749 | countingStream->write((uint64_t*)&cgen_var_1066, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13750 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13751 | } |
| 13752 | uint32_t packetSize_vkCmdEndRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13753 | countingStream->rewind(); |
| 13754 | uint32_t opcode_vkCmdEndRenderPass2KHR = OP_vkCmdEndRenderPass2KHR; |
| 13755 | stream->write(&opcode_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| 13756 | stream->write(&packetSize_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13757 | uint64_t cgen_var_1067; |
| 13758 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1067, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13759 | stream->write((uint64_t*)&cgen_var_1067, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13760 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13761 | } |
| 13762 | |
| 13763 | #endif |
| 13764 | #ifdef VK_KHR_shared_presentable_image |
| 13765 | VkResult VkEncoder::vkGetSwapchainStatusKHR( |
| 13766 | VkDevice device, |
| 13767 | VkSwapchainKHR swapchain) |
| 13768 | { |
| 13769 | auto stream = mImpl->stream(); |
| 13770 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13771 | auto resources = mImpl->resources(); |
| 13772 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13773 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13774 | VkDevice local_device; |
| 13775 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13776 | VkSwapchainKHR local_swapchain; |
| 13777 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13778 | countingStream->rewind(); |
| 13779 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13780 | uint64_t cgen_var_1068; |
| 13781 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1068, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13782 | countingStream->write((uint64_t*)&cgen_var_1068, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13783 | uint64_t cgen_var_1069; |
| 13784 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1069, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13785 | countingStream->write((uint64_t*)&cgen_var_1069, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13786 | } |
| 13787 | uint32_t packetSize_vkGetSwapchainStatusKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13788 | countingStream->rewind(); |
| 13789 | uint32_t opcode_vkGetSwapchainStatusKHR = OP_vkGetSwapchainStatusKHR; |
| 13790 | stream->write(&opcode_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| 13791 | stream->write(&packetSize_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13792 | uint64_t cgen_var_1070; |
| 13793 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1070, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13794 | stream->write((uint64_t*)&cgen_var_1070, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13795 | uint64_t cgen_var_1071; |
| 13796 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1071, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13797 | stream->write((uint64_t*)&cgen_var_1071, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13798 | VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0; |
| 13799 | stream->read(&vkGetSwapchainStatusKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13800 | countingStream->clearPool(); |
| 13801 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13802 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13803 | return vkGetSwapchainStatusKHR_VkResult_return; |
| 13804 | } |
| 13805 | |
| 13806 | #endif |
| 13807 | #ifdef VK_KHR_external_fence_capabilities |
| 13808 | void VkEncoder::vkGetPhysicalDeviceExternalFencePropertiesKHR( |
| 13809 | VkPhysicalDevice physicalDevice, |
| 13810 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 13811 | VkExternalFenceProperties* pExternalFenceProperties) |
| 13812 | { |
| 13813 | auto stream = mImpl->stream(); |
| 13814 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13815 | auto resources = mImpl->resources(); |
| 13816 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13817 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13818 | VkPhysicalDevice local_physicalDevice; |
| 13819 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13820 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| 13821 | local_pExternalFenceInfo = nullptr; |
| 13822 | if (pExternalFenceInfo) |
| 13823 | { |
| 13824 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 13825 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 13826 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13827 | countingStream->rewind(); |
| 13828 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13829 | uint64_t cgen_var_1072; |
| 13830 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1072, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13831 | countingStream->write((uint64_t*)&cgen_var_1072, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13832 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13833 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 13834 | } |
| 13835 | uint32_t packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13836 | countingStream->rewind(); |
| 13837 | uint32_t opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR = OP_vkGetPhysicalDeviceExternalFencePropertiesKHR; |
| 13838 | stream->write(&opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| 13839 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13840 | uint64_t cgen_var_1073; |
| 13841 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1073, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13842 | stream->write((uint64_t*)&cgen_var_1073, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13843 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13844 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 13845 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 13846 | } |
| 13847 | |
| 13848 | #endif |
| 13849 | #ifdef VK_KHR_external_fence |
| 13850 | #endif |
| 13851 | #ifdef VK_KHR_external_fence_win32 |
| 13852 | VkResult VkEncoder::vkImportFenceWin32HandleKHR( |
| 13853 | VkDevice device, |
| 13854 | const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) |
| 13855 | { |
| 13856 | auto stream = mImpl->stream(); |
| 13857 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13858 | auto resources = mImpl->resources(); |
| 13859 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13860 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13861 | VkDevice local_device; |
| 13862 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13863 | VkImportFenceWin32HandleInfoKHR* local_pImportFenceWin32HandleInfo; |
| 13864 | local_pImportFenceWin32HandleInfo = nullptr; |
| 13865 | if (pImportFenceWin32HandleInfo) |
| 13866 | { |
| 13867 | local_pImportFenceWin32HandleInfo = (VkImportFenceWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportFenceWin32HandleInfoKHR)); |
| 13868 | deepcopy_VkImportFenceWin32HandleInfoKHR(pool, pImportFenceWin32HandleInfo, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| 13869 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13870 | countingStream->rewind(); |
| 13871 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13872 | uint64_t cgen_var_1074; |
| 13873 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1074, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13874 | countingStream->write((uint64_t*)&cgen_var_1074, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13875 | marshal_VkImportFenceWin32HandleInfoKHR(countingStream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13876 | } |
| 13877 | uint32_t packetSize_vkImportFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13878 | countingStream->rewind(); |
| 13879 | uint32_t opcode_vkImportFenceWin32HandleKHR = OP_vkImportFenceWin32HandleKHR; |
| 13880 | stream->write(&opcode_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| 13881 | stream->write(&packetSize_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13882 | uint64_t cgen_var_1075; |
| 13883 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1075, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13884 | stream->write((uint64_t*)&cgen_var_1075, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13885 | marshal_VkImportFenceWin32HandleInfoKHR(stream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13886 | VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 13887 | stream->read(&vkImportFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13888 | countingStream->clearPool(); |
| 13889 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13890 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13891 | return vkImportFenceWin32HandleKHR_VkResult_return; |
| 13892 | } |
| 13893 | |
| 13894 | VkResult VkEncoder::vkGetFenceWin32HandleKHR( |
| 13895 | VkDevice device, |
| 13896 | const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 13897 | HANDLE* pHandle) |
| 13898 | { |
| 13899 | auto stream = mImpl->stream(); |
| 13900 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13901 | auto resources = mImpl->resources(); |
| 13902 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13903 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13904 | VkDevice local_device; |
| 13905 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13906 | VkFenceGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| 13907 | local_pGetWin32HandleInfo = nullptr; |
| 13908 | if (pGetWin32HandleInfo) |
| 13909 | { |
| 13910 | local_pGetWin32HandleInfo = (VkFenceGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkFenceGetWin32HandleInfoKHR)); |
| 13911 | deepcopy_VkFenceGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 13912 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13913 | countingStream->rewind(); |
| 13914 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13915 | uint64_t cgen_var_1076; |
| 13916 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1076, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13917 | countingStream->write((uint64_t*)&cgen_var_1076, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13918 | marshal_VkFenceGetWin32HandleInfoKHR(countingStream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13919 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 13920 | } |
| 13921 | uint32_t packetSize_vkGetFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13922 | countingStream->rewind(); |
| 13923 | uint32_t opcode_vkGetFenceWin32HandleKHR = OP_vkGetFenceWin32HandleKHR; |
| 13924 | stream->write(&opcode_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| 13925 | stream->write(&packetSize_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13926 | uint64_t cgen_var_1077; |
| 13927 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1077, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13928 | stream->write((uint64_t*)&cgen_var_1077, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13929 | marshal_VkFenceGetWin32HandleInfoKHR(stream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13930 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 13931 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 13932 | VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 13933 | stream->read(&vkGetFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13934 | countingStream->clearPool(); |
| 13935 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13936 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13937 | return vkGetFenceWin32HandleKHR_VkResult_return; |
| 13938 | } |
| 13939 | |
| 13940 | #endif |
| 13941 | #ifdef VK_KHR_external_fence_fd |
| 13942 | VkResult VkEncoder::vkImportFenceFdKHR( |
| 13943 | VkDevice device, |
| 13944 | const VkImportFenceFdInfoKHR* pImportFenceFdInfo) |
| 13945 | { |
| 13946 | auto stream = mImpl->stream(); |
| 13947 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13948 | auto resources = mImpl->resources(); |
| 13949 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13950 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13951 | VkDevice local_device; |
| 13952 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13953 | VkImportFenceFdInfoKHR* local_pImportFenceFdInfo; |
| 13954 | local_pImportFenceFdInfo = nullptr; |
| 13955 | if (pImportFenceFdInfo) |
| 13956 | { |
| 13957 | local_pImportFenceFdInfo = (VkImportFenceFdInfoKHR*)pool->alloc(sizeof(const VkImportFenceFdInfoKHR)); |
| 13958 | deepcopy_VkImportFenceFdInfoKHR(pool, pImportFenceFdInfo, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| 13959 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13960 | countingStream->rewind(); |
| 13961 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13962 | uint64_t cgen_var_1078; |
| 13963 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1078, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13964 | countingStream->write((uint64_t*)&cgen_var_1078, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13965 | marshal_VkImportFenceFdInfoKHR(countingStream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13966 | } |
| 13967 | uint32_t packetSize_vkImportFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13968 | countingStream->rewind(); |
| 13969 | uint32_t opcode_vkImportFenceFdKHR = OP_vkImportFenceFdKHR; |
| 13970 | stream->write(&opcode_vkImportFenceFdKHR, sizeof(uint32_t)); |
| 13971 | stream->write(&packetSize_vkImportFenceFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13972 | uint64_t cgen_var_1079; |
| 13973 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1079, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13974 | stream->write((uint64_t*)&cgen_var_1079, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13975 | marshal_VkImportFenceFdInfoKHR(stream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13976 | VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0; |
| 13977 | stream->read(&vkImportFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13978 | countingStream->clearPool(); |
| 13979 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13980 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13981 | return vkImportFenceFdKHR_VkResult_return; |
| 13982 | } |
| 13983 | |
| 13984 | VkResult VkEncoder::vkGetFenceFdKHR( |
| 13985 | VkDevice device, |
| 13986 | const VkFenceGetFdInfoKHR* pGetFdInfo, |
| 13987 | int* pFd) |
| 13988 | { |
| 13989 | auto stream = mImpl->stream(); |
| 13990 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13991 | auto resources = mImpl->resources(); |
| 13992 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 13993 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13994 | VkDevice local_device; |
| 13995 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13996 | VkFenceGetFdInfoKHR* local_pGetFdInfo; |
| 13997 | local_pGetFdInfo = nullptr; |
| 13998 | if (pGetFdInfo) |
| 13999 | { |
| 14000 | local_pGetFdInfo = (VkFenceGetFdInfoKHR*)pool->alloc(sizeof(const VkFenceGetFdInfoKHR)); |
| 14001 | deepcopy_VkFenceGetFdInfoKHR(pool, pGetFdInfo, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| 14002 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14003 | countingStream->rewind(); |
| 14004 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14005 | uint64_t cgen_var_1080; |
| 14006 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1080, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14007 | countingStream->write((uint64_t*)&cgen_var_1080, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14008 | marshal_VkFenceGetFdInfoKHR(countingStream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14009 | countingStream->write((int*)pFd, sizeof(int)); |
| 14010 | } |
| 14011 | uint32_t packetSize_vkGetFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14012 | countingStream->rewind(); |
| 14013 | uint32_t opcode_vkGetFenceFdKHR = OP_vkGetFenceFdKHR; |
| 14014 | stream->write(&opcode_vkGetFenceFdKHR, sizeof(uint32_t)); |
| 14015 | stream->write(&packetSize_vkGetFenceFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14016 | uint64_t cgen_var_1081; |
| 14017 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1081, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14018 | stream->write((uint64_t*)&cgen_var_1081, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14019 | marshal_VkFenceGetFdInfoKHR(stream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14020 | stream->write((int*)pFd, sizeof(int)); |
| 14021 | stream->read((int*)pFd, sizeof(int)); |
| 14022 | VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0; |
| 14023 | stream->read(&vkGetFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14024 | countingStream->clearPool(); |
| 14025 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14026 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14027 | return vkGetFenceFdKHR_VkResult_return; |
| 14028 | } |
| 14029 | |
| 14030 | #endif |
| 14031 | #ifdef VK_KHR_maintenance2 |
| 14032 | #endif |
| 14033 | #ifdef VK_KHR_get_surface_capabilities2 |
| 14034 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2KHR( |
| 14035 | VkPhysicalDevice physicalDevice, |
| 14036 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 14037 | VkSurfaceCapabilities2KHR* pSurfaceCapabilities) |
| 14038 | { |
| 14039 | auto stream = mImpl->stream(); |
| 14040 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14041 | auto resources = mImpl->resources(); |
| 14042 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14043 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14044 | VkPhysicalDevice local_physicalDevice; |
| 14045 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14046 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| 14047 | local_pSurfaceInfo = nullptr; |
| 14048 | if (pSurfaceInfo) |
| 14049 | { |
| 14050 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 14051 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 14052 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14053 | countingStream->rewind(); |
| 14054 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14055 | uint64_t cgen_var_1082; |
| 14056 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1082, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14057 | countingStream->write((uint64_t*)&cgen_var_1082, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14058 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14059 | marshal_VkSurfaceCapabilities2KHR(countingStream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 14060 | } |
| 14061 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14062 | countingStream->rewind(); |
| 14063 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR = OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR; |
| 14064 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| 14065 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14066 | uint64_t cgen_var_1083; |
| 14067 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1083, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14068 | stream->write((uint64_t*)&cgen_var_1083, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14069 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14070 | marshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 14071 | unmarshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 14072 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0; |
| 14073 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14074 | countingStream->clearPool(); |
| 14075 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14076 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14077 | return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return; |
| 14078 | } |
| 14079 | |
| 14080 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormats2KHR( |
| 14081 | VkPhysicalDevice physicalDevice, |
| 14082 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 14083 | uint32_t* pSurfaceFormatCount, |
| 14084 | VkSurfaceFormat2KHR* pSurfaceFormats) |
| 14085 | { |
| 14086 | auto stream = mImpl->stream(); |
| 14087 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14088 | auto resources = mImpl->resources(); |
| 14089 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14090 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14091 | VkPhysicalDevice local_physicalDevice; |
| 14092 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14093 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| 14094 | local_pSurfaceInfo = nullptr; |
| 14095 | if (pSurfaceInfo) |
| 14096 | { |
| 14097 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 14098 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 14099 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14100 | countingStream->rewind(); |
| 14101 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14102 | uint64_t cgen_var_1084; |
| 14103 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1084, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14104 | countingStream->write((uint64_t*)&cgen_var_1084, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14105 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14106 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14107 | uint64_t cgen_var_1085 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 14108 | countingStream->putBe64(cgen_var_1085); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14109 | if (pSurfaceFormatCount) |
| 14110 | { |
| 14111 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 14112 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14113 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14114 | uint64_t cgen_var_1086 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 14115 | countingStream->putBe64(cgen_var_1086); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14116 | if (pSurfaceFormats) |
| 14117 | { |
| 14118 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 14119 | { |
| 14120 | marshal_VkSurfaceFormat2KHR(countingStream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 14121 | } |
| 14122 | } |
| 14123 | } |
| 14124 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14125 | countingStream->rewind(); |
| 14126 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormats2KHR = OP_vkGetPhysicalDeviceSurfaceFormats2KHR; |
| 14127 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| 14128 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14129 | uint64_t cgen_var_1087; |
| 14130 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1087, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14131 | stream->write((uint64_t*)&cgen_var_1087, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14132 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14133 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14134 | uint64_t cgen_var_1088 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 14135 | stream->putBe64(cgen_var_1088); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14136 | if (pSurfaceFormatCount) |
| 14137 | { |
| 14138 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 14139 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14140 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14141 | uint64_t cgen_var_1089 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 14142 | stream->putBe64(cgen_var_1089); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14143 | if (pSurfaceFormats) |
| 14144 | { |
| 14145 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 14146 | { |
| 14147 | marshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 14148 | } |
| 14149 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14150 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14151 | uint32_t* check_pSurfaceFormatCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14152 | check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14153 | if (pSurfaceFormatCount) |
| 14154 | { |
| 14155 | if (!(check_pSurfaceFormatCount)) |
| 14156 | { |
| 14157 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 14158 | } |
| 14159 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 14160 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14161 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14162 | VkSurfaceFormat2KHR* check_pSurfaceFormats; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14163 | check_pSurfaceFormats = (VkSurfaceFormat2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14164 | if (pSurfaceFormats) |
| 14165 | { |
| 14166 | if (!(check_pSurfaceFormats)) |
| 14167 | { |
| 14168 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 14169 | } |
| 14170 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 14171 | { |
| 14172 | unmarshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 14173 | } |
| 14174 | } |
| 14175 | VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0; |
| 14176 | stream->read(&vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14177 | countingStream->clearPool(); |
| 14178 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14179 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14180 | return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return; |
| 14181 | } |
| 14182 | |
| 14183 | #endif |
| 14184 | #ifdef VK_KHR_variable_pointers |
| 14185 | #endif |
| 14186 | #ifdef VK_KHR_get_display_properties2 |
| 14187 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayProperties2KHR( |
| 14188 | VkPhysicalDevice physicalDevice, |
| 14189 | uint32_t* pPropertyCount, |
| 14190 | VkDisplayProperties2KHR* pProperties) |
| 14191 | { |
| 14192 | auto stream = mImpl->stream(); |
| 14193 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14194 | auto resources = mImpl->resources(); |
| 14195 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14196 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14197 | VkPhysicalDevice local_physicalDevice; |
| 14198 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14199 | countingStream->rewind(); |
| 14200 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14201 | uint64_t cgen_var_1092; |
| 14202 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1092, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14203 | countingStream->write((uint64_t*)&cgen_var_1092, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14204 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14205 | uint64_t cgen_var_1093 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14206 | countingStream->putBe64(cgen_var_1093); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14207 | if (pPropertyCount) |
| 14208 | { |
| 14209 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14210 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14211 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14212 | uint64_t cgen_var_1094 = (uint64_t)(uintptr_t)pProperties; |
| 14213 | countingStream->putBe64(cgen_var_1094); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14214 | if (pProperties) |
| 14215 | { |
| 14216 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14217 | { |
| 14218 | marshal_VkDisplayProperties2KHR(countingStream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 14219 | } |
| 14220 | } |
| 14221 | } |
| 14222 | uint32_t packetSize_vkGetPhysicalDeviceDisplayProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14223 | countingStream->rewind(); |
| 14224 | uint32_t opcode_vkGetPhysicalDeviceDisplayProperties2KHR = OP_vkGetPhysicalDeviceDisplayProperties2KHR; |
| 14225 | stream->write(&opcode_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| 14226 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14227 | uint64_t cgen_var_1095; |
| 14228 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1095, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14229 | stream->write((uint64_t*)&cgen_var_1095, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14230 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14231 | uint64_t cgen_var_1096 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14232 | stream->putBe64(cgen_var_1096); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14233 | if (pPropertyCount) |
| 14234 | { |
| 14235 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14236 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14237 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14238 | uint64_t cgen_var_1097 = (uint64_t)(uintptr_t)pProperties; |
| 14239 | stream->putBe64(cgen_var_1097); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14240 | if (pProperties) |
| 14241 | { |
| 14242 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14243 | { |
| 14244 | marshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 14245 | } |
| 14246 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14247 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14248 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14249 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14250 | if (pPropertyCount) |
| 14251 | { |
| 14252 | if (!(check_pPropertyCount)) |
| 14253 | { |
| 14254 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 14255 | } |
| 14256 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14257 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14258 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14259 | VkDisplayProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14260 | check_pProperties = (VkDisplayProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14261 | if (pProperties) |
| 14262 | { |
| 14263 | if (!(check_pProperties)) |
| 14264 | { |
| 14265 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 14266 | } |
| 14267 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14268 | { |
| 14269 | unmarshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 14270 | } |
| 14271 | } |
| 14272 | VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0; |
| 14273 | stream->read(&vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14274 | countingStream->clearPool(); |
| 14275 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14276 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14277 | return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return; |
| 14278 | } |
| 14279 | |
| 14280 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlaneProperties2KHR( |
| 14281 | VkPhysicalDevice physicalDevice, |
| 14282 | uint32_t* pPropertyCount, |
| 14283 | VkDisplayPlaneProperties2KHR* pProperties) |
| 14284 | { |
| 14285 | auto stream = mImpl->stream(); |
| 14286 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14287 | auto resources = mImpl->resources(); |
| 14288 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14289 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14290 | VkPhysicalDevice local_physicalDevice; |
| 14291 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14292 | countingStream->rewind(); |
| 14293 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14294 | uint64_t cgen_var_1100; |
| 14295 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1100, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14296 | countingStream->write((uint64_t*)&cgen_var_1100, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14297 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14298 | uint64_t cgen_var_1101 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14299 | countingStream->putBe64(cgen_var_1101); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14300 | if (pPropertyCount) |
| 14301 | { |
| 14302 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14303 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14304 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14305 | uint64_t cgen_var_1102 = (uint64_t)(uintptr_t)pProperties; |
| 14306 | countingStream->putBe64(cgen_var_1102); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14307 | if (pProperties) |
| 14308 | { |
| 14309 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14310 | { |
| 14311 | marshal_VkDisplayPlaneProperties2KHR(countingStream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 14312 | } |
| 14313 | } |
| 14314 | } |
| 14315 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14316 | countingStream->rewind(); |
| 14317 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR; |
| 14318 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| 14319 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14320 | uint64_t cgen_var_1103; |
| 14321 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1103, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14322 | stream->write((uint64_t*)&cgen_var_1103, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14323 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14324 | uint64_t cgen_var_1104 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14325 | stream->putBe64(cgen_var_1104); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14326 | if (pPropertyCount) |
| 14327 | { |
| 14328 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14329 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14330 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14331 | uint64_t cgen_var_1105 = (uint64_t)(uintptr_t)pProperties; |
| 14332 | stream->putBe64(cgen_var_1105); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14333 | if (pProperties) |
| 14334 | { |
| 14335 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14336 | { |
| 14337 | marshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 14338 | } |
| 14339 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14340 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14341 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14342 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14343 | if (pPropertyCount) |
| 14344 | { |
| 14345 | if (!(check_pPropertyCount)) |
| 14346 | { |
| 14347 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 14348 | } |
| 14349 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14350 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14351 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14352 | VkDisplayPlaneProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14353 | check_pProperties = (VkDisplayPlaneProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14354 | if (pProperties) |
| 14355 | { |
| 14356 | if (!(check_pProperties)) |
| 14357 | { |
| 14358 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 14359 | } |
| 14360 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14361 | { |
| 14362 | unmarshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 14363 | } |
| 14364 | } |
| 14365 | VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0; |
| 14366 | stream->read(&vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14367 | countingStream->clearPool(); |
| 14368 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14369 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14370 | return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return; |
| 14371 | } |
| 14372 | |
| 14373 | VkResult VkEncoder::vkGetDisplayModeProperties2KHR( |
| 14374 | VkPhysicalDevice physicalDevice, |
| 14375 | VkDisplayKHR display, |
| 14376 | uint32_t* pPropertyCount, |
| 14377 | VkDisplayModeProperties2KHR* pProperties) |
| 14378 | { |
| 14379 | auto stream = mImpl->stream(); |
| 14380 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14381 | auto resources = mImpl->resources(); |
| 14382 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14383 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14384 | VkPhysicalDevice local_physicalDevice; |
| 14385 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14386 | VkDisplayKHR local_display; |
| 14387 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14388 | countingStream->rewind(); |
| 14389 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14390 | uint64_t cgen_var_1108; |
| 14391 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1108, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14392 | countingStream->write((uint64_t*)&cgen_var_1108, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14393 | uint64_t cgen_var_1109; |
| 14394 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1109, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14395 | countingStream->write((uint64_t*)&cgen_var_1109, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14396 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14397 | uint64_t cgen_var_1110 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14398 | countingStream->putBe64(cgen_var_1110); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14399 | if (pPropertyCount) |
| 14400 | { |
| 14401 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14402 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14403 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14404 | uint64_t cgen_var_1111 = (uint64_t)(uintptr_t)pProperties; |
| 14405 | countingStream->putBe64(cgen_var_1111); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14406 | if (pProperties) |
| 14407 | { |
| 14408 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14409 | { |
| 14410 | marshal_VkDisplayModeProperties2KHR(countingStream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 14411 | } |
| 14412 | } |
| 14413 | } |
| 14414 | uint32_t packetSize_vkGetDisplayModeProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14415 | countingStream->rewind(); |
| 14416 | uint32_t opcode_vkGetDisplayModeProperties2KHR = OP_vkGetDisplayModeProperties2KHR; |
| 14417 | stream->write(&opcode_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| 14418 | stream->write(&packetSize_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14419 | uint64_t cgen_var_1112; |
| 14420 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1112, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14421 | stream->write((uint64_t*)&cgen_var_1112, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14422 | uint64_t cgen_var_1113; |
| 14423 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1113, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14424 | stream->write((uint64_t*)&cgen_var_1113, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14425 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14426 | uint64_t cgen_var_1114 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14427 | stream->putBe64(cgen_var_1114); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14428 | if (pPropertyCount) |
| 14429 | { |
| 14430 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14431 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14432 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14433 | uint64_t cgen_var_1115 = (uint64_t)(uintptr_t)pProperties; |
| 14434 | stream->putBe64(cgen_var_1115); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14435 | if (pProperties) |
| 14436 | { |
| 14437 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14438 | { |
| 14439 | marshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 14440 | } |
| 14441 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14442 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14443 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14444 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14445 | if (pPropertyCount) |
| 14446 | { |
| 14447 | if (!(check_pPropertyCount)) |
| 14448 | { |
| 14449 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 14450 | } |
| 14451 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14452 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14453 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14454 | VkDisplayModeProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14455 | check_pProperties = (VkDisplayModeProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14456 | if (pProperties) |
| 14457 | { |
| 14458 | if (!(check_pProperties)) |
| 14459 | { |
| 14460 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 14461 | } |
| 14462 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14463 | { |
| 14464 | unmarshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 14465 | } |
| 14466 | } |
| 14467 | VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0; |
| 14468 | stream->read(&vkGetDisplayModeProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14469 | countingStream->clearPool(); |
| 14470 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14471 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14472 | return vkGetDisplayModeProperties2KHR_VkResult_return; |
| 14473 | } |
| 14474 | |
| 14475 | VkResult VkEncoder::vkGetDisplayPlaneCapabilities2KHR( |
| 14476 | VkPhysicalDevice physicalDevice, |
| 14477 | const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, |
| 14478 | VkDisplayPlaneCapabilities2KHR* pCapabilities) |
| 14479 | { |
| 14480 | auto stream = mImpl->stream(); |
| 14481 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14482 | auto resources = mImpl->resources(); |
| 14483 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14484 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14485 | VkPhysicalDevice local_physicalDevice; |
| 14486 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14487 | VkDisplayPlaneInfo2KHR* local_pDisplayPlaneInfo; |
| 14488 | local_pDisplayPlaneInfo = nullptr; |
| 14489 | if (pDisplayPlaneInfo) |
| 14490 | { |
| 14491 | local_pDisplayPlaneInfo = (VkDisplayPlaneInfo2KHR*)pool->alloc(sizeof(const VkDisplayPlaneInfo2KHR)); |
| 14492 | deepcopy_VkDisplayPlaneInfo2KHR(pool, pDisplayPlaneInfo, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| 14493 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14494 | countingStream->rewind(); |
| 14495 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14496 | uint64_t cgen_var_1118; |
| 14497 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1118, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14498 | countingStream->write((uint64_t*)&cgen_var_1118, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14499 | marshal_VkDisplayPlaneInfo2KHR(countingStream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14500 | marshal_VkDisplayPlaneCapabilities2KHR(countingStream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 14501 | } |
| 14502 | uint32_t packetSize_vkGetDisplayPlaneCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14503 | countingStream->rewind(); |
| 14504 | uint32_t opcode_vkGetDisplayPlaneCapabilities2KHR = OP_vkGetDisplayPlaneCapabilities2KHR; |
| 14505 | stream->write(&opcode_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| 14506 | stream->write(&packetSize_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14507 | uint64_t cgen_var_1119; |
| 14508 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1119, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14509 | stream->write((uint64_t*)&cgen_var_1119, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14510 | marshal_VkDisplayPlaneInfo2KHR(stream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14511 | marshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 14512 | unmarshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 14513 | VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0; |
| 14514 | stream->read(&vkGetDisplayPlaneCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14515 | countingStream->clearPool(); |
| 14516 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14517 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14518 | return vkGetDisplayPlaneCapabilities2KHR_VkResult_return; |
| 14519 | } |
| 14520 | |
| 14521 | #endif |
| 14522 | #ifdef VK_KHR_dedicated_allocation |
| 14523 | #endif |
| 14524 | #ifdef VK_KHR_storage_buffer_storage_class |
| 14525 | #endif |
| 14526 | #ifdef VK_KHR_relaxed_block_layout |
| 14527 | #endif |
| 14528 | #ifdef VK_KHR_get_memory_requirements2 |
| 14529 | void VkEncoder::vkGetImageMemoryRequirements2KHR( |
| 14530 | VkDevice device, |
| 14531 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 14532 | VkMemoryRequirements2* pMemoryRequirements) |
| 14533 | { |
| 14534 | auto stream = mImpl->stream(); |
| 14535 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14536 | auto resources = mImpl->resources(); |
| 14537 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14538 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14539 | VkDevice local_device; |
| 14540 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14541 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| 14542 | local_pInfo = nullptr; |
| 14543 | if (pInfo) |
| 14544 | { |
| 14545 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 14546 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 14547 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14548 | countingStream->rewind(); |
| 14549 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14550 | uint64_t cgen_var_1120; |
| 14551 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1120, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14552 | countingStream->write((uint64_t*)&cgen_var_1120, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14553 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14554 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 14555 | } |
| 14556 | uint32_t packetSize_vkGetImageMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14557 | countingStream->rewind(); |
| 14558 | uint32_t opcode_vkGetImageMemoryRequirements2KHR = OP_vkGetImageMemoryRequirements2KHR; |
| 14559 | stream->write(&opcode_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| 14560 | stream->write(&packetSize_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14561 | uint64_t cgen_var_1121; |
| 14562 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1121, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14563 | stream->write((uint64_t*)&cgen_var_1121, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14564 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14565 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 14566 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 14567 | } |
| 14568 | |
| 14569 | void VkEncoder::vkGetBufferMemoryRequirements2KHR( |
| 14570 | VkDevice device, |
| 14571 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 14572 | VkMemoryRequirements2* pMemoryRequirements) |
| 14573 | { |
| 14574 | auto stream = mImpl->stream(); |
| 14575 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14576 | auto resources = mImpl->resources(); |
| 14577 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14578 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14579 | VkDevice local_device; |
| 14580 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14581 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| 14582 | local_pInfo = nullptr; |
| 14583 | if (pInfo) |
| 14584 | { |
| 14585 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 14586 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 14587 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14588 | countingStream->rewind(); |
| 14589 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14590 | uint64_t cgen_var_1122; |
| 14591 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1122, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14592 | countingStream->write((uint64_t*)&cgen_var_1122, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14593 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14594 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 14595 | } |
| 14596 | uint32_t packetSize_vkGetBufferMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14597 | countingStream->rewind(); |
| 14598 | uint32_t opcode_vkGetBufferMemoryRequirements2KHR = OP_vkGetBufferMemoryRequirements2KHR; |
| 14599 | stream->write(&opcode_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| 14600 | stream->write(&packetSize_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14601 | uint64_t cgen_var_1123; |
| 14602 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1123, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14603 | stream->write((uint64_t*)&cgen_var_1123, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14604 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14605 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 14606 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 14607 | } |
| 14608 | |
| 14609 | void VkEncoder::vkGetImageSparseMemoryRequirements2KHR( |
| 14610 | VkDevice device, |
| 14611 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 14612 | uint32_t* pSparseMemoryRequirementCount, |
| 14613 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 14614 | { |
| 14615 | auto stream = mImpl->stream(); |
| 14616 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14617 | auto resources = mImpl->resources(); |
| 14618 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14619 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14620 | VkDevice local_device; |
| 14621 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14622 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| 14623 | local_pInfo = nullptr; |
| 14624 | if (pInfo) |
| 14625 | { |
| 14626 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 14627 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 14628 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14629 | countingStream->rewind(); |
| 14630 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14631 | uint64_t cgen_var_1124; |
| 14632 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1124, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14633 | countingStream->write((uint64_t*)&cgen_var_1124, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14634 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14635 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14636 | uint64_t cgen_var_1125 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 14637 | countingStream->putBe64(cgen_var_1125); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14638 | if (pSparseMemoryRequirementCount) |
| 14639 | { |
| 14640 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 14641 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14642 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14643 | uint64_t cgen_var_1126 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 14644 | countingStream->putBe64(cgen_var_1126); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14645 | if (pSparseMemoryRequirements) |
| 14646 | { |
| 14647 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 14648 | { |
| 14649 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 14650 | } |
| 14651 | } |
| 14652 | } |
| 14653 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14654 | countingStream->rewind(); |
| 14655 | uint32_t opcode_vkGetImageSparseMemoryRequirements2KHR = OP_vkGetImageSparseMemoryRequirements2KHR; |
| 14656 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| 14657 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14658 | uint64_t cgen_var_1127; |
| 14659 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1127, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14660 | stream->write((uint64_t*)&cgen_var_1127, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14661 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14662 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14663 | uint64_t cgen_var_1128 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 14664 | stream->putBe64(cgen_var_1128); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14665 | if (pSparseMemoryRequirementCount) |
| 14666 | { |
| 14667 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 14668 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14669 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14670 | uint64_t cgen_var_1129 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 14671 | stream->putBe64(cgen_var_1129); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14672 | if (pSparseMemoryRequirements) |
| 14673 | { |
| 14674 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 14675 | { |
| 14676 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 14677 | } |
| 14678 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14679 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14680 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14681 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14682 | if (pSparseMemoryRequirementCount) |
| 14683 | { |
| 14684 | if (!(check_pSparseMemoryRequirementCount)) |
| 14685 | { |
| 14686 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 14687 | } |
| 14688 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 14689 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14690 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14691 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14692 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14693 | if (pSparseMemoryRequirements) |
| 14694 | { |
| 14695 | if (!(check_pSparseMemoryRequirements)) |
| 14696 | { |
| 14697 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 14698 | } |
| 14699 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 14700 | { |
| 14701 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 14702 | } |
| 14703 | } |
| 14704 | } |
| 14705 | |
| 14706 | #endif |
| 14707 | #ifdef VK_KHR_image_format_list |
| 14708 | #endif |
| 14709 | #ifdef VK_KHR_sampler_ycbcr_conversion |
| 14710 | VkResult VkEncoder::vkCreateSamplerYcbcrConversionKHR( |
| 14711 | VkDevice device, |
| 14712 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 14713 | const VkAllocationCallbacks* pAllocator, |
| 14714 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 14715 | { |
| 14716 | auto stream = mImpl->stream(); |
| 14717 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14718 | auto resources = mImpl->resources(); |
| 14719 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14720 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14721 | VkDevice local_device; |
| 14722 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14723 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| 14724 | local_pCreateInfo = nullptr; |
| 14725 | if (pCreateInfo) |
| 14726 | { |
| 14727 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 14728 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 14729 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14730 | VkAllocationCallbacks* local_pAllocator; |
| 14731 | local_pAllocator = nullptr; |
| 14732 | if (pAllocator) |
| 14733 | { |
| 14734 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14735 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14736 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 14737 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14738 | countingStream->rewind(); |
| 14739 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14740 | uint64_t cgen_var_1132; |
| 14741 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1132, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14742 | countingStream->write((uint64_t*)&cgen_var_1132, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14743 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14744 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14745 | uint64_t cgen_var_1133 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14746 | countingStream->putBe64(cgen_var_1133); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14747 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14748 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14749 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14750 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14751 | uint64_t cgen_var_1134; |
| 14752 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1134, 1); |
| 14753 | countingStream->write((uint64_t*)&cgen_var_1134, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14754 | } |
| 14755 | uint32_t packetSize_vkCreateSamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14756 | countingStream->rewind(); |
| 14757 | uint32_t opcode_vkCreateSamplerYcbcrConversionKHR = OP_vkCreateSamplerYcbcrConversionKHR; |
| 14758 | stream->write(&opcode_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 14759 | stream->write(&packetSize_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14760 | uint64_t cgen_var_1135; |
| 14761 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1135, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14762 | stream->write((uint64_t*)&cgen_var_1135, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14763 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14764 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14765 | uint64_t cgen_var_1136 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14766 | stream->putBe64(cgen_var_1136); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14767 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14768 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14769 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14770 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14771 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14772 | uint64_t cgen_var_1137; |
| 14773 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1137, 1); |
| 14774 | stream->write((uint64_t*)&cgen_var_1137, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14775 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14776 | uint64_t cgen_var_1138; |
| 14777 | stream->read((uint64_t*)&cgen_var_1138, 8); |
| 14778 | stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_1138, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14779 | VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0; |
| 14780 | stream->read(&vkCreateSamplerYcbcrConversionKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14781 | countingStream->clearPool(); |
| 14782 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14783 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14784 | return vkCreateSamplerYcbcrConversionKHR_VkResult_return; |
| 14785 | } |
| 14786 | |
| 14787 | void VkEncoder::vkDestroySamplerYcbcrConversionKHR( |
| 14788 | VkDevice device, |
| 14789 | VkSamplerYcbcrConversion ycbcrConversion, |
| 14790 | const VkAllocationCallbacks* pAllocator) |
| 14791 | { |
| 14792 | auto stream = mImpl->stream(); |
| 14793 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14794 | auto resources = mImpl->resources(); |
| 14795 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14796 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14797 | VkDevice local_device; |
| 14798 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14799 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| 14800 | local_ycbcrConversion = ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14801 | VkAllocationCallbacks* local_pAllocator; |
| 14802 | local_pAllocator = nullptr; |
| 14803 | if (pAllocator) |
| 14804 | { |
| 14805 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14806 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14807 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 14808 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14809 | countingStream->rewind(); |
| 14810 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14811 | uint64_t cgen_var_1139; |
| 14812 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1139, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14813 | countingStream->write((uint64_t*)&cgen_var_1139, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14814 | uint64_t cgen_var_1140; |
| 14815 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1140, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14816 | countingStream->write((uint64_t*)&cgen_var_1140, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14817 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14818 | uint64_t cgen_var_1141 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14819 | countingStream->putBe64(cgen_var_1141); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14820 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14821 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14822 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14823 | } |
| 14824 | } |
| 14825 | uint32_t packetSize_vkDestroySamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14826 | countingStream->rewind(); |
| 14827 | uint32_t opcode_vkDestroySamplerYcbcrConversionKHR = OP_vkDestroySamplerYcbcrConversionKHR; |
| 14828 | stream->write(&opcode_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 14829 | stream->write(&packetSize_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14830 | uint64_t cgen_var_1142; |
| 14831 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1142, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14832 | stream->write((uint64_t*)&cgen_var_1142, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14833 | uint64_t cgen_var_1143; |
| 14834 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1143, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14835 | stream->write((uint64_t*)&cgen_var_1143, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14836 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14837 | uint64_t cgen_var_1144 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14838 | stream->putBe64(cgen_var_1144); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14839 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14840 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14841 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14842 | } |
| 14843 | } |
| 14844 | |
| 14845 | #endif |
| 14846 | #ifdef VK_KHR_bind_memory2 |
| 14847 | VkResult VkEncoder::vkBindBufferMemory2KHR( |
| 14848 | VkDevice device, |
| 14849 | uint32_t bindInfoCount, |
| 14850 | const VkBindBufferMemoryInfo* pBindInfos) |
| 14851 | { |
| 14852 | auto stream = mImpl->stream(); |
| 14853 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14854 | auto resources = mImpl->resources(); |
| 14855 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14856 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14857 | VkDevice local_device; |
| 14858 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14859 | uint32_t local_bindInfoCount; |
| 14860 | local_bindInfoCount = bindInfoCount; |
| 14861 | VkBindBufferMemoryInfo* local_pBindInfos; |
| 14862 | local_pBindInfos = nullptr; |
| 14863 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14864 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14865 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14866 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 14867 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14868 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 14869 | } |
| 14870 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14871 | countingStream->rewind(); |
| 14872 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14873 | uint64_t cgen_var_1145; |
| 14874 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1145, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14875 | countingStream->write((uint64_t*)&cgen_var_1145, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14876 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 14877 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 14878 | { |
| 14879 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14880 | } |
| 14881 | } |
| 14882 | uint32_t packetSize_vkBindBufferMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14883 | countingStream->rewind(); |
| 14884 | uint32_t opcode_vkBindBufferMemory2KHR = OP_vkBindBufferMemory2KHR; |
| 14885 | stream->write(&opcode_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| 14886 | stream->write(&packetSize_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14887 | uint64_t cgen_var_1146; |
| 14888 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1146, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14889 | stream->write((uint64_t*)&cgen_var_1146, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14890 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14891 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 14892 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14893 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14894 | } |
| 14895 | VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0; |
| 14896 | stream->read(&vkBindBufferMemory2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14897 | countingStream->clearPool(); |
| 14898 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14899 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14900 | return vkBindBufferMemory2KHR_VkResult_return; |
| 14901 | } |
| 14902 | |
| 14903 | VkResult VkEncoder::vkBindImageMemory2KHR( |
| 14904 | VkDevice device, |
| 14905 | uint32_t bindInfoCount, |
| 14906 | const VkBindImageMemoryInfo* pBindInfos) |
| 14907 | { |
| 14908 | auto stream = mImpl->stream(); |
| 14909 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14910 | auto resources = mImpl->resources(); |
| 14911 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14912 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14913 | VkDevice local_device; |
| 14914 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14915 | uint32_t local_bindInfoCount; |
| 14916 | local_bindInfoCount = bindInfoCount; |
| 14917 | VkBindImageMemoryInfo* local_pBindInfos; |
| 14918 | local_pBindInfos = nullptr; |
| 14919 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14920 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14921 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14922 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 14923 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14924 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 14925 | } |
| 14926 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14927 | countingStream->rewind(); |
| 14928 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14929 | uint64_t cgen_var_1147; |
| 14930 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1147, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14931 | countingStream->write((uint64_t*)&cgen_var_1147, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14932 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 14933 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 14934 | { |
| 14935 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14936 | } |
| 14937 | } |
| 14938 | uint32_t packetSize_vkBindImageMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14939 | countingStream->rewind(); |
| 14940 | uint32_t opcode_vkBindImageMemory2KHR = OP_vkBindImageMemory2KHR; |
| 14941 | stream->write(&opcode_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| 14942 | stream->write(&packetSize_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14943 | uint64_t cgen_var_1148; |
| 14944 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1148, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14945 | stream->write((uint64_t*)&cgen_var_1148, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14946 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14947 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 14948 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14949 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14950 | } |
| 14951 | VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0; |
| 14952 | stream->read(&vkBindImageMemory2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14953 | countingStream->clearPool(); |
| 14954 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14955 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14956 | return vkBindImageMemory2KHR_VkResult_return; |
| 14957 | } |
| 14958 | |
| 14959 | #endif |
| 14960 | #ifdef VK_KHR_maintenance3 |
| 14961 | void VkEncoder::vkGetDescriptorSetLayoutSupportKHR( |
| 14962 | VkDevice device, |
| 14963 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 14964 | VkDescriptorSetLayoutSupport* pSupport) |
| 14965 | { |
| 14966 | auto stream = mImpl->stream(); |
| 14967 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14968 | auto resources = mImpl->resources(); |
| 14969 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14970 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14971 | VkDevice local_device; |
| 14972 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14973 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| 14974 | local_pCreateInfo = nullptr; |
| 14975 | if (pCreateInfo) |
| 14976 | { |
| 14977 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 14978 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 14979 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14980 | countingStream->rewind(); |
| 14981 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14982 | uint64_t cgen_var_1149; |
| 14983 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1149, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14984 | countingStream->write((uint64_t*)&cgen_var_1149, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14985 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14986 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 14987 | } |
| 14988 | uint32_t packetSize_vkGetDescriptorSetLayoutSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14989 | countingStream->rewind(); |
| 14990 | uint32_t opcode_vkGetDescriptorSetLayoutSupportKHR = OP_vkGetDescriptorSetLayoutSupportKHR; |
| 14991 | stream->write(&opcode_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| 14992 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14993 | uint64_t cgen_var_1150; |
| 14994 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1150, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 14995 | stream->write((uint64_t*)&cgen_var_1150, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14996 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14997 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 14998 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 14999 | } |
| 15000 | |
| 15001 | #endif |
| 15002 | #ifdef VK_KHR_draw_indirect_count |
| 15003 | void VkEncoder::vkCmdDrawIndirectCountKHR( |
| 15004 | VkCommandBuffer commandBuffer, |
| 15005 | VkBuffer buffer, |
| 15006 | VkDeviceSize offset, |
| 15007 | VkBuffer countBuffer, |
| 15008 | VkDeviceSize countBufferOffset, |
| 15009 | uint32_t maxDrawCount, |
| 15010 | uint32_t stride) |
| 15011 | { |
| 15012 | auto stream = mImpl->stream(); |
| 15013 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15014 | auto resources = mImpl->resources(); |
| 15015 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15016 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15017 | VkCommandBuffer local_commandBuffer; |
| 15018 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15019 | VkBuffer local_buffer; |
| 15020 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15021 | VkDeviceSize local_offset; |
| 15022 | local_offset = offset; |
| 15023 | VkBuffer local_countBuffer; |
| 15024 | local_countBuffer = countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15025 | VkDeviceSize local_countBufferOffset; |
| 15026 | local_countBufferOffset = countBufferOffset; |
| 15027 | uint32_t local_maxDrawCount; |
| 15028 | local_maxDrawCount = maxDrawCount; |
| 15029 | uint32_t local_stride; |
| 15030 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15031 | countingStream->rewind(); |
| 15032 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15033 | uint64_t cgen_var_1151; |
| 15034 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1151, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15035 | countingStream->write((uint64_t*)&cgen_var_1151, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15036 | uint64_t cgen_var_1152; |
| 15037 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1152, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15038 | countingStream->write((uint64_t*)&cgen_var_1152, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15039 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15040 | uint64_t cgen_var_1153; |
| 15041 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1153, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15042 | countingStream->write((uint64_t*)&cgen_var_1153, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15043 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 15044 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 15045 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15046 | } |
| 15047 | uint32_t packetSize_vkCmdDrawIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15048 | countingStream->rewind(); |
| 15049 | uint32_t opcode_vkCmdDrawIndirectCountKHR = OP_vkCmdDrawIndirectCountKHR; |
| 15050 | stream->write(&opcode_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| 15051 | stream->write(&packetSize_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15052 | uint64_t cgen_var_1154; |
| 15053 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1154, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15054 | stream->write((uint64_t*)&cgen_var_1154, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15055 | uint64_t cgen_var_1155; |
| 15056 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1155, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15057 | stream->write((uint64_t*)&cgen_var_1155, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15058 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15059 | uint64_t cgen_var_1156; |
| 15060 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1156, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15061 | stream->write((uint64_t*)&cgen_var_1156, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15062 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 15063 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 15064 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15065 | } |
| 15066 | |
| 15067 | void VkEncoder::vkCmdDrawIndexedIndirectCountKHR( |
| 15068 | VkCommandBuffer commandBuffer, |
| 15069 | VkBuffer buffer, |
| 15070 | VkDeviceSize offset, |
| 15071 | VkBuffer countBuffer, |
| 15072 | VkDeviceSize countBufferOffset, |
| 15073 | uint32_t maxDrawCount, |
| 15074 | uint32_t stride) |
| 15075 | { |
| 15076 | auto stream = mImpl->stream(); |
| 15077 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15078 | auto resources = mImpl->resources(); |
| 15079 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15080 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15081 | VkCommandBuffer local_commandBuffer; |
| 15082 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15083 | VkBuffer local_buffer; |
| 15084 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15085 | VkDeviceSize local_offset; |
| 15086 | local_offset = offset; |
| 15087 | VkBuffer local_countBuffer; |
| 15088 | local_countBuffer = countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15089 | VkDeviceSize local_countBufferOffset; |
| 15090 | local_countBufferOffset = countBufferOffset; |
| 15091 | uint32_t local_maxDrawCount; |
| 15092 | local_maxDrawCount = maxDrawCount; |
| 15093 | uint32_t local_stride; |
| 15094 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15095 | countingStream->rewind(); |
| 15096 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15097 | uint64_t cgen_var_1157; |
| 15098 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1157, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15099 | countingStream->write((uint64_t*)&cgen_var_1157, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15100 | uint64_t cgen_var_1158; |
| 15101 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1158, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15102 | countingStream->write((uint64_t*)&cgen_var_1158, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15103 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15104 | uint64_t cgen_var_1159; |
| 15105 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1159, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15106 | countingStream->write((uint64_t*)&cgen_var_1159, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15107 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 15108 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 15109 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15110 | } |
| 15111 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15112 | countingStream->rewind(); |
| 15113 | uint32_t opcode_vkCmdDrawIndexedIndirectCountKHR = OP_vkCmdDrawIndexedIndirectCountKHR; |
| 15114 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| 15115 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15116 | uint64_t cgen_var_1160; |
| 15117 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1160, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15118 | stream->write((uint64_t*)&cgen_var_1160, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15119 | uint64_t cgen_var_1161; |
| 15120 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1161, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15121 | stream->write((uint64_t*)&cgen_var_1161, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15122 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15123 | uint64_t cgen_var_1162; |
| 15124 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1162, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15125 | stream->write((uint64_t*)&cgen_var_1162, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15126 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 15127 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 15128 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15129 | } |
| 15130 | |
| 15131 | #endif |
| 15132 | #ifdef VK_KHR_8bit_storage |
| 15133 | #endif |
| 15134 | #ifdef VK_EXT_debug_report |
| 15135 | VkResult VkEncoder::vkCreateDebugReportCallbackEXT( |
| 15136 | VkInstance instance, |
| 15137 | const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, |
| 15138 | const VkAllocationCallbacks* pAllocator, |
| 15139 | VkDebugReportCallbackEXT* pCallback) |
| 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(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15145 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15146 | VkInstance local_instance; |
| 15147 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15148 | VkDebugReportCallbackCreateInfoEXT* local_pCreateInfo; |
| 15149 | local_pCreateInfo = nullptr; |
| 15150 | if (pCreateInfo) |
| 15151 | { |
| 15152 | local_pCreateInfo = (VkDebugReportCallbackCreateInfoEXT*)pool->alloc(sizeof(const VkDebugReportCallbackCreateInfoEXT)); |
| 15153 | deepcopy_VkDebugReportCallbackCreateInfoEXT(pool, pCreateInfo, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| 15154 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15155 | VkAllocationCallbacks* local_pAllocator; |
| 15156 | local_pAllocator = nullptr; |
| 15157 | if (pAllocator) |
| 15158 | { |
| 15159 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15160 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15161 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 15162 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15163 | countingStream->rewind(); |
| 15164 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15165 | uint64_t cgen_var_1163; |
| 15166 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1163, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15167 | countingStream->write((uint64_t*)&cgen_var_1163, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15168 | marshal_VkDebugReportCallbackCreateInfoEXT(countingStream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15169 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15170 | uint64_t cgen_var_1164 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15171 | countingStream->putBe64(cgen_var_1164); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15172 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15173 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15174 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15175 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15176 | uint64_t cgen_var_1165; |
| 15177 | countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1165, 1); |
| 15178 | countingStream->write((uint64_t*)&cgen_var_1165, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15179 | } |
| 15180 | uint32_t packetSize_vkCreateDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15181 | countingStream->rewind(); |
| 15182 | uint32_t opcode_vkCreateDebugReportCallbackEXT = OP_vkCreateDebugReportCallbackEXT; |
| 15183 | stream->write(&opcode_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| 15184 | stream->write(&packetSize_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15185 | uint64_t cgen_var_1166; |
| 15186 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1166, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15187 | stream->write((uint64_t*)&cgen_var_1166, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15188 | marshal_VkDebugReportCallbackCreateInfoEXT(stream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15189 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15190 | uint64_t cgen_var_1167 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15191 | stream->putBe64(cgen_var_1167); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15192 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15193 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15194 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15195 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15196 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15197 | uint64_t cgen_var_1168; |
| 15198 | stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1168, 1); |
| 15199 | stream->write((uint64_t*)&cgen_var_1168, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15200 | stream->setHandleMapping(resources->unwrapMapping()); |
| 15201 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15202 | uint64_t cgen_var_1169; |
| 15203 | stream->read((uint64_t*)&cgen_var_1169, 8); |
| 15204 | stream->handleMapping()->mapHandles_u64_VkDebugReportCallbackEXT(&cgen_var_1169, (VkDebugReportCallbackEXT*)pCallback, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15205 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15206 | VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0; |
| 15207 | stream->read(&vkCreateDebugReportCallbackEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15208 | countingStream->clearPool(); |
| 15209 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15210 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15211 | return vkCreateDebugReportCallbackEXT_VkResult_return; |
| 15212 | } |
| 15213 | |
| 15214 | void VkEncoder::vkDestroyDebugReportCallbackEXT( |
| 15215 | VkInstance instance, |
| 15216 | VkDebugReportCallbackEXT callback, |
| 15217 | const VkAllocationCallbacks* pAllocator) |
| 15218 | { |
| 15219 | auto stream = mImpl->stream(); |
| 15220 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15221 | auto resources = mImpl->resources(); |
| 15222 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15223 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15224 | VkInstance local_instance; |
| 15225 | local_instance = instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 15226 | VkDebugReportCallbackEXT local_callback; |
| 15227 | local_callback = callback; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15228 | VkAllocationCallbacks* local_pAllocator; |
| 15229 | local_pAllocator = nullptr; |
| 15230 | if (pAllocator) |
| 15231 | { |
| 15232 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15233 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15234 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 15235 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15236 | countingStream->rewind(); |
| 15237 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15238 | uint64_t cgen_var_1170; |
| 15239 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1170, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15240 | countingStream->write((uint64_t*)&cgen_var_1170, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15241 | uint64_t cgen_var_1171; |
| 15242 | countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1171, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15243 | countingStream->write((uint64_t*)&cgen_var_1171, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15244 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15245 | uint64_t cgen_var_1172 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15246 | countingStream->putBe64(cgen_var_1172); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15247 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15248 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15249 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15250 | } |
| 15251 | } |
| 15252 | uint32_t packetSize_vkDestroyDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15253 | countingStream->rewind(); |
| 15254 | uint32_t opcode_vkDestroyDebugReportCallbackEXT = OP_vkDestroyDebugReportCallbackEXT; |
| 15255 | stream->write(&opcode_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| 15256 | stream->write(&packetSize_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15257 | uint64_t cgen_var_1173; |
| 15258 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1173, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15259 | stream->write((uint64_t*)&cgen_var_1173, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15260 | uint64_t cgen_var_1174; |
| 15261 | stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1174, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15262 | stream->write((uint64_t*)&cgen_var_1174, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15263 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15264 | uint64_t cgen_var_1175 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15265 | stream->putBe64(cgen_var_1175); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15266 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15267 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15268 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15269 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15270 | resources->destroyMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)&callback); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15271 | } |
| 15272 | |
| 15273 | void VkEncoder::vkDebugReportMessageEXT( |
| 15274 | VkInstance instance, |
| 15275 | VkDebugReportFlagsEXT flags, |
| 15276 | VkDebugReportObjectTypeEXT objectType, |
| 15277 | uint64_t object, |
| 15278 | size_t location, |
| 15279 | int32_t messageCode, |
| 15280 | const char* pLayerPrefix, |
| 15281 | const char* pMessage) |
| 15282 | { |
| 15283 | auto stream = mImpl->stream(); |
| 15284 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15285 | auto resources = mImpl->resources(); |
| 15286 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15287 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15288 | VkInstance local_instance; |
| 15289 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15290 | VkDebugReportFlagsEXT local_flags; |
| 15291 | local_flags = flags; |
| 15292 | VkDebugReportObjectTypeEXT local_objectType; |
| 15293 | local_objectType = objectType; |
| 15294 | uint64_t local_object; |
| 15295 | local_object = object; |
| 15296 | size_t local_location; |
| 15297 | local_location = location; |
| 15298 | int32_t local_messageCode; |
| 15299 | local_messageCode = messageCode; |
| 15300 | char* local_pLayerPrefix; |
| 15301 | local_pLayerPrefix = nullptr; |
| 15302 | if (pLayerPrefix) |
| 15303 | { |
| 15304 | local_pLayerPrefix = pool->strDup(pLayerPrefix); |
| 15305 | } |
| 15306 | char* local_pMessage; |
| 15307 | local_pMessage = nullptr; |
| 15308 | if (pMessage) |
| 15309 | { |
| 15310 | local_pMessage = pool->strDup(pMessage); |
| 15311 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15312 | countingStream->rewind(); |
| 15313 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15314 | uint64_t cgen_var_1176; |
| 15315 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1176, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15316 | countingStream->write((uint64_t*)&cgen_var_1176, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15317 | countingStream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 15318 | countingStream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 15319 | countingStream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| 15320 | countingStream->write((size_t*)&local_location, sizeof(size_t)); |
| 15321 | countingStream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 15322 | countingStream->putString(local_pLayerPrefix); |
| 15323 | countingStream->putString(local_pMessage); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15324 | } |
| 15325 | uint32_t packetSize_vkDebugReportMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15326 | countingStream->rewind(); |
| 15327 | uint32_t opcode_vkDebugReportMessageEXT = OP_vkDebugReportMessageEXT; |
| 15328 | stream->write(&opcode_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| 15329 | stream->write(&packetSize_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15330 | uint64_t cgen_var_1177; |
| 15331 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1177, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15332 | stream->write((uint64_t*)&cgen_var_1177, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15333 | stream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 15334 | stream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 15335 | stream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| 15336 | stream->write((size_t*)&local_location, sizeof(size_t)); |
| 15337 | stream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 15338 | stream->putString(local_pLayerPrefix); |
| 15339 | stream->putString(local_pMessage); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15340 | } |
| 15341 | |
| 15342 | #endif |
| 15343 | #ifdef VK_NV_glsl_shader |
| 15344 | #endif |
| 15345 | #ifdef VK_EXT_depth_range_unrestricted |
| 15346 | #endif |
| 15347 | #ifdef VK_IMG_filter_cubic |
| 15348 | #endif |
| 15349 | #ifdef VK_AMD_rasterization_order |
| 15350 | #endif |
| 15351 | #ifdef VK_AMD_shader_trinary_minmax |
| 15352 | #endif |
| 15353 | #ifdef VK_AMD_shader_explicit_vertex_parameter |
| 15354 | #endif |
| 15355 | #ifdef VK_EXT_debug_marker |
| 15356 | VkResult VkEncoder::vkDebugMarkerSetObjectTagEXT( |
| 15357 | VkDevice device, |
| 15358 | const VkDebugMarkerObjectTagInfoEXT* pTagInfo) |
| 15359 | { |
| 15360 | auto stream = mImpl->stream(); |
| 15361 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15362 | auto resources = mImpl->resources(); |
| 15363 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15364 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15365 | VkDevice local_device; |
| 15366 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15367 | VkDebugMarkerObjectTagInfoEXT* local_pTagInfo; |
| 15368 | local_pTagInfo = nullptr; |
| 15369 | if (pTagInfo) |
| 15370 | { |
| 15371 | local_pTagInfo = (VkDebugMarkerObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectTagInfoEXT)); |
| 15372 | deepcopy_VkDebugMarkerObjectTagInfoEXT(pool, pTagInfo, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| 15373 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15374 | countingStream->rewind(); |
| 15375 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15376 | uint64_t cgen_var_1178; |
| 15377 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1178, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15378 | countingStream->write((uint64_t*)&cgen_var_1178, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15379 | marshal_VkDebugMarkerObjectTagInfoEXT(countingStream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15380 | } |
| 15381 | uint32_t packetSize_vkDebugMarkerSetObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15382 | countingStream->rewind(); |
| 15383 | uint32_t opcode_vkDebugMarkerSetObjectTagEXT = OP_vkDebugMarkerSetObjectTagEXT; |
| 15384 | stream->write(&opcode_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| 15385 | stream->write(&packetSize_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15386 | uint64_t cgen_var_1179; |
| 15387 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1179, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15388 | stream->write((uint64_t*)&cgen_var_1179, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15389 | marshal_VkDebugMarkerObjectTagInfoEXT(stream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15390 | VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0; |
| 15391 | stream->read(&vkDebugMarkerSetObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15392 | countingStream->clearPool(); |
| 15393 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15394 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15395 | return vkDebugMarkerSetObjectTagEXT_VkResult_return; |
| 15396 | } |
| 15397 | |
| 15398 | VkResult VkEncoder::vkDebugMarkerSetObjectNameEXT( |
| 15399 | VkDevice device, |
| 15400 | const VkDebugMarkerObjectNameInfoEXT* pNameInfo) |
| 15401 | { |
| 15402 | auto stream = mImpl->stream(); |
| 15403 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15404 | auto resources = mImpl->resources(); |
| 15405 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15406 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15407 | VkDevice local_device; |
| 15408 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15409 | VkDebugMarkerObjectNameInfoEXT* local_pNameInfo; |
| 15410 | local_pNameInfo = nullptr; |
| 15411 | if (pNameInfo) |
| 15412 | { |
| 15413 | local_pNameInfo = (VkDebugMarkerObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectNameInfoEXT)); |
| 15414 | deepcopy_VkDebugMarkerObjectNameInfoEXT(pool, pNameInfo, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| 15415 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15416 | countingStream->rewind(); |
| 15417 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15418 | uint64_t cgen_var_1180; |
| 15419 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1180, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15420 | countingStream->write((uint64_t*)&cgen_var_1180, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15421 | marshal_VkDebugMarkerObjectNameInfoEXT(countingStream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15422 | } |
| 15423 | uint32_t packetSize_vkDebugMarkerSetObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15424 | countingStream->rewind(); |
| 15425 | uint32_t opcode_vkDebugMarkerSetObjectNameEXT = OP_vkDebugMarkerSetObjectNameEXT; |
| 15426 | stream->write(&opcode_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| 15427 | stream->write(&packetSize_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15428 | uint64_t cgen_var_1181; |
| 15429 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1181, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15430 | stream->write((uint64_t*)&cgen_var_1181, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15431 | marshal_VkDebugMarkerObjectNameInfoEXT(stream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15432 | VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0; |
| 15433 | stream->read(&vkDebugMarkerSetObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15434 | countingStream->clearPool(); |
| 15435 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15436 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15437 | return vkDebugMarkerSetObjectNameEXT_VkResult_return; |
| 15438 | } |
| 15439 | |
| 15440 | void VkEncoder::vkCmdDebugMarkerBeginEXT( |
| 15441 | VkCommandBuffer commandBuffer, |
| 15442 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 15443 | { |
| 15444 | auto stream = mImpl->stream(); |
| 15445 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15446 | auto resources = mImpl->resources(); |
| 15447 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15448 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15449 | VkCommandBuffer local_commandBuffer; |
| 15450 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15451 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| 15452 | local_pMarkerInfo = nullptr; |
| 15453 | if (pMarkerInfo) |
| 15454 | { |
| 15455 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 15456 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 15457 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15458 | countingStream->rewind(); |
| 15459 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15460 | uint64_t cgen_var_1182; |
| 15461 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1182, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15462 | countingStream->write((uint64_t*)&cgen_var_1182, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15463 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15464 | } |
| 15465 | uint32_t packetSize_vkCmdDebugMarkerBeginEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15466 | countingStream->rewind(); |
| 15467 | uint32_t opcode_vkCmdDebugMarkerBeginEXT = OP_vkCmdDebugMarkerBeginEXT; |
| 15468 | stream->write(&opcode_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| 15469 | stream->write(&packetSize_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15470 | uint64_t cgen_var_1183; |
| 15471 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1183, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15472 | stream->write((uint64_t*)&cgen_var_1183, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15473 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15474 | } |
| 15475 | |
| 15476 | void VkEncoder::vkCmdDebugMarkerEndEXT( |
| 15477 | VkCommandBuffer commandBuffer) |
| 15478 | { |
| 15479 | auto stream = mImpl->stream(); |
| 15480 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15481 | auto resources = mImpl->resources(); |
| 15482 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15483 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15484 | VkCommandBuffer local_commandBuffer; |
| 15485 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15486 | countingStream->rewind(); |
| 15487 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15488 | uint64_t cgen_var_1184; |
| 15489 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1184, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15490 | countingStream->write((uint64_t*)&cgen_var_1184, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15491 | } |
| 15492 | uint32_t packetSize_vkCmdDebugMarkerEndEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15493 | countingStream->rewind(); |
| 15494 | uint32_t opcode_vkCmdDebugMarkerEndEXT = OP_vkCmdDebugMarkerEndEXT; |
| 15495 | stream->write(&opcode_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| 15496 | stream->write(&packetSize_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15497 | uint64_t cgen_var_1185; |
| 15498 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1185, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15499 | stream->write((uint64_t*)&cgen_var_1185, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15500 | } |
| 15501 | |
| 15502 | void VkEncoder::vkCmdDebugMarkerInsertEXT( |
| 15503 | VkCommandBuffer commandBuffer, |
| 15504 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 15505 | { |
| 15506 | auto stream = mImpl->stream(); |
| 15507 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15508 | auto resources = mImpl->resources(); |
| 15509 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15510 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15511 | VkCommandBuffer local_commandBuffer; |
| 15512 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15513 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| 15514 | local_pMarkerInfo = nullptr; |
| 15515 | if (pMarkerInfo) |
| 15516 | { |
| 15517 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 15518 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 15519 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15520 | countingStream->rewind(); |
| 15521 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15522 | uint64_t cgen_var_1186; |
| 15523 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1186, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15524 | countingStream->write((uint64_t*)&cgen_var_1186, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15525 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15526 | } |
| 15527 | uint32_t packetSize_vkCmdDebugMarkerInsertEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15528 | countingStream->rewind(); |
| 15529 | uint32_t opcode_vkCmdDebugMarkerInsertEXT = OP_vkCmdDebugMarkerInsertEXT; |
| 15530 | stream->write(&opcode_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| 15531 | stream->write(&packetSize_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15532 | uint64_t cgen_var_1187; |
| 15533 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1187, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15534 | stream->write((uint64_t*)&cgen_var_1187, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15535 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15536 | } |
| 15537 | |
| 15538 | #endif |
| 15539 | #ifdef VK_AMD_gcn_shader |
| 15540 | #endif |
| 15541 | #ifdef VK_NV_dedicated_allocation |
| 15542 | #endif |
| 15543 | #ifdef VK_AMD_draw_indirect_count |
| 15544 | void VkEncoder::vkCmdDrawIndirectCountAMD( |
| 15545 | VkCommandBuffer commandBuffer, |
| 15546 | VkBuffer buffer, |
| 15547 | VkDeviceSize offset, |
| 15548 | VkBuffer countBuffer, |
| 15549 | VkDeviceSize countBufferOffset, |
| 15550 | uint32_t maxDrawCount, |
| 15551 | uint32_t stride) |
| 15552 | { |
| 15553 | auto stream = mImpl->stream(); |
| 15554 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15555 | auto resources = mImpl->resources(); |
| 15556 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15557 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15558 | VkCommandBuffer local_commandBuffer; |
| 15559 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15560 | VkBuffer local_buffer; |
| 15561 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15562 | VkDeviceSize local_offset; |
| 15563 | local_offset = offset; |
| 15564 | VkBuffer local_countBuffer; |
| 15565 | local_countBuffer = countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15566 | VkDeviceSize local_countBufferOffset; |
| 15567 | local_countBufferOffset = countBufferOffset; |
| 15568 | uint32_t local_maxDrawCount; |
| 15569 | local_maxDrawCount = maxDrawCount; |
| 15570 | uint32_t local_stride; |
| 15571 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15572 | countingStream->rewind(); |
| 15573 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15574 | uint64_t cgen_var_1188; |
| 15575 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1188, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15576 | countingStream->write((uint64_t*)&cgen_var_1188, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15577 | uint64_t cgen_var_1189; |
| 15578 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1189, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15579 | countingStream->write((uint64_t*)&cgen_var_1189, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15580 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15581 | uint64_t cgen_var_1190; |
| 15582 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1190, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15583 | countingStream->write((uint64_t*)&cgen_var_1190, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15584 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 15585 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 15586 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15587 | } |
| 15588 | uint32_t packetSize_vkCmdDrawIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15589 | countingStream->rewind(); |
| 15590 | uint32_t opcode_vkCmdDrawIndirectCountAMD = OP_vkCmdDrawIndirectCountAMD; |
| 15591 | stream->write(&opcode_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| 15592 | stream->write(&packetSize_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15593 | uint64_t cgen_var_1191; |
| 15594 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1191, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15595 | stream->write((uint64_t*)&cgen_var_1191, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15596 | uint64_t cgen_var_1192; |
| 15597 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1192, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15598 | stream->write((uint64_t*)&cgen_var_1192, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15599 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15600 | uint64_t cgen_var_1193; |
| 15601 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1193, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15602 | stream->write((uint64_t*)&cgen_var_1193, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15603 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 15604 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 15605 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15606 | } |
| 15607 | |
| 15608 | void VkEncoder::vkCmdDrawIndexedIndirectCountAMD( |
| 15609 | VkCommandBuffer commandBuffer, |
| 15610 | VkBuffer buffer, |
| 15611 | VkDeviceSize offset, |
| 15612 | VkBuffer countBuffer, |
| 15613 | VkDeviceSize countBufferOffset, |
| 15614 | uint32_t maxDrawCount, |
| 15615 | uint32_t stride) |
| 15616 | { |
| 15617 | auto stream = mImpl->stream(); |
| 15618 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15619 | auto resources = mImpl->resources(); |
| 15620 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15621 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15622 | VkCommandBuffer local_commandBuffer; |
| 15623 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15624 | VkBuffer local_buffer; |
| 15625 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15626 | VkDeviceSize local_offset; |
| 15627 | local_offset = offset; |
| 15628 | VkBuffer local_countBuffer; |
| 15629 | local_countBuffer = countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15630 | VkDeviceSize local_countBufferOffset; |
| 15631 | local_countBufferOffset = countBufferOffset; |
| 15632 | uint32_t local_maxDrawCount; |
| 15633 | local_maxDrawCount = maxDrawCount; |
| 15634 | uint32_t local_stride; |
| 15635 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15636 | countingStream->rewind(); |
| 15637 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15638 | uint64_t cgen_var_1194; |
| 15639 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1194, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15640 | countingStream->write((uint64_t*)&cgen_var_1194, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15641 | uint64_t cgen_var_1195; |
| 15642 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1195, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15643 | countingStream->write((uint64_t*)&cgen_var_1195, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15644 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15645 | uint64_t cgen_var_1196; |
| 15646 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1196, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15647 | countingStream->write((uint64_t*)&cgen_var_1196, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15648 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 15649 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 15650 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15651 | } |
| 15652 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15653 | countingStream->rewind(); |
| 15654 | uint32_t opcode_vkCmdDrawIndexedIndirectCountAMD = OP_vkCmdDrawIndexedIndirectCountAMD; |
| 15655 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| 15656 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15657 | uint64_t cgen_var_1197; |
| 15658 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1197, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15659 | stream->write((uint64_t*)&cgen_var_1197, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15660 | uint64_t cgen_var_1198; |
| 15661 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1198, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15662 | stream->write((uint64_t*)&cgen_var_1198, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15663 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15664 | uint64_t cgen_var_1199; |
| 15665 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1199, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15666 | stream->write((uint64_t*)&cgen_var_1199, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15667 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 15668 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 15669 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15670 | } |
| 15671 | |
| 15672 | #endif |
| 15673 | #ifdef VK_AMD_negative_viewport_height |
| 15674 | #endif |
| 15675 | #ifdef VK_AMD_gpu_shader_half_float |
| 15676 | #endif |
| 15677 | #ifdef VK_AMD_shader_ballot |
| 15678 | #endif |
| 15679 | #ifdef VK_AMD_texture_gather_bias_lod |
| 15680 | #endif |
| 15681 | #ifdef VK_AMD_shader_info |
| 15682 | VkResult VkEncoder::vkGetShaderInfoAMD( |
| 15683 | VkDevice device, |
| 15684 | VkPipeline pipeline, |
| 15685 | VkShaderStageFlagBits shaderStage, |
| 15686 | VkShaderInfoTypeAMD infoType, |
| 15687 | size_t* pInfoSize, |
| 15688 | void* pInfo) |
| 15689 | { |
| 15690 | auto stream = mImpl->stream(); |
| 15691 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15692 | auto resources = mImpl->resources(); |
| 15693 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15694 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15695 | VkDevice local_device; |
| 15696 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15697 | VkPipeline local_pipeline; |
| 15698 | local_pipeline = pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15699 | VkShaderStageFlagBits local_shaderStage; |
| 15700 | local_shaderStage = shaderStage; |
| 15701 | VkShaderInfoTypeAMD local_infoType; |
| 15702 | local_infoType = infoType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15703 | countingStream->rewind(); |
| 15704 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15705 | uint64_t cgen_var_1200; |
| 15706 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1200, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15707 | countingStream->write((uint64_t*)&cgen_var_1200, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15708 | uint64_t cgen_var_1201; |
| 15709 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1201, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15710 | countingStream->write((uint64_t*)&cgen_var_1201, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15711 | countingStream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 15712 | countingStream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15713 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15714 | uint64_t cgen_var_1202 = (uint64_t)(uintptr_t)pInfoSize; |
| 15715 | countingStream->putBe64(cgen_var_1202); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15716 | if (pInfoSize) |
| 15717 | { |
| 15718 | countingStream->write((size_t*)pInfoSize, sizeof(size_t)); |
| 15719 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15720 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15721 | uint64_t cgen_var_1203 = (uint64_t)(uintptr_t)pInfo; |
| 15722 | countingStream->putBe64(cgen_var_1203); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15723 | if (pInfo) |
| 15724 | { |
| 15725 | countingStream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 15726 | } |
| 15727 | } |
| 15728 | uint32_t packetSize_vkGetShaderInfoAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15729 | countingStream->rewind(); |
| 15730 | uint32_t opcode_vkGetShaderInfoAMD = OP_vkGetShaderInfoAMD; |
| 15731 | stream->write(&opcode_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| 15732 | stream->write(&packetSize_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15733 | uint64_t cgen_var_1204; |
| 15734 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1204, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15735 | stream->write((uint64_t*)&cgen_var_1204, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15736 | uint64_t cgen_var_1205; |
| 15737 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1205, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15738 | stream->write((uint64_t*)&cgen_var_1205, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15739 | stream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 15740 | stream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15741 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15742 | uint64_t cgen_var_1206 = (uint64_t)(uintptr_t)pInfoSize; |
| 15743 | stream->putBe64(cgen_var_1206); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15744 | if (pInfoSize) |
| 15745 | { |
| 15746 | stream->write((size_t*)pInfoSize, sizeof(size_t)); |
| 15747 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15748 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15749 | uint64_t cgen_var_1207 = (uint64_t)(uintptr_t)pInfo; |
| 15750 | stream->putBe64(cgen_var_1207); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15751 | if (pInfo) |
| 15752 | { |
| 15753 | stream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 15754 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15755 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15756 | size_t* check_pInfoSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15757 | check_pInfoSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15758 | if (pInfoSize) |
| 15759 | { |
| 15760 | if (!(check_pInfoSize)) |
| 15761 | { |
| 15762 | fprintf(stderr, "fatal: pInfoSize inconsistent between guest and host\n"); |
| 15763 | } |
| 15764 | stream->read((size_t*)pInfoSize, sizeof(size_t)); |
| 15765 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15766 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15767 | void* check_pInfo; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15768 | check_pInfo = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15769 | if (pInfo) |
| 15770 | { |
| 15771 | if (!(check_pInfo)) |
| 15772 | { |
| 15773 | fprintf(stderr, "fatal: pInfo inconsistent between guest and host\n"); |
| 15774 | } |
| 15775 | stream->read((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 15776 | } |
| 15777 | VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0; |
| 15778 | stream->read(&vkGetShaderInfoAMD_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15779 | countingStream->clearPool(); |
| 15780 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15781 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15782 | return vkGetShaderInfoAMD_VkResult_return; |
| 15783 | } |
| 15784 | |
| 15785 | #endif |
| 15786 | #ifdef VK_AMD_shader_image_load_store_lod |
| 15787 | #endif |
| 15788 | #ifdef VK_IMG_format_pvrtc |
| 15789 | #endif |
| 15790 | #ifdef VK_NV_external_memory_capabilities |
| 15791 | VkResult VkEncoder::vkGetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 15792 | VkPhysicalDevice physicalDevice, |
| 15793 | VkFormat format, |
| 15794 | VkImageType type, |
| 15795 | VkImageTiling tiling, |
| 15796 | VkImageUsageFlags usage, |
| 15797 | VkImageCreateFlags flags, |
| 15798 | VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 15799 | VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) |
| 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(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15805 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15806 | VkPhysicalDevice local_physicalDevice; |
| 15807 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15808 | VkFormat local_format; |
| 15809 | local_format = format; |
| 15810 | VkImageType local_type; |
| 15811 | local_type = type; |
| 15812 | VkImageTiling local_tiling; |
| 15813 | local_tiling = tiling; |
| 15814 | VkImageUsageFlags local_usage; |
| 15815 | local_usage = usage; |
| 15816 | VkImageCreateFlags local_flags; |
| 15817 | local_flags = flags; |
| 15818 | VkExternalMemoryHandleTypeFlagsNV local_externalHandleType; |
| 15819 | local_externalHandleType = externalHandleType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15820 | countingStream->rewind(); |
| 15821 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15822 | uint64_t cgen_var_1210; |
| 15823 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1210, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15824 | countingStream->write((uint64_t*)&cgen_var_1210, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15825 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 15826 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 15827 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 15828 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 15829 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 15830 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15831 | marshal_VkExternalImageFormatPropertiesNV(countingStream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 15832 | } |
| 15833 | uint32_t packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15834 | countingStream->rewind(); |
| 15835 | uint32_t opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV; |
| 15836 | stream->write(&opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| 15837 | stream->write(&packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15838 | uint64_t cgen_var_1211; |
| 15839 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1211, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15840 | stream->write((uint64_t*)&cgen_var_1211, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15841 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 15842 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 15843 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 15844 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 15845 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 15846 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15847 | marshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 15848 | unmarshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 15849 | VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0; |
| 15850 | stream->read(&vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15851 | countingStream->clearPool(); |
| 15852 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15853 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15854 | return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return; |
| 15855 | } |
| 15856 | |
| 15857 | #endif |
| 15858 | #ifdef VK_NV_external_memory |
| 15859 | #endif |
| 15860 | #ifdef VK_NV_external_memory_win32 |
| 15861 | VkResult VkEncoder::vkGetMemoryWin32HandleNV( |
| 15862 | VkDevice device, |
| 15863 | VkDeviceMemory memory, |
| 15864 | VkExternalMemoryHandleTypeFlagsNV handleType, |
| 15865 | HANDLE* pHandle) |
| 15866 | { |
| 15867 | auto stream = mImpl->stream(); |
| 15868 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15869 | auto resources = mImpl->resources(); |
| 15870 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15871 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15872 | VkDevice local_device; |
| 15873 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15874 | VkDeviceMemory local_memory; |
| 15875 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15876 | VkExternalMemoryHandleTypeFlagsNV local_handleType; |
| 15877 | local_handleType = handleType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15878 | countingStream->rewind(); |
| 15879 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15880 | uint64_t cgen_var_1212; |
| 15881 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1212, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15882 | countingStream->write((uint64_t*)&cgen_var_1212, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15883 | uint64_t cgen_var_1213; |
| 15884 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1213, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15885 | countingStream->write((uint64_t*)&cgen_var_1213, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15886 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15887 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15888 | } |
| 15889 | uint32_t packetSize_vkGetMemoryWin32HandleNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15890 | countingStream->rewind(); |
| 15891 | uint32_t opcode_vkGetMemoryWin32HandleNV = OP_vkGetMemoryWin32HandleNV; |
| 15892 | stream->write(&opcode_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| 15893 | stream->write(&packetSize_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15894 | uint64_t cgen_var_1214; |
| 15895 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1214, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15896 | stream->write((uint64_t*)&cgen_var_1214, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15897 | uint64_t cgen_var_1215; |
| 15898 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1215, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15899 | stream->write((uint64_t*)&cgen_var_1215, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15900 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15901 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15902 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15903 | VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0; |
| 15904 | stream->read(&vkGetMemoryWin32HandleNV_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15905 | countingStream->clearPool(); |
| 15906 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15907 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15908 | return vkGetMemoryWin32HandleNV_VkResult_return; |
| 15909 | } |
| 15910 | |
| 15911 | #endif |
| 15912 | #ifdef VK_NV_win32_keyed_mutex |
| 15913 | #endif |
| 15914 | #ifdef VK_EXT_validation_flags |
| 15915 | #endif |
| 15916 | #ifdef VK_NN_vi_surface |
| 15917 | VkResult VkEncoder::vkCreateViSurfaceNN( |
| 15918 | VkInstance instance, |
| 15919 | const VkViSurfaceCreateInfoNN* pCreateInfo, |
| 15920 | const VkAllocationCallbacks* pAllocator, |
| 15921 | VkSurfaceKHR* pSurface) |
| 15922 | { |
| 15923 | auto stream = mImpl->stream(); |
| 15924 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15925 | auto resources = mImpl->resources(); |
| 15926 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15927 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15928 | VkInstance local_instance; |
| 15929 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15930 | VkViSurfaceCreateInfoNN* local_pCreateInfo; |
| 15931 | local_pCreateInfo = nullptr; |
| 15932 | if (pCreateInfo) |
| 15933 | { |
| 15934 | local_pCreateInfo = (VkViSurfaceCreateInfoNN*)pool->alloc(sizeof(const VkViSurfaceCreateInfoNN)); |
| 15935 | deepcopy_VkViSurfaceCreateInfoNN(pool, pCreateInfo, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| 15936 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15937 | VkAllocationCallbacks* local_pAllocator; |
| 15938 | local_pAllocator = nullptr; |
| 15939 | if (pAllocator) |
| 15940 | { |
| 15941 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15942 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15943 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 15944 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15945 | countingStream->rewind(); |
| 15946 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15947 | uint64_t cgen_var_1216; |
| 15948 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1216, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15949 | countingStream->write((uint64_t*)&cgen_var_1216, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15950 | marshal_VkViSurfaceCreateInfoNN(countingStream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15951 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15952 | uint64_t cgen_var_1217 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15953 | countingStream->putBe64(cgen_var_1217); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15954 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15955 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15956 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15957 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15958 | uint64_t cgen_var_1218; |
| 15959 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1218, 1); |
| 15960 | countingStream->write((uint64_t*)&cgen_var_1218, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15961 | } |
| 15962 | uint32_t packetSize_vkCreateViSurfaceNN = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15963 | countingStream->rewind(); |
| 15964 | uint32_t opcode_vkCreateViSurfaceNN = OP_vkCreateViSurfaceNN; |
| 15965 | stream->write(&opcode_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| 15966 | stream->write(&packetSize_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15967 | uint64_t cgen_var_1219; |
| 15968 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1219, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15969 | stream->write((uint64_t*)&cgen_var_1219, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15970 | marshal_VkViSurfaceCreateInfoNN(stream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15971 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15972 | uint64_t cgen_var_1220 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15973 | stream->putBe64(cgen_var_1220); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15974 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15975 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15976 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15977 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15978 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15979 | uint64_t cgen_var_1221; |
| 15980 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1221, 1); |
| 15981 | stream->write((uint64_t*)&cgen_var_1221, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15982 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15983 | uint64_t cgen_var_1222; |
| 15984 | stream->read((uint64_t*)&cgen_var_1222, 8); |
| 15985 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1222, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15986 | VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0; |
| 15987 | stream->read(&vkCreateViSurfaceNN_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15988 | countingStream->clearPool(); |
| 15989 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 15990 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15991 | return vkCreateViSurfaceNN_VkResult_return; |
| 15992 | } |
| 15993 | |
| 15994 | #endif |
| 15995 | #ifdef VK_EXT_shader_subgroup_ballot |
| 15996 | #endif |
| 15997 | #ifdef VK_EXT_shader_subgroup_vote |
| 15998 | #endif |
| 15999 | #ifdef VK_EXT_conditional_rendering |
| 16000 | void VkEncoder::vkCmdBeginConditionalRenderingEXT( |
| 16001 | VkCommandBuffer commandBuffer, |
| 16002 | const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) |
| 16003 | { |
| 16004 | auto stream = mImpl->stream(); |
| 16005 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16006 | auto resources = mImpl->resources(); |
| 16007 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16008 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16009 | VkCommandBuffer local_commandBuffer; |
| 16010 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16011 | VkConditionalRenderingBeginInfoEXT* local_pConditionalRenderingBegin; |
| 16012 | local_pConditionalRenderingBegin = nullptr; |
| 16013 | if (pConditionalRenderingBegin) |
| 16014 | { |
| 16015 | local_pConditionalRenderingBegin = (VkConditionalRenderingBeginInfoEXT*)pool->alloc(sizeof(const VkConditionalRenderingBeginInfoEXT)); |
| 16016 | deepcopy_VkConditionalRenderingBeginInfoEXT(pool, pConditionalRenderingBegin, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| 16017 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16018 | countingStream->rewind(); |
| 16019 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16020 | uint64_t cgen_var_1223; |
| 16021 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1223, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16022 | countingStream->write((uint64_t*)&cgen_var_1223, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16023 | marshal_VkConditionalRenderingBeginInfoEXT(countingStream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16024 | } |
| 16025 | uint32_t packetSize_vkCmdBeginConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16026 | countingStream->rewind(); |
| 16027 | uint32_t opcode_vkCmdBeginConditionalRenderingEXT = OP_vkCmdBeginConditionalRenderingEXT; |
| 16028 | stream->write(&opcode_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| 16029 | stream->write(&packetSize_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16030 | uint64_t cgen_var_1224; |
| 16031 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1224, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16032 | stream->write((uint64_t*)&cgen_var_1224, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16033 | marshal_VkConditionalRenderingBeginInfoEXT(stream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16034 | } |
| 16035 | |
| 16036 | void VkEncoder::vkCmdEndConditionalRenderingEXT( |
| 16037 | VkCommandBuffer commandBuffer) |
| 16038 | { |
| 16039 | auto stream = mImpl->stream(); |
| 16040 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16041 | auto resources = mImpl->resources(); |
| 16042 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16043 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16044 | VkCommandBuffer local_commandBuffer; |
| 16045 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16046 | countingStream->rewind(); |
| 16047 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16048 | uint64_t cgen_var_1225; |
| 16049 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1225, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16050 | countingStream->write((uint64_t*)&cgen_var_1225, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16051 | } |
| 16052 | uint32_t packetSize_vkCmdEndConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16053 | countingStream->rewind(); |
| 16054 | uint32_t opcode_vkCmdEndConditionalRenderingEXT = OP_vkCmdEndConditionalRenderingEXT; |
| 16055 | stream->write(&opcode_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| 16056 | stream->write(&packetSize_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16057 | uint64_t cgen_var_1226; |
| 16058 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1226, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16059 | stream->write((uint64_t*)&cgen_var_1226, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16060 | } |
| 16061 | |
| 16062 | #endif |
| 16063 | #ifdef VK_NVX_device_generated_commands |
| 16064 | void VkEncoder::vkCmdProcessCommandsNVX( |
| 16065 | VkCommandBuffer commandBuffer, |
| 16066 | const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) |
| 16067 | { |
| 16068 | auto stream = mImpl->stream(); |
| 16069 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16070 | auto resources = mImpl->resources(); |
| 16071 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16072 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16073 | VkCommandBuffer local_commandBuffer; |
| 16074 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16075 | VkCmdProcessCommandsInfoNVX* local_pProcessCommandsInfo; |
| 16076 | local_pProcessCommandsInfo = nullptr; |
| 16077 | if (pProcessCommandsInfo) |
| 16078 | { |
| 16079 | local_pProcessCommandsInfo = (VkCmdProcessCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdProcessCommandsInfoNVX)); |
| 16080 | deepcopy_VkCmdProcessCommandsInfoNVX(pool, pProcessCommandsInfo, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| 16081 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16082 | countingStream->rewind(); |
| 16083 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16084 | uint64_t cgen_var_1227; |
| 16085 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1227, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16086 | countingStream->write((uint64_t*)&cgen_var_1227, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16087 | marshal_VkCmdProcessCommandsInfoNVX(countingStream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16088 | } |
| 16089 | uint32_t packetSize_vkCmdProcessCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16090 | countingStream->rewind(); |
| 16091 | uint32_t opcode_vkCmdProcessCommandsNVX = OP_vkCmdProcessCommandsNVX; |
| 16092 | stream->write(&opcode_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| 16093 | stream->write(&packetSize_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16094 | uint64_t cgen_var_1228; |
| 16095 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1228, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16096 | stream->write((uint64_t*)&cgen_var_1228, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16097 | marshal_VkCmdProcessCommandsInfoNVX(stream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16098 | } |
| 16099 | |
| 16100 | void VkEncoder::vkCmdReserveSpaceForCommandsNVX( |
| 16101 | VkCommandBuffer commandBuffer, |
| 16102 | const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) |
| 16103 | { |
| 16104 | auto stream = mImpl->stream(); |
| 16105 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16106 | auto resources = mImpl->resources(); |
| 16107 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16108 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16109 | VkCommandBuffer local_commandBuffer; |
| 16110 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16111 | VkCmdReserveSpaceForCommandsInfoNVX* local_pReserveSpaceInfo; |
| 16112 | local_pReserveSpaceInfo = nullptr; |
| 16113 | if (pReserveSpaceInfo) |
| 16114 | { |
| 16115 | local_pReserveSpaceInfo = (VkCmdReserveSpaceForCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdReserveSpaceForCommandsInfoNVX)); |
| 16116 | deepcopy_VkCmdReserveSpaceForCommandsInfoNVX(pool, pReserveSpaceInfo, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| 16117 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16118 | countingStream->rewind(); |
| 16119 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16120 | uint64_t cgen_var_1229; |
| 16121 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1229, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16122 | countingStream->write((uint64_t*)&cgen_var_1229, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16123 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(countingStream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16124 | } |
| 16125 | uint32_t packetSize_vkCmdReserveSpaceForCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16126 | countingStream->rewind(); |
| 16127 | uint32_t opcode_vkCmdReserveSpaceForCommandsNVX = OP_vkCmdReserveSpaceForCommandsNVX; |
| 16128 | stream->write(&opcode_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| 16129 | stream->write(&packetSize_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16130 | uint64_t cgen_var_1230; |
| 16131 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1230, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16132 | stream->write((uint64_t*)&cgen_var_1230, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16133 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(stream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16134 | } |
| 16135 | |
| 16136 | VkResult VkEncoder::vkCreateIndirectCommandsLayoutNVX( |
| 16137 | VkDevice device, |
| 16138 | const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, |
| 16139 | const VkAllocationCallbacks* pAllocator, |
| 16140 | VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) |
| 16141 | { |
| 16142 | auto stream = mImpl->stream(); |
| 16143 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16144 | auto resources = mImpl->resources(); |
| 16145 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16146 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16147 | VkDevice local_device; |
| 16148 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16149 | VkIndirectCommandsLayoutCreateInfoNVX* local_pCreateInfo; |
| 16150 | local_pCreateInfo = nullptr; |
| 16151 | if (pCreateInfo) |
| 16152 | { |
| 16153 | local_pCreateInfo = (VkIndirectCommandsLayoutCreateInfoNVX*)pool->alloc(sizeof(const VkIndirectCommandsLayoutCreateInfoNVX)); |
| 16154 | deepcopy_VkIndirectCommandsLayoutCreateInfoNVX(pool, pCreateInfo, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| 16155 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16156 | VkAllocationCallbacks* local_pAllocator; |
| 16157 | local_pAllocator = nullptr; |
| 16158 | if (pAllocator) |
| 16159 | { |
| 16160 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16161 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16162 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16163 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16164 | countingStream->rewind(); |
| 16165 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16166 | uint64_t cgen_var_1231; |
| 16167 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1231, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16168 | countingStream->write((uint64_t*)&cgen_var_1231, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16169 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(countingStream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16170 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16171 | uint64_t cgen_var_1232 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16172 | countingStream->putBe64(cgen_var_1232); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16173 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16174 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16175 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16176 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16177 | uint64_t cgen_var_1233; |
| 16178 | countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1233, 1); |
| 16179 | countingStream->write((uint64_t*)&cgen_var_1233, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16180 | } |
| 16181 | uint32_t packetSize_vkCreateIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16182 | countingStream->rewind(); |
| 16183 | uint32_t opcode_vkCreateIndirectCommandsLayoutNVX = OP_vkCreateIndirectCommandsLayoutNVX; |
| 16184 | stream->write(&opcode_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 16185 | stream->write(&packetSize_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16186 | uint64_t cgen_var_1234; |
| 16187 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1234, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16188 | stream->write((uint64_t*)&cgen_var_1234, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16189 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(stream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16190 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16191 | uint64_t cgen_var_1235 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16192 | stream->putBe64(cgen_var_1235); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16193 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16194 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16195 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16196 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16197 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16198 | uint64_t cgen_var_1236; |
| 16199 | stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1236, 1); |
| 16200 | stream->write((uint64_t*)&cgen_var_1236, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16201 | stream->setHandleMapping(resources->unwrapMapping()); |
| 16202 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16203 | uint64_t cgen_var_1237; |
| 16204 | stream->read((uint64_t*)&cgen_var_1237, 8); |
| 16205 | stream->handleMapping()->mapHandles_u64_VkIndirectCommandsLayoutNVX(&cgen_var_1237, (VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16206 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16207 | VkResult vkCreateIndirectCommandsLayoutNVX_VkResult_return = (VkResult)0; |
| 16208 | stream->read(&vkCreateIndirectCommandsLayoutNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16209 | countingStream->clearPool(); |
| 16210 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16211 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16212 | return vkCreateIndirectCommandsLayoutNVX_VkResult_return; |
| 16213 | } |
| 16214 | |
| 16215 | void VkEncoder::vkDestroyIndirectCommandsLayoutNVX( |
| 16216 | VkDevice device, |
| 16217 | VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 16218 | const VkAllocationCallbacks* pAllocator) |
| 16219 | { |
| 16220 | auto stream = mImpl->stream(); |
| 16221 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16222 | auto resources = mImpl->resources(); |
| 16223 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16224 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16225 | VkDevice local_device; |
| 16226 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16227 | VkIndirectCommandsLayoutNVX local_indirectCommandsLayout; |
| 16228 | local_indirectCommandsLayout = indirectCommandsLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16229 | VkAllocationCallbacks* local_pAllocator; |
| 16230 | local_pAllocator = nullptr; |
| 16231 | if (pAllocator) |
| 16232 | { |
| 16233 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16234 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16235 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16236 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16237 | countingStream->rewind(); |
| 16238 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16239 | uint64_t cgen_var_1238; |
| 16240 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1238, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16241 | countingStream->write((uint64_t*)&cgen_var_1238, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16242 | uint64_t cgen_var_1239; |
| 16243 | countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1239, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16244 | countingStream->write((uint64_t*)&cgen_var_1239, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16245 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16246 | uint64_t cgen_var_1240 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16247 | countingStream->putBe64(cgen_var_1240); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16248 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16249 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16250 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16251 | } |
| 16252 | } |
| 16253 | uint32_t packetSize_vkDestroyIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16254 | countingStream->rewind(); |
| 16255 | uint32_t opcode_vkDestroyIndirectCommandsLayoutNVX = OP_vkDestroyIndirectCommandsLayoutNVX; |
| 16256 | stream->write(&opcode_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 16257 | stream->write(&packetSize_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16258 | uint64_t cgen_var_1241; |
| 16259 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1241, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16260 | stream->write((uint64_t*)&cgen_var_1241, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16261 | uint64_t cgen_var_1242; |
| 16262 | stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1242, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16263 | stream->write((uint64_t*)&cgen_var_1242, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16264 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16265 | uint64_t cgen_var_1243 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16266 | stream->putBe64(cgen_var_1243); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16267 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16268 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16269 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16270 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16271 | resources->destroyMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)&indirectCommandsLayout); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16272 | } |
| 16273 | |
| 16274 | VkResult VkEncoder::vkCreateObjectTableNVX( |
| 16275 | VkDevice device, |
| 16276 | const VkObjectTableCreateInfoNVX* pCreateInfo, |
| 16277 | const VkAllocationCallbacks* pAllocator, |
| 16278 | VkObjectTableNVX* pObjectTable) |
| 16279 | { |
| 16280 | auto stream = mImpl->stream(); |
| 16281 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16282 | auto resources = mImpl->resources(); |
| 16283 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16284 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16285 | VkDevice local_device; |
| 16286 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16287 | VkObjectTableCreateInfoNVX* local_pCreateInfo; |
| 16288 | local_pCreateInfo = nullptr; |
| 16289 | if (pCreateInfo) |
| 16290 | { |
| 16291 | local_pCreateInfo = (VkObjectTableCreateInfoNVX*)pool->alloc(sizeof(const VkObjectTableCreateInfoNVX)); |
| 16292 | deepcopy_VkObjectTableCreateInfoNVX(pool, pCreateInfo, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| 16293 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16294 | VkAllocationCallbacks* local_pAllocator; |
| 16295 | local_pAllocator = nullptr; |
| 16296 | if (pAllocator) |
| 16297 | { |
| 16298 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16299 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16300 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16301 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16302 | countingStream->rewind(); |
| 16303 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16304 | uint64_t cgen_var_1244; |
| 16305 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1244, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16306 | countingStream->write((uint64_t*)&cgen_var_1244, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16307 | marshal_VkObjectTableCreateInfoNVX(countingStream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16308 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16309 | uint64_t cgen_var_1245 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16310 | countingStream->putBe64(cgen_var_1245); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16311 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16312 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16313 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16314 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16315 | uint64_t cgen_var_1246; |
| 16316 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1246, 1); |
| 16317 | countingStream->write((uint64_t*)&cgen_var_1246, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16318 | } |
| 16319 | uint32_t packetSize_vkCreateObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16320 | countingStream->rewind(); |
| 16321 | uint32_t opcode_vkCreateObjectTableNVX = OP_vkCreateObjectTableNVX; |
| 16322 | stream->write(&opcode_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| 16323 | stream->write(&packetSize_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16324 | uint64_t cgen_var_1247; |
| 16325 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1247, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16326 | stream->write((uint64_t*)&cgen_var_1247, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16327 | marshal_VkObjectTableCreateInfoNVX(stream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16328 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16329 | uint64_t cgen_var_1248 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16330 | stream->putBe64(cgen_var_1248); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16331 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16332 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16333 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16334 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16335 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16336 | uint64_t cgen_var_1249; |
| 16337 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1249, 1); |
| 16338 | stream->write((uint64_t*)&cgen_var_1249, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16339 | stream->setHandleMapping(resources->unwrapMapping()); |
| 16340 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16341 | uint64_t cgen_var_1250; |
| 16342 | stream->read((uint64_t*)&cgen_var_1250, 8); |
| 16343 | stream->handleMapping()->mapHandles_u64_VkObjectTableNVX(&cgen_var_1250, (VkObjectTableNVX*)pObjectTable, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16344 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16345 | VkResult vkCreateObjectTableNVX_VkResult_return = (VkResult)0; |
| 16346 | stream->read(&vkCreateObjectTableNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16347 | countingStream->clearPool(); |
| 16348 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16349 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16350 | return vkCreateObjectTableNVX_VkResult_return; |
| 16351 | } |
| 16352 | |
| 16353 | void VkEncoder::vkDestroyObjectTableNVX( |
| 16354 | VkDevice device, |
| 16355 | VkObjectTableNVX objectTable, |
| 16356 | const VkAllocationCallbacks* pAllocator) |
| 16357 | { |
| 16358 | auto stream = mImpl->stream(); |
| 16359 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16360 | auto resources = mImpl->resources(); |
| 16361 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16362 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16363 | VkDevice local_device; |
| 16364 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16365 | VkObjectTableNVX local_objectTable; |
| 16366 | local_objectTable = objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16367 | VkAllocationCallbacks* local_pAllocator; |
| 16368 | local_pAllocator = nullptr; |
| 16369 | if (pAllocator) |
| 16370 | { |
| 16371 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16372 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16373 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16374 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16375 | countingStream->rewind(); |
| 16376 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16377 | uint64_t cgen_var_1251; |
| 16378 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1251, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16379 | countingStream->write((uint64_t*)&cgen_var_1251, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16380 | uint64_t cgen_var_1252; |
| 16381 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1252, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16382 | countingStream->write((uint64_t*)&cgen_var_1252, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16383 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16384 | uint64_t cgen_var_1253 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16385 | countingStream->putBe64(cgen_var_1253); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16386 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16387 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16388 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16389 | } |
| 16390 | } |
| 16391 | uint32_t packetSize_vkDestroyObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16392 | countingStream->rewind(); |
| 16393 | uint32_t opcode_vkDestroyObjectTableNVX = OP_vkDestroyObjectTableNVX; |
| 16394 | stream->write(&opcode_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| 16395 | stream->write(&packetSize_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16396 | uint64_t cgen_var_1254; |
| 16397 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1254, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16398 | stream->write((uint64_t*)&cgen_var_1254, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16399 | uint64_t cgen_var_1255; |
| 16400 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1255, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16401 | stream->write((uint64_t*)&cgen_var_1255, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16402 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16403 | uint64_t cgen_var_1256 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16404 | stream->putBe64(cgen_var_1256); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16405 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16406 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16407 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16408 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16409 | resources->destroyMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&objectTable); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16410 | } |
| 16411 | |
| 16412 | VkResult VkEncoder::vkRegisterObjectsNVX( |
| 16413 | VkDevice device, |
| 16414 | VkObjectTableNVX objectTable, |
| 16415 | uint32_t objectCount, |
| 16416 | const VkObjectTableEntryNVX* const* ppObjectTableEntries, |
| 16417 | const uint32_t* pObjectIndices) |
| 16418 | { |
| 16419 | auto stream = mImpl->stream(); |
| 16420 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16421 | auto resources = mImpl->resources(); |
| 16422 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16423 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16424 | VkDevice local_device; |
| 16425 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16426 | VkObjectTableNVX local_objectTable; |
| 16427 | local_objectTable = objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16428 | uint32_t local_objectCount; |
| 16429 | local_objectCount = objectCount; |
| 16430 | VkObjectTableEntryNVX** local_ppObjectTableEntries; |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 16431 | (void)ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16432 | uint32_t* local_pObjectIndices; |
| 16433 | local_pObjectIndices = nullptr; |
| 16434 | if (pObjectIndices) |
| 16435 | { |
| 16436 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 16437 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16438 | countingStream->rewind(); |
| 16439 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16440 | uint64_t cgen_var_1257; |
| 16441 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1257, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16442 | countingStream->write((uint64_t*)&cgen_var_1257, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16443 | uint64_t cgen_var_1258; |
| 16444 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1258, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16445 | countingStream->write((uint64_t*)&cgen_var_1258, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16446 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 16447 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16448 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16449 | } |
| 16450 | uint32_t packetSize_vkRegisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16451 | countingStream->rewind(); |
| 16452 | uint32_t opcode_vkRegisterObjectsNVX = OP_vkRegisterObjectsNVX; |
| 16453 | stream->write(&opcode_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| 16454 | stream->write(&packetSize_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16455 | uint64_t cgen_var_1259; |
| 16456 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1259, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16457 | stream->write((uint64_t*)&cgen_var_1259, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16458 | uint64_t cgen_var_1260; |
| 16459 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1260, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16460 | stream->write((uint64_t*)&cgen_var_1260, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16461 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 16462 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16463 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16464 | VkResult vkRegisterObjectsNVX_VkResult_return = (VkResult)0; |
| 16465 | stream->read(&vkRegisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16466 | countingStream->clearPool(); |
| 16467 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16468 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16469 | return vkRegisterObjectsNVX_VkResult_return; |
| 16470 | } |
| 16471 | |
| 16472 | VkResult VkEncoder::vkUnregisterObjectsNVX( |
| 16473 | VkDevice device, |
| 16474 | VkObjectTableNVX objectTable, |
| 16475 | uint32_t objectCount, |
| 16476 | const VkObjectEntryTypeNVX* pObjectEntryTypes, |
| 16477 | const uint32_t* pObjectIndices) |
| 16478 | { |
| 16479 | auto stream = mImpl->stream(); |
| 16480 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16481 | auto resources = mImpl->resources(); |
| 16482 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16483 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16484 | VkDevice local_device; |
| 16485 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16486 | VkObjectTableNVX local_objectTable; |
| 16487 | local_objectTable = objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16488 | uint32_t local_objectCount; |
| 16489 | local_objectCount = objectCount; |
| 16490 | VkObjectEntryTypeNVX* local_pObjectEntryTypes; |
| 16491 | local_pObjectEntryTypes = nullptr; |
| 16492 | if (pObjectEntryTypes) |
| 16493 | { |
| 16494 | local_pObjectEntryTypes = (VkObjectEntryTypeNVX*)pool->dupArray(pObjectEntryTypes, ((objectCount)) * sizeof(const VkObjectEntryTypeNVX)); |
| 16495 | } |
| 16496 | uint32_t* local_pObjectIndices; |
| 16497 | local_pObjectIndices = nullptr; |
| 16498 | if (pObjectIndices) |
| 16499 | { |
| 16500 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 16501 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16502 | countingStream->rewind(); |
| 16503 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16504 | uint64_t cgen_var_1261; |
| 16505 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1261, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16506 | countingStream->write((uint64_t*)&cgen_var_1261, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16507 | uint64_t cgen_var_1262; |
| 16508 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1262, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16509 | countingStream->write((uint64_t*)&cgen_var_1262, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16510 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 16511 | countingStream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 16512 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16513 | } |
| 16514 | uint32_t packetSize_vkUnregisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16515 | countingStream->rewind(); |
| 16516 | uint32_t opcode_vkUnregisterObjectsNVX = OP_vkUnregisterObjectsNVX; |
| 16517 | stream->write(&opcode_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| 16518 | stream->write(&packetSize_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16519 | uint64_t cgen_var_1263; |
| 16520 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1263, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16521 | stream->write((uint64_t*)&cgen_var_1263, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16522 | uint64_t cgen_var_1264; |
| 16523 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1264, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16524 | stream->write((uint64_t*)&cgen_var_1264, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16525 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 16526 | stream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 16527 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16528 | VkResult vkUnregisterObjectsNVX_VkResult_return = (VkResult)0; |
| 16529 | stream->read(&vkUnregisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16530 | countingStream->clearPool(); |
| 16531 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16532 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16533 | return vkUnregisterObjectsNVX_VkResult_return; |
| 16534 | } |
| 16535 | |
| 16536 | void VkEncoder::vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( |
| 16537 | VkPhysicalDevice physicalDevice, |
| 16538 | VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, |
| 16539 | VkDeviceGeneratedCommandsLimitsNVX* pLimits) |
| 16540 | { |
| 16541 | auto stream = mImpl->stream(); |
| 16542 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16543 | auto resources = mImpl->resources(); |
| 16544 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16545 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16546 | VkPhysicalDevice local_physicalDevice; |
| 16547 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16548 | countingStream->rewind(); |
| 16549 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16550 | uint64_t cgen_var_1265; |
| 16551 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1265, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16552 | countingStream->write((uint64_t*)&cgen_var_1265, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16553 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(countingStream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 16554 | marshal_VkDeviceGeneratedCommandsLimitsNVX(countingStream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 16555 | } |
| 16556 | uint32_t packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16557 | countingStream->rewind(); |
| 16558 | uint32_t opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = OP_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX; |
| 16559 | stream->write(&opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| 16560 | stream->write(&packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16561 | uint64_t cgen_var_1266; |
| 16562 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1266, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16563 | stream->write((uint64_t*)&cgen_var_1266, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16564 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 16565 | marshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 16566 | unmarshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 16567 | unmarshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 16568 | } |
| 16569 | |
| 16570 | #endif |
| 16571 | #ifdef VK_NV_clip_space_w_scaling |
| 16572 | void VkEncoder::vkCmdSetViewportWScalingNV( |
| 16573 | VkCommandBuffer commandBuffer, |
| 16574 | uint32_t firstViewport, |
| 16575 | uint32_t viewportCount, |
| 16576 | const VkViewportWScalingNV* pViewportWScalings) |
| 16577 | { |
| 16578 | auto stream = mImpl->stream(); |
| 16579 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16580 | auto resources = mImpl->resources(); |
| 16581 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16582 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16583 | VkCommandBuffer local_commandBuffer; |
| 16584 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16585 | uint32_t local_firstViewport; |
| 16586 | local_firstViewport = firstViewport; |
| 16587 | uint32_t local_viewportCount; |
| 16588 | local_viewportCount = viewportCount; |
| 16589 | VkViewportWScalingNV* local_pViewportWScalings; |
| 16590 | local_pViewportWScalings = nullptr; |
| 16591 | if (pViewportWScalings) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16592 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16593 | local_pViewportWScalings = (VkViewportWScalingNV*)pool->alloc(((viewportCount)) * sizeof(const VkViewportWScalingNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16594 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 16595 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16596 | deepcopy_VkViewportWScalingNV(pool, pViewportWScalings + i, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| 16597 | } |
| 16598 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16599 | countingStream->rewind(); |
| 16600 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16601 | uint64_t cgen_var_1267; |
| 16602 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1267, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16603 | countingStream->write((uint64_t*)&cgen_var_1267, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16604 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 16605 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 16606 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 16607 | { |
| 16608 | marshal_VkViewportWScalingNV(countingStream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16609 | } |
| 16610 | } |
| 16611 | uint32_t packetSize_vkCmdSetViewportWScalingNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16612 | countingStream->rewind(); |
| 16613 | uint32_t opcode_vkCmdSetViewportWScalingNV = OP_vkCmdSetViewportWScalingNV; |
| 16614 | stream->write(&opcode_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| 16615 | stream->write(&packetSize_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16616 | uint64_t cgen_var_1268; |
| 16617 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1268, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16618 | stream->write((uint64_t*)&cgen_var_1268, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16619 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 16620 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16621 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 16622 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16623 | marshal_VkViewportWScalingNV(stream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16624 | } |
| 16625 | } |
| 16626 | |
| 16627 | #endif |
| 16628 | #ifdef VK_EXT_direct_mode_display |
| 16629 | VkResult VkEncoder::vkReleaseDisplayEXT( |
| 16630 | VkPhysicalDevice physicalDevice, |
| 16631 | VkDisplayKHR display) |
| 16632 | { |
| 16633 | auto stream = mImpl->stream(); |
| 16634 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16635 | auto resources = mImpl->resources(); |
| 16636 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16637 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16638 | VkPhysicalDevice local_physicalDevice; |
| 16639 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16640 | VkDisplayKHR local_display; |
| 16641 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16642 | countingStream->rewind(); |
| 16643 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16644 | uint64_t cgen_var_1269; |
| 16645 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1269, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16646 | countingStream->write((uint64_t*)&cgen_var_1269, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16647 | uint64_t cgen_var_1270; |
| 16648 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1270, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16649 | countingStream->write((uint64_t*)&cgen_var_1270, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16650 | } |
| 16651 | uint32_t packetSize_vkReleaseDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16652 | countingStream->rewind(); |
| 16653 | uint32_t opcode_vkReleaseDisplayEXT = OP_vkReleaseDisplayEXT; |
| 16654 | stream->write(&opcode_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| 16655 | stream->write(&packetSize_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16656 | uint64_t cgen_var_1271; |
| 16657 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1271, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16658 | stream->write((uint64_t*)&cgen_var_1271, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16659 | uint64_t cgen_var_1272; |
| 16660 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1272, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16661 | stream->write((uint64_t*)&cgen_var_1272, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16662 | VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0; |
| 16663 | stream->read(&vkReleaseDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16664 | countingStream->clearPool(); |
| 16665 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16666 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16667 | return vkReleaseDisplayEXT_VkResult_return; |
| 16668 | } |
| 16669 | |
| 16670 | #endif |
| 16671 | #ifdef VK_EXT_acquire_xlib_display |
| 16672 | VkResult VkEncoder::vkAcquireXlibDisplayEXT( |
| 16673 | VkPhysicalDevice physicalDevice, |
| 16674 | Display* dpy, |
| 16675 | VkDisplayKHR display) |
| 16676 | { |
| 16677 | auto stream = mImpl->stream(); |
| 16678 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16679 | auto resources = mImpl->resources(); |
| 16680 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16681 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16682 | VkPhysicalDevice local_physicalDevice; |
| 16683 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16684 | VkDisplayKHR local_display; |
| 16685 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16686 | countingStream->rewind(); |
| 16687 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16688 | uint64_t cgen_var_1273; |
| 16689 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1273, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16690 | countingStream->write((uint64_t*)&cgen_var_1273, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16691 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16692 | uint64_t cgen_var_1274; |
| 16693 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1274, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16694 | countingStream->write((uint64_t*)&cgen_var_1274, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16695 | } |
| 16696 | uint32_t packetSize_vkAcquireXlibDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16697 | countingStream->rewind(); |
| 16698 | uint32_t opcode_vkAcquireXlibDisplayEXT = OP_vkAcquireXlibDisplayEXT; |
| 16699 | stream->write(&opcode_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| 16700 | stream->write(&packetSize_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16701 | uint64_t cgen_var_1275; |
| 16702 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1275, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16703 | stream->write((uint64_t*)&cgen_var_1275, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16704 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16705 | uint64_t cgen_var_1276; |
| 16706 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1276, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16707 | stream->write((uint64_t*)&cgen_var_1276, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16708 | stream->read((Display*)dpy, sizeof(Display)); |
| 16709 | VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0; |
| 16710 | stream->read(&vkAcquireXlibDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16711 | countingStream->clearPool(); |
| 16712 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16713 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16714 | return vkAcquireXlibDisplayEXT_VkResult_return; |
| 16715 | } |
| 16716 | |
| 16717 | VkResult VkEncoder::vkGetRandROutputDisplayEXT( |
| 16718 | VkPhysicalDevice physicalDevice, |
| 16719 | Display* dpy, |
| 16720 | RROutput rrOutput, |
| 16721 | VkDisplayKHR* pDisplay) |
| 16722 | { |
| 16723 | auto stream = mImpl->stream(); |
| 16724 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16725 | auto resources = mImpl->resources(); |
| 16726 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16727 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16728 | VkPhysicalDevice local_physicalDevice; |
| 16729 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16730 | RROutput local_rrOutput; |
| 16731 | local_rrOutput = rrOutput; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16732 | countingStream->rewind(); |
| 16733 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16734 | uint64_t cgen_var_1277; |
| 16735 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1277, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16736 | countingStream->write((uint64_t*)&cgen_var_1277, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16737 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16738 | countingStream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16739 | uint64_t cgen_var_1278; |
| 16740 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1278, 1); |
| 16741 | countingStream->write((uint64_t*)&cgen_var_1278, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16742 | } |
| 16743 | uint32_t packetSize_vkGetRandROutputDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16744 | countingStream->rewind(); |
| 16745 | uint32_t opcode_vkGetRandROutputDisplayEXT = OP_vkGetRandROutputDisplayEXT; |
| 16746 | stream->write(&opcode_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| 16747 | stream->write(&packetSize_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16748 | uint64_t cgen_var_1279; |
| 16749 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1279, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16750 | stream->write((uint64_t*)&cgen_var_1279, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16751 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16752 | stream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16753 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16754 | uint64_t cgen_var_1280; |
| 16755 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1280, 1); |
| 16756 | stream->write((uint64_t*)&cgen_var_1280, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16757 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16758 | stream->read((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16759 | uint64_t cgen_var_1281; |
| 16760 | stream->read((uint64_t*)&cgen_var_1281, 8); |
| 16761 | stream->handleMapping()->mapHandles_u64_VkDisplayKHR(&cgen_var_1281, (VkDisplayKHR*)pDisplay, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16762 | VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0; |
| 16763 | stream->read(&vkGetRandROutputDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16764 | countingStream->clearPool(); |
| 16765 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16766 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16767 | return vkGetRandROutputDisplayEXT_VkResult_return; |
| 16768 | } |
| 16769 | |
| 16770 | #endif |
| 16771 | #ifdef VK_EXT_display_surface_counter |
| 16772 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2EXT( |
| 16773 | VkPhysicalDevice physicalDevice, |
| 16774 | VkSurfaceKHR surface, |
| 16775 | VkSurfaceCapabilities2EXT* pSurfaceCapabilities) |
| 16776 | { |
| 16777 | auto stream = mImpl->stream(); |
| 16778 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16779 | auto resources = mImpl->resources(); |
| 16780 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16781 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16782 | VkPhysicalDevice local_physicalDevice; |
| 16783 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16784 | VkSurfaceKHR local_surface; |
| 16785 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16786 | countingStream->rewind(); |
| 16787 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16788 | uint64_t cgen_var_1282; |
| 16789 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1282, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16790 | countingStream->write((uint64_t*)&cgen_var_1282, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16791 | uint64_t cgen_var_1283; |
| 16792 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1283, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16793 | countingStream->write((uint64_t*)&cgen_var_1283, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16794 | marshal_VkSurfaceCapabilities2EXT(countingStream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 16795 | } |
| 16796 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16797 | countingStream->rewind(); |
| 16798 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT = OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT; |
| 16799 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| 16800 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16801 | uint64_t cgen_var_1284; |
| 16802 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1284, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16803 | stream->write((uint64_t*)&cgen_var_1284, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16804 | uint64_t cgen_var_1285; |
| 16805 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1285, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16806 | stream->write((uint64_t*)&cgen_var_1285, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16807 | marshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 16808 | unmarshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 16809 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0; |
| 16810 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16811 | countingStream->clearPool(); |
| 16812 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16813 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16814 | return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return; |
| 16815 | } |
| 16816 | |
| 16817 | #endif |
| 16818 | #ifdef VK_EXT_display_control |
| 16819 | VkResult VkEncoder::vkDisplayPowerControlEXT( |
| 16820 | VkDevice device, |
| 16821 | VkDisplayKHR display, |
| 16822 | const VkDisplayPowerInfoEXT* pDisplayPowerInfo) |
| 16823 | { |
| 16824 | auto stream = mImpl->stream(); |
| 16825 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16826 | auto resources = mImpl->resources(); |
| 16827 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16828 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16829 | VkDevice local_device; |
| 16830 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16831 | VkDisplayKHR local_display; |
| 16832 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16833 | VkDisplayPowerInfoEXT* local_pDisplayPowerInfo; |
| 16834 | local_pDisplayPowerInfo = nullptr; |
| 16835 | if (pDisplayPowerInfo) |
| 16836 | { |
| 16837 | local_pDisplayPowerInfo = (VkDisplayPowerInfoEXT*)pool->alloc(sizeof(const VkDisplayPowerInfoEXT)); |
| 16838 | deepcopy_VkDisplayPowerInfoEXT(pool, pDisplayPowerInfo, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| 16839 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16840 | countingStream->rewind(); |
| 16841 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16842 | uint64_t cgen_var_1286; |
| 16843 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1286, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16844 | countingStream->write((uint64_t*)&cgen_var_1286, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16845 | uint64_t cgen_var_1287; |
| 16846 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1287, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16847 | countingStream->write((uint64_t*)&cgen_var_1287, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16848 | marshal_VkDisplayPowerInfoEXT(countingStream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16849 | } |
| 16850 | uint32_t packetSize_vkDisplayPowerControlEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16851 | countingStream->rewind(); |
| 16852 | uint32_t opcode_vkDisplayPowerControlEXT = OP_vkDisplayPowerControlEXT; |
| 16853 | stream->write(&opcode_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| 16854 | stream->write(&packetSize_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16855 | uint64_t cgen_var_1288; |
| 16856 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1288, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16857 | stream->write((uint64_t*)&cgen_var_1288, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16858 | uint64_t cgen_var_1289; |
| 16859 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1289, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16860 | stream->write((uint64_t*)&cgen_var_1289, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16861 | marshal_VkDisplayPowerInfoEXT(stream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16862 | VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0; |
| 16863 | stream->read(&vkDisplayPowerControlEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16864 | countingStream->clearPool(); |
| 16865 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16866 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16867 | return vkDisplayPowerControlEXT_VkResult_return; |
| 16868 | } |
| 16869 | |
| 16870 | VkResult VkEncoder::vkRegisterDeviceEventEXT( |
| 16871 | VkDevice device, |
| 16872 | const VkDeviceEventInfoEXT* pDeviceEventInfo, |
| 16873 | const VkAllocationCallbacks* pAllocator, |
| 16874 | VkFence* pFence) |
| 16875 | { |
| 16876 | auto stream = mImpl->stream(); |
| 16877 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16878 | auto resources = mImpl->resources(); |
| 16879 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16880 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16881 | VkDevice local_device; |
| 16882 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16883 | VkDeviceEventInfoEXT* local_pDeviceEventInfo; |
| 16884 | local_pDeviceEventInfo = nullptr; |
| 16885 | if (pDeviceEventInfo) |
| 16886 | { |
| 16887 | local_pDeviceEventInfo = (VkDeviceEventInfoEXT*)pool->alloc(sizeof(const VkDeviceEventInfoEXT)); |
| 16888 | deepcopy_VkDeviceEventInfoEXT(pool, pDeviceEventInfo, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| 16889 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16890 | VkAllocationCallbacks* local_pAllocator; |
| 16891 | local_pAllocator = nullptr; |
| 16892 | if (pAllocator) |
| 16893 | { |
| 16894 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16895 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16896 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16897 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16898 | countingStream->rewind(); |
| 16899 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16900 | uint64_t cgen_var_1290; |
| 16901 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1290, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16902 | countingStream->write((uint64_t*)&cgen_var_1290, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16903 | marshal_VkDeviceEventInfoEXT(countingStream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16904 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16905 | uint64_t cgen_var_1291 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16906 | countingStream->putBe64(cgen_var_1291); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16907 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16908 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16909 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16910 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16911 | uint64_t cgen_var_1292; |
| 16912 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1292, 1); |
| 16913 | countingStream->write((uint64_t*)&cgen_var_1292, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16914 | } |
| 16915 | uint32_t packetSize_vkRegisterDeviceEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16916 | countingStream->rewind(); |
| 16917 | uint32_t opcode_vkRegisterDeviceEventEXT = OP_vkRegisterDeviceEventEXT; |
| 16918 | stream->write(&opcode_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| 16919 | stream->write(&packetSize_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16920 | uint64_t cgen_var_1293; |
| 16921 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1293, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16922 | stream->write((uint64_t*)&cgen_var_1293, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16923 | marshal_VkDeviceEventInfoEXT(stream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16924 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16925 | uint64_t cgen_var_1294 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16926 | stream->putBe64(cgen_var_1294); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16927 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16928 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16929 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16930 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16931 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16932 | uint64_t cgen_var_1295; |
| 16933 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1295, 1); |
| 16934 | stream->write((uint64_t*)&cgen_var_1295, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16935 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16936 | uint64_t cgen_var_1296; |
| 16937 | stream->read((uint64_t*)&cgen_var_1296, 8); |
| 16938 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1296, (VkFence*)pFence, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16939 | VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0; |
| 16940 | stream->read(&vkRegisterDeviceEventEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16941 | countingStream->clearPool(); |
| 16942 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16943 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16944 | return vkRegisterDeviceEventEXT_VkResult_return; |
| 16945 | } |
| 16946 | |
| 16947 | VkResult VkEncoder::vkRegisterDisplayEventEXT( |
| 16948 | VkDevice device, |
| 16949 | VkDisplayKHR display, |
| 16950 | const VkDisplayEventInfoEXT* pDisplayEventInfo, |
| 16951 | const VkAllocationCallbacks* pAllocator, |
| 16952 | VkFence* pFence) |
| 16953 | { |
| 16954 | auto stream = mImpl->stream(); |
| 16955 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16956 | auto resources = mImpl->resources(); |
| 16957 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16958 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16959 | VkDevice local_device; |
| 16960 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16961 | VkDisplayKHR local_display; |
| 16962 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16963 | VkDisplayEventInfoEXT* local_pDisplayEventInfo; |
| 16964 | local_pDisplayEventInfo = nullptr; |
| 16965 | if (pDisplayEventInfo) |
| 16966 | { |
| 16967 | local_pDisplayEventInfo = (VkDisplayEventInfoEXT*)pool->alloc(sizeof(const VkDisplayEventInfoEXT)); |
| 16968 | deepcopy_VkDisplayEventInfoEXT(pool, pDisplayEventInfo, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| 16969 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16970 | VkAllocationCallbacks* local_pAllocator; |
| 16971 | local_pAllocator = nullptr; |
| 16972 | if (pAllocator) |
| 16973 | { |
| 16974 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16975 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16976 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16977 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16978 | countingStream->rewind(); |
| 16979 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16980 | uint64_t cgen_var_1297; |
| 16981 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1297, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16982 | countingStream->write((uint64_t*)&cgen_var_1297, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16983 | uint64_t cgen_var_1298; |
| 16984 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1298, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 16985 | countingStream->write((uint64_t*)&cgen_var_1298, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16986 | marshal_VkDisplayEventInfoEXT(countingStream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16987 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16988 | uint64_t cgen_var_1299 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16989 | countingStream->putBe64(cgen_var_1299); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16990 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16991 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16992 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16993 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16994 | uint64_t cgen_var_1300; |
| 16995 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1300, 1); |
| 16996 | countingStream->write((uint64_t*)&cgen_var_1300, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16997 | } |
| 16998 | uint32_t packetSize_vkRegisterDisplayEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16999 | countingStream->rewind(); |
| 17000 | uint32_t opcode_vkRegisterDisplayEventEXT = OP_vkRegisterDisplayEventEXT; |
| 17001 | stream->write(&opcode_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| 17002 | stream->write(&packetSize_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17003 | uint64_t cgen_var_1301; |
| 17004 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1301, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17005 | stream->write((uint64_t*)&cgen_var_1301, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17006 | uint64_t cgen_var_1302; |
| 17007 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1302, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17008 | stream->write((uint64_t*)&cgen_var_1302, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17009 | marshal_VkDisplayEventInfoEXT(stream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17010 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17011 | uint64_t cgen_var_1303 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17012 | stream->putBe64(cgen_var_1303); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17013 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17014 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17015 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17016 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17017 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17018 | uint64_t cgen_var_1304; |
| 17019 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1304, 1); |
| 17020 | stream->write((uint64_t*)&cgen_var_1304, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17021 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17022 | uint64_t cgen_var_1305; |
| 17023 | stream->read((uint64_t*)&cgen_var_1305, 8); |
| 17024 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1305, (VkFence*)pFence, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17025 | VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0; |
| 17026 | stream->read(&vkRegisterDisplayEventEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17027 | countingStream->clearPool(); |
| 17028 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17029 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17030 | return vkRegisterDisplayEventEXT_VkResult_return; |
| 17031 | } |
| 17032 | |
| 17033 | VkResult VkEncoder::vkGetSwapchainCounterEXT( |
| 17034 | VkDevice device, |
| 17035 | VkSwapchainKHR swapchain, |
| 17036 | VkSurfaceCounterFlagBitsEXT counter, |
| 17037 | uint64_t* pCounterValue) |
| 17038 | { |
| 17039 | auto stream = mImpl->stream(); |
| 17040 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17041 | auto resources = mImpl->resources(); |
| 17042 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17043 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17044 | VkDevice local_device; |
| 17045 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17046 | VkSwapchainKHR local_swapchain; |
| 17047 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17048 | VkSurfaceCounterFlagBitsEXT local_counter; |
| 17049 | local_counter = counter; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17050 | countingStream->rewind(); |
| 17051 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17052 | uint64_t cgen_var_1306; |
| 17053 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1306, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17054 | countingStream->write((uint64_t*)&cgen_var_1306, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17055 | uint64_t cgen_var_1307; |
| 17056 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1307, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17057 | countingStream->write((uint64_t*)&cgen_var_1307, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17058 | countingStream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17059 | countingStream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 17060 | } |
| 17061 | uint32_t packetSize_vkGetSwapchainCounterEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17062 | countingStream->rewind(); |
| 17063 | uint32_t opcode_vkGetSwapchainCounterEXT = OP_vkGetSwapchainCounterEXT; |
| 17064 | stream->write(&opcode_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| 17065 | stream->write(&packetSize_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17066 | uint64_t cgen_var_1308; |
| 17067 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1308, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17068 | stream->write((uint64_t*)&cgen_var_1308, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17069 | uint64_t cgen_var_1309; |
| 17070 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1309, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17071 | stream->write((uint64_t*)&cgen_var_1309, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17072 | stream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17073 | stream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 17074 | stream->read((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 17075 | VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0; |
| 17076 | stream->read(&vkGetSwapchainCounterEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17077 | countingStream->clearPool(); |
| 17078 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17079 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17080 | return vkGetSwapchainCounterEXT_VkResult_return; |
| 17081 | } |
| 17082 | |
| 17083 | #endif |
| 17084 | #ifdef VK_GOOGLE_display_timing |
| 17085 | VkResult VkEncoder::vkGetRefreshCycleDurationGOOGLE( |
| 17086 | VkDevice device, |
| 17087 | VkSwapchainKHR swapchain, |
| 17088 | VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) |
| 17089 | { |
| 17090 | auto stream = mImpl->stream(); |
| 17091 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17092 | auto resources = mImpl->resources(); |
| 17093 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17094 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17095 | VkDevice local_device; |
| 17096 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17097 | VkSwapchainKHR local_swapchain; |
| 17098 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17099 | countingStream->rewind(); |
| 17100 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17101 | uint64_t cgen_var_1310; |
| 17102 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1310, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17103 | countingStream->write((uint64_t*)&cgen_var_1310, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17104 | uint64_t cgen_var_1311; |
| 17105 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1311, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17106 | countingStream->write((uint64_t*)&cgen_var_1311, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17107 | marshal_VkRefreshCycleDurationGOOGLE(countingStream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 17108 | } |
| 17109 | uint32_t packetSize_vkGetRefreshCycleDurationGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17110 | countingStream->rewind(); |
| 17111 | uint32_t opcode_vkGetRefreshCycleDurationGOOGLE = OP_vkGetRefreshCycleDurationGOOGLE; |
| 17112 | stream->write(&opcode_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| 17113 | stream->write(&packetSize_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17114 | uint64_t cgen_var_1312; |
| 17115 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1312, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17116 | stream->write((uint64_t*)&cgen_var_1312, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17117 | uint64_t cgen_var_1313; |
| 17118 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1313, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17119 | stream->write((uint64_t*)&cgen_var_1313, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17120 | marshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 17121 | unmarshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 17122 | VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0; |
| 17123 | stream->read(&vkGetRefreshCycleDurationGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17124 | countingStream->clearPool(); |
| 17125 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17126 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17127 | return vkGetRefreshCycleDurationGOOGLE_VkResult_return; |
| 17128 | } |
| 17129 | |
| 17130 | VkResult VkEncoder::vkGetPastPresentationTimingGOOGLE( |
| 17131 | VkDevice device, |
| 17132 | VkSwapchainKHR swapchain, |
| 17133 | uint32_t* pPresentationTimingCount, |
| 17134 | VkPastPresentationTimingGOOGLE* pPresentationTimings) |
| 17135 | { |
| 17136 | auto stream = mImpl->stream(); |
| 17137 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17138 | auto resources = mImpl->resources(); |
| 17139 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17140 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17141 | VkDevice local_device; |
| 17142 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17143 | VkSwapchainKHR local_swapchain; |
| 17144 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17145 | countingStream->rewind(); |
| 17146 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17147 | uint64_t cgen_var_1314; |
| 17148 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1314, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17149 | countingStream->write((uint64_t*)&cgen_var_1314, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17150 | uint64_t cgen_var_1315; |
| 17151 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1315, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17152 | countingStream->write((uint64_t*)&cgen_var_1315, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17153 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17154 | uint64_t cgen_var_1316 = (uint64_t)(uintptr_t)pPresentationTimingCount; |
| 17155 | countingStream->putBe64(cgen_var_1316); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17156 | if (pPresentationTimingCount) |
| 17157 | { |
| 17158 | countingStream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 17159 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17160 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17161 | uint64_t cgen_var_1317 = (uint64_t)(uintptr_t)pPresentationTimings; |
| 17162 | countingStream->putBe64(cgen_var_1317); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17163 | if (pPresentationTimings) |
| 17164 | { |
| 17165 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 17166 | { |
| 17167 | marshal_VkPastPresentationTimingGOOGLE(countingStream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 17168 | } |
| 17169 | } |
| 17170 | } |
| 17171 | uint32_t packetSize_vkGetPastPresentationTimingGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17172 | countingStream->rewind(); |
| 17173 | uint32_t opcode_vkGetPastPresentationTimingGOOGLE = OP_vkGetPastPresentationTimingGOOGLE; |
| 17174 | stream->write(&opcode_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| 17175 | stream->write(&packetSize_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17176 | uint64_t cgen_var_1318; |
| 17177 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1318, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17178 | stream->write((uint64_t*)&cgen_var_1318, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17179 | uint64_t cgen_var_1319; |
| 17180 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1319, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17181 | stream->write((uint64_t*)&cgen_var_1319, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17182 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17183 | uint64_t cgen_var_1320 = (uint64_t)(uintptr_t)pPresentationTimingCount; |
| 17184 | stream->putBe64(cgen_var_1320); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17185 | if (pPresentationTimingCount) |
| 17186 | { |
| 17187 | stream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 17188 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17189 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17190 | uint64_t cgen_var_1321 = (uint64_t)(uintptr_t)pPresentationTimings; |
| 17191 | stream->putBe64(cgen_var_1321); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17192 | if (pPresentationTimings) |
| 17193 | { |
| 17194 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 17195 | { |
| 17196 | marshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 17197 | } |
| 17198 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17199 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17200 | uint32_t* check_pPresentationTimingCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17201 | check_pPresentationTimingCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17202 | if (pPresentationTimingCount) |
| 17203 | { |
| 17204 | if (!(check_pPresentationTimingCount)) |
| 17205 | { |
| 17206 | fprintf(stderr, "fatal: pPresentationTimingCount inconsistent between guest and host\n"); |
| 17207 | } |
| 17208 | stream->read((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 17209 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17210 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17211 | VkPastPresentationTimingGOOGLE* check_pPresentationTimings; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17212 | check_pPresentationTimings = (VkPastPresentationTimingGOOGLE*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17213 | if (pPresentationTimings) |
| 17214 | { |
| 17215 | if (!(check_pPresentationTimings)) |
| 17216 | { |
| 17217 | fprintf(stderr, "fatal: pPresentationTimings inconsistent between guest and host\n"); |
| 17218 | } |
| 17219 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 17220 | { |
| 17221 | unmarshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 17222 | } |
| 17223 | } |
| 17224 | VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0; |
| 17225 | stream->read(&vkGetPastPresentationTimingGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17226 | countingStream->clearPool(); |
| 17227 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17228 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17229 | return vkGetPastPresentationTimingGOOGLE_VkResult_return; |
| 17230 | } |
| 17231 | |
| 17232 | #endif |
| 17233 | #ifdef VK_NV_sample_mask_override_coverage |
| 17234 | #endif |
| 17235 | #ifdef VK_NV_geometry_shader_passthrough |
| 17236 | #endif |
| 17237 | #ifdef VK_NV_viewport_array2 |
| 17238 | #endif |
| 17239 | #ifdef VK_NVX_multiview_per_view_attributes |
| 17240 | #endif |
| 17241 | #ifdef VK_NV_viewport_swizzle |
| 17242 | #endif |
| 17243 | #ifdef VK_EXT_discard_rectangles |
| 17244 | void VkEncoder::vkCmdSetDiscardRectangleEXT( |
| 17245 | VkCommandBuffer commandBuffer, |
| 17246 | uint32_t firstDiscardRectangle, |
| 17247 | uint32_t discardRectangleCount, |
| 17248 | const VkRect2D* pDiscardRectangles) |
| 17249 | { |
| 17250 | auto stream = mImpl->stream(); |
| 17251 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17252 | auto resources = mImpl->resources(); |
| 17253 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17254 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17255 | VkCommandBuffer local_commandBuffer; |
| 17256 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17257 | uint32_t local_firstDiscardRectangle; |
| 17258 | local_firstDiscardRectangle = firstDiscardRectangle; |
| 17259 | uint32_t local_discardRectangleCount; |
| 17260 | local_discardRectangleCount = discardRectangleCount; |
| 17261 | VkRect2D* local_pDiscardRectangles; |
| 17262 | local_pDiscardRectangles = nullptr; |
| 17263 | if (pDiscardRectangles) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17264 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17265 | local_pDiscardRectangles = (VkRect2D*)pool->alloc(((discardRectangleCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17266 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 17267 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17268 | deepcopy_VkRect2D(pool, pDiscardRectangles + i, (VkRect2D*)(local_pDiscardRectangles + i)); |
| 17269 | } |
| 17270 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17271 | countingStream->rewind(); |
| 17272 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17273 | uint64_t cgen_var_1324; |
| 17274 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1324, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17275 | countingStream->write((uint64_t*)&cgen_var_1324, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17276 | countingStream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 17277 | countingStream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| 17278 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 17279 | { |
| 17280 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17281 | } |
| 17282 | } |
| 17283 | uint32_t packetSize_vkCmdSetDiscardRectangleEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17284 | countingStream->rewind(); |
| 17285 | uint32_t opcode_vkCmdSetDiscardRectangleEXT = OP_vkCmdSetDiscardRectangleEXT; |
| 17286 | stream->write(&opcode_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| 17287 | stream->write(&packetSize_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17288 | uint64_t cgen_var_1325; |
| 17289 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1325, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17290 | stream->write((uint64_t*)&cgen_var_1325, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17291 | stream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 17292 | stream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17293 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 17294 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17295 | marshal_VkRect2D(stream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17296 | } |
| 17297 | } |
| 17298 | |
| 17299 | #endif |
| 17300 | #ifdef VK_EXT_conservative_rasterization |
| 17301 | #endif |
| 17302 | #ifdef VK_EXT_swapchain_colorspace |
| 17303 | #endif |
| 17304 | #ifdef VK_EXT_hdr_metadata |
| 17305 | void VkEncoder::vkSetHdrMetadataEXT( |
| 17306 | VkDevice device, |
| 17307 | uint32_t swapchainCount, |
| 17308 | const VkSwapchainKHR* pSwapchains, |
| 17309 | const VkHdrMetadataEXT* pMetadata) |
| 17310 | { |
| 17311 | auto stream = mImpl->stream(); |
| 17312 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17313 | auto resources = mImpl->resources(); |
| 17314 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17315 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17316 | VkDevice local_device; |
| 17317 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17318 | uint32_t local_swapchainCount; |
| 17319 | local_swapchainCount = swapchainCount; |
| 17320 | VkSwapchainKHR* local_pSwapchains; |
| 17321 | local_pSwapchains = nullptr; |
| 17322 | if (pSwapchains) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17323 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17324 | local_pSwapchains = (VkSwapchainKHR*)pool->dupArray(pSwapchains, ((swapchainCount)) * sizeof(const VkSwapchainKHR)); |
| 17325 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17326 | VkHdrMetadataEXT* local_pMetadata; |
| 17327 | local_pMetadata = nullptr; |
| 17328 | if (pMetadata) |
| 17329 | { |
| 17330 | local_pMetadata = (VkHdrMetadataEXT*)pool->alloc(((swapchainCount)) * sizeof(const VkHdrMetadataEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17331 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 17332 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17333 | deepcopy_VkHdrMetadataEXT(pool, pMetadata + i, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| 17334 | } |
| 17335 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17336 | countingStream->rewind(); |
| 17337 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17338 | uint64_t cgen_var_1326; |
| 17339 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1326, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17340 | countingStream->write((uint64_t*)&cgen_var_1326, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17341 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17342 | if (((swapchainCount))) |
| 17343 | { |
| 17344 | uint64_t* cgen_var_1327; |
| 17345 | countingStream->alloc((void**)&cgen_var_1327, ((swapchainCount)) * 8); |
| 17346 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1327, ((swapchainCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17347 | countingStream->write((uint64_t*)cgen_var_1327, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17348 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17349 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 17350 | { |
| 17351 | marshal_VkHdrMetadataEXT(countingStream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17352 | } |
| 17353 | } |
| 17354 | uint32_t packetSize_vkSetHdrMetadataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17355 | countingStream->rewind(); |
| 17356 | uint32_t opcode_vkSetHdrMetadataEXT = OP_vkSetHdrMetadataEXT; |
| 17357 | stream->write(&opcode_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| 17358 | stream->write(&packetSize_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17359 | uint64_t cgen_var_1328; |
| 17360 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1328, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17361 | stream->write((uint64_t*)&cgen_var_1328, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17362 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17363 | if (((swapchainCount))) |
| 17364 | { |
| 17365 | uint64_t* cgen_var_1329; |
| 17366 | stream->alloc((void**)&cgen_var_1329, ((swapchainCount)) * 8); |
| 17367 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1329, ((swapchainCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17368 | stream->write((uint64_t*)cgen_var_1329, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17369 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17370 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 17371 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17372 | marshal_VkHdrMetadataEXT(stream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17373 | } |
| 17374 | } |
| 17375 | |
| 17376 | #endif |
| 17377 | #ifdef VK_MVK_ios_surface |
| 17378 | VkResult VkEncoder::vkCreateIOSSurfaceMVK( |
| 17379 | VkInstance instance, |
| 17380 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo, |
| 17381 | const VkAllocationCallbacks* pAllocator, |
| 17382 | VkSurfaceKHR* pSurface) |
| 17383 | { |
| 17384 | auto stream = mImpl->stream(); |
| 17385 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17386 | auto resources = mImpl->resources(); |
| 17387 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17388 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17389 | VkInstance local_instance; |
| 17390 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17391 | VkIOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| 17392 | local_pCreateInfo = nullptr; |
| 17393 | if (pCreateInfo) |
| 17394 | { |
| 17395 | local_pCreateInfo = (VkIOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkIOSSurfaceCreateInfoMVK)); |
| 17396 | deepcopy_VkIOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 17397 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17398 | VkAllocationCallbacks* local_pAllocator; |
| 17399 | local_pAllocator = nullptr; |
| 17400 | if (pAllocator) |
| 17401 | { |
| 17402 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17403 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17404 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17405 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17406 | countingStream->rewind(); |
| 17407 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17408 | uint64_t cgen_var_1330; |
| 17409 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1330, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17410 | countingStream->write((uint64_t*)&cgen_var_1330, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17411 | marshal_VkIOSSurfaceCreateInfoMVK(countingStream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17412 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17413 | uint64_t cgen_var_1331 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17414 | countingStream->putBe64(cgen_var_1331); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17415 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17416 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17417 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17418 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17419 | uint64_t cgen_var_1332; |
| 17420 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1332, 1); |
| 17421 | countingStream->write((uint64_t*)&cgen_var_1332, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17422 | } |
| 17423 | uint32_t packetSize_vkCreateIOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17424 | countingStream->rewind(); |
| 17425 | uint32_t opcode_vkCreateIOSSurfaceMVK = OP_vkCreateIOSSurfaceMVK; |
| 17426 | stream->write(&opcode_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| 17427 | stream->write(&packetSize_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17428 | uint64_t cgen_var_1333; |
| 17429 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1333, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17430 | stream->write((uint64_t*)&cgen_var_1333, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17431 | marshal_VkIOSSurfaceCreateInfoMVK(stream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17432 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17433 | uint64_t cgen_var_1334 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17434 | stream->putBe64(cgen_var_1334); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17435 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17436 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17437 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17438 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17439 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17440 | uint64_t cgen_var_1335; |
| 17441 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1335, 1); |
| 17442 | stream->write((uint64_t*)&cgen_var_1335, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17443 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17444 | uint64_t cgen_var_1336; |
| 17445 | stream->read((uint64_t*)&cgen_var_1336, 8); |
| 17446 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1336, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17447 | VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 17448 | stream->read(&vkCreateIOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17449 | countingStream->clearPool(); |
| 17450 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17451 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17452 | return vkCreateIOSSurfaceMVK_VkResult_return; |
| 17453 | } |
| 17454 | |
| 17455 | #endif |
| 17456 | #ifdef VK_MVK_macos_surface |
| 17457 | VkResult VkEncoder::vkCreateMacOSSurfaceMVK( |
| 17458 | VkInstance instance, |
| 17459 | const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, |
| 17460 | const VkAllocationCallbacks* pAllocator, |
| 17461 | VkSurfaceKHR* pSurface) |
| 17462 | { |
| 17463 | auto stream = mImpl->stream(); |
| 17464 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17465 | auto resources = mImpl->resources(); |
| 17466 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17467 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17468 | VkInstance local_instance; |
| 17469 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17470 | VkMacOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| 17471 | local_pCreateInfo = nullptr; |
| 17472 | if (pCreateInfo) |
| 17473 | { |
| 17474 | local_pCreateInfo = (VkMacOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkMacOSSurfaceCreateInfoMVK)); |
| 17475 | deepcopy_VkMacOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 17476 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17477 | VkAllocationCallbacks* local_pAllocator; |
| 17478 | local_pAllocator = nullptr; |
| 17479 | if (pAllocator) |
| 17480 | { |
| 17481 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17482 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17483 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17484 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17485 | countingStream->rewind(); |
| 17486 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17487 | uint64_t cgen_var_1337; |
| 17488 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1337, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17489 | countingStream->write((uint64_t*)&cgen_var_1337, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17490 | marshal_VkMacOSSurfaceCreateInfoMVK(countingStream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17491 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17492 | uint64_t cgen_var_1338 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17493 | countingStream->putBe64(cgen_var_1338); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17494 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17495 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17496 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17497 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17498 | uint64_t cgen_var_1339; |
| 17499 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1339, 1); |
| 17500 | countingStream->write((uint64_t*)&cgen_var_1339, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17501 | } |
| 17502 | uint32_t packetSize_vkCreateMacOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17503 | countingStream->rewind(); |
| 17504 | uint32_t opcode_vkCreateMacOSSurfaceMVK = OP_vkCreateMacOSSurfaceMVK; |
| 17505 | stream->write(&opcode_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| 17506 | stream->write(&packetSize_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17507 | uint64_t cgen_var_1340; |
| 17508 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1340, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17509 | stream->write((uint64_t*)&cgen_var_1340, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17510 | marshal_VkMacOSSurfaceCreateInfoMVK(stream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17511 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17512 | uint64_t cgen_var_1341 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17513 | stream->putBe64(cgen_var_1341); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17514 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17515 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17516 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17517 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17518 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17519 | uint64_t cgen_var_1342; |
| 17520 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1342, 1); |
| 17521 | stream->write((uint64_t*)&cgen_var_1342, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17522 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17523 | uint64_t cgen_var_1343; |
| 17524 | stream->read((uint64_t*)&cgen_var_1343, 8); |
| 17525 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1343, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17526 | VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 17527 | stream->read(&vkCreateMacOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17528 | countingStream->clearPool(); |
| 17529 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17530 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17531 | return vkCreateMacOSSurfaceMVK_VkResult_return; |
| 17532 | } |
| 17533 | |
| 17534 | #endif |
| 17535 | #ifdef VK_EXT_external_memory_dma_buf |
| 17536 | #endif |
| 17537 | #ifdef VK_EXT_queue_family_foreign |
| 17538 | #endif |
| 17539 | #ifdef VK_EXT_debug_utils |
| 17540 | VkResult VkEncoder::vkSetDebugUtilsObjectNameEXT( |
| 17541 | VkDevice device, |
| 17542 | const VkDebugUtilsObjectNameInfoEXT* pNameInfo) |
| 17543 | { |
| 17544 | auto stream = mImpl->stream(); |
| 17545 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17546 | auto resources = mImpl->resources(); |
| 17547 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17548 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17549 | VkDevice local_device; |
| 17550 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17551 | VkDebugUtilsObjectNameInfoEXT* local_pNameInfo; |
| 17552 | local_pNameInfo = nullptr; |
| 17553 | if (pNameInfo) |
| 17554 | { |
| 17555 | local_pNameInfo = (VkDebugUtilsObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectNameInfoEXT)); |
| 17556 | deepcopy_VkDebugUtilsObjectNameInfoEXT(pool, pNameInfo, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| 17557 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17558 | countingStream->rewind(); |
| 17559 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17560 | uint64_t cgen_var_1344; |
| 17561 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1344, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17562 | countingStream->write((uint64_t*)&cgen_var_1344, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17563 | marshal_VkDebugUtilsObjectNameInfoEXT(countingStream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17564 | } |
| 17565 | uint32_t packetSize_vkSetDebugUtilsObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17566 | countingStream->rewind(); |
| 17567 | uint32_t opcode_vkSetDebugUtilsObjectNameEXT = OP_vkSetDebugUtilsObjectNameEXT; |
| 17568 | stream->write(&opcode_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| 17569 | stream->write(&packetSize_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17570 | uint64_t cgen_var_1345; |
| 17571 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1345, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17572 | stream->write((uint64_t*)&cgen_var_1345, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17573 | marshal_VkDebugUtilsObjectNameInfoEXT(stream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17574 | VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0; |
| 17575 | stream->read(&vkSetDebugUtilsObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17576 | countingStream->clearPool(); |
| 17577 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17578 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17579 | return vkSetDebugUtilsObjectNameEXT_VkResult_return; |
| 17580 | } |
| 17581 | |
| 17582 | VkResult VkEncoder::vkSetDebugUtilsObjectTagEXT( |
| 17583 | VkDevice device, |
| 17584 | const VkDebugUtilsObjectTagInfoEXT* pTagInfo) |
| 17585 | { |
| 17586 | auto stream = mImpl->stream(); |
| 17587 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17588 | auto resources = mImpl->resources(); |
| 17589 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17590 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17591 | VkDevice local_device; |
| 17592 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17593 | VkDebugUtilsObjectTagInfoEXT* local_pTagInfo; |
| 17594 | local_pTagInfo = nullptr; |
| 17595 | if (pTagInfo) |
| 17596 | { |
| 17597 | local_pTagInfo = (VkDebugUtilsObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectTagInfoEXT)); |
| 17598 | deepcopy_VkDebugUtilsObjectTagInfoEXT(pool, pTagInfo, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| 17599 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17600 | countingStream->rewind(); |
| 17601 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17602 | uint64_t cgen_var_1346; |
| 17603 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1346, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17604 | countingStream->write((uint64_t*)&cgen_var_1346, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17605 | marshal_VkDebugUtilsObjectTagInfoEXT(countingStream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17606 | } |
| 17607 | uint32_t packetSize_vkSetDebugUtilsObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17608 | countingStream->rewind(); |
| 17609 | uint32_t opcode_vkSetDebugUtilsObjectTagEXT = OP_vkSetDebugUtilsObjectTagEXT; |
| 17610 | stream->write(&opcode_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| 17611 | stream->write(&packetSize_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17612 | uint64_t cgen_var_1347; |
| 17613 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1347, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17614 | stream->write((uint64_t*)&cgen_var_1347, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17615 | marshal_VkDebugUtilsObjectTagInfoEXT(stream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17616 | VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0; |
| 17617 | stream->read(&vkSetDebugUtilsObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17618 | countingStream->clearPool(); |
| 17619 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17620 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17621 | return vkSetDebugUtilsObjectTagEXT_VkResult_return; |
| 17622 | } |
| 17623 | |
| 17624 | void VkEncoder::vkQueueBeginDebugUtilsLabelEXT( |
| 17625 | VkQueue queue, |
| 17626 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 17627 | { |
| 17628 | auto stream = mImpl->stream(); |
| 17629 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17630 | auto resources = mImpl->resources(); |
| 17631 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17632 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17633 | VkQueue local_queue; |
| 17634 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17635 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| 17636 | local_pLabelInfo = nullptr; |
| 17637 | if (pLabelInfo) |
| 17638 | { |
| 17639 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 17640 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 17641 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17642 | countingStream->rewind(); |
| 17643 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17644 | uint64_t cgen_var_1348; |
| 17645 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1348, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17646 | countingStream->write((uint64_t*)&cgen_var_1348, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17647 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17648 | } |
| 17649 | uint32_t packetSize_vkQueueBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17650 | countingStream->rewind(); |
| 17651 | uint32_t opcode_vkQueueBeginDebugUtilsLabelEXT = OP_vkQueueBeginDebugUtilsLabelEXT; |
| 17652 | stream->write(&opcode_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 17653 | stream->write(&packetSize_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17654 | uint64_t cgen_var_1349; |
| 17655 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1349, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17656 | stream->write((uint64_t*)&cgen_var_1349, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17657 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17658 | } |
| 17659 | |
| 17660 | void VkEncoder::vkQueueEndDebugUtilsLabelEXT( |
| 17661 | VkQueue queue) |
| 17662 | { |
| 17663 | auto stream = mImpl->stream(); |
| 17664 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17665 | auto resources = mImpl->resources(); |
| 17666 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17667 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17668 | VkQueue local_queue; |
| 17669 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17670 | countingStream->rewind(); |
| 17671 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17672 | uint64_t cgen_var_1350; |
| 17673 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1350, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17674 | countingStream->write((uint64_t*)&cgen_var_1350, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17675 | } |
| 17676 | uint32_t packetSize_vkQueueEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17677 | countingStream->rewind(); |
| 17678 | uint32_t opcode_vkQueueEndDebugUtilsLabelEXT = OP_vkQueueEndDebugUtilsLabelEXT; |
| 17679 | stream->write(&opcode_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 17680 | stream->write(&packetSize_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17681 | uint64_t cgen_var_1351; |
| 17682 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1351, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17683 | stream->write((uint64_t*)&cgen_var_1351, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17684 | } |
| 17685 | |
| 17686 | void VkEncoder::vkQueueInsertDebugUtilsLabelEXT( |
| 17687 | VkQueue queue, |
| 17688 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 17689 | { |
| 17690 | auto stream = mImpl->stream(); |
| 17691 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17692 | auto resources = mImpl->resources(); |
| 17693 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17694 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17695 | VkQueue local_queue; |
| 17696 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17697 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| 17698 | local_pLabelInfo = nullptr; |
| 17699 | if (pLabelInfo) |
| 17700 | { |
| 17701 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 17702 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 17703 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17704 | countingStream->rewind(); |
| 17705 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17706 | uint64_t cgen_var_1352; |
| 17707 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1352, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17708 | countingStream->write((uint64_t*)&cgen_var_1352, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17709 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17710 | } |
| 17711 | uint32_t packetSize_vkQueueInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17712 | countingStream->rewind(); |
| 17713 | uint32_t opcode_vkQueueInsertDebugUtilsLabelEXT = OP_vkQueueInsertDebugUtilsLabelEXT; |
| 17714 | stream->write(&opcode_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 17715 | stream->write(&packetSize_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17716 | uint64_t cgen_var_1353; |
| 17717 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1353, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17718 | stream->write((uint64_t*)&cgen_var_1353, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17719 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17720 | } |
| 17721 | |
| 17722 | void VkEncoder::vkCmdBeginDebugUtilsLabelEXT( |
| 17723 | VkCommandBuffer commandBuffer, |
| 17724 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 17725 | { |
| 17726 | auto stream = mImpl->stream(); |
| 17727 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17728 | auto resources = mImpl->resources(); |
| 17729 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17730 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17731 | VkCommandBuffer local_commandBuffer; |
| 17732 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17733 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| 17734 | local_pLabelInfo = nullptr; |
| 17735 | if (pLabelInfo) |
| 17736 | { |
| 17737 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 17738 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 17739 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17740 | countingStream->rewind(); |
| 17741 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17742 | uint64_t cgen_var_1354; |
| 17743 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1354, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17744 | countingStream->write((uint64_t*)&cgen_var_1354, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17745 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17746 | } |
| 17747 | uint32_t packetSize_vkCmdBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17748 | countingStream->rewind(); |
| 17749 | uint32_t opcode_vkCmdBeginDebugUtilsLabelEXT = OP_vkCmdBeginDebugUtilsLabelEXT; |
| 17750 | stream->write(&opcode_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 17751 | stream->write(&packetSize_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17752 | uint64_t cgen_var_1355; |
| 17753 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1355, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17754 | stream->write((uint64_t*)&cgen_var_1355, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17755 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17756 | } |
| 17757 | |
| 17758 | void VkEncoder::vkCmdEndDebugUtilsLabelEXT( |
| 17759 | VkCommandBuffer commandBuffer) |
| 17760 | { |
| 17761 | auto stream = mImpl->stream(); |
| 17762 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17763 | auto resources = mImpl->resources(); |
| 17764 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17765 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17766 | VkCommandBuffer local_commandBuffer; |
| 17767 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17768 | countingStream->rewind(); |
| 17769 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17770 | uint64_t cgen_var_1356; |
| 17771 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1356, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17772 | countingStream->write((uint64_t*)&cgen_var_1356, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17773 | } |
| 17774 | uint32_t packetSize_vkCmdEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17775 | countingStream->rewind(); |
| 17776 | uint32_t opcode_vkCmdEndDebugUtilsLabelEXT = OP_vkCmdEndDebugUtilsLabelEXT; |
| 17777 | stream->write(&opcode_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 17778 | stream->write(&packetSize_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17779 | uint64_t cgen_var_1357; |
| 17780 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1357, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17781 | stream->write((uint64_t*)&cgen_var_1357, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17782 | } |
| 17783 | |
| 17784 | void VkEncoder::vkCmdInsertDebugUtilsLabelEXT( |
| 17785 | VkCommandBuffer commandBuffer, |
| 17786 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 17787 | { |
| 17788 | auto stream = mImpl->stream(); |
| 17789 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17790 | auto resources = mImpl->resources(); |
| 17791 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17792 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17793 | VkCommandBuffer local_commandBuffer; |
| 17794 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17795 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| 17796 | local_pLabelInfo = nullptr; |
| 17797 | if (pLabelInfo) |
| 17798 | { |
| 17799 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 17800 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 17801 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17802 | countingStream->rewind(); |
| 17803 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17804 | uint64_t cgen_var_1358; |
| 17805 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1358, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17806 | countingStream->write((uint64_t*)&cgen_var_1358, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17807 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17808 | } |
| 17809 | uint32_t packetSize_vkCmdInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17810 | countingStream->rewind(); |
| 17811 | uint32_t opcode_vkCmdInsertDebugUtilsLabelEXT = OP_vkCmdInsertDebugUtilsLabelEXT; |
| 17812 | stream->write(&opcode_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 17813 | stream->write(&packetSize_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17814 | uint64_t cgen_var_1359; |
| 17815 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1359, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17816 | stream->write((uint64_t*)&cgen_var_1359, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17817 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17818 | } |
| 17819 | |
| 17820 | VkResult VkEncoder::vkCreateDebugUtilsMessengerEXT( |
| 17821 | VkInstance instance, |
| 17822 | const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, |
| 17823 | const VkAllocationCallbacks* pAllocator, |
| 17824 | VkDebugUtilsMessengerEXT* pMessenger) |
| 17825 | { |
| 17826 | auto stream = mImpl->stream(); |
| 17827 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17828 | auto resources = mImpl->resources(); |
| 17829 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17830 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17831 | VkInstance local_instance; |
| 17832 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17833 | VkDebugUtilsMessengerCreateInfoEXT* local_pCreateInfo; |
| 17834 | local_pCreateInfo = nullptr; |
| 17835 | if (pCreateInfo) |
| 17836 | { |
| 17837 | local_pCreateInfo = (VkDebugUtilsMessengerCreateInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCreateInfoEXT)); |
| 17838 | deepcopy_VkDebugUtilsMessengerCreateInfoEXT(pool, pCreateInfo, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| 17839 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17840 | VkAllocationCallbacks* local_pAllocator; |
| 17841 | local_pAllocator = nullptr; |
| 17842 | if (pAllocator) |
| 17843 | { |
| 17844 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17845 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17846 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17847 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17848 | countingStream->rewind(); |
| 17849 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17850 | uint64_t cgen_var_1360; |
| 17851 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1360, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17852 | countingStream->write((uint64_t*)&cgen_var_1360, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17853 | marshal_VkDebugUtilsMessengerCreateInfoEXT(countingStream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17854 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17855 | uint64_t cgen_var_1361 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17856 | countingStream->putBe64(cgen_var_1361); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17857 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17858 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17859 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17860 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17861 | uint64_t cgen_var_1362; |
| 17862 | countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1362, 1); |
| 17863 | countingStream->write((uint64_t*)&cgen_var_1362, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17864 | } |
| 17865 | uint32_t packetSize_vkCreateDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17866 | countingStream->rewind(); |
| 17867 | uint32_t opcode_vkCreateDebugUtilsMessengerEXT = OP_vkCreateDebugUtilsMessengerEXT; |
| 17868 | stream->write(&opcode_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 17869 | stream->write(&packetSize_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17870 | uint64_t cgen_var_1363; |
| 17871 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1363, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17872 | stream->write((uint64_t*)&cgen_var_1363, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17873 | marshal_VkDebugUtilsMessengerCreateInfoEXT(stream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17874 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17875 | uint64_t cgen_var_1364 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17876 | stream->putBe64(cgen_var_1364); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17877 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17878 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17879 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17880 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17881 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17882 | uint64_t cgen_var_1365; |
| 17883 | stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1365, 1); |
| 17884 | stream->write((uint64_t*)&cgen_var_1365, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17885 | stream->setHandleMapping(resources->unwrapMapping()); |
| 17886 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17887 | uint64_t cgen_var_1366; |
| 17888 | stream->read((uint64_t*)&cgen_var_1366, 8); |
| 17889 | stream->handleMapping()->mapHandles_u64_VkDebugUtilsMessengerEXT(&cgen_var_1366, (VkDebugUtilsMessengerEXT*)pMessenger, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17890 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17891 | VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0; |
| 17892 | stream->read(&vkCreateDebugUtilsMessengerEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17893 | countingStream->clearPool(); |
| 17894 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17895 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17896 | return vkCreateDebugUtilsMessengerEXT_VkResult_return; |
| 17897 | } |
| 17898 | |
| 17899 | void VkEncoder::vkDestroyDebugUtilsMessengerEXT( |
| 17900 | VkInstance instance, |
| 17901 | VkDebugUtilsMessengerEXT messenger, |
| 17902 | const VkAllocationCallbacks* pAllocator) |
| 17903 | { |
| 17904 | auto stream = mImpl->stream(); |
| 17905 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17906 | auto resources = mImpl->resources(); |
| 17907 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17908 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17909 | VkInstance local_instance; |
| 17910 | local_instance = instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17911 | VkDebugUtilsMessengerEXT local_messenger; |
| 17912 | local_messenger = messenger; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17913 | VkAllocationCallbacks* local_pAllocator; |
| 17914 | local_pAllocator = nullptr; |
| 17915 | if (pAllocator) |
| 17916 | { |
| 17917 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17918 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17919 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17920 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17921 | countingStream->rewind(); |
| 17922 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17923 | uint64_t cgen_var_1367; |
| 17924 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1367, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17925 | countingStream->write((uint64_t*)&cgen_var_1367, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17926 | uint64_t cgen_var_1368; |
| 17927 | countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1368, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17928 | countingStream->write((uint64_t*)&cgen_var_1368, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17929 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17930 | uint64_t cgen_var_1369 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17931 | countingStream->putBe64(cgen_var_1369); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17932 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17933 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17934 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17935 | } |
| 17936 | } |
| 17937 | uint32_t packetSize_vkDestroyDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17938 | countingStream->rewind(); |
| 17939 | uint32_t opcode_vkDestroyDebugUtilsMessengerEXT = OP_vkDestroyDebugUtilsMessengerEXT; |
| 17940 | stream->write(&opcode_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 17941 | stream->write(&packetSize_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17942 | uint64_t cgen_var_1370; |
| 17943 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1370, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17944 | stream->write((uint64_t*)&cgen_var_1370, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17945 | uint64_t cgen_var_1371; |
| 17946 | stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1371, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17947 | stream->write((uint64_t*)&cgen_var_1371, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17948 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17949 | uint64_t cgen_var_1372 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17950 | stream->putBe64(cgen_var_1372); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17951 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17952 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17953 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17954 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17955 | resources->destroyMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)&messenger); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17956 | } |
| 17957 | |
| 17958 | void VkEncoder::vkSubmitDebugUtilsMessageEXT( |
| 17959 | VkInstance instance, |
| 17960 | VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, |
| 17961 | VkDebugUtilsMessageTypeFlagsEXT messageTypes, |
| 17962 | const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) |
| 17963 | { |
| 17964 | auto stream = mImpl->stream(); |
| 17965 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17966 | auto resources = mImpl->resources(); |
| 17967 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17968 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17969 | VkInstance local_instance; |
| 17970 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17971 | VkDebugUtilsMessageSeverityFlagBitsEXT local_messageSeverity; |
| 17972 | local_messageSeverity = messageSeverity; |
| 17973 | VkDebugUtilsMessageTypeFlagsEXT local_messageTypes; |
| 17974 | local_messageTypes = messageTypes; |
| 17975 | VkDebugUtilsMessengerCallbackDataEXT* local_pCallbackData; |
| 17976 | local_pCallbackData = nullptr; |
| 17977 | if (pCallbackData) |
| 17978 | { |
| 17979 | local_pCallbackData = (VkDebugUtilsMessengerCallbackDataEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCallbackDataEXT)); |
| 17980 | deepcopy_VkDebugUtilsMessengerCallbackDataEXT(pool, pCallbackData, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| 17981 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17982 | countingStream->rewind(); |
| 17983 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17984 | uint64_t cgen_var_1373; |
| 17985 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1373, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17986 | countingStream->write((uint64_t*)&cgen_var_1373, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17987 | countingStream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 17988 | countingStream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 17989 | marshal_VkDebugUtilsMessengerCallbackDataEXT(countingStream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17990 | } |
| 17991 | uint32_t packetSize_vkSubmitDebugUtilsMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17992 | countingStream->rewind(); |
| 17993 | uint32_t opcode_vkSubmitDebugUtilsMessageEXT = OP_vkSubmitDebugUtilsMessageEXT; |
| 17994 | stream->write(&opcode_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| 17995 | stream->write(&packetSize_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17996 | uint64_t cgen_var_1374; |
| 17997 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1374, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 17998 | stream->write((uint64_t*)&cgen_var_1374, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17999 | stream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 18000 | stream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 18001 | marshal_VkDebugUtilsMessengerCallbackDataEXT(stream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18002 | } |
| 18003 | |
| 18004 | #endif |
| 18005 | #ifdef VK_ANDROID_external_memory_android_hardware_buffer |
| 18006 | VkResult VkEncoder::vkGetAndroidHardwareBufferPropertiesANDROID( |
| 18007 | VkDevice device, |
| 18008 | const AHardwareBuffer* buffer, |
| 18009 | VkAndroidHardwareBufferPropertiesANDROID* pProperties) |
| 18010 | { |
| 18011 | auto stream = mImpl->stream(); |
| 18012 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18013 | auto resources = mImpl->resources(); |
| 18014 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18015 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18016 | VkDevice local_device; |
| 18017 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18018 | AHardwareBuffer* local_buffer; |
| 18019 | local_buffer = nullptr; |
| 18020 | if (buffer) |
| 18021 | { |
| 18022 | local_buffer = (AHardwareBuffer*)pool->dupArray(buffer, sizeof(const AHardwareBuffer)); |
| 18023 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18024 | countingStream->rewind(); |
| 18025 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18026 | uint64_t cgen_var_1375; |
| 18027 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1375, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18028 | countingStream->write((uint64_t*)&cgen_var_1375, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18029 | countingStream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18030 | marshal_VkAndroidHardwareBufferPropertiesANDROID(countingStream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 18031 | } |
| 18032 | uint32_t packetSize_vkGetAndroidHardwareBufferPropertiesANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18033 | countingStream->rewind(); |
| 18034 | uint32_t opcode_vkGetAndroidHardwareBufferPropertiesANDROID = OP_vkGetAndroidHardwareBufferPropertiesANDROID; |
| 18035 | stream->write(&opcode_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| 18036 | stream->write(&packetSize_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18037 | uint64_t cgen_var_1376; |
| 18038 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1376, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18039 | stream->write((uint64_t*)&cgen_var_1376, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18040 | stream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18041 | marshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 18042 | unmarshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 18043 | VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0; |
| 18044 | stream->read(&vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18045 | countingStream->clearPool(); |
| 18046 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18047 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18048 | return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return; |
| 18049 | } |
| 18050 | |
| 18051 | VkResult VkEncoder::vkGetMemoryAndroidHardwareBufferANDROID( |
| 18052 | VkDevice device, |
| 18053 | const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, |
| 18054 | AHardwareBuffer** pBuffer) |
| 18055 | { |
| 18056 | auto stream = mImpl->stream(); |
| 18057 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18058 | auto resources = mImpl->resources(); |
| 18059 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18060 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18061 | VkDevice local_device; |
| 18062 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18063 | VkMemoryGetAndroidHardwareBufferInfoANDROID* local_pInfo; |
| 18064 | local_pInfo = nullptr; |
| 18065 | if (pInfo) |
| 18066 | { |
| 18067 | local_pInfo = (VkMemoryGetAndroidHardwareBufferInfoANDROID*)pool->alloc(sizeof(const VkMemoryGetAndroidHardwareBufferInfoANDROID)); |
| 18068 | deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(pool, pInfo, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| 18069 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18070 | countingStream->rewind(); |
| 18071 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18072 | uint64_t cgen_var_1377; |
| 18073 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1377, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18074 | countingStream->write((uint64_t*)&cgen_var_1377, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18075 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(countingStream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18076 | countingStream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 18077 | } |
| 18078 | uint32_t packetSize_vkGetMemoryAndroidHardwareBufferANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18079 | countingStream->rewind(); |
| 18080 | uint32_t opcode_vkGetMemoryAndroidHardwareBufferANDROID = OP_vkGetMemoryAndroidHardwareBufferANDROID; |
| 18081 | stream->write(&opcode_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| 18082 | stream->write(&packetSize_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18083 | uint64_t cgen_var_1378; |
| 18084 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1378, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18085 | stream->write((uint64_t*)&cgen_var_1378, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18086 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(stream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18087 | stream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 18088 | stream->read((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 18089 | VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0; |
| 18090 | stream->read(&vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18091 | countingStream->clearPool(); |
| 18092 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18093 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18094 | return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return; |
| 18095 | } |
| 18096 | |
| 18097 | #endif |
| 18098 | #ifdef VK_EXT_sampler_filter_minmax |
| 18099 | #endif |
| 18100 | #ifdef VK_AMD_gpu_shader_int16 |
| 18101 | #endif |
| 18102 | #ifdef VK_AMD_mixed_attachment_samples |
| 18103 | #endif |
| 18104 | #ifdef VK_AMD_shader_fragment_mask |
| 18105 | #endif |
| 18106 | #ifdef VK_EXT_shader_stencil_export |
| 18107 | #endif |
| 18108 | #ifdef VK_EXT_sample_locations |
| 18109 | void VkEncoder::vkCmdSetSampleLocationsEXT( |
| 18110 | VkCommandBuffer commandBuffer, |
| 18111 | const VkSampleLocationsInfoEXT* pSampleLocationsInfo) |
| 18112 | { |
| 18113 | auto stream = mImpl->stream(); |
| 18114 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18115 | auto resources = mImpl->resources(); |
| 18116 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18117 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18118 | VkCommandBuffer local_commandBuffer; |
| 18119 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18120 | VkSampleLocationsInfoEXT* local_pSampleLocationsInfo; |
| 18121 | local_pSampleLocationsInfo = nullptr; |
| 18122 | if (pSampleLocationsInfo) |
| 18123 | { |
| 18124 | local_pSampleLocationsInfo = (VkSampleLocationsInfoEXT*)pool->alloc(sizeof(const VkSampleLocationsInfoEXT)); |
| 18125 | deepcopy_VkSampleLocationsInfoEXT(pool, pSampleLocationsInfo, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| 18126 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18127 | countingStream->rewind(); |
| 18128 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18129 | uint64_t cgen_var_1379; |
| 18130 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1379, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18131 | countingStream->write((uint64_t*)&cgen_var_1379, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18132 | marshal_VkSampleLocationsInfoEXT(countingStream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18133 | } |
| 18134 | uint32_t packetSize_vkCmdSetSampleLocationsEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18135 | countingStream->rewind(); |
| 18136 | uint32_t opcode_vkCmdSetSampleLocationsEXT = OP_vkCmdSetSampleLocationsEXT; |
| 18137 | stream->write(&opcode_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| 18138 | stream->write(&packetSize_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18139 | uint64_t cgen_var_1380; |
| 18140 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1380, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18141 | stream->write((uint64_t*)&cgen_var_1380, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18142 | marshal_VkSampleLocationsInfoEXT(stream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18143 | } |
| 18144 | |
| 18145 | void VkEncoder::vkGetPhysicalDeviceMultisamplePropertiesEXT( |
| 18146 | VkPhysicalDevice physicalDevice, |
| 18147 | VkSampleCountFlagBits samples, |
| 18148 | VkMultisamplePropertiesEXT* pMultisampleProperties) |
| 18149 | { |
| 18150 | auto stream = mImpl->stream(); |
| 18151 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18152 | auto resources = mImpl->resources(); |
| 18153 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18154 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18155 | VkPhysicalDevice local_physicalDevice; |
| 18156 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18157 | VkSampleCountFlagBits local_samples; |
| 18158 | local_samples = samples; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18159 | countingStream->rewind(); |
| 18160 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18161 | uint64_t cgen_var_1381; |
| 18162 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1381, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18163 | countingStream->write((uint64_t*)&cgen_var_1381, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18164 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18165 | marshal_VkMultisamplePropertiesEXT(countingStream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 18166 | } |
| 18167 | uint32_t packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18168 | countingStream->rewind(); |
| 18169 | uint32_t opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT = OP_vkGetPhysicalDeviceMultisamplePropertiesEXT; |
| 18170 | stream->write(&opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| 18171 | stream->write(&packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18172 | uint64_t cgen_var_1382; |
| 18173 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1382, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18174 | stream->write((uint64_t*)&cgen_var_1382, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18175 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18176 | marshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 18177 | unmarshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 18178 | } |
| 18179 | |
| 18180 | #endif |
| 18181 | #ifdef VK_EXT_blend_operation_advanced |
| 18182 | #endif |
| 18183 | #ifdef VK_NV_fragment_coverage_to_color |
| 18184 | #endif |
| 18185 | #ifdef VK_NV_framebuffer_mixed_samples |
| 18186 | #endif |
| 18187 | #ifdef VK_NV_fill_rectangle |
| 18188 | #endif |
| 18189 | #ifdef VK_EXT_post_depth_coverage |
| 18190 | #endif |
| 18191 | #ifdef VK_EXT_validation_cache |
| 18192 | VkResult VkEncoder::vkCreateValidationCacheEXT( |
| 18193 | VkDevice device, |
| 18194 | const VkValidationCacheCreateInfoEXT* pCreateInfo, |
| 18195 | const VkAllocationCallbacks* pAllocator, |
| 18196 | VkValidationCacheEXT* pValidationCache) |
| 18197 | { |
| 18198 | auto stream = mImpl->stream(); |
| 18199 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18200 | auto resources = mImpl->resources(); |
| 18201 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18202 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18203 | VkDevice local_device; |
| 18204 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18205 | VkValidationCacheCreateInfoEXT* local_pCreateInfo; |
| 18206 | local_pCreateInfo = nullptr; |
| 18207 | if (pCreateInfo) |
| 18208 | { |
| 18209 | local_pCreateInfo = (VkValidationCacheCreateInfoEXT*)pool->alloc(sizeof(const VkValidationCacheCreateInfoEXT)); |
| 18210 | deepcopy_VkValidationCacheCreateInfoEXT(pool, pCreateInfo, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| 18211 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18212 | VkAllocationCallbacks* local_pAllocator; |
| 18213 | local_pAllocator = nullptr; |
| 18214 | if (pAllocator) |
| 18215 | { |
| 18216 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18217 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18218 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18219 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18220 | countingStream->rewind(); |
| 18221 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18222 | uint64_t cgen_var_1383; |
| 18223 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1383, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18224 | countingStream->write((uint64_t*)&cgen_var_1383, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18225 | marshal_VkValidationCacheCreateInfoEXT(countingStream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18226 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18227 | uint64_t cgen_var_1384 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18228 | countingStream->putBe64(cgen_var_1384); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18229 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18230 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18231 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18232 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18233 | uint64_t cgen_var_1385; |
| 18234 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1385, 1); |
| 18235 | countingStream->write((uint64_t*)&cgen_var_1385, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18236 | } |
| 18237 | uint32_t packetSize_vkCreateValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18238 | countingStream->rewind(); |
| 18239 | uint32_t opcode_vkCreateValidationCacheEXT = OP_vkCreateValidationCacheEXT; |
| 18240 | stream->write(&opcode_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| 18241 | stream->write(&packetSize_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18242 | uint64_t cgen_var_1386; |
| 18243 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1386, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18244 | stream->write((uint64_t*)&cgen_var_1386, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18245 | marshal_VkValidationCacheCreateInfoEXT(stream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18246 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18247 | uint64_t cgen_var_1387 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18248 | stream->putBe64(cgen_var_1387); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18249 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18250 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18251 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18252 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18253 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18254 | uint64_t cgen_var_1388; |
| 18255 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1388, 1); |
| 18256 | stream->write((uint64_t*)&cgen_var_1388, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18257 | stream->setHandleMapping(resources->unwrapMapping()); |
| 18258 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18259 | uint64_t cgen_var_1389; |
| 18260 | stream->read((uint64_t*)&cgen_var_1389, 8); |
| 18261 | stream->handleMapping()->mapHandles_u64_VkValidationCacheEXT(&cgen_var_1389, (VkValidationCacheEXT*)pValidationCache, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18262 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18263 | VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0; |
| 18264 | stream->read(&vkCreateValidationCacheEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18265 | countingStream->clearPool(); |
| 18266 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18267 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18268 | return vkCreateValidationCacheEXT_VkResult_return; |
| 18269 | } |
| 18270 | |
| 18271 | void VkEncoder::vkDestroyValidationCacheEXT( |
| 18272 | VkDevice device, |
| 18273 | VkValidationCacheEXT validationCache, |
| 18274 | const VkAllocationCallbacks* pAllocator) |
| 18275 | { |
| 18276 | auto stream = mImpl->stream(); |
| 18277 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18278 | auto resources = mImpl->resources(); |
| 18279 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18280 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18281 | VkDevice local_device; |
| 18282 | local_device = device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18283 | VkValidationCacheEXT local_validationCache; |
| 18284 | local_validationCache = validationCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18285 | VkAllocationCallbacks* local_pAllocator; |
| 18286 | local_pAllocator = nullptr; |
| 18287 | if (pAllocator) |
| 18288 | { |
| 18289 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18290 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18291 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18292 | local_pAllocator = nullptr; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18293 | countingStream->rewind(); |
| 18294 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18295 | uint64_t cgen_var_1390; |
| 18296 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1390, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18297 | countingStream->write((uint64_t*)&cgen_var_1390, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18298 | uint64_t cgen_var_1391; |
| 18299 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1391, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18300 | countingStream->write((uint64_t*)&cgen_var_1391, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18301 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18302 | uint64_t cgen_var_1392 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18303 | countingStream->putBe64(cgen_var_1392); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18304 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18305 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18306 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18307 | } |
| 18308 | } |
| 18309 | uint32_t packetSize_vkDestroyValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18310 | countingStream->rewind(); |
| 18311 | uint32_t opcode_vkDestroyValidationCacheEXT = OP_vkDestroyValidationCacheEXT; |
| 18312 | stream->write(&opcode_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| 18313 | stream->write(&packetSize_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18314 | uint64_t cgen_var_1393; |
| 18315 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1393, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18316 | stream->write((uint64_t*)&cgen_var_1393, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18317 | uint64_t cgen_var_1394; |
| 18318 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1394, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18319 | stream->write((uint64_t*)&cgen_var_1394, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18320 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18321 | uint64_t cgen_var_1395 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18322 | stream->putBe64(cgen_var_1395); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18323 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18324 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18325 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18326 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18327 | resources->destroyMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&validationCache); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18328 | } |
| 18329 | |
| 18330 | VkResult VkEncoder::vkMergeValidationCachesEXT( |
| 18331 | VkDevice device, |
| 18332 | VkValidationCacheEXT dstCache, |
| 18333 | uint32_t srcCacheCount, |
| 18334 | const VkValidationCacheEXT* pSrcCaches) |
| 18335 | { |
| 18336 | auto stream = mImpl->stream(); |
| 18337 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18338 | auto resources = mImpl->resources(); |
| 18339 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18340 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18341 | VkDevice local_device; |
| 18342 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18343 | VkValidationCacheEXT local_dstCache; |
| 18344 | local_dstCache = dstCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18345 | uint32_t local_srcCacheCount; |
| 18346 | local_srcCacheCount = srcCacheCount; |
| 18347 | VkValidationCacheEXT* local_pSrcCaches; |
| 18348 | local_pSrcCaches = nullptr; |
| 18349 | if (pSrcCaches) |
| 18350 | { |
| 18351 | local_pSrcCaches = (VkValidationCacheEXT*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkValidationCacheEXT)); |
| 18352 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18353 | countingStream->rewind(); |
| 18354 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18355 | uint64_t cgen_var_1396; |
| 18356 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1396, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18357 | countingStream->write((uint64_t*)&cgen_var_1396, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18358 | uint64_t cgen_var_1397; |
| 18359 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1397, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18360 | countingStream->write((uint64_t*)&cgen_var_1397, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18361 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18362 | if (((srcCacheCount))) |
| 18363 | { |
| 18364 | uint64_t* cgen_var_1398; |
| 18365 | countingStream->alloc((void**)&cgen_var_1398, ((srcCacheCount)) * 8); |
| 18366 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1398, ((srcCacheCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18367 | countingStream->write((uint64_t*)cgen_var_1398, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18368 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18369 | } |
| 18370 | uint32_t packetSize_vkMergeValidationCachesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18371 | countingStream->rewind(); |
| 18372 | uint32_t opcode_vkMergeValidationCachesEXT = OP_vkMergeValidationCachesEXT; |
| 18373 | stream->write(&opcode_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| 18374 | stream->write(&packetSize_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18375 | uint64_t cgen_var_1399; |
| 18376 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1399, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18377 | stream->write((uint64_t*)&cgen_var_1399, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18378 | uint64_t cgen_var_1400; |
| 18379 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1400, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18380 | stream->write((uint64_t*)&cgen_var_1400, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18381 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18382 | if (((srcCacheCount))) |
| 18383 | { |
| 18384 | uint64_t* cgen_var_1401; |
| 18385 | stream->alloc((void**)&cgen_var_1401, ((srcCacheCount)) * 8); |
| 18386 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1401, ((srcCacheCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18387 | stream->write((uint64_t*)cgen_var_1401, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18388 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18389 | VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0; |
| 18390 | stream->read(&vkMergeValidationCachesEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18391 | countingStream->clearPool(); |
| 18392 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18393 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18394 | return vkMergeValidationCachesEXT_VkResult_return; |
| 18395 | } |
| 18396 | |
| 18397 | VkResult VkEncoder::vkGetValidationCacheDataEXT( |
| 18398 | VkDevice device, |
| 18399 | VkValidationCacheEXT validationCache, |
| 18400 | size_t* pDataSize, |
| 18401 | void* pData) |
| 18402 | { |
| 18403 | auto stream = mImpl->stream(); |
| 18404 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18405 | auto resources = mImpl->resources(); |
| 18406 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18407 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18408 | VkDevice local_device; |
| 18409 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18410 | VkValidationCacheEXT local_validationCache; |
| 18411 | local_validationCache = validationCache; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18412 | countingStream->rewind(); |
| 18413 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18414 | uint64_t cgen_var_1402; |
| 18415 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1402, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18416 | countingStream->write((uint64_t*)&cgen_var_1402, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18417 | uint64_t cgen_var_1403; |
| 18418 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1403, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18419 | countingStream->write((uint64_t*)&cgen_var_1403, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18420 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18421 | uint64_t cgen_var_1404 = (uint64_t)(uintptr_t)pDataSize; |
| 18422 | countingStream->putBe64(cgen_var_1404); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18423 | if (pDataSize) |
| 18424 | { |
| 18425 | countingStream->write((size_t*)pDataSize, sizeof(size_t)); |
| 18426 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18427 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18428 | uint64_t cgen_var_1405 = (uint64_t)(uintptr_t)pData; |
| 18429 | countingStream->putBe64(cgen_var_1405); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18430 | if (pData) |
| 18431 | { |
| 18432 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 18433 | } |
| 18434 | } |
| 18435 | uint32_t packetSize_vkGetValidationCacheDataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18436 | countingStream->rewind(); |
| 18437 | uint32_t opcode_vkGetValidationCacheDataEXT = OP_vkGetValidationCacheDataEXT; |
| 18438 | stream->write(&opcode_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| 18439 | stream->write(&packetSize_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18440 | uint64_t cgen_var_1406; |
| 18441 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1406, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18442 | stream->write((uint64_t*)&cgen_var_1406, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18443 | uint64_t cgen_var_1407; |
| 18444 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1407, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18445 | stream->write((uint64_t*)&cgen_var_1407, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18446 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18447 | uint64_t cgen_var_1408 = (uint64_t)(uintptr_t)pDataSize; |
| 18448 | stream->putBe64(cgen_var_1408); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18449 | if (pDataSize) |
| 18450 | { |
| 18451 | stream->write((size_t*)pDataSize, sizeof(size_t)); |
| 18452 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18453 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18454 | uint64_t cgen_var_1409 = (uint64_t)(uintptr_t)pData; |
| 18455 | stream->putBe64(cgen_var_1409); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18456 | if (pData) |
| 18457 | { |
| 18458 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 18459 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18460 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18461 | size_t* check_pDataSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18462 | check_pDataSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18463 | if (pDataSize) |
| 18464 | { |
| 18465 | if (!(check_pDataSize)) |
| 18466 | { |
| 18467 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 18468 | } |
| 18469 | stream->read((size_t*)pDataSize, sizeof(size_t)); |
| 18470 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18471 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18472 | void* check_pData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18473 | check_pData = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18474 | if (pData) |
| 18475 | { |
| 18476 | if (!(check_pData)) |
| 18477 | { |
| 18478 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 18479 | } |
| 18480 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 18481 | } |
| 18482 | VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0; |
| 18483 | stream->read(&vkGetValidationCacheDataEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18484 | countingStream->clearPool(); |
| 18485 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18486 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18487 | return vkGetValidationCacheDataEXT_VkResult_return; |
| 18488 | } |
| 18489 | |
| 18490 | #endif |
| 18491 | #ifdef VK_EXT_descriptor_indexing |
| 18492 | #endif |
| 18493 | #ifdef VK_EXT_shader_viewport_index_layer |
| 18494 | #endif |
| 18495 | #ifdef VK_EXT_global_priority |
| 18496 | #endif |
| 18497 | #ifdef VK_EXT_external_memory_host |
| 18498 | VkResult VkEncoder::vkGetMemoryHostPointerPropertiesEXT( |
| 18499 | VkDevice device, |
| 18500 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 18501 | const void* pHostPointer, |
| 18502 | VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) |
| 18503 | { |
| 18504 | auto stream = mImpl->stream(); |
| 18505 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18506 | auto resources = mImpl->resources(); |
| 18507 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18508 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18509 | VkDevice local_device; |
| 18510 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18511 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| 18512 | local_handleType = handleType; |
| 18513 | void* local_pHostPointer; |
| 18514 | local_pHostPointer = nullptr; |
| 18515 | if (pHostPointer) |
| 18516 | { |
| 18517 | local_pHostPointer = (void*)pool->dupArray(pHostPointer, sizeof(const uint8_t)); |
| 18518 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18519 | countingStream->rewind(); |
| 18520 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18521 | uint64_t cgen_var_1412; |
| 18522 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1412, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18523 | countingStream->write((uint64_t*)&cgen_var_1412, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18524 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18525 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18526 | uint64_t cgen_var_1413 = (uint64_t)(uintptr_t)local_pHostPointer; |
| 18527 | countingStream->putBe64(cgen_var_1413); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18528 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18529 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18530 | countingStream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18531 | } |
| 18532 | marshal_VkMemoryHostPointerPropertiesEXT(countingStream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 18533 | } |
| 18534 | uint32_t packetSize_vkGetMemoryHostPointerPropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18535 | countingStream->rewind(); |
| 18536 | uint32_t opcode_vkGetMemoryHostPointerPropertiesEXT = OP_vkGetMemoryHostPointerPropertiesEXT; |
| 18537 | stream->write(&opcode_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| 18538 | stream->write(&packetSize_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18539 | uint64_t cgen_var_1414; |
| 18540 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1414, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18541 | stream->write((uint64_t*)&cgen_var_1414, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18542 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18543 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18544 | uint64_t cgen_var_1415 = (uint64_t)(uintptr_t)local_pHostPointer; |
| 18545 | stream->putBe64(cgen_var_1415); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18546 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18547 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18548 | stream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18549 | } |
| 18550 | marshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 18551 | unmarshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 18552 | VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0; |
| 18553 | stream->read(&vkGetMemoryHostPointerPropertiesEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18554 | countingStream->clearPool(); |
| 18555 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18556 | pool->freeAll(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18557 | return vkGetMemoryHostPointerPropertiesEXT_VkResult_return; |
| 18558 | } |
| 18559 | |
| 18560 | #endif |
| 18561 | #ifdef VK_AMD_buffer_marker |
| 18562 | void VkEncoder::vkCmdWriteBufferMarkerAMD( |
| 18563 | VkCommandBuffer commandBuffer, |
| 18564 | VkPipelineStageFlagBits pipelineStage, |
| 18565 | VkBuffer dstBuffer, |
| 18566 | VkDeviceSize dstOffset, |
| 18567 | uint32_t marker) |
| 18568 | { |
| 18569 | auto stream = mImpl->stream(); |
| 18570 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18571 | auto resources = mImpl->resources(); |
| 18572 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18573 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18574 | VkCommandBuffer local_commandBuffer; |
| 18575 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18576 | VkPipelineStageFlagBits local_pipelineStage; |
| 18577 | local_pipelineStage = pipelineStage; |
| 18578 | VkBuffer local_dstBuffer; |
| 18579 | local_dstBuffer = dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18580 | VkDeviceSize local_dstOffset; |
| 18581 | local_dstOffset = dstOffset; |
| 18582 | uint32_t local_marker; |
| 18583 | local_marker = marker; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18584 | countingStream->rewind(); |
| 18585 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18586 | uint64_t cgen_var_1416; |
| 18587 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1416, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18588 | countingStream->write((uint64_t*)&cgen_var_1416, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18589 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18590 | uint64_t cgen_var_1417; |
| 18591 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1417, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18592 | countingStream->write((uint64_t*)&cgen_var_1417, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18593 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 18594 | countingStream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18595 | } |
| 18596 | uint32_t packetSize_vkCmdWriteBufferMarkerAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18597 | countingStream->rewind(); |
| 18598 | uint32_t opcode_vkCmdWriteBufferMarkerAMD = OP_vkCmdWriteBufferMarkerAMD; |
| 18599 | stream->write(&opcode_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| 18600 | stream->write(&packetSize_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18601 | uint64_t cgen_var_1418; |
| 18602 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1418, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18603 | stream->write((uint64_t*)&cgen_var_1418, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18604 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18605 | uint64_t cgen_var_1419; |
| 18606 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1419, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18607 | stream->write((uint64_t*)&cgen_var_1419, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18608 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 18609 | stream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18610 | } |
| 18611 | |
| 18612 | #endif |
| 18613 | #ifdef VK_AMD_shader_core_properties |
| 18614 | #endif |
| 18615 | #ifdef VK_EXT_vertex_attribute_divisor |
| 18616 | #endif |
| 18617 | #ifdef VK_NV_shader_subgroup_partitioned |
| 18618 | #endif |
| 18619 | #ifdef VK_NV_device_diagnostic_checkpoints |
| 18620 | void VkEncoder::vkCmdSetCheckpointNV( |
| 18621 | VkCommandBuffer commandBuffer, |
| 18622 | const void* pCheckpointMarker) |
| 18623 | { |
| 18624 | auto stream = mImpl->stream(); |
| 18625 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18626 | auto resources = mImpl->resources(); |
| 18627 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18628 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18629 | VkCommandBuffer local_commandBuffer; |
| 18630 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18631 | void* local_pCheckpointMarker; |
| 18632 | local_pCheckpointMarker = nullptr; |
| 18633 | if (pCheckpointMarker) |
| 18634 | { |
| 18635 | local_pCheckpointMarker = (void*)pool->dupArray(pCheckpointMarker, sizeof(const uint8_t)); |
| 18636 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18637 | countingStream->rewind(); |
| 18638 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18639 | uint64_t cgen_var_1420; |
| 18640 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1420, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18641 | countingStream->write((uint64_t*)&cgen_var_1420, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18642 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18643 | uint64_t cgen_var_1421 = (uint64_t)(uintptr_t)local_pCheckpointMarker; |
| 18644 | countingStream->putBe64(cgen_var_1421); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18645 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18646 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18647 | countingStream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18648 | } |
| 18649 | } |
| 18650 | uint32_t packetSize_vkCmdSetCheckpointNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18651 | countingStream->rewind(); |
| 18652 | uint32_t opcode_vkCmdSetCheckpointNV = OP_vkCmdSetCheckpointNV; |
| 18653 | stream->write(&opcode_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| 18654 | stream->write(&packetSize_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18655 | uint64_t cgen_var_1422; |
| 18656 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1422, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18657 | stream->write((uint64_t*)&cgen_var_1422, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18658 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18659 | uint64_t cgen_var_1423 = (uint64_t)(uintptr_t)local_pCheckpointMarker; |
| 18660 | stream->putBe64(cgen_var_1423); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18661 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18662 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18663 | stream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18664 | } |
| 18665 | } |
| 18666 | |
| 18667 | void VkEncoder::vkGetQueueCheckpointDataNV( |
| 18668 | VkQueue queue, |
| 18669 | uint32_t* pCheckpointDataCount, |
| 18670 | VkCheckpointDataNV* pCheckpointData) |
| 18671 | { |
| 18672 | auto stream = mImpl->stream(); |
| 18673 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18674 | auto resources = mImpl->resources(); |
| 18675 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18676 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18677 | VkQueue local_queue; |
| 18678 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18679 | countingStream->rewind(); |
| 18680 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18681 | uint64_t cgen_var_1424; |
| 18682 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1424, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18683 | countingStream->write((uint64_t*)&cgen_var_1424, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18684 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18685 | uint64_t cgen_var_1425 = (uint64_t)(uintptr_t)pCheckpointDataCount; |
| 18686 | countingStream->putBe64(cgen_var_1425); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18687 | if (pCheckpointDataCount) |
| 18688 | { |
| 18689 | countingStream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 18690 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18691 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18692 | uint64_t cgen_var_1426 = (uint64_t)(uintptr_t)pCheckpointData; |
| 18693 | countingStream->putBe64(cgen_var_1426); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18694 | if (pCheckpointData) |
| 18695 | { |
| 18696 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 18697 | { |
| 18698 | marshal_VkCheckpointDataNV(countingStream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 18699 | } |
| 18700 | } |
| 18701 | } |
| 18702 | uint32_t packetSize_vkGetQueueCheckpointDataNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18703 | countingStream->rewind(); |
| 18704 | uint32_t opcode_vkGetQueueCheckpointDataNV = OP_vkGetQueueCheckpointDataNV; |
| 18705 | stream->write(&opcode_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| 18706 | stream->write(&packetSize_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18707 | uint64_t cgen_var_1427; |
| 18708 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1427, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame^] | 18709 | stream->write((uint64_t*)&cgen_var_1427, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18710 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18711 | uint64_t cgen_var_1428 = (uint64_t)(uintptr_t)pCheckpointDataCount; |
| 18712 | stream->putBe64(cgen_var_1428); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18713 | if (pCheckpointDataCount) |
| 18714 | { |
| 18715 | stream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 18716 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18717 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18718 | uint64_t cgen_var_1429 = (uint64_t)(uintptr_t)pCheckpointData; |
| 18719 | stream->putBe64(cgen_var_1429); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18720 | if (pCheckpointData) |
| 18721 | { |
| 18722 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 18723 | { |
| 18724 | marshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 18725 | } |
| 18726 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18727 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18728 | uint32_t* check_pCheckpointDataCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18729 | check_pCheckpointDataCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18730 | if (pCheckpointDataCount) |
| 18731 | { |
| 18732 | if (!(check_pCheckpointDataCount)) |
| 18733 | { |
| 18734 | fprintf(stderr, "fatal: pCheckpointDataCount inconsistent between guest and host\n"); |
| 18735 | } |
| 18736 | stream->read((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 18737 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18738 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18739 | VkCheckpointDataNV* check_pCheckpointData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18740 | check_pCheckpointData = (VkCheckpointDataNV*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18741 | if (pCheckpointData) |
| 18742 | { |
| 18743 | if (!(check_pCheckpointData)) |
| 18744 | { |
| 18745 | fprintf(stderr, "fatal: pCheckpointData inconsistent between guest and host\n"); |
| 18746 | } |
| 18747 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 18748 | { |
| 18749 | unmarshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 18750 | } |
| 18751 | } |
| 18752 | } |
| 18753 | |
| 18754 | #endif |
| 18755 | |
| 18756 | |