| 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 | 60b411d | 2018-11-29 00:26:45 -0800 | [diff] [blame] | 31 | #include "Validation.h" |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 32 | #include "VulkanStream.h" |
| 33 | |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 34 | #include "android/base/AlignedBuf.h" |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 35 | #include "android/base/Pool.h" |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 36 | |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 37 | #include <cutils/properties.h> |
| 38 | |
| Lingfeng Yang | e71c642 | 2018-11-01 19:29:49 -0700 | [diff] [blame] | 39 | #include "goldfish_vk_marshaling_guest.h" |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 40 | #include "goldfish_vk_deepcopy_guest.h" |
| 41 | #include "goldfish_vk_handlemap_guest.h" |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 42 | #include "goldfish_vk_private_defs.h" |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 43 | #include "goldfish_vk_transform.h" |
| Lingfeng Yang | e71c642 | 2018-11-01 19:29:49 -0700 | [diff] [blame] | 44 | |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 45 | |
| Lingfeng Yang | b1d9010 | 2018-11-29 16:10:36 -0800 | [diff] [blame] | 46 | namespace goldfish_vk { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 47 | |
| 48 | |
| 49 | |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 50 | using namespace goldfish_vk; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 51 | |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 52 | using android::aligned_buf_alloc; |
| 53 | using android::aligned_buf_free; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 54 | using android::base::Pool; |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 55 | |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 56 | class VkEncoder::Impl { |
| 57 | public: |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 58 | Impl(IOStream* stream) : m_stream(stream), m_logEncodes(false) { |
| 59 | const char* emuVkLogEncodesPropName = "qemu.vk.log"; |
| 60 | char encodeProp[PROPERTY_VALUE_MAX]; |
| 61 | if (property_get(emuVkLogEncodesPropName, encodeProp, nullptr) > 0) { |
| 62 | m_logEncodes = atoi(encodeProp) > 0; |
| 63 | } |
| 64 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 65 | VulkanCountingStream* countingStream() { return &m_countingStream; } |
| 66 | VulkanStream* stream() { return &m_stream; } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 67 | Pool* pool() { return &m_pool; } |
| 68 | ResourceTracker* resources() { return ResourceTracker::get(); } |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 69 | Validation* validation() { return &m_validation; } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 70 | |
| 71 | void log(const char* text) { |
| 72 | if (!m_logEncodes) return; |
| 73 | ALOGD("encoder log: %s", text); |
| 74 | } |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 75 | private: |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 76 | VulkanCountingStream m_countingStream; |
| 77 | VulkanStream m_stream; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 78 | Pool m_pool { 8, 4096, 64 }; |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 79 | |
| 80 | Validation m_validation; |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 81 | bool m_logEncodes; |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 82 | }; |
| 83 | |
| 84 | VkEncoder::VkEncoder(IOStream *stream) : |
| 85 | mImpl(new VkEncoder::Impl(stream)) { } |
| Lingfeng Yang | 60b411d | 2018-11-29 00:26:45 -0800 | [diff] [blame] | 86 | |
| 87 | #define VALIDATE_RET(retType, success, validate) \ |
| 88 | retType goldfish_vk_validateResult = validate; \ |
| 89 | if (goldfish_vk_validateResult != success) return goldfish_vk_validateResult; \ |
| 90 | |
| 91 | #define VALIDATE_VOID(validate) \ |
| 92 | VkResult goldfish_vk_validateResult = validate; \ |
| 93 | if (goldfish_vk_validateResult != VK_SUCCESS) return; \ |
| 94 | |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 95 | #ifdef VK_VERSION_1_0 |
| 96 | VkResult VkEncoder::vkCreateInstance( |
| 97 | const VkInstanceCreateInfo* pCreateInfo, |
| 98 | const VkAllocationCallbacks* pAllocator, |
| 99 | VkInstance* pInstance) |
| 100 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 101 | mImpl->log("start vkCreateInstance"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 102 | auto stream = mImpl->stream(); |
| 103 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 104 | auto resources = mImpl->resources(); |
| 105 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 106 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 107 | VkInstanceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 108 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 109 | local_pCreateInfo = nullptr; |
| 110 | if (pCreateInfo) |
| 111 | { |
| 112 | local_pCreateInfo = (VkInstanceCreateInfo*)pool->alloc(sizeof(const VkInstanceCreateInfo)); |
| 113 | deepcopy_VkInstanceCreateInfo(pool, pCreateInfo, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| 114 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 115 | local_pAllocator = nullptr; |
| 116 | if (pAllocator) |
| 117 | { |
| 118 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 119 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 120 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 121 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 122 | if (local_pCreateInfo) |
| 123 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 124 | transform_tohost_VkInstanceCreateInfo(mImpl->resources(), (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 125 | } |
| 126 | if (local_pAllocator) |
| 127 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 128 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 129 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 130 | countingStream->rewind(); |
| 131 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 132 | marshal_VkInstanceCreateInfo(countingStream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 133 | // WARNING PTR CHECK |
| 134 | uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pAllocator; |
| 135 | countingStream->putBe64(cgen_var_0); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 136 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 137 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 138 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 139 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 140 | uint64_t cgen_var_1; |
| 141 | countingStream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_1, 1); |
| 142 | countingStream->write((uint64_t*)&cgen_var_1, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 143 | } |
| 144 | uint32_t packetSize_vkCreateInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 145 | countingStream->rewind(); |
| 146 | uint32_t opcode_vkCreateInstance = OP_vkCreateInstance; |
| 147 | stream->write(&opcode_vkCreateInstance, sizeof(uint32_t)); |
| 148 | stream->write(&packetSize_vkCreateInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 149 | marshal_VkInstanceCreateInfo(stream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 150 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 151 | uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator; |
| 152 | stream->putBe64(cgen_var_2); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 153 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 154 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 155 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 156 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 157 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 158 | uint64_t cgen_var_3; |
| 159 | stream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_3, 1); |
| 160 | stream->write((uint64_t*)&cgen_var_3, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 161 | stream->setHandleMapping(resources->unwrapMapping()); |
| 162 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 163 | uint64_t cgen_var_4; |
| 164 | stream->read((uint64_t*)&cgen_var_4, 8); |
| 165 | stream->handleMapping()->mapHandles_u64_VkInstance(&cgen_var_4, (VkInstance*)pInstance, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 166 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 167 | VkResult vkCreateInstance_VkResult_return = (VkResult)0; |
| 168 | stream->read(&vkCreateInstance_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 169 | countingStream->clearPool(); |
| 170 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 171 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 172 | mImpl->log("finish vkCreateInstance");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 173 | return vkCreateInstance_VkResult_return; |
| 174 | } |
| 175 | |
| 176 | void VkEncoder::vkDestroyInstance( |
| 177 | VkInstance instance, |
| 178 | const VkAllocationCallbacks* pAllocator) |
| 179 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 180 | mImpl->log("start vkDestroyInstance"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 181 | auto stream = mImpl->stream(); |
| 182 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 183 | auto resources = mImpl->resources(); |
| 184 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 185 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 186 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 187 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 188 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 189 | local_pAllocator = nullptr; |
| 190 | if (pAllocator) |
| 191 | { |
| 192 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 193 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 194 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 195 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 196 | if (local_pAllocator) |
| 197 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 198 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 199 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 200 | countingStream->rewind(); |
| 201 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 202 | uint64_t cgen_var_5; |
| 203 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_5, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 204 | countingStream->write((uint64_t*)&cgen_var_5, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 205 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 206 | uint64_t cgen_var_6 = (uint64_t)(uintptr_t)local_pAllocator; |
| 207 | countingStream->putBe64(cgen_var_6); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 208 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 209 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 210 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 211 | } |
| 212 | } |
| 213 | uint32_t packetSize_vkDestroyInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 214 | countingStream->rewind(); |
| 215 | uint32_t opcode_vkDestroyInstance = OP_vkDestroyInstance; |
| 216 | stream->write(&opcode_vkDestroyInstance, sizeof(uint32_t)); |
| 217 | stream->write(&packetSize_vkDestroyInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 218 | uint64_t cgen_var_7; |
| 219 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_7, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 220 | stream->write((uint64_t*)&cgen_var_7, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 221 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 222 | uint64_t cgen_var_8 = (uint64_t)(uintptr_t)local_pAllocator; |
| 223 | stream->putBe64(cgen_var_8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 224 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 225 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 226 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 227 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 228 | resources->destroyMapping()->mapHandles_VkInstance((VkInstance*)&instance); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 229 | mImpl->log("finish vkDestroyInstance");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | VkResult VkEncoder::vkEnumeratePhysicalDevices( |
| 233 | VkInstance instance, |
| 234 | uint32_t* pPhysicalDeviceCount, |
| 235 | VkPhysicalDevice* pPhysicalDevices) |
| 236 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 237 | mImpl->log("start vkEnumeratePhysicalDevices"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 238 | auto stream = mImpl->stream(); |
| 239 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 240 | auto resources = mImpl->resources(); |
| 241 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 242 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 243 | VkInstance local_instance; |
| 244 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 245 | countingStream->rewind(); |
| 246 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 247 | uint64_t cgen_var_9; |
| 248 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_9, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 249 | countingStream->write((uint64_t*)&cgen_var_9, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 250 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 251 | uint64_t cgen_var_10 = (uint64_t)(uintptr_t)pPhysicalDeviceCount; |
| 252 | countingStream->putBe64(cgen_var_10); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 253 | if (pPhysicalDeviceCount) |
| 254 | { |
| 255 | countingStream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 256 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 257 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 258 | uint64_t cgen_var_11 = (uint64_t)(uintptr_t)pPhysicalDevices; |
| 259 | countingStream->putBe64(cgen_var_11); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 260 | if (pPhysicalDevices) |
| 261 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 262 | if ((*(pPhysicalDeviceCount))) |
| 263 | { |
| 264 | uint64_t* cgen_var_12; |
| 265 | countingStream->alloc((void**)&cgen_var_12, (*(pPhysicalDeviceCount)) * 8); |
| 266 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_12, (*(pPhysicalDeviceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 267 | countingStream->write((uint64_t*)cgen_var_12, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 268 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 269 | } |
| 270 | } |
| 271 | uint32_t packetSize_vkEnumeratePhysicalDevices = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 272 | countingStream->rewind(); |
| 273 | uint32_t opcode_vkEnumeratePhysicalDevices = OP_vkEnumeratePhysicalDevices; |
| 274 | stream->write(&opcode_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| 275 | stream->write(&packetSize_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 276 | uint64_t cgen_var_13; |
| 277 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_13, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 278 | stream->write((uint64_t*)&cgen_var_13, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 279 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 280 | uint64_t cgen_var_14 = (uint64_t)(uintptr_t)pPhysicalDeviceCount; |
| 281 | stream->putBe64(cgen_var_14); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 282 | if (pPhysicalDeviceCount) |
| 283 | { |
| 284 | stream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 285 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 286 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 287 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 288 | uint64_t cgen_var_15 = (uint64_t)(uintptr_t)pPhysicalDevices; |
| 289 | stream->putBe64(cgen_var_15); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 290 | if (pPhysicalDevices) |
| 291 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 292 | if ((*(pPhysicalDeviceCount))) |
| 293 | { |
| 294 | uint64_t* cgen_var_16; |
| 295 | stream->alloc((void**)&cgen_var_16, (*(pPhysicalDeviceCount)) * 8); |
| 296 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_16, (*(pPhysicalDeviceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 297 | stream->write((uint64_t*)cgen_var_16, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 298 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 299 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 300 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 301 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 302 | uint32_t* check_pPhysicalDeviceCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 303 | check_pPhysicalDeviceCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 304 | if (pPhysicalDeviceCount) |
| 305 | { |
| 306 | if (!(check_pPhysicalDeviceCount)) |
| 307 | { |
| 308 | fprintf(stderr, "fatal: pPhysicalDeviceCount inconsistent between guest and host\n"); |
| 309 | } |
| 310 | stream->read((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 311 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 312 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 313 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 314 | VkPhysicalDevice* check_pPhysicalDevices; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 315 | check_pPhysicalDevices = (VkPhysicalDevice*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 316 | if (pPhysicalDevices) |
| 317 | { |
| 318 | if (!(check_pPhysicalDevices)) |
| 319 | { |
| 320 | fprintf(stderr, "fatal: pPhysicalDevices inconsistent between guest and host\n"); |
| 321 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 322 | if ((*(pPhysicalDeviceCount))) |
| 323 | { |
| 324 | uint64_t* cgen_var_19; |
| 325 | stream->alloc((void**)&cgen_var_19, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 326 | stream->read((uint64_t*)cgen_var_19, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 327 | stream->handleMapping()->mapHandles_u64_VkPhysicalDevice(cgen_var_19, (VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount))); |
| 328 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 329 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 330 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 331 | VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0; |
| 332 | stream->read(&vkEnumeratePhysicalDevices_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 333 | countingStream->clearPool(); |
| 334 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 335 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 336 | mImpl->log("finish vkEnumeratePhysicalDevices");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 337 | return vkEnumeratePhysicalDevices_VkResult_return; |
| 338 | } |
| 339 | |
| 340 | void VkEncoder::vkGetPhysicalDeviceFeatures( |
| 341 | VkPhysicalDevice physicalDevice, |
| 342 | VkPhysicalDeviceFeatures* pFeatures) |
| 343 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 344 | mImpl->log("start vkGetPhysicalDeviceFeatures"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 345 | auto stream = mImpl->stream(); |
| 346 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 347 | auto resources = mImpl->resources(); |
| 348 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 349 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 350 | VkPhysicalDevice local_physicalDevice; |
| 351 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 352 | countingStream->rewind(); |
| 353 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 354 | uint64_t cgen_var_20; |
| 355 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_20, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 356 | countingStream->write((uint64_t*)&cgen_var_20, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 357 | marshal_VkPhysicalDeviceFeatures(countingStream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 358 | } |
| 359 | uint32_t packetSize_vkGetPhysicalDeviceFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 360 | countingStream->rewind(); |
| 361 | uint32_t opcode_vkGetPhysicalDeviceFeatures = OP_vkGetPhysicalDeviceFeatures; |
| 362 | stream->write(&opcode_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| 363 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 364 | uint64_t cgen_var_21; |
| 365 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_21, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 366 | stream->write((uint64_t*)&cgen_var_21, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 367 | marshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 368 | unmarshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 369 | if (pFeatures) |
| 370 | { |
| 371 | transform_fromhost_VkPhysicalDeviceFeatures(mImpl->resources(), (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 372 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 373 | mImpl->log("finish vkGetPhysicalDeviceFeatures");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 374 | } |
| 375 | |
| 376 | void VkEncoder::vkGetPhysicalDeviceFormatProperties( |
| 377 | VkPhysicalDevice physicalDevice, |
| 378 | VkFormat format, |
| 379 | VkFormatProperties* pFormatProperties) |
| 380 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 381 | mImpl->log("start vkGetPhysicalDeviceFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 382 | auto stream = mImpl->stream(); |
| 383 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 384 | auto resources = mImpl->resources(); |
| 385 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 386 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 387 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 388 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 389 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 390 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 391 | countingStream->rewind(); |
| 392 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 393 | uint64_t cgen_var_22; |
| 394 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_22, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 395 | countingStream->write((uint64_t*)&cgen_var_22, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 396 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 397 | marshal_VkFormatProperties(countingStream, (VkFormatProperties*)(pFormatProperties)); |
| 398 | } |
| 399 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 400 | countingStream->rewind(); |
| 401 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties = OP_vkGetPhysicalDeviceFormatProperties; |
| 402 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| 403 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 404 | uint64_t cgen_var_23; |
| 405 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_23, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 406 | stream->write((uint64_t*)&cgen_var_23, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 407 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 408 | marshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| 409 | unmarshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 410 | if (pFormatProperties) |
| 411 | { |
| 412 | transform_fromhost_VkFormatProperties(mImpl->resources(), (VkFormatProperties*)(pFormatProperties)); |
| 413 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 414 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 415 | } |
| 416 | |
| 417 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties( |
| 418 | VkPhysicalDevice physicalDevice, |
| 419 | VkFormat format, |
| 420 | VkImageType type, |
| 421 | VkImageTiling tiling, |
| 422 | VkImageUsageFlags usage, |
| 423 | VkImageCreateFlags flags, |
| 424 | VkImageFormatProperties* pImageFormatProperties) |
| 425 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 426 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 427 | auto stream = mImpl->stream(); |
| 428 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 429 | auto resources = mImpl->resources(); |
| 430 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 431 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 432 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 433 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 434 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 435 | VkImageTiling local_tiling; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 436 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 437 | VkImageCreateFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 438 | local_physicalDevice = physicalDevice; |
| 439 | local_format = format; |
| 440 | local_type = type; |
| 441 | local_tiling = tiling; |
| 442 | local_usage = usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 443 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 444 | countingStream->rewind(); |
| 445 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 446 | uint64_t cgen_var_24; |
| 447 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_24, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 448 | countingStream->write((uint64_t*)&cgen_var_24, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 449 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 450 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 451 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 452 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 453 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 454 | marshal_VkImageFormatProperties(countingStream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 455 | } |
| 456 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 457 | countingStream->rewind(); |
| 458 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties = OP_vkGetPhysicalDeviceImageFormatProperties; |
| 459 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| 460 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 461 | uint64_t cgen_var_25; |
| 462 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_25, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 463 | stream->write((uint64_t*)&cgen_var_25, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 464 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 465 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 466 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 467 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 468 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 469 | marshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 470 | unmarshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 471 | if (pImageFormatProperties) |
| 472 | { |
| 473 | transform_fromhost_VkImageFormatProperties(mImpl->resources(), (VkImageFormatProperties*)(pImageFormatProperties)); |
| 474 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 475 | VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0; |
| 476 | stream->read(&vkGetPhysicalDeviceImageFormatProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 477 | countingStream->clearPool(); |
| 478 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 479 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 480 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 481 | return vkGetPhysicalDeviceImageFormatProperties_VkResult_return; |
| 482 | } |
| 483 | |
| 484 | void VkEncoder::vkGetPhysicalDeviceProperties( |
| 485 | VkPhysicalDevice physicalDevice, |
| 486 | VkPhysicalDeviceProperties* pProperties) |
| 487 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 488 | mImpl->log("start vkGetPhysicalDeviceProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 489 | auto stream = mImpl->stream(); |
| 490 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 491 | auto resources = mImpl->resources(); |
| 492 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 493 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 494 | VkPhysicalDevice local_physicalDevice; |
| 495 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 496 | countingStream->rewind(); |
| 497 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 498 | uint64_t cgen_var_26; |
| 499 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_26, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 500 | countingStream->write((uint64_t*)&cgen_var_26, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 501 | marshal_VkPhysicalDeviceProperties(countingStream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 502 | } |
| 503 | uint32_t packetSize_vkGetPhysicalDeviceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 504 | countingStream->rewind(); |
| 505 | uint32_t opcode_vkGetPhysicalDeviceProperties = OP_vkGetPhysicalDeviceProperties; |
| 506 | stream->write(&opcode_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| 507 | stream->write(&packetSize_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 508 | uint64_t cgen_var_27; |
| 509 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_27, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 510 | stream->write((uint64_t*)&cgen_var_27, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 511 | marshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 512 | unmarshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 513 | if (pProperties) |
| 514 | { |
| 515 | transform_fromhost_VkPhysicalDeviceProperties(mImpl->resources(), (VkPhysicalDeviceProperties*)(pProperties)); |
| 516 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 517 | mImpl->log("finish vkGetPhysicalDeviceProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 518 | } |
| 519 | |
| 520 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties( |
| 521 | VkPhysicalDevice physicalDevice, |
| 522 | uint32_t* pQueueFamilyPropertyCount, |
| 523 | VkQueueFamilyProperties* pQueueFamilyProperties) |
| 524 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 525 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 526 | auto stream = mImpl->stream(); |
| 527 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 528 | auto resources = mImpl->resources(); |
| 529 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 530 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 531 | VkPhysicalDevice local_physicalDevice; |
| 532 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 533 | countingStream->rewind(); |
| 534 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 535 | uint64_t cgen_var_28; |
| 536 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_28, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 537 | countingStream->write((uint64_t*)&cgen_var_28, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 538 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 539 | uint64_t cgen_var_29 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 540 | countingStream->putBe64(cgen_var_29); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 541 | if (pQueueFamilyPropertyCount) |
| 542 | { |
| 543 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 544 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 545 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 546 | uint64_t cgen_var_30 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 547 | countingStream->putBe64(cgen_var_30); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 548 | if (pQueueFamilyProperties) |
| 549 | { |
| 550 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 551 | { |
| 552 | marshal_VkQueueFamilyProperties(countingStream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 553 | } |
| 554 | } |
| 555 | } |
| 556 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 557 | countingStream->rewind(); |
| 558 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties = OP_vkGetPhysicalDeviceQueueFamilyProperties; |
| 559 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| 560 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 561 | uint64_t cgen_var_31; |
| 562 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_31, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 563 | stream->write((uint64_t*)&cgen_var_31, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 564 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 565 | uint64_t cgen_var_32 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 566 | stream->putBe64(cgen_var_32); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 567 | if (pQueueFamilyPropertyCount) |
| 568 | { |
| 569 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 570 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 571 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 572 | uint64_t cgen_var_33 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 573 | stream->putBe64(cgen_var_33); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 574 | if (pQueueFamilyProperties) |
| 575 | { |
| 576 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 577 | { |
| 578 | marshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 579 | } |
| 580 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 581 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 582 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 583 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 584 | if (pQueueFamilyPropertyCount) |
| 585 | { |
| 586 | if (!(check_pQueueFamilyPropertyCount)) |
| 587 | { |
| 588 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 589 | } |
| 590 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 591 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 592 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 593 | VkQueueFamilyProperties* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 594 | check_pQueueFamilyProperties = (VkQueueFamilyProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 595 | if (pQueueFamilyProperties) |
| 596 | { |
| 597 | if (!(check_pQueueFamilyProperties)) |
| 598 | { |
| 599 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 600 | } |
| 601 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 602 | { |
| 603 | unmarshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 604 | } |
| 605 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 606 | if (pQueueFamilyProperties) |
| 607 | { |
| 608 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 609 | { |
| 610 | transform_fromhost_VkQueueFamilyProperties(mImpl->resources(), (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 611 | } |
| 612 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 613 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 614 | } |
| 615 | |
| 616 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties( |
| 617 | VkPhysicalDevice physicalDevice, |
| 618 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 619 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 620 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 621 | auto stream = mImpl->stream(); |
| 622 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 623 | auto resources = mImpl->resources(); |
| 624 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 625 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 626 | VkPhysicalDevice local_physicalDevice; |
| 627 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 628 | countingStream->rewind(); |
| 629 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 630 | uint64_t cgen_var_36; |
| 631 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_36, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 632 | countingStream->write((uint64_t*)&cgen_var_36, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 633 | marshal_VkPhysicalDeviceMemoryProperties(countingStream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 634 | } |
| 635 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 636 | countingStream->rewind(); |
| 637 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties = OP_vkGetPhysicalDeviceMemoryProperties; |
| 638 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| 639 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 640 | uint64_t cgen_var_37; |
| 641 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_37, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 642 | stream->write((uint64_t*)&cgen_var_37, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 643 | marshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 644 | unmarshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 645 | if (pMemoryProperties) |
| 646 | { |
| 647 | transform_fromhost_VkPhysicalDeviceMemoryProperties(mImpl->resources(), (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 648 | } |
| 649 | mImpl->resources()->on_vkGetPhysicalDeviceMemoryProperties(this, physicalDevice, pMemoryProperties); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 650 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 651 | } |
| 652 | |
| 653 | PFN_vkVoidFunction VkEncoder::vkGetInstanceProcAddr( |
| 654 | VkInstance instance, |
| 655 | const char* pName) |
| 656 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 657 | mImpl->log("start vkGetInstanceProcAddr"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 658 | auto stream = mImpl->stream(); |
| 659 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 660 | auto resources = mImpl->resources(); |
| 661 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 662 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 663 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 664 | char* local_pName; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 665 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 666 | local_pName = nullptr; |
| 667 | if (pName) |
| 668 | { |
| 669 | local_pName = pool->strDup(pName); |
| 670 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 671 | countingStream->rewind(); |
| 672 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 673 | uint64_t cgen_var_38; |
| 674 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_38, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 675 | countingStream->write((uint64_t*)&cgen_var_38, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 676 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 677 | } |
| 678 | uint32_t packetSize_vkGetInstanceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 679 | countingStream->rewind(); |
| 680 | uint32_t opcode_vkGetInstanceProcAddr = OP_vkGetInstanceProcAddr; |
| 681 | stream->write(&opcode_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| 682 | stream->write(&packetSize_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 683 | uint64_t cgen_var_39; |
| 684 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_39, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 685 | stream->write((uint64_t*)&cgen_var_39, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 686 | stream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 687 | PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 688 | stream->read(&vkGetInstanceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 689 | countingStream->clearPool(); |
| 690 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 691 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 692 | mImpl->log("finish vkGetInstanceProcAddr");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 693 | return vkGetInstanceProcAddr_PFN_vkVoidFunction_return; |
| 694 | } |
| 695 | |
| 696 | PFN_vkVoidFunction VkEncoder::vkGetDeviceProcAddr( |
| 697 | VkDevice device, |
| 698 | const char* pName) |
| 699 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 700 | mImpl->log("start vkGetDeviceProcAddr"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 701 | auto stream = mImpl->stream(); |
| 702 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 703 | auto resources = mImpl->resources(); |
| 704 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 705 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 706 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 707 | char* local_pName; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 708 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 709 | local_pName = nullptr; |
| 710 | if (pName) |
| 711 | { |
| 712 | local_pName = pool->strDup(pName); |
| 713 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 714 | countingStream->rewind(); |
| 715 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 716 | uint64_t cgen_var_40; |
| 717 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_40, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 718 | countingStream->write((uint64_t*)&cgen_var_40, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 719 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 720 | } |
| 721 | uint32_t packetSize_vkGetDeviceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 722 | countingStream->rewind(); |
| 723 | uint32_t opcode_vkGetDeviceProcAddr = OP_vkGetDeviceProcAddr; |
| 724 | stream->write(&opcode_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| 725 | stream->write(&packetSize_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 726 | uint64_t cgen_var_41; |
| 727 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_41, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 728 | stream->write((uint64_t*)&cgen_var_41, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 729 | stream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 730 | PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 731 | stream->read(&vkGetDeviceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 732 | countingStream->clearPool(); |
| 733 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 734 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 735 | mImpl->log("finish vkGetDeviceProcAddr");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 736 | return vkGetDeviceProcAddr_PFN_vkVoidFunction_return; |
| 737 | } |
| 738 | |
| 739 | VkResult VkEncoder::vkCreateDevice( |
| 740 | VkPhysicalDevice physicalDevice, |
| 741 | const VkDeviceCreateInfo* pCreateInfo, |
| 742 | const VkAllocationCallbacks* pAllocator, |
| 743 | VkDevice* pDevice) |
| 744 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 745 | mImpl->log("start vkCreateDevice"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 746 | auto stream = mImpl->stream(); |
| 747 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 748 | auto resources = mImpl->resources(); |
| 749 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 750 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 751 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 752 | VkDeviceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 753 | VkAllocationCallbacks* local_pAllocator; |
| 754 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 755 | local_pCreateInfo = nullptr; |
| 756 | if (pCreateInfo) |
| 757 | { |
| 758 | local_pCreateInfo = (VkDeviceCreateInfo*)pool->alloc(sizeof(const VkDeviceCreateInfo)); |
| 759 | deepcopy_VkDeviceCreateInfo(pool, pCreateInfo, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| 760 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 761 | local_pAllocator = nullptr; |
| 762 | if (pAllocator) |
| 763 | { |
| 764 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 765 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 766 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 767 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 768 | if (local_pCreateInfo) |
| 769 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 770 | transform_tohost_VkDeviceCreateInfo(mImpl->resources(), (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 771 | } |
| 772 | if (local_pAllocator) |
| 773 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 774 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 775 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 776 | countingStream->rewind(); |
| 777 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 778 | uint64_t cgen_var_42; |
| 779 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_42, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 780 | countingStream->write((uint64_t*)&cgen_var_42, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 781 | marshal_VkDeviceCreateInfo(countingStream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 782 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 783 | uint64_t cgen_var_43 = (uint64_t)(uintptr_t)local_pAllocator; |
| 784 | countingStream->putBe64(cgen_var_43); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 785 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 786 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 787 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 788 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 789 | uint64_t cgen_var_44; |
| 790 | countingStream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_44, 1); |
| 791 | countingStream->write((uint64_t*)&cgen_var_44, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 792 | } |
| 793 | uint32_t packetSize_vkCreateDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 794 | countingStream->rewind(); |
| 795 | uint32_t opcode_vkCreateDevice = OP_vkCreateDevice; |
| 796 | stream->write(&opcode_vkCreateDevice, sizeof(uint32_t)); |
| 797 | stream->write(&packetSize_vkCreateDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 798 | uint64_t cgen_var_45; |
| 799 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_45, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 800 | stream->write((uint64_t*)&cgen_var_45, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 801 | marshal_VkDeviceCreateInfo(stream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 802 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 803 | uint64_t cgen_var_46 = (uint64_t)(uintptr_t)local_pAllocator; |
| 804 | stream->putBe64(cgen_var_46); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 805 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 806 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 807 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 808 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 809 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 810 | uint64_t cgen_var_47; |
| 811 | stream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_47, 1); |
| 812 | stream->write((uint64_t*)&cgen_var_47, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 813 | stream->setHandleMapping(resources->unwrapMapping()); |
| 814 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 815 | uint64_t cgen_var_48; |
| 816 | stream->read((uint64_t*)&cgen_var_48, 8); |
| 817 | stream->handleMapping()->mapHandles_u64_VkDevice(&cgen_var_48, (VkDevice*)pDevice, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 818 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 819 | VkResult vkCreateDevice_VkResult_return = (VkResult)0; |
| 820 | stream->read(&vkCreateDevice_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 821 | countingStream->clearPool(); |
| 822 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 823 | pool->freeAll(); |
| Lingfeng Yang | 131d5a4 | 2018-11-30 12:00:33 -0800 | [diff] [blame] | 824 | mImpl->resources()->on_vkCreateDevice(this, vkCreateDevice_VkResult_return, physicalDevice, pCreateInfo, pAllocator, pDevice); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 825 | mImpl->log("finish vkCreateDevice");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 826 | return vkCreateDevice_VkResult_return; |
| 827 | } |
| 828 | |
| 829 | void VkEncoder::vkDestroyDevice( |
| 830 | VkDevice device, |
| 831 | const VkAllocationCallbacks* pAllocator) |
| 832 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 833 | mImpl->log("start vkDestroyDevice"); |
| Lingfeng Yang | 35e9c6a | 2018-12-25 17:13:36 -0800 | [diff] [blame] | 834 | mImpl->resources()->on_vkDestroyDevice_pre(this, device, pAllocator); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 835 | auto stream = mImpl->stream(); |
| 836 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 837 | auto resources = mImpl->resources(); |
| 838 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 839 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 840 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 841 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 842 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 843 | local_pAllocator = nullptr; |
| 844 | if (pAllocator) |
| 845 | { |
| 846 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 847 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 848 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 849 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 850 | if (local_pAllocator) |
| 851 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 852 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 853 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 854 | countingStream->rewind(); |
| 855 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 856 | uint64_t cgen_var_49; |
| 857 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_49, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 858 | countingStream->write((uint64_t*)&cgen_var_49, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 859 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 860 | uint64_t cgen_var_50 = (uint64_t)(uintptr_t)local_pAllocator; |
| 861 | countingStream->putBe64(cgen_var_50); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 862 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 863 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 864 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 865 | } |
| 866 | } |
| 867 | uint32_t packetSize_vkDestroyDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 868 | countingStream->rewind(); |
| 869 | uint32_t opcode_vkDestroyDevice = OP_vkDestroyDevice; |
| 870 | stream->write(&opcode_vkDestroyDevice, sizeof(uint32_t)); |
| 871 | stream->write(&packetSize_vkDestroyDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 872 | uint64_t cgen_var_51; |
| 873 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_51, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 874 | stream->write((uint64_t*)&cgen_var_51, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 875 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 876 | uint64_t cgen_var_52 = (uint64_t)(uintptr_t)local_pAllocator; |
| 877 | stream->putBe64(cgen_var_52); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 878 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 879 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 880 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 881 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 882 | resources->destroyMapping()->mapHandles_VkDevice((VkDevice*)&device); |
| Lingfeng Yang | 35e9c6a | 2018-12-25 17:13:36 -0800 | [diff] [blame] | 883 | stream->flush(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 884 | mImpl->log("finish vkDestroyDevice");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 885 | } |
| 886 | |
| 887 | VkResult VkEncoder::vkEnumerateInstanceExtensionProperties( |
| 888 | const char* pLayerName, |
| 889 | uint32_t* pPropertyCount, |
| 890 | VkExtensionProperties* pProperties) |
| 891 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 892 | mImpl->log("start vkEnumerateInstanceExtensionProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 893 | auto stream = mImpl->stream(); |
| 894 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 895 | auto resources = mImpl->resources(); |
| 896 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 897 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 898 | char* local_pLayerName; |
| 899 | local_pLayerName = nullptr; |
| 900 | if (pLayerName) |
| 901 | { |
| 902 | local_pLayerName = pool->strDup(pLayerName); |
| 903 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 904 | countingStream->rewind(); |
| 905 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 906 | countingStream->putString(local_pLayerName); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 907 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 908 | uint64_t cgen_var_53 = (uint64_t)(uintptr_t)pPropertyCount; |
| 909 | countingStream->putBe64(cgen_var_53); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 910 | if (pPropertyCount) |
| 911 | { |
| 912 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 913 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 914 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 915 | uint64_t cgen_var_54 = (uint64_t)(uintptr_t)pProperties; |
| 916 | countingStream->putBe64(cgen_var_54); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 917 | if (pProperties) |
| 918 | { |
| 919 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 920 | { |
| 921 | marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i)); |
| 922 | } |
| 923 | } |
| 924 | } |
| 925 | uint32_t packetSize_vkEnumerateInstanceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 926 | countingStream->rewind(); |
| 927 | uint32_t opcode_vkEnumerateInstanceExtensionProperties = OP_vkEnumerateInstanceExtensionProperties; |
| 928 | stream->write(&opcode_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| 929 | stream->write(&packetSize_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 930 | stream->putString(local_pLayerName); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 931 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 932 | uint64_t cgen_var_55 = (uint64_t)(uintptr_t)pPropertyCount; |
| 933 | stream->putBe64(cgen_var_55); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 934 | if (pPropertyCount) |
| 935 | { |
| 936 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 937 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 938 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 939 | uint64_t cgen_var_56 = (uint64_t)(uintptr_t)pProperties; |
| 940 | stream->putBe64(cgen_var_56); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 941 | if (pProperties) |
| 942 | { |
| 943 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 944 | { |
| 945 | marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 946 | } |
| 947 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 948 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 949 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 950 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 951 | if (pPropertyCount) |
| 952 | { |
| 953 | if (!(check_pPropertyCount)) |
| 954 | { |
| 955 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 956 | } |
| 957 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 958 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 959 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 960 | VkExtensionProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 961 | check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 962 | if (pProperties) |
| 963 | { |
| 964 | if (!(check_pProperties)) |
| 965 | { |
| 966 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 967 | } |
| 968 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 969 | { |
| 970 | unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 971 | } |
| 972 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 973 | if (pProperties) |
| 974 | { |
| 975 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 976 | { |
| 977 | transform_fromhost_VkExtensionProperties(mImpl->resources(), (VkExtensionProperties*)(pProperties + i)); |
| 978 | } |
| 979 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 980 | VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0; |
| 981 | stream->read(&vkEnumerateInstanceExtensionProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 982 | countingStream->clearPool(); |
| 983 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 984 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 985 | mImpl->log("finish vkEnumerateInstanceExtensionProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 986 | return vkEnumerateInstanceExtensionProperties_VkResult_return; |
| 987 | } |
| 988 | |
| 989 | VkResult VkEncoder::vkEnumerateDeviceExtensionProperties( |
| 990 | VkPhysicalDevice physicalDevice, |
| 991 | const char* pLayerName, |
| 992 | uint32_t* pPropertyCount, |
| 993 | VkExtensionProperties* pProperties) |
| 994 | { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 995 | VkResult vkEnumerateDeviceExtensionProperties_VkResult_return = (VkResult)0; |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 996 | vkEnumerateDeviceExtensionProperties_VkResult_return = mImpl->resources()->on_vkEnumerateDeviceExtensionProperties(this, VK_SUCCESS, physicalDevice, pLayerName, pPropertyCount, pProperties); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 997 | mImpl->log("finish vkEnumerateDeviceExtensionProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 998 | return vkEnumerateDeviceExtensionProperties_VkResult_return; |
| 999 | } |
| 1000 | |
| 1001 | VkResult VkEncoder::vkEnumerateInstanceLayerProperties( |
| 1002 | uint32_t* pPropertyCount, |
| 1003 | VkLayerProperties* pProperties) |
| 1004 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1005 | mImpl->log("start vkEnumerateInstanceLayerProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1006 | auto stream = mImpl->stream(); |
| 1007 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1008 | auto resources = mImpl->resources(); |
| 1009 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1010 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1011 | countingStream->rewind(); |
| 1012 | { |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1013 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1014 | uint64_t cgen_var_59 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1015 | countingStream->putBe64(cgen_var_59); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1016 | if (pPropertyCount) |
| 1017 | { |
| 1018 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1019 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1020 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1021 | uint64_t cgen_var_60 = (uint64_t)(uintptr_t)pProperties; |
| 1022 | countingStream->putBe64(cgen_var_60); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1023 | if (pProperties) |
| 1024 | { |
| 1025 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1026 | { |
| 1027 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 1028 | } |
| 1029 | } |
| 1030 | } |
| 1031 | uint32_t packetSize_vkEnumerateInstanceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1032 | countingStream->rewind(); |
| 1033 | uint32_t opcode_vkEnumerateInstanceLayerProperties = OP_vkEnumerateInstanceLayerProperties; |
| 1034 | stream->write(&opcode_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| 1035 | stream->write(&packetSize_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1036 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1037 | uint64_t cgen_var_61 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1038 | stream->putBe64(cgen_var_61); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1039 | if (pPropertyCount) |
| 1040 | { |
| 1041 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1042 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1043 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1044 | uint64_t cgen_var_62 = (uint64_t)(uintptr_t)pProperties; |
| 1045 | stream->putBe64(cgen_var_62); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1046 | if (pProperties) |
| 1047 | { |
| 1048 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1049 | { |
| 1050 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1051 | } |
| 1052 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1053 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1054 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1055 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1056 | if (pPropertyCount) |
| 1057 | { |
| 1058 | if (!(check_pPropertyCount)) |
| 1059 | { |
| 1060 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1061 | } |
| 1062 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1063 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1064 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1065 | VkLayerProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1066 | check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1067 | if (pProperties) |
| 1068 | { |
| 1069 | if (!(check_pProperties)) |
| 1070 | { |
| 1071 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1072 | } |
| 1073 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1074 | { |
| 1075 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1076 | } |
| 1077 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1078 | if (pProperties) |
| 1079 | { |
| 1080 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1081 | { |
| 1082 | transform_fromhost_VkLayerProperties(mImpl->resources(), (VkLayerProperties*)(pProperties + i)); |
| 1083 | } |
| 1084 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1085 | VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0; |
| 1086 | stream->read(&vkEnumerateInstanceLayerProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1087 | countingStream->clearPool(); |
| 1088 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1089 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1090 | mImpl->log("finish vkEnumerateInstanceLayerProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1091 | return vkEnumerateInstanceLayerProperties_VkResult_return; |
| 1092 | } |
| 1093 | |
| 1094 | VkResult VkEncoder::vkEnumerateDeviceLayerProperties( |
| 1095 | VkPhysicalDevice physicalDevice, |
| 1096 | uint32_t* pPropertyCount, |
| 1097 | VkLayerProperties* pProperties) |
| 1098 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1099 | mImpl->log("start vkEnumerateDeviceLayerProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1100 | auto stream = mImpl->stream(); |
| 1101 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1102 | auto resources = mImpl->resources(); |
| 1103 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1104 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1105 | VkPhysicalDevice local_physicalDevice; |
| 1106 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1107 | countingStream->rewind(); |
| 1108 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1109 | uint64_t cgen_var_65; |
| 1110 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_65, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1111 | countingStream->write((uint64_t*)&cgen_var_65, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1112 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1113 | uint64_t cgen_var_66 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1114 | countingStream->putBe64(cgen_var_66); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1115 | if (pPropertyCount) |
| 1116 | { |
| 1117 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1118 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1119 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1120 | uint64_t cgen_var_67 = (uint64_t)(uintptr_t)pProperties; |
| 1121 | countingStream->putBe64(cgen_var_67); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1122 | if (pProperties) |
| 1123 | { |
| 1124 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1125 | { |
| 1126 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 1127 | } |
| 1128 | } |
| 1129 | } |
| 1130 | uint32_t packetSize_vkEnumerateDeviceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1131 | countingStream->rewind(); |
| 1132 | uint32_t opcode_vkEnumerateDeviceLayerProperties = OP_vkEnumerateDeviceLayerProperties; |
| 1133 | stream->write(&opcode_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| 1134 | stream->write(&packetSize_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1135 | uint64_t cgen_var_68; |
| 1136 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_68, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1137 | stream->write((uint64_t*)&cgen_var_68, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1138 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1139 | uint64_t cgen_var_69 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1140 | stream->putBe64(cgen_var_69); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1141 | if (pPropertyCount) |
| 1142 | { |
| 1143 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1144 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1145 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1146 | uint64_t cgen_var_70 = (uint64_t)(uintptr_t)pProperties; |
| 1147 | stream->putBe64(cgen_var_70); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1148 | if (pProperties) |
| 1149 | { |
| 1150 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1151 | { |
| 1152 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1153 | } |
| 1154 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1155 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1156 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1157 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1158 | if (pPropertyCount) |
| 1159 | { |
| 1160 | if (!(check_pPropertyCount)) |
| 1161 | { |
| 1162 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1163 | } |
| 1164 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1165 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1166 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1167 | VkLayerProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1168 | check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1169 | if (pProperties) |
| 1170 | { |
| 1171 | if (!(check_pProperties)) |
| 1172 | { |
| 1173 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1174 | } |
| 1175 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1176 | { |
| 1177 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1178 | } |
| 1179 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1180 | if (pProperties) |
| 1181 | { |
| 1182 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1183 | { |
| 1184 | transform_fromhost_VkLayerProperties(mImpl->resources(), (VkLayerProperties*)(pProperties + i)); |
| 1185 | } |
| 1186 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1187 | VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0; |
| 1188 | stream->read(&vkEnumerateDeviceLayerProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1189 | countingStream->clearPool(); |
| 1190 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1191 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1192 | mImpl->log("finish vkEnumerateDeviceLayerProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1193 | return vkEnumerateDeviceLayerProperties_VkResult_return; |
| 1194 | } |
| 1195 | |
| 1196 | void VkEncoder::vkGetDeviceQueue( |
| 1197 | VkDevice device, |
| 1198 | uint32_t queueFamilyIndex, |
| 1199 | uint32_t queueIndex, |
| 1200 | VkQueue* pQueue) |
| 1201 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1202 | mImpl->log("start vkGetDeviceQueue"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1203 | auto stream = mImpl->stream(); |
| 1204 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1205 | auto resources = mImpl->resources(); |
| 1206 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1207 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1208 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1209 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1210 | uint32_t local_queueIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1211 | local_device = device; |
| 1212 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1213 | local_queueIndex = queueIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1214 | countingStream->rewind(); |
| 1215 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1216 | uint64_t cgen_var_73; |
| 1217 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_73, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1218 | countingStream->write((uint64_t*)&cgen_var_73, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1219 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 1220 | countingStream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1221 | uint64_t cgen_var_74; |
| 1222 | countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_74, 1); |
| 1223 | countingStream->write((uint64_t*)&cgen_var_74, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1224 | } |
| 1225 | uint32_t packetSize_vkGetDeviceQueue = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1226 | countingStream->rewind(); |
| 1227 | uint32_t opcode_vkGetDeviceQueue = OP_vkGetDeviceQueue; |
| 1228 | stream->write(&opcode_vkGetDeviceQueue, sizeof(uint32_t)); |
| 1229 | stream->write(&packetSize_vkGetDeviceQueue, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1230 | uint64_t cgen_var_75; |
| 1231 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_75, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1232 | stream->write((uint64_t*)&cgen_var_75, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1233 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 1234 | stream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1235 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1236 | uint64_t cgen_var_76; |
| 1237 | stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_76, 1); |
| 1238 | stream->write((uint64_t*)&cgen_var_76, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1239 | stream->setHandleMapping(resources->unwrapMapping()); |
| 1240 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1241 | uint64_t cgen_var_77; |
| 1242 | stream->read((uint64_t*)&cgen_var_77, 8); |
| 1243 | stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_77, (VkQueue*)pQueue, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1244 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1245 | mImpl->log("finish vkGetDeviceQueue");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1246 | } |
| 1247 | |
| 1248 | VkResult VkEncoder::vkQueueSubmit( |
| 1249 | VkQueue queue, |
| 1250 | uint32_t submitCount, |
| 1251 | const VkSubmitInfo* pSubmits, |
| 1252 | VkFence fence) |
| 1253 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1254 | mImpl->log("start vkQueueSubmit"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1255 | auto stream = mImpl->stream(); |
| 1256 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1257 | auto resources = mImpl->resources(); |
| 1258 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1259 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1260 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1261 | uint32_t local_submitCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1262 | VkSubmitInfo* local_pSubmits; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1263 | VkFence local_fence; |
| 1264 | local_queue = queue; |
| 1265 | local_submitCount = submitCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1266 | local_pSubmits = nullptr; |
| 1267 | if (pSubmits) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1268 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1269 | local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1270 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1271 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1272 | deepcopy_VkSubmitInfo(pool, pSubmits + i, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1273 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1274 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1275 | local_fence = fence; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1276 | if (local_pSubmits) |
| 1277 | { |
| 1278 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1279 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1280 | transform_tohost_VkSubmitInfo(mImpl->resources(), (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1281 | } |
| 1282 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1283 | countingStream->rewind(); |
| 1284 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1285 | uint64_t cgen_var_78; |
| 1286 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_78, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1287 | countingStream->write((uint64_t*)&cgen_var_78, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1288 | countingStream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| 1289 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1290 | { |
| 1291 | marshal_VkSubmitInfo(countingStream, (VkSubmitInfo*)(local_pSubmits + i)); |
| 1292 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1293 | uint64_t cgen_var_79; |
| 1294 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_79, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1295 | countingStream->write((uint64_t*)&cgen_var_79, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1296 | } |
| 1297 | uint32_t packetSize_vkQueueSubmit = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1298 | countingStream->rewind(); |
| 1299 | uint32_t opcode_vkQueueSubmit = OP_vkQueueSubmit; |
| 1300 | stream->write(&opcode_vkQueueSubmit, sizeof(uint32_t)); |
| 1301 | stream->write(&packetSize_vkQueueSubmit, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1302 | uint64_t cgen_var_80; |
| 1303 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_80, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1304 | stream->write((uint64_t*)&cgen_var_80, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1305 | stream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1306 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1307 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1308 | marshal_VkSubmitInfo(stream, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1309 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1310 | uint64_t cgen_var_81; |
| 1311 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_81, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1312 | stream->write((uint64_t*)&cgen_var_81, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1313 | VkResult vkQueueSubmit_VkResult_return = (VkResult)0; |
| 1314 | stream->read(&vkQueueSubmit_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1315 | countingStream->clearPool(); |
| 1316 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1317 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1318 | mImpl->log("finish vkQueueSubmit");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1319 | return vkQueueSubmit_VkResult_return; |
| 1320 | } |
| 1321 | |
| 1322 | VkResult VkEncoder::vkQueueWaitIdle( |
| 1323 | VkQueue queue) |
| 1324 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1325 | mImpl->log("start vkQueueWaitIdle"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1326 | auto stream = mImpl->stream(); |
| 1327 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1328 | auto resources = mImpl->resources(); |
| 1329 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1330 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1331 | VkQueue local_queue; |
| 1332 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1333 | countingStream->rewind(); |
| 1334 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1335 | uint64_t cgen_var_82; |
| 1336 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_82, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1337 | countingStream->write((uint64_t*)&cgen_var_82, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1338 | } |
| 1339 | uint32_t packetSize_vkQueueWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1340 | countingStream->rewind(); |
| 1341 | uint32_t opcode_vkQueueWaitIdle = OP_vkQueueWaitIdle; |
| 1342 | stream->write(&opcode_vkQueueWaitIdle, sizeof(uint32_t)); |
| 1343 | stream->write(&packetSize_vkQueueWaitIdle, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1344 | uint64_t cgen_var_83; |
| 1345 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_83, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1346 | stream->write((uint64_t*)&cgen_var_83, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1347 | VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0; |
| 1348 | stream->read(&vkQueueWaitIdle_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1349 | countingStream->clearPool(); |
| 1350 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1351 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1352 | mImpl->log("finish vkQueueWaitIdle");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1353 | return vkQueueWaitIdle_VkResult_return; |
| 1354 | } |
| 1355 | |
| 1356 | VkResult VkEncoder::vkDeviceWaitIdle( |
| 1357 | VkDevice device) |
| 1358 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1359 | mImpl->log("start vkDeviceWaitIdle"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1360 | auto stream = mImpl->stream(); |
| 1361 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1362 | auto resources = mImpl->resources(); |
| 1363 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1364 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1365 | VkDevice local_device; |
| 1366 | local_device = device; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1367 | countingStream->rewind(); |
| 1368 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1369 | uint64_t cgen_var_84; |
| 1370 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_84, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1371 | countingStream->write((uint64_t*)&cgen_var_84, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1372 | } |
| 1373 | uint32_t packetSize_vkDeviceWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1374 | countingStream->rewind(); |
| 1375 | uint32_t opcode_vkDeviceWaitIdle = OP_vkDeviceWaitIdle; |
| 1376 | stream->write(&opcode_vkDeviceWaitIdle, sizeof(uint32_t)); |
| 1377 | stream->write(&packetSize_vkDeviceWaitIdle, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1378 | uint64_t cgen_var_85; |
| 1379 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_85, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1380 | stream->write((uint64_t*)&cgen_var_85, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1381 | VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0; |
| 1382 | stream->read(&vkDeviceWaitIdle_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1383 | countingStream->clearPool(); |
| 1384 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1385 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1386 | mImpl->log("finish vkDeviceWaitIdle");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1387 | return vkDeviceWaitIdle_VkResult_return; |
| 1388 | } |
| 1389 | |
| 1390 | VkResult VkEncoder::vkAllocateMemory( |
| 1391 | VkDevice device, |
| 1392 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 1393 | const VkAllocationCallbacks* pAllocator, |
| 1394 | VkDeviceMemory* pMemory) |
| 1395 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1396 | mImpl->log("start vkAllocateMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1397 | auto stream = mImpl->stream(); |
| 1398 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1399 | auto resources = mImpl->resources(); |
| 1400 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1401 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1402 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1403 | VkMemoryAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1404 | VkAllocationCallbacks* local_pAllocator; |
| 1405 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1406 | local_pAllocateInfo = nullptr; |
| 1407 | if (pAllocateInfo) |
| 1408 | { |
| 1409 | local_pAllocateInfo = (VkMemoryAllocateInfo*)pool->alloc(sizeof(const VkMemoryAllocateInfo)); |
| 1410 | deepcopy_VkMemoryAllocateInfo(pool, pAllocateInfo, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| 1411 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1412 | local_pAllocator = nullptr; |
| 1413 | if (pAllocator) |
| 1414 | { |
| 1415 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1416 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1417 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1418 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1419 | if (local_pAllocateInfo) |
| 1420 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1421 | transform_tohost_VkMemoryAllocateInfo(mImpl->resources(), (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1422 | } |
| 1423 | if (local_pAllocator) |
| 1424 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1425 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1426 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1427 | countingStream->rewind(); |
| 1428 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1429 | uint64_t cgen_var_86; |
| 1430 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_86, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1431 | countingStream->write((uint64_t*)&cgen_var_86, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1432 | marshal_VkMemoryAllocateInfo(countingStream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1433 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1434 | uint64_t cgen_var_87 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1435 | countingStream->putBe64(cgen_var_87); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1436 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1437 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1438 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1439 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1440 | uint64_t cgen_var_88; |
| 1441 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_88, 1); |
| 1442 | countingStream->write((uint64_t*)&cgen_var_88, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1443 | } |
| 1444 | uint32_t packetSize_vkAllocateMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1445 | countingStream->rewind(); |
| 1446 | uint32_t opcode_vkAllocateMemory = OP_vkAllocateMemory; |
| 1447 | stream->write(&opcode_vkAllocateMemory, sizeof(uint32_t)); |
| 1448 | stream->write(&packetSize_vkAllocateMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1449 | uint64_t cgen_var_89; |
| 1450 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_89, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1451 | stream->write((uint64_t*)&cgen_var_89, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1452 | marshal_VkMemoryAllocateInfo(stream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1453 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1454 | uint64_t cgen_var_90 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1455 | stream->putBe64(cgen_var_90); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1456 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1457 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1458 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1459 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1460 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1461 | uint64_t cgen_var_91; |
| 1462 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_91, 1); |
| 1463 | stream->write((uint64_t*)&cgen_var_91, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1464 | stream->setHandleMapping(resources->unwrapMapping()); |
| 1465 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1466 | uint64_t cgen_var_92; |
| 1467 | stream->read((uint64_t*)&cgen_var_92, 8); |
| 1468 | stream->handleMapping()->mapHandles_u64_VkDeviceMemory(&cgen_var_92, (VkDeviceMemory*)pMemory, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1469 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1470 | VkResult vkAllocateMemory_VkResult_return = (VkResult)0; |
| 1471 | stream->read(&vkAllocateMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1472 | countingStream->clearPool(); |
| 1473 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1474 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1475 | mImpl->log("finish vkAllocateMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1476 | return vkAllocateMemory_VkResult_return; |
| 1477 | } |
| 1478 | |
| 1479 | void VkEncoder::vkFreeMemory( |
| 1480 | VkDevice device, |
| 1481 | VkDeviceMemory memory, |
| 1482 | const VkAllocationCallbacks* pAllocator) |
| 1483 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1484 | mImpl->log("start vkFreeMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1485 | auto stream = mImpl->stream(); |
| 1486 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1487 | auto resources = mImpl->resources(); |
| 1488 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1489 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1490 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1491 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1492 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1493 | local_device = device; |
| 1494 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1495 | local_pAllocator = nullptr; |
| 1496 | if (pAllocator) |
| 1497 | { |
| 1498 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1499 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1500 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1501 | local_pAllocator = nullptr; |
| Lingfeng Yang | afe29d3 | 2018-12-25 13:01:52 -0800 | [diff] [blame] | 1502 | mImpl->resources()->deviceMemoryTransform_tohost(&local_memory, 1, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 0); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1503 | countingStream->rewind(); |
| 1504 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1505 | uint64_t cgen_var_93; |
| 1506 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_93, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1507 | countingStream->write((uint64_t*)&cgen_var_93, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1508 | uint64_t cgen_var_94; |
| 1509 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_94, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1510 | countingStream->write((uint64_t*)&cgen_var_94, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1511 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1512 | uint64_t cgen_var_95 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1513 | countingStream->putBe64(cgen_var_95); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1514 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1515 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1516 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1517 | } |
| 1518 | } |
| 1519 | uint32_t packetSize_vkFreeMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1520 | countingStream->rewind(); |
| 1521 | uint32_t opcode_vkFreeMemory = OP_vkFreeMemory; |
| 1522 | stream->write(&opcode_vkFreeMemory, sizeof(uint32_t)); |
| 1523 | stream->write(&packetSize_vkFreeMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1524 | uint64_t cgen_var_96; |
| 1525 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_96, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1526 | stream->write((uint64_t*)&cgen_var_96, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1527 | uint64_t cgen_var_97; |
| 1528 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_97, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1529 | stream->write((uint64_t*)&cgen_var_97, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1530 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1531 | uint64_t cgen_var_98 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1532 | stream->putBe64(cgen_var_98); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1533 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1534 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1535 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1536 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1537 | resources->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1538 | mImpl->log("finish vkFreeMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1539 | } |
| 1540 | |
| 1541 | VkResult VkEncoder::vkMapMemory( |
| 1542 | VkDevice device, |
| 1543 | VkDeviceMemory memory, |
| 1544 | VkDeviceSize offset, |
| 1545 | VkDeviceSize size, |
| 1546 | VkMemoryMapFlags flags, |
| 1547 | void** ppData) |
| 1548 | { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1549 | VkResult vkMapMemory_VkResult_return = (VkResult)0; |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 1550 | vkMapMemory_VkResult_return = mImpl->resources()->on_vkMapMemory(this, VK_SUCCESS, device, memory, offset, size, flags, ppData); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1551 | mImpl->log("finish vkMapMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1552 | return vkMapMemory_VkResult_return; |
| 1553 | } |
| 1554 | |
| 1555 | void VkEncoder::vkUnmapMemory( |
| 1556 | VkDevice device, |
| 1557 | VkDeviceMemory memory) |
| 1558 | { |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 1559 | mImpl->resources()->on_vkUnmapMemory(this, device, memory); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1560 | } |
| 1561 | |
| 1562 | VkResult VkEncoder::vkFlushMappedMemoryRanges( |
| 1563 | VkDevice device, |
| 1564 | uint32_t memoryRangeCount, |
| 1565 | const VkMappedMemoryRange* pMemoryRanges) |
| 1566 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1567 | mImpl->log("start vkFlushMappedMemoryRanges"); |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 1568 | VALIDATE_RET(VkResult, VK_SUCCESS, mImpl->validation()->on_vkFlushMappedMemoryRanges(this, VK_SUCCESS, device, memoryRangeCount, pMemoryRanges)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1569 | auto stream = mImpl->stream(); |
| 1570 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1571 | auto resources = mImpl->resources(); |
| 1572 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1573 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1574 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1575 | uint32_t local_memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1576 | VkMappedMemoryRange* local_pMemoryRanges; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1577 | local_device = device; |
| 1578 | local_memoryRangeCount = memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1579 | local_pMemoryRanges = nullptr; |
| 1580 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1581 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1582 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1583 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1584 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1585 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1586 | } |
| 1587 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1588 | if (local_pMemoryRanges) |
| 1589 | { |
| 1590 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1591 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1592 | transform_tohost_VkMappedMemoryRange(mImpl->resources(), (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1593 | } |
| 1594 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1595 | countingStream->rewind(); |
| 1596 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1597 | uint64_t cgen_var_99; |
| 1598 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_99, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1599 | countingStream->write((uint64_t*)&cgen_var_99, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1600 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 1601 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1602 | { |
| 1603 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1604 | } |
| 1605 | } |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1606 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1607 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1608 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1609 | { |
| 1610 | auto range = pMemoryRanges[i]; |
| 1611 | auto memory = pMemoryRanges[i].memory; |
| 1612 | auto size = pMemoryRanges[i].size; |
| 1613 | auto offset = pMemoryRanges[i].offset; |
| 1614 | uint64_t streamSize = 0; |
| 1615 | if (!memory) { countingStream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1616 | auto hostPtr = resources->getMappedPointer(memory); |
| 1617 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 1618 | if (!hostPtr) { countingStream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1619 | streamSize = actualSize; |
| 1620 | countingStream->write(&streamSize, sizeof(uint64_t)); |
| 1621 | uint8_t* targetRange = hostPtr + offset; |
| 1622 | countingStream->write(targetRange, actualSize); |
| 1623 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1624 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1625 | uint32_t packetSize_vkFlushMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1626 | countingStream->rewind(); |
| 1627 | uint32_t opcode_vkFlushMappedMemoryRanges = OP_vkFlushMappedMemoryRanges; |
| 1628 | stream->write(&opcode_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| 1629 | stream->write(&packetSize_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1630 | uint64_t cgen_var_100; |
| 1631 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_100, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1632 | stream->write((uint64_t*)&cgen_var_100, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1633 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1634 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1635 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1636 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1637 | } |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1638 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1639 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1640 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1641 | { |
| 1642 | auto range = pMemoryRanges[i]; |
| 1643 | auto memory = pMemoryRanges[i].memory; |
| 1644 | auto size = pMemoryRanges[i].size; |
| 1645 | auto offset = pMemoryRanges[i].offset; |
| 1646 | uint64_t streamSize = 0; |
| 1647 | if (!memory) { stream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1648 | auto hostPtr = resources->getMappedPointer(memory); |
| 1649 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 1650 | if (!hostPtr) { stream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1651 | streamSize = actualSize; |
| 1652 | stream->write(&streamSize, sizeof(uint64_t)); |
| 1653 | uint8_t* targetRange = hostPtr + offset; |
| 1654 | stream->write(targetRange, actualSize); |
| 1655 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1656 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1657 | VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 1658 | stream->read(&vkFlushMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1659 | countingStream->clearPool(); |
| 1660 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1661 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1662 | mImpl->log("finish vkFlushMappedMemoryRanges");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1663 | return vkFlushMappedMemoryRanges_VkResult_return; |
| 1664 | } |
| 1665 | |
| 1666 | VkResult VkEncoder::vkInvalidateMappedMemoryRanges( |
| 1667 | VkDevice device, |
| 1668 | uint32_t memoryRangeCount, |
| 1669 | const VkMappedMemoryRange* pMemoryRanges) |
| 1670 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1671 | mImpl->log("start vkInvalidateMappedMemoryRanges"); |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 1672 | VALIDATE_RET(VkResult, VK_SUCCESS, mImpl->validation()->on_vkInvalidateMappedMemoryRanges(this, VK_SUCCESS, device, memoryRangeCount, pMemoryRanges)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1673 | auto stream = mImpl->stream(); |
| 1674 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1675 | auto resources = mImpl->resources(); |
| 1676 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1677 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1678 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1679 | uint32_t local_memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1680 | VkMappedMemoryRange* local_pMemoryRanges; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1681 | local_device = device; |
| 1682 | local_memoryRangeCount = memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1683 | local_pMemoryRanges = nullptr; |
| 1684 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1685 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1686 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1687 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1688 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1689 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1690 | } |
| 1691 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1692 | if (local_pMemoryRanges) |
| 1693 | { |
| 1694 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1695 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1696 | transform_tohost_VkMappedMemoryRange(mImpl->resources(), (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1697 | } |
| 1698 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1699 | countingStream->rewind(); |
| 1700 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1701 | uint64_t cgen_var_101; |
| 1702 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_101, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1703 | countingStream->write((uint64_t*)&cgen_var_101, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1704 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 1705 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1706 | { |
| 1707 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1708 | } |
| 1709 | } |
| 1710 | uint32_t packetSize_vkInvalidateMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1711 | countingStream->rewind(); |
| 1712 | uint32_t opcode_vkInvalidateMappedMemoryRanges = OP_vkInvalidateMappedMemoryRanges; |
| 1713 | stream->write(&opcode_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| 1714 | stream->write(&packetSize_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1715 | uint64_t cgen_var_102; |
| 1716 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_102, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1717 | stream->write((uint64_t*)&cgen_var_102, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1718 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1719 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1720 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1721 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1722 | } |
| 1723 | VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 1724 | stream->read(&vkInvalidateMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1725 | countingStream->clearPool(); |
| 1726 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1727 | pool->freeAll(); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1728 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1729 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1730 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1731 | { |
| 1732 | auto range = pMemoryRanges[i]; |
| 1733 | auto memory = pMemoryRanges[i].memory; |
| 1734 | auto size = pMemoryRanges[i].size; |
| 1735 | auto offset = pMemoryRanges[i].offset; |
| 1736 | uint64_t streamSize = 0; |
| 1737 | if (!memory) { stream->read(&streamSize, sizeof(uint64_t)); continue; }; |
| 1738 | auto hostPtr = resources->getMappedPointer(memory); |
| 1739 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 1740 | if (!hostPtr) { stream->read(&streamSize, sizeof(uint64_t)); continue; }; |
| 1741 | streamSize = actualSize; |
| 1742 | stream->read(&streamSize, sizeof(uint64_t)); |
| 1743 | uint8_t* targetRange = hostPtr + offset; |
| 1744 | stream->read(targetRange, actualSize); |
| 1745 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1746 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1747 | mImpl->log("finish vkInvalidateMappedMemoryRanges");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1748 | return vkInvalidateMappedMemoryRanges_VkResult_return; |
| 1749 | } |
| 1750 | |
| 1751 | void VkEncoder::vkGetDeviceMemoryCommitment( |
| 1752 | VkDevice device, |
| 1753 | VkDeviceMemory memory, |
| 1754 | VkDeviceSize* pCommittedMemoryInBytes) |
| 1755 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1756 | mImpl->log("start vkGetDeviceMemoryCommitment"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1757 | auto stream = mImpl->stream(); |
| 1758 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1759 | auto resources = mImpl->resources(); |
| 1760 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1761 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1762 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1763 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1764 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1765 | local_memory = memory; |
| Lingfeng Yang | afe29d3 | 2018-12-25 13:01:52 -0800 | [diff] [blame] | 1766 | mImpl->resources()->deviceMemoryTransform_tohost(&local_memory, 1, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 0); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1767 | countingStream->rewind(); |
| 1768 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1769 | uint64_t cgen_var_103; |
| 1770 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_103, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1771 | countingStream->write((uint64_t*)&cgen_var_103, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1772 | uint64_t cgen_var_104; |
| 1773 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_104, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1774 | countingStream->write((uint64_t*)&cgen_var_104, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1775 | countingStream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 1776 | } |
| 1777 | uint32_t packetSize_vkGetDeviceMemoryCommitment = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1778 | countingStream->rewind(); |
| 1779 | uint32_t opcode_vkGetDeviceMemoryCommitment = OP_vkGetDeviceMemoryCommitment; |
| 1780 | stream->write(&opcode_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| 1781 | stream->write(&packetSize_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1782 | uint64_t cgen_var_105; |
| 1783 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_105, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1784 | stream->write((uint64_t*)&cgen_var_105, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1785 | uint64_t cgen_var_106; |
| 1786 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_106, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1787 | stream->write((uint64_t*)&cgen_var_106, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1788 | stream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 1789 | stream->read((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1790 | mImpl->log("finish vkGetDeviceMemoryCommitment");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1791 | } |
| 1792 | |
| 1793 | VkResult VkEncoder::vkBindBufferMemory( |
| 1794 | VkDevice device, |
| 1795 | VkBuffer buffer, |
| 1796 | VkDeviceMemory memory, |
| 1797 | VkDeviceSize memoryOffset) |
| 1798 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1799 | mImpl->log("start vkBindBufferMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1800 | auto stream = mImpl->stream(); |
| 1801 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1802 | auto resources = mImpl->resources(); |
| 1803 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1804 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1805 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1806 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1807 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1808 | VkDeviceSize local_memoryOffset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1809 | local_device = device; |
| 1810 | local_buffer = buffer; |
| 1811 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1812 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | afe29d3 | 2018-12-25 13:01:52 -0800 | [diff] [blame] | 1813 | mImpl->resources()->deviceMemoryTransform_tohost(&local_memory, 1, &local_memoryOffset, 1, nullptr, 0, nullptr, 0, nullptr, 0); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1814 | countingStream->rewind(); |
| 1815 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1816 | uint64_t cgen_var_107; |
| 1817 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_107, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1818 | countingStream->write((uint64_t*)&cgen_var_107, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1819 | uint64_t cgen_var_108; |
| 1820 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_108, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1821 | countingStream->write((uint64_t*)&cgen_var_108, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1822 | uint64_t cgen_var_109; |
| 1823 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_109, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1824 | countingStream->write((uint64_t*)&cgen_var_109, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1825 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1826 | } |
| 1827 | uint32_t packetSize_vkBindBufferMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1828 | countingStream->rewind(); |
| 1829 | uint32_t opcode_vkBindBufferMemory = OP_vkBindBufferMemory; |
| 1830 | stream->write(&opcode_vkBindBufferMemory, sizeof(uint32_t)); |
| 1831 | stream->write(&packetSize_vkBindBufferMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1832 | uint64_t cgen_var_110; |
| 1833 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_110, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1834 | stream->write((uint64_t*)&cgen_var_110, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1835 | uint64_t cgen_var_111; |
| 1836 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_111, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1837 | stream->write((uint64_t*)&cgen_var_111, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1838 | uint64_t cgen_var_112; |
| 1839 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_112, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1840 | stream->write((uint64_t*)&cgen_var_112, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1841 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1842 | VkResult vkBindBufferMemory_VkResult_return = (VkResult)0; |
| 1843 | stream->read(&vkBindBufferMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1844 | countingStream->clearPool(); |
| 1845 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1846 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1847 | mImpl->log("finish vkBindBufferMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1848 | return vkBindBufferMemory_VkResult_return; |
| 1849 | } |
| 1850 | |
| 1851 | VkResult VkEncoder::vkBindImageMemory( |
| 1852 | VkDevice device, |
| 1853 | VkImage image, |
| 1854 | VkDeviceMemory memory, |
| 1855 | VkDeviceSize memoryOffset) |
| 1856 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1857 | mImpl->log("start vkBindImageMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1858 | auto stream = mImpl->stream(); |
| 1859 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1860 | auto resources = mImpl->resources(); |
| 1861 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1862 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1863 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1864 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1865 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1866 | VkDeviceSize local_memoryOffset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1867 | local_device = device; |
| 1868 | local_image = image; |
| 1869 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1870 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | afe29d3 | 2018-12-25 13:01:52 -0800 | [diff] [blame] | 1871 | mImpl->resources()->deviceMemoryTransform_tohost(&local_memory, 1, &local_memoryOffset, 1, nullptr, 0, nullptr, 0, nullptr, 0); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1872 | countingStream->rewind(); |
| 1873 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1874 | uint64_t cgen_var_113; |
| 1875 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_113, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1876 | countingStream->write((uint64_t*)&cgen_var_113, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1877 | uint64_t cgen_var_114; |
| 1878 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_114, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1879 | countingStream->write((uint64_t*)&cgen_var_114, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1880 | uint64_t cgen_var_115; |
| 1881 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_115, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1882 | countingStream->write((uint64_t*)&cgen_var_115, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1883 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1884 | } |
| 1885 | uint32_t packetSize_vkBindImageMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1886 | countingStream->rewind(); |
| 1887 | uint32_t opcode_vkBindImageMemory = OP_vkBindImageMemory; |
| 1888 | stream->write(&opcode_vkBindImageMemory, sizeof(uint32_t)); |
| 1889 | stream->write(&packetSize_vkBindImageMemory, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1890 | uint64_t cgen_var_116; |
| 1891 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_116, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1892 | stream->write((uint64_t*)&cgen_var_116, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1893 | uint64_t cgen_var_117; |
| 1894 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_117, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1895 | stream->write((uint64_t*)&cgen_var_117, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1896 | uint64_t cgen_var_118; |
| 1897 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_118, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1898 | stream->write((uint64_t*)&cgen_var_118, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1899 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1900 | VkResult vkBindImageMemory_VkResult_return = (VkResult)0; |
| 1901 | stream->read(&vkBindImageMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1902 | countingStream->clearPool(); |
| 1903 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1904 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1905 | mImpl->log("finish vkBindImageMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1906 | return vkBindImageMemory_VkResult_return; |
| 1907 | } |
| 1908 | |
| 1909 | void VkEncoder::vkGetBufferMemoryRequirements( |
| 1910 | VkDevice device, |
| 1911 | VkBuffer buffer, |
| 1912 | VkMemoryRequirements* pMemoryRequirements) |
| 1913 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1914 | mImpl->log("start vkGetBufferMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1915 | auto stream = mImpl->stream(); |
| 1916 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1917 | auto resources = mImpl->resources(); |
| 1918 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1919 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1920 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1921 | VkBuffer local_buffer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1922 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1923 | local_buffer = buffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1924 | countingStream->rewind(); |
| 1925 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1926 | uint64_t cgen_var_119; |
| 1927 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_119, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1928 | countingStream->write((uint64_t*)&cgen_var_119, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1929 | uint64_t cgen_var_120; |
| 1930 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_120, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1931 | countingStream->write((uint64_t*)&cgen_var_120, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1932 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1933 | } |
| 1934 | uint32_t packetSize_vkGetBufferMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1935 | countingStream->rewind(); |
| 1936 | uint32_t opcode_vkGetBufferMemoryRequirements = OP_vkGetBufferMemoryRequirements; |
| 1937 | stream->write(&opcode_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| 1938 | stream->write(&packetSize_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1939 | uint64_t cgen_var_121; |
| 1940 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_121, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1941 | stream->write((uint64_t*)&cgen_var_121, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1942 | uint64_t cgen_var_122; |
| 1943 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_122, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1944 | stream->write((uint64_t*)&cgen_var_122, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1945 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1946 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1947 | if (pMemoryRequirements) |
| 1948 | { |
| 1949 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1950 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1951 | mImpl->log("finish vkGetBufferMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1952 | } |
| 1953 | |
| 1954 | void VkEncoder::vkGetImageMemoryRequirements( |
| 1955 | VkDevice device, |
| 1956 | VkImage image, |
| 1957 | VkMemoryRequirements* pMemoryRequirements) |
| 1958 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1959 | mImpl->log("start vkGetImageMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1960 | auto stream = mImpl->stream(); |
| 1961 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1962 | auto resources = mImpl->resources(); |
| 1963 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1964 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1965 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1966 | VkImage local_image; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1967 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1968 | local_image = image; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1969 | countingStream->rewind(); |
| 1970 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1971 | uint64_t cgen_var_123; |
| 1972 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_123, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1973 | countingStream->write((uint64_t*)&cgen_var_123, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1974 | uint64_t cgen_var_124; |
| 1975 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_124, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1976 | countingStream->write((uint64_t*)&cgen_var_124, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1977 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1978 | } |
| 1979 | uint32_t packetSize_vkGetImageMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1980 | countingStream->rewind(); |
| 1981 | uint32_t opcode_vkGetImageMemoryRequirements = OP_vkGetImageMemoryRequirements; |
| 1982 | stream->write(&opcode_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| 1983 | stream->write(&packetSize_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1984 | uint64_t cgen_var_125; |
| 1985 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_125, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1986 | stream->write((uint64_t*)&cgen_var_125, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1987 | uint64_t cgen_var_126; |
| 1988 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_126, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1989 | stream->write((uint64_t*)&cgen_var_126, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1990 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1991 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1992 | if (pMemoryRequirements) |
| 1993 | { |
| 1994 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 1995 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1996 | mImpl->log("finish vkGetImageMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1997 | } |
| 1998 | |
| 1999 | void VkEncoder::vkGetImageSparseMemoryRequirements( |
| 2000 | VkDevice device, |
| 2001 | VkImage image, |
| 2002 | uint32_t* pSparseMemoryRequirementCount, |
| 2003 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 2004 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2005 | mImpl->log("start vkGetImageSparseMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2006 | auto stream = mImpl->stream(); |
| 2007 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2008 | auto resources = mImpl->resources(); |
| 2009 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2010 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2011 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2012 | VkImage local_image; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2013 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2014 | local_image = image; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2015 | countingStream->rewind(); |
| 2016 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2017 | uint64_t cgen_var_127; |
| 2018 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_127, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2019 | countingStream->write((uint64_t*)&cgen_var_127, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2020 | uint64_t cgen_var_128; |
| 2021 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_128, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2022 | countingStream->write((uint64_t*)&cgen_var_128, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2023 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2024 | uint64_t cgen_var_129 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 2025 | countingStream->putBe64(cgen_var_129); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2026 | if (pSparseMemoryRequirementCount) |
| 2027 | { |
| 2028 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2029 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2030 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2031 | uint64_t cgen_var_130 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 2032 | countingStream->putBe64(cgen_var_130); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2033 | if (pSparseMemoryRequirements) |
| 2034 | { |
| 2035 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2036 | { |
| 2037 | marshal_VkSparseImageMemoryRequirements(countingStream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2038 | } |
| 2039 | } |
| 2040 | } |
| 2041 | uint32_t packetSize_vkGetImageSparseMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2042 | countingStream->rewind(); |
| 2043 | uint32_t opcode_vkGetImageSparseMemoryRequirements = OP_vkGetImageSparseMemoryRequirements; |
| 2044 | stream->write(&opcode_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| 2045 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2046 | uint64_t cgen_var_131; |
| 2047 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_131, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2048 | stream->write((uint64_t*)&cgen_var_131, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2049 | uint64_t cgen_var_132; |
| 2050 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_132, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2051 | stream->write((uint64_t*)&cgen_var_132, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2052 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2053 | uint64_t cgen_var_133 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 2054 | stream->putBe64(cgen_var_133); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2055 | if (pSparseMemoryRequirementCount) |
| 2056 | { |
| 2057 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2058 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2059 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2060 | uint64_t cgen_var_134 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 2061 | stream->putBe64(cgen_var_134); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2062 | if (pSparseMemoryRequirements) |
| 2063 | { |
| 2064 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2065 | { |
| 2066 | marshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2067 | } |
| 2068 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2069 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2070 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2071 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2072 | if (pSparseMemoryRequirementCount) |
| 2073 | { |
| 2074 | if (!(check_pSparseMemoryRequirementCount)) |
| 2075 | { |
| 2076 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 2077 | } |
| 2078 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2079 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2080 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2081 | VkSparseImageMemoryRequirements* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2082 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2083 | if (pSparseMemoryRequirements) |
| 2084 | { |
| 2085 | if (!(check_pSparseMemoryRequirements)) |
| 2086 | { |
| 2087 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 2088 | } |
| 2089 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2090 | { |
| 2091 | unmarshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2092 | } |
| 2093 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2094 | if (pSparseMemoryRequirements) |
| 2095 | { |
| 2096 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2097 | { |
| 2098 | transform_fromhost_VkSparseImageMemoryRequirements(mImpl->resources(), (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2099 | } |
| 2100 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2101 | mImpl->log("finish vkGetImageSparseMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2102 | } |
| 2103 | |
| 2104 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties( |
| 2105 | VkPhysicalDevice physicalDevice, |
| 2106 | VkFormat format, |
| 2107 | VkImageType type, |
| 2108 | VkSampleCountFlagBits samples, |
| 2109 | VkImageUsageFlags usage, |
| 2110 | VkImageTiling tiling, |
| 2111 | uint32_t* pPropertyCount, |
| 2112 | VkSparseImageFormatProperties* pProperties) |
| 2113 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2114 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2115 | auto stream = mImpl->stream(); |
| 2116 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2117 | auto resources = mImpl->resources(); |
| 2118 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2119 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2120 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2121 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2122 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2123 | VkSampleCountFlagBits local_samples; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2124 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2125 | VkImageTiling local_tiling; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2126 | local_physicalDevice = physicalDevice; |
| 2127 | local_format = format; |
| 2128 | local_type = type; |
| 2129 | local_samples = samples; |
| 2130 | local_usage = usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2131 | local_tiling = tiling; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2132 | countingStream->rewind(); |
| 2133 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2134 | uint64_t cgen_var_137; |
| 2135 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_137, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2136 | countingStream->write((uint64_t*)&cgen_var_137, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2137 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 2138 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 2139 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 2140 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 2141 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2142 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2143 | uint64_t cgen_var_138 = (uint64_t)(uintptr_t)pPropertyCount; |
| 2144 | countingStream->putBe64(cgen_var_138); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2145 | if (pPropertyCount) |
| 2146 | { |
| 2147 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2148 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2149 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2150 | uint64_t cgen_var_139 = (uint64_t)(uintptr_t)pProperties; |
| 2151 | countingStream->putBe64(cgen_var_139); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2152 | if (pProperties) |
| 2153 | { |
| 2154 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2155 | { |
| 2156 | marshal_VkSparseImageFormatProperties(countingStream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2157 | } |
| 2158 | } |
| 2159 | } |
| 2160 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2161 | countingStream->rewind(); |
| 2162 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties = OP_vkGetPhysicalDeviceSparseImageFormatProperties; |
| 2163 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| 2164 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2165 | uint64_t cgen_var_140; |
| 2166 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_140, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2167 | stream->write((uint64_t*)&cgen_var_140, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2168 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 2169 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 2170 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 2171 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 2172 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2173 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2174 | uint64_t cgen_var_141 = (uint64_t)(uintptr_t)pPropertyCount; |
| 2175 | stream->putBe64(cgen_var_141); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2176 | if (pPropertyCount) |
| 2177 | { |
| 2178 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2179 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2180 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2181 | uint64_t cgen_var_142 = (uint64_t)(uintptr_t)pProperties; |
| 2182 | stream->putBe64(cgen_var_142); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2183 | if (pProperties) |
| 2184 | { |
| 2185 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2186 | { |
| 2187 | marshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2188 | } |
| 2189 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2190 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2191 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2192 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2193 | if (pPropertyCount) |
| 2194 | { |
| 2195 | if (!(check_pPropertyCount)) |
| 2196 | { |
| 2197 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 2198 | } |
| 2199 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2200 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2201 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2202 | VkSparseImageFormatProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2203 | check_pProperties = (VkSparseImageFormatProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2204 | if (pProperties) |
| 2205 | { |
| 2206 | if (!(check_pProperties)) |
| 2207 | { |
| 2208 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 2209 | } |
| 2210 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2211 | { |
| 2212 | unmarshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2213 | } |
| 2214 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2215 | if (pProperties) |
| 2216 | { |
| 2217 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2218 | { |
| 2219 | transform_fromhost_VkSparseImageFormatProperties(mImpl->resources(), (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2220 | } |
| 2221 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2222 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2223 | } |
| 2224 | |
| 2225 | VkResult VkEncoder::vkQueueBindSparse( |
| 2226 | VkQueue queue, |
| 2227 | uint32_t bindInfoCount, |
| 2228 | const VkBindSparseInfo* pBindInfo, |
| 2229 | VkFence fence) |
| 2230 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2231 | mImpl->log("start vkQueueBindSparse"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2232 | auto stream = mImpl->stream(); |
| 2233 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2234 | auto resources = mImpl->resources(); |
| 2235 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2236 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2237 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2238 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2239 | VkBindSparseInfo* local_pBindInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2240 | VkFence local_fence; |
| 2241 | local_queue = queue; |
| 2242 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2243 | local_pBindInfo = nullptr; |
| 2244 | if (pBindInfo) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2245 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2246 | local_pBindInfo = (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2247 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2248 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2249 | deepcopy_VkBindSparseInfo(pool, pBindInfo + i, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2250 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2251 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2252 | local_fence = fence; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2253 | if (local_pBindInfo) |
| 2254 | { |
| 2255 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2256 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2257 | transform_tohost_VkBindSparseInfo(mImpl->resources(), (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2258 | } |
| 2259 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2260 | countingStream->rewind(); |
| 2261 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2262 | uint64_t cgen_var_145; |
| 2263 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_145, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2264 | countingStream->write((uint64_t*)&cgen_var_145, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2265 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 2266 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2267 | { |
| 2268 | marshal_VkBindSparseInfo(countingStream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 2269 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2270 | uint64_t cgen_var_146; |
| 2271 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_146, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2272 | countingStream->write((uint64_t*)&cgen_var_146, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2273 | } |
| 2274 | uint32_t packetSize_vkQueueBindSparse = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2275 | countingStream->rewind(); |
| 2276 | uint32_t opcode_vkQueueBindSparse = OP_vkQueueBindSparse; |
| 2277 | stream->write(&opcode_vkQueueBindSparse, sizeof(uint32_t)); |
| 2278 | stream->write(&packetSize_vkQueueBindSparse, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2279 | uint64_t cgen_var_147; |
| 2280 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_147, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2281 | stream->write((uint64_t*)&cgen_var_147, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2282 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2283 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2284 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2285 | marshal_VkBindSparseInfo(stream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2286 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2287 | uint64_t cgen_var_148; |
| 2288 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_148, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2289 | stream->write((uint64_t*)&cgen_var_148, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2290 | VkResult vkQueueBindSparse_VkResult_return = (VkResult)0; |
| 2291 | stream->read(&vkQueueBindSparse_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2292 | countingStream->clearPool(); |
| 2293 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2294 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2295 | mImpl->log("finish vkQueueBindSparse");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2296 | return vkQueueBindSparse_VkResult_return; |
| 2297 | } |
| 2298 | |
| 2299 | VkResult VkEncoder::vkCreateFence( |
| 2300 | VkDevice device, |
| 2301 | const VkFenceCreateInfo* pCreateInfo, |
| 2302 | const VkAllocationCallbacks* pAllocator, |
| 2303 | VkFence* pFence) |
| 2304 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2305 | mImpl->log("start vkCreateFence"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2306 | auto stream = mImpl->stream(); |
| 2307 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2308 | auto resources = mImpl->resources(); |
| 2309 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2310 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2311 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2312 | VkFenceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2313 | VkAllocationCallbacks* local_pAllocator; |
| 2314 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2315 | local_pCreateInfo = nullptr; |
| 2316 | if (pCreateInfo) |
| 2317 | { |
| 2318 | local_pCreateInfo = (VkFenceCreateInfo*)pool->alloc(sizeof(const VkFenceCreateInfo)); |
| 2319 | deepcopy_VkFenceCreateInfo(pool, pCreateInfo, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| 2320 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2321 | local_pAllocator = nullptr; |
| 2322 | if (pAllocator) |
| 2323 | { |
| 2324 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2325 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2326 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2327 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2328 | if (local_pCreateInfo) |
| 2329 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2330 | transform_tohost_VkFenceCreateInfo(mImpl->resources(), (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2331 | } |
| 2332 | if (local_pAllocator) |
| 2333 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2334 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2335 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2336 | countingStream->rewind(); |
| 2337 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2338 | uint64_t cgen_var_149; |
| 2339 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_149, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2340 | countingStream->write((uint64_t*)&cgen_var_149, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2341 | marshal_VkFenceCreateInfo(countingStream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2342 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2343 | uint64_t cgen_var_150 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2344 | countingStream->putBe64(cgen_var_150); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2345 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2346 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2347 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2348 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2349 | uint64_t cgen_var_151; |
| 2350 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_151, 1); |
| 2351 | countingStream->write((uint64_t*)&cgen_var_151, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2352 | } |
| 2353 | uint32_t packetSize_vkCreateFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2354 | countingStream->rewind(); |
| 2355 | uint32_t opcode_vkCreateFence = OP_vkCreateFence; |
| 2356 | stream->write(&opcode_vkCreateFence, sizeof(uint32_t)); |
| 2357 | stream->write(&packetSize_vkCreateFence, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2358 | uint64_t cgen_var_152; |
| 2359 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_152, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2360 | stream->write((uint64_t*)&cgen_var_152, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2361 | marshal_VkFenceCreateInfo(stream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2362 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2363 | uint64_t cgen_var_153 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2364 | stream->putBe64(cgen_var_153); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2365 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2366 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2367 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2368 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2369 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2370 | uint64_t cgen_var_154; |
| 2371 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_154, 1); |
| 2372 | stream->write((uint64_t*)&cgen_var_154, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2373 | stream->setHandleMapping(resources->unwrapMapping()); |
| 2374 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2375 | uint64_t cgen_var_155; |
| 2376 | stream->read((uint64_t*)&cgen_var_155, 8); |
| 2377 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_155, (VkFence*)pFence, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2378 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2379 | VkResult vkCreateFence_VkResult_return = (VkResult)0; |
| 2380 | stream->read(&vkCreateFence_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2381 | countingStream->clearPool(); |
| 2382 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2383 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2384 | mImpl->log("finish vkCreateFence");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2385 | return vkCreateFence_VkResult_return; |
| 2386 | } |
| 2387 | |
| 2388 | void VkEncoder::vkDestroyFence( |
| 2389 | VkDevice device, |
| 2390 | VkFence fence, |
| 2391 | const VkAllocationCallbacks* pAllocator) |
| 2392 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2393 | mImpl->log("start vkDestroyFence"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2394 | auto stream = mImpl->stream(); |
| 2395 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2396 | auto resources = mImpl->resources(); |
| 2397 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2398 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2399 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2400 | VkFence local_fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2401 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2402 | local_device = device; |
| 2403 | local_fence = fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2404 | local_pAllocator = nullptr; |
| 2405 | if (pAllocator) |
| 2406 | { |
| 2407 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2408 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2409 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2410 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2411 | if (local_pAllocator) |
| 2412 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2413 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2414 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2415 | countingStream->rewind(); |
| 2416 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2417 | uint64_t cgen_var_156; |
| 2418 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_156, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2419 | countingStream->write((uint64_t*)&cgen_var_156, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2420 | uint64_t cgen_var_157; |
| 2421 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_157, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2422 | countingStream->write((uint64_t*)&cgen_var_157, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2423 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2424 | uint64_t cgen_var_158 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2425 | countingStream->putBe64(cgen_var_158); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2426 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2427 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2428 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2429 | } |
| 2430 | } |
| 2431 | uint32_t packetSize_vkDestroyFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2432 | countingStream->rewind(); |
| 2433 | uint32_t opcode_vkDestroyFence = OP_vkDestroyFence; |
| 2434 | stream->write(&opcode_vkDestroyFence, sizeof(uint32_t)); |
| 2435 | stream->write(&packetSize_vkDestroyFence, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2436 | uint64_t cgen_var_159; |
| 2437 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_159, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2438 | stream->write((uint64_t*)&cgen_var_159, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2439 | uint64_t cgen_var_160; |
| 2440 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_160, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2441 | stream->write((uint64_t*)&cgen_var_160, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2442 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2443 | uint64_t cgen_var_161 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2444 | stream->putBe64(cgen_var_161); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2445 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2446 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2447 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2448 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2449 | resources->destroyMapping()->mapHandles_VkFence((VkFence*)&fence); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2450 | mImpl->log("finish vkDestroyFence");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2451 | } |
| 2452 | |
| 2453 | VkResult VkEncoder::vkResetFences( |
| 2454 | VkDevice device, |
| 2455 | uint32_t fenceCount, |
| 2456 | const VkFence* pFences) |
| 2457 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2458 | mImpl->log("start vkResetFences"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2459 | auto stream = mImpl->stream(); |
| 2460 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2461 | auto resources = mImpl->resources(); |
| 2462 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2463 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2464 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2465 | uint32_t local_fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2466 | VkFence* local_pFences; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2467 | local_device = device; |
| 2468 | local_fenceCount = fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2469 | local_pFences = nullptr; |
| 2470 | if (pFences) |
| 2471 | { |
| 2472 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2473 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2474 | countingStream->rewind(); |
| 2475 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2476 | uint64_t cgen_var_162; |
| 2477 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_162, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2478 | countingStream->write((uint64_t*)&cgen_var_162, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2479 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2480 | if (((fenceCount))) |
| 2481 | { |
| 2482 | uint64_t* cgen_var_163; |
| 2483 | countingStream->alloc((void**)&cgen_var_163, ((fenceCount)) * 8); |
| 2484 | countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_163, ((fenceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2485 | countingStream->write((uint64_t*)cgen_var_163, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2486 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2487 | } |
| 2488 | uint32_t packetSize_vkResetFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2489 | countingStream->rewind(); |
| 2490 | uint32_t opcode_vkResetFences = OP_vkResetFences; |
| 2491 | stream->write(&opcode_vkResetFences, sizeof(uint32_t)); |
| 2492 | stream->write(&packetSize_vkResetFences, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2493 | uint64_t cgen_var_164; |
| 2494 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_164, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2495 | stream->write((uint64_t*)&cgen_var_164, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2496 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2497 | if (((fenceCount))) |
| 2498 | { |
| 2499 | uint64_t* cgen_var_165; |
| 2500 | stream->alloc((void**)&cgen_var_165, ((fenceCount)) * 8); |
| 2501 | stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_165, ((fenceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2502 | stream->write((uint64_t*)cgen_var_165, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2503 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2504 | VkResult vkResetFences_VkResult_return = (VkResult)0; |
| 2505 | stream->read(&vkResetFences_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2506 | countingStream->clearPool(); |
| 2507 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2508 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2509 | mImpl->log("finish vkResetFences");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2510 | return vkResetFences_VkResult_return; |
| 2511 | } |
| 2512 | |
| 2513 | VkResult VkEncoder::vkGetFenceStatus( |
| 2514 | VkDevice device, |
| 2515 | VkFence fence) |
| 2516 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2517 | mImpl->log("start vkGetFenceStatus"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2518 | auto stream = mImpl->stream(); |
| 2519 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2520 | auto resources = mImpl->resources(); |
| 2521 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2522 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2523 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2524 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2525 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2526 | local_fence = fence; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2527 | countingStream->rewind(); |
| 2528 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2529 | uint64_t cgen_var_166; |
| 2530 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_166, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2531 | countingStream->write((uint64_t*)&cgen_var_166, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2532 | uint64_t cgen_var_167; |
| 2533 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_167, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2534 | countingStream->write((uint64_t*)&cgen_var_167, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2535 | } |
| 2536 | uint32_t packetSize_vkGetFenceStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2537 | countingStream->rewind(); |
| 2538 | uint32_t opcode_vkGetFenceStatus = OP_vkGetFenceStatus; |
| 2539 | stream->write(&opcode_vkGetFenceStatus, sizeof(uint32_t)); |
| 2540 | stream->write(&packetSize_vkGetFenceStatus, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2541 | uint64_t cgen_var_168; |
| 2542 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_168, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2543 | stream->write((uint64_t*)&cgen_var_168, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2544 | uint64_t cgen_var_169; |
| 2545 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_169, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2546 | stream->write((uint64_t*)&cgen_var_169, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2547 | VkResult vkGetFenceStatus_VkResult_return = (VkResult)0; |
| 2548 | stream->read(&vkGetFenceStatus_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2549 | countingStream->clearPool(); |
| 2550 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2551 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2552 | mImpl->log("finish vkGetFenceStatus");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2553 | return vkGetFenceStatus_VkResult_return; |
| 2554 | } |
| 2555 | |
| 2556 | VkResult VkEncoder::vkWaitForFences( |
| 2557 | VkDevice device, |
| 2558 | uint32_t fenceCount, |
| 2559 | const VkFence* pFences, |
| 2560 | VkBool32 waitAll, |
| 2561 | uint64_t timeout) |
| 2562 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2563 | mImpl->log("start vkWaitForFences"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2564 | auto stream = mImpl->stream(); |
| 2565 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2566 | auto resources = mImpl->resources(); |
| 2567 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2568 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2569 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2570 | uint32_t local_fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2571 | VkFence* local_pFences; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2572 | VkBool32 local_waitAll; |
| 2573 | uint64_t local_timeout; |
| 2574 | local_device = device; |
| 2575 | local_fenceCount = fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2576 | local_pFences = nullptr; |
| 2577 | if (pFences) |
| 2578 | { |
| 2579 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2580 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2581 | local_waitAll = waitAll; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2582 | local_timeout = timeout; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2583 | countingStream->rewind(); |
| 2584 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2585 | uint64_t cgen_var_170; |
| 2586 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_170, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2587 | countingStream->write((uint64_t*)&cgen_var_170, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2588 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2589 | if (((fenceCount))) |
| 2590 | { |
| 2591 | uint64_t* cgen_var_171; |
| 2592 | countingStream->alloc((void**)&cgen_var_171, ((fenceCount)) * 8); |
| 2593 | countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_171, ((fenceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2594 | countingStream->write((uint64_t*)cgen_var_171, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2595 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2596 | countingStream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2597 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2598 | } |
| 2599 | uint32_t packetSize_vkWaitForFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2600 | countingStream->rewind(); |
| 2601 | uint32_t opcode_vkWaitForFences = OP_vkWaitForFences; |
| 2602 | stream->write(&opcode_vkWaitForFences, sizeof(uint32_t)); |
| 2603 | stream->write(&packetSize_vkWaitForFences, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2604 | uint64_t cgen_var_172; |
| 2605 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_172, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2606 | stream->write((uint64_t*)&cgen_var_172, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2607 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2608 | if (((fenceCount))) |
| 2609 | { |
| 2610 | uint64_t* cgen_var_173; |
| 2611 | stream->alloc((void**)&cgen_var_173, ((fenceCount)) * 8); |
| 2612 | stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_173, ((fenceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2613 | stream->write((uint64_t*)cgen_var_173, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2614 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2615 | stream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2616 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2617 | VkResult vkWaitForFences_VkResult_return = (VkResult)0; |
| 2618 | stream->read(&vkWaitForFences_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2619 | countingStream->clearPool(); |
| 2620 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2621 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2622 | mImpl->log("finish vkWaitForFences");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2623 | return vkWaitForFences_VkResult_return; |
| 2624 | } |
| 2625 | |
| 2626 | VkResult VkEncoder::vkCreateSemaphore( |
| 2627 | VkDevice device, |
| 2628 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 2629 | const VkAllocationCallbacks* pAllocator, |
| 2630 | VkSemaphore* pSemaphore) |
| 2631 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2632 | mImpl->log("start vkCreateSemaphore"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2633 | auto stream = mImpl->stream(); |
| 2634 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2635 | auto resources = mImpl->resources(); |
| 2636 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2637 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2638 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2639 | VkSemaphoreCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2640 | VkAllocationCallbacks* local_pAllocator; |
| 2641 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2642 | local_pCreateInfo = nullptr; |
| 2643 | if (pCreateInfo) |
| 2644 | { |
| 2645 | local_pCreateInfo = (VkSemaphoreCreateInfo*)pool->alloc(sizeof(const VkSemaphoreCreateInfo)); |
| 2646 | deepcopy_VkSemaphoreCreateInfo(pool, pCreateInfo, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| 2647 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2648 | local_pAllocator = nullptr; |
| 2649 | if (pAllocator) |
| 2650 | { |
| 2651 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2652 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2653 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2654 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2655 | if (local_pCreateInfo) |
| 2656 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2657 | transform_tohost_VkSemaphoreCreateInfo(mImpl->resources(), (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2658 | } |
| 2659 | if (local_pAllocator) |
| 2660 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2661 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2662 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2663 | countingStream->rewind(); |
| 2664 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2665 | uint64_t cgen_var_174; |
| 2666 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_174, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2667 | countingStream->write((uint64_t*)&cgen_var_174, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2668 | marshal_VkSemaphoreCreateInfo(countingStream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2669 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2670 | uint64_t cgen_var_175 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2671 | countingStream->putBe64(cgen_var_175); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2672 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2673 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2674 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2675 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2676 | uint64_t cgen_var_176; |
| 2677 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_176, 1); |
| 2678 | countingStream->write((uint64_t*)&cgen_var_176, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2679 | } |
| 2680 | uint32_t packetSize_vkCreateSemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2681 | countingStream->rewind(); |
| 2682 | uint32_t opcode_vkCreateSemaphore = OP_vkCreateSemaphore; |
| 2683 | stream->write(&opcode_vkCreateSemaphore, sizeof(uint32_t)); |
| 2684 | stream->write(&packetSize_vkCreateSemaphore, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2685 | uint64_t cgen_var_177; |
| 2686 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_177, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2687 | stream->write((uint64_t*)&cgen_var_177, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2688 | marshal_VkSemaphoreCreateInfo(stream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2689 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2690 | uint64_t cgen_var_178 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2691 | stream->putBe64(cgen_var_178); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2692 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2693 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2694 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2695 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2696 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2697 | uint64_t cgen_var_179; |
| 2698 | stream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_179, 1); |
| 2699 | stream->write((uint64_t*)&cgen_var_179, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2700 | stream->setHandleMapping(resources->unwrapMapping()); |
| 2701 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2702 | uint64_t cgen_var_180; |
| 2703 | stream->read((uint64_t*)&cgen_var_180, 8); |
| 2704 | stream->handleMapping()->mapHandles_u64_VkSemaphore(&cgen_var_180, (VkSemaphore*)pSemaphore, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2705 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2706 | VkResult vkCreateSemaphore_VkResult_return = (VkResult)0; |
| 2707 | stream->read(&vkCreateSemaphore_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2708 | countingStream->clearPool(); |
| 2709 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2710 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2711 | mImpl->log("finish vkCreateSemaphore");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2712 | return vkCreateSemaphore_VkResult_return; |
| 2713 | } |
| 2714 | |
| 2715 | void VkEncoder::vkDestroySemaphore( |
| 2716 | VkDevice device, |
| 2717 | VkSemaphore semaphore, |
| 2718 | const VkAllocationCallbacks* pAllocator) |
| 2719 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2720 | mImpl->log("start vkDestroySemaphore"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2721 | auto stream = mImpl->stream(); |
| 2722 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2723 | auto resources = mImpl->resources(); |
| 2724 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2725 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2726 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2727 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2728 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2729 | local_device = device; |
| 2730 | local_semaphore = semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2731 | local_pAllocator = nullptr; |
| 2732 | if (pAllocator) |
| 2733 | { |
| 2734 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2735 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2736 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2737 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2738 | if (local_pAllocator) |
| 2739 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2740 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2741 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2742 | countingStream->rewind(); |
| 2743 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2744 | uint64_t cgen_var_181; |
| 2745 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_181, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2746 | countingStream->write((uint64_t*)&cgen_var_181, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2747 | uint64_t cgen_var_182; |
| 2748 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_182, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2749 | countingStream->write((uint64_t*)&cgen_var_182, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2750 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2751 | uint64_t cgen_var_183 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2752 | countingStream->putBe64(cgen_var_183); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2753 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2754 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2755 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2756 | } |
| 2757 | } |
| 2758 | uint32_t packetSize_vkDestroySemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2759 | countingStream->rewind(); |
| 2760 | uint32_t opcode_vkDestroySemaphore = OP_vkDestroySemaphore; |
| 2761 | stream->write(&opcode_vkDestroySemaphore, sizeof(uint32_t)); |
| 2762 | stream->write(&packetSize_vkDestroySemaphore, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2763 | uint64_t cgen_var_184; |
| 2764 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_184, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2765 | stream->write((uint64_t*)&cgen_var_184, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2766 | uint64_t cgen_var_185; |
| 2767 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_185, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2768 | stream->write((uint64_t*)&cgen_var_185, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2769 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2770 | uint64_t cgen_var_186 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2771 | stream->putBe64(cgen_var_186); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2772 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2773 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2774 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2775 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2776 | resources->destroyMapping()->mapHandles_VkSemaphore((VkSemaphore*)&semaphore); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2777 | mImpl->log("finish vkDestroySemaphore");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2778 | } |
| 2779 | |
| 2780 | VkResult VkEncoder::vkCreateEvent( |
| 2781 | VkDevice device, |
| 2782 | const VkEventCreateInfo* pCreateInfo, |
| 2783 | const VkAllocationCallbacks* pAllocator, |
| 2784 | VkEvent* pEvent) |
| 2785 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2786 | mImpl->log("start vkCreateEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2787 | auto stream = mImpl->stream(); |
| 2788 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2789 | auto resources = mImpl->resources(); |
| 2790 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2791 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2792 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2793 | VkEventCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2794 | VkAllocationCallbacks* local_pAllocator; |
| 2795 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2796 | local_pCreateInfo = nullptr; |
| 2797 | if (pCreateInfo) |
| 2798 | { |
| 2799 | local_pCreateInfo = (VkEventCreateInfo*)pool->alloc(sizeof(const VkEventCreateInfo)); |
| 2800 | deepcopy_VkEventCreateInfo(pool, pCreateInfo, (VkEventCreateInfo*)(local_pCreateInfo)); |
| 2801 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2802 | local_pAllocator = nullptr; |
| 2803 | if (pAllocator) |
| 2804 | { |
| 2805 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2806 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2807 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2808 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2809 | if (local_pCreateInfo) |
| 2810 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2811 | transform_tohost_VkEventCreateInfo(mImpl->resources(), (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2812 | } |
| 2813 | if (local_pAllocator) |
| 2814 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2815 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2816 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2817 | countingStream->rewind(); |
| 2818 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2819 | uint64_t cgen_var_187; |
| 2820 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_187, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2821 | countingStream->write((uint64_t*)&cgen_var_187, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2822 | marshal_VkEventCreateInfo(countingStream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2823 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2824 | uint64_t cgen_var_188 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2825 | countingStream->putBe64(cgen_var_188); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2826 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2827 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2828 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2829 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2830 | uint64_t cgen_var_189; |
| 2831 | countingStream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_189, 1); |
| 2832 | countingStream->write((uint64_t*)&cgen_var_189, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2833 | } |
| 2834 | uint32_t packetSize_vkCreateEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2835 | countingStream->rewind(); |
| 2836 | uint32_t opcode_vkCreateEvent = OP_vkCreateEvent; |
| 2837 | stream->write(&opcode_vkCreateEvent, sizeof(uint32_t)); |
| 2838 | stream->write(&packetSize_vkCreateEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2839 | uint64_t cgen_var_190; |
| 2840 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_190, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2841 | stream->write((uint64_t*)&cgen_var_190, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2842 | marshal_VkEventCreateInfo(stream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2843 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2844 | uint64_t cgen_var_191 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2845 | stream->putBe64(cgen_var_191); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2846 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2847 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2848 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2849 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2850 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2851 | uint64_t cgen_var_192; |
| 2852 | stream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_192, 1); |
| 2853 | stream->write((uint64_t*)&cgen_var_192, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2854 | stream->setHandleMapping(resources->unwrapMapping()); |
| 2855 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2856 | uint64_t cgen_var_193; |
| 2857 | stream->read((uint64_t*)&cgen_var_193, 8); |
| 2858 | stream->handleMapping()->mapHandles_u64_VkEvent(&cgen_var_193, (VkEvent*)pEvent, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2859 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2860 | VkResult vkCreateEvent_VkResult_return = (VkResult)0; |
| 2861 | stream->read(&vkCreateEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2862 | countingStream->clearPool(); |
| 2863 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2864 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2865 | mImpl->log("finish vkCreateEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2866 | return vkCreateEvent_VkResult_return; |
| 2867 | } |
| 2868 | |
| 2869 | void VkEncoder::vkDestroyEvent( |
| 2870 | VkDevice device, |
| 2871 | VkEvent event, |
| 2872 | const VkAllocationCallbacks* pAllocator) |
| 2873 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2874 | mImpl->log("start vkDestroyEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2875 | auto stream = mImpl->stream(); |
| 2876 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2877 | auto resources = mImpl->resources(); |
| 2878 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2879 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2880 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2881 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2882 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2883 | local_device = device; |
| 2884 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2885 | local_pAllocator = nullptr; |
| 2886 | if (pAllocator) |
| 2887 | { |
| 2888 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2889 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2890 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2891 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2892 | if (local_pAllocator) |
| 2893 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2894 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2895 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2896 | countingStream->rewind(); |
| 2897 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2898 | uint64_t cgen_var_194; |
| 2899 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_194, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2900 | countingStream->write((uint64_t*)&cgen_var_194, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2901 | uint64_t cgen_var_195; |
| 2902 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_195, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2903 | countingStream->write((uint64_t*)&cgen_var_195, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2904 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2905 | uint64_t cgen_var_196 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2906 | countingStream->putBe64(cgen_var_196); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2907 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2908 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2909 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2910 | } |
| 2911 | } |
| 2912 | uint32_t packetSize_vkDestroyEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2913 | countingStream->rewind(); |
| 2914 | uint32_t opcode_vkDestroyEvent = OP_vkDestroyEvent; |
| 2915 | stream->write(&opcode_vkDestroyEvent, sizeof(uint32_t)); |
| 2916 | stream->write(&packetSize_vkDestroyEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2917 | uint64_t cgen_var_197; |
| 2918 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_197, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2919 | stream->write((uint64_t*)&cgen_var_197, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2920 | uint64_t cgen_var_198; |
| 2921 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_198, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2922 | stream->write((uint64_t*)&cgen_var_198, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2923 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2924 | uint64_t cgen_var_199 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2925 | stream->putBe64(cgen_var_199); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2926 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2927 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2928 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2929 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2930 | resources->destroyMapping()->mapHandles_VkEvent((VkEvent*)&event); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2931 | mImpl->log("finish vkDestroyEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2932 | } |
| 2933 | |
| 2934 | VkResult VkEncoder::vkGetEventStatus( |
| 2935 | VkDevice device, |
| 2936 | VkEvent event) |
| 2937 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2938 | mImpl->log("start vkGetEventStatus"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2939 | auto stream = mImpl->stream(); |
| 2940 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2941 | auto resources = mImpl->resources(); |
| 2942 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2943 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2944 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2945 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2946 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2947 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2948 | countingStream->rewind(); |
| 2949 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2950 | uint64_t cgen_var_200; |
| 2951 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_200, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2952 | countingStream->write((uint64_t*)&cgen_var_200, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2953 | uint64_t cgen_var_201; |
| 2954 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_201, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2955 | countingStream->write((uint64_t*)&cgen_var_201, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2956 | } |
| 2957 | uint32_t packetSize_vkGetEventStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2958 | countingStream->rewind(); |
| 2959 | uint32_t opcode_vkGetEventStatus = OP_vkGetEventStatus; |
| 2960 | stream->write(&opcode_vkGetEventStatus, sizeof(uint32_t)); |
| 2961 | stream->write(&packetSize_vkGetEventStatus, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2962 | uint64_t cgen_var_202; |
| 2963 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_202, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2964 | stream->write((uint64_t*)&cgen_var_202, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2965 | uint64_t cgen_var_203; |
| 2966 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_203, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2967 | stream->write((uint64_t*)&cgen_var_203, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2968 | VkResult vkGetEventStatus_VkResult_return = (VkResult)0; |
| 2969 | stream->read(&vkGetEventStatus_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2970 | countingStream->clearPool(); |
| 2971 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2972 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2973 | mImpl->log("finish vkGetEventStatus");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2974 | return vkGetEventStatus_VkResult_return; |
| 2975 | } |
| 2976 | |
| 2977 | VkResult VkEncoder::vkSetEvent( |
| 2978 | VkDevice device, |
| 2979 | VkEvent event) |
| 2980 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2981 | mImpl->log("start vkSetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2982 | auto stream = mImpl->stream(); |
| 2983 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2984 | auto resources = mImpl->resources(); |
| 2985 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2986 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2987 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2988 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2989 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2990 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2991 | countingStream->rewind(); |
| 2992 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2993 | uint64_t cgen_var_204; |
| 2994 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_204, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2995 | countingStream->write((uint64_t*)&cgen_var_204, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2996 | uint64_t cgen_var_205; |
| 2997 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_205, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2998 | countingStream->write((uint64_t*)&cgen_var_205, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2999 | } |
| 3000 | uint32_t packetSize_vkSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3001 | countingStream->rewind(); |
| 3002 | uint32_t opcode_vkSetEvent = OP_vkSetEvent; |
| 3003 | stream->write(&opcode_vkSetEvent, sizeof(uint32_t)); |
| 3004 | stream->write(&packetSize_vkSetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3005 | uint64_t cgen_var_206; |
| 3006 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_206, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3007 | stream->write((uint64_t*)&cgen_var_206, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3008 | uint64_t cgen_var_207; |
| 3009 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_207, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3010 | stream->write((uint64_t*)&cgen_var_207, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3011 | VkResult vkSetEvent_VkResult_return = (VkResult)0; |
| 3012 | stream->read(&vkSetEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3013 | countingStream->clearPool(); |
| 3014 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3015 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3016 | mImpl->log("finish vkSetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3017 | return vkSetEvent_VkResult_return; |
| 3018 | } |
| 3019 | |
| 3020 | VkResult VkEncoder::vkResetEvent( |
| 3021 | VkDevice device, |
| 3022 | VkEvent event) |
| 3023 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3024 | mImpl->log("start vkResetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3025 | auto stream = mImpl->stream(); |
| 3026 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3027 | auto resources = mImpl->resources(); |
| 3028 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3029 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3030 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3031 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3032 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3033 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3034 | countingStream->rewind(); |
| 3035 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3036 | uint64_t cgen_var_208; |
| 3037 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_208, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3038 | countingStream->write((uint64_t*)&cgen_var_208, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3039 | uint64_t cgen_var_209; |
| 3040 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_209, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3041 | countingStream->write((uint64_t*)&cgen_var_209, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3042 | } |
| 3043 | uint32_t packetSize_vkResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3044 | countingStream->rewind(); |
| 3045 | uint32_t opcode_vkResetEvent = OP_vkResetEvent; |
| 3046 | stream->write(&opcode_vkResetEvent, sizeof(uint32_t)); |
| 3047 | stream->write(&packetSize_vkResetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3048 | uint64_t cgen_var_210; |
| 3049 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_210, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3050 | stream->write((uint64_t*)&cgen_var_210, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3051 | uint64_t cgen_var_211; |
| 3052 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_211, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3053 | stream->write((uint64_t*)&cgen_var_211, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3054 | VkResult vkResetEvent_VkResult_return = (VkResult)0; |
| 3055 | stream->read(&vkResetEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3056 | countingStream->clearPool(); |
| 3057 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3058 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3059 | mImpl->log("finish vkResetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3060 | return vkResetEvent_VkResult_return; |
| 3061 | } |
| 3062 | |
| 3063 | VkResult VkEncoder::vkCreateQueryPool( |
| 3064 | VkDevice device, |
| 3065 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3066 | const VkAllocationCallbacks* pAllocator, |
| 3067 | VkQueryPool* pQueryPool) |
| 3068 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3069 | mImpl->log("start vkCreateQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3070 | auto stream = mImpl->stream(); |
| 3071 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3072 | auto resources = mImpl->resources(); |
| 3073 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3074 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3075 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3076 | VkQueryPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3077 | VkAllocationCallbacks* local_pAllocator; |
| 3078 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3079 | local_pCreateInfo = nullptr; |
| 3080 | if (pCreateInfo) |
| 3081 | { |
| 3082 | local_pCreateInfo = (VkQueryPoolCreateInfo*)pool->alloc(sizeof(const VkQueryPoolCreateInfo)); |
| 3083 | deepcopy_VkQueryPoolCreateInfo(pool, pCreateInfo, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| 3084 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3085 | local_pAllocator = nullptr; |
| 3086 | if (pAllocator) |
| 3087 | { |
| 3088 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3089 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3090 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3091 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3092 | if (local_pCreateInfo) |
| 3093 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3094 | transform_tohost_VkQueryPoolCreateInfo(mImpl->resources(), (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3095 | } |
| 3096 | if (local_pAllocator) |
| 3097 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3098 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3099 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3100 | countingStream->rewind(); |
| 3101 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3102 | uint64_t cgen_var_212; |
| 3103 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_212, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3104 | countingStream->write((uint64_t*)&cgen_var_212, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3105 | marshal_VkQueryPoolCreateInfo(countingStream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3106 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3107 | uint64_t cgen_var_213 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3108 | countingStream->putBe64(cgen_var_213); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3109 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3110 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3111 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3112 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3113 | uint64_t cgen_var_214; |
| 3114 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_214, 1); |
| 3115 | countingStream->write((uint64_t*)&cgen_var_214, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3116 | } |
| 3117 | uint32_t packetSize_vkCreateQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3118 | countingStream->rewind(); |
| 3119 | uint32_t opcode_vkCreateQueryPool = OP_vkCreateQueryPool; |
| 3120 | stream->write(&opcode_vkCreateQueryPool, sizeof(uint32_t)); |
| 3121 | stream->write(&packetSize_vkCreateQueryPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3122 | uint64_t cgen_var_215; |
| 3123 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_215, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3124 | stream->write((uint64_t*)&cgen_var_215, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3125 | marshal_VkQueryPoolCreateInfo(stream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3126 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3127 | uint64_t cgen_var_216 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3128 | stream->putBe64(cgen_var_216); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3129 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3130 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3131 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3132 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3133 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3134 | uint64_t cgen_var_217; |
| 3135 | stream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_217, 1); |
| 3136 | stream->write((uint64_t*)&cgen_var_217, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3137 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3138 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3139 | uint64_t cgen_var_218; |
| 3140 | stream->read((uint64_t*)&cgen_var_218, 8); |
| 3141 | stream->handleMapping()->mapHandles_u64_VkQueryPool(&cgen_var_218, (VkQueryPool*)pQueryPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3142 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3143 | VkResult vkCreateQueryPool_VkResult_return = (VkResult)0; |
| 3144 | stream->read(&vkCreateQueryPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3145 | countingStream->clearPool(); |
| 3146 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3147 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3148 | mImpl->log("finish vkCreateQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3149 | return vkCreateQueryPool_VkResult_return; |
| 3150 | } |
| 3151 | |
| 3152 | void VkEncoder::vkDestroyQueryPool( |
| 3153 | VkDevice device, |
| 3154 | VkQueryPool queryPool, |
| 3155 | const VkAllocationCallbacks* pAllocator) |
| 3156 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3157 | mImpl->log("start vkDestroyQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3158 | auto stream = mImpl->stream(); |
| 3159 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3160 | auto resources = mImpl->resources(); |
| 3161 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3162 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3163 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3164 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3165 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3166 | local_device = device; |
| 3167 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3168 | local_pAllocator = nullptr; |
| 3169 | if (pAllocator) |
| 3170 | { |
| 3171 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3172 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3173 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3174 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3175 | if (local_pAllocator) |
| 3176 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3177 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3178 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3179 | countingStream->rewind(); |
| 3180 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3181 | uint64_t cgen_var_219; |
| 3182 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_219, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3183 | countingStream->write((uint64_t*)&cgen_var_219, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3184 | uint64_t cgen_var_220; |
| 3185 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_220, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3186 | countingStream->write((uint64_t*)&cgen_var_220, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3187 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3188 | uint64_t cgen_var_221 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3189 | countingStream->putBe64(cgen_var_221); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3190 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3191 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3192 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3193 | } |
| 3194 | } |
| 3195 | uint32_t packetSize_vkDestroyQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3196 | countingStream->rewind(); |
| 3197 | uint32_t opcode_vkDestroyQueryPool = OP_vkDestroyQueryPool; |
| 3198 | stream->write(&opcode_vkDestroyQueryPool, sizeof(uint32_t)); |
| 3199 | stream->write(&packetSize_vkDestroyQueryPool, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3200 | uint64_t cgen_var_222; |
| 3201 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_222, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3202 | stream->write((uint64_t*)&cgen_var_222, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3203 | uint64_t cgen_var_223; |
| 3204 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_223, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3205 | stream->write((uint64_t*)&cgen_var_223, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3206 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3207 | uint64_t cgen_var_224 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3208 | stream->putBe64(cgen_var_224); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3209 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3210 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3211 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3212 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3213 | resources->destroyMapping()->mapHandles_VkQueryPool((VkQueryPool*)&queryPool); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3214 | mImpl->log("finish vkDestroyQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3215 | } |
| 3216 | |
| 3217 | VkResult VkEncoder::vkGetQueryPoolResults( |
| 3218 | VkDevice device, |
| 3219 | VkQueryPool queryPool, |
| 3220 | uint32_t firstQuery, |
| 3221 | uint32_t queryCount, |
| 3222 | size_t dataSize, |
| 3223 | void* pData, |
| 3224 | VkDeviceSize stride, |
| 3225 | VkQueryResultFlags flags) |
| 3226 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3227 | mImpl->log("start vkGetQueryPoolResults"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3228 | auto stream = mImpl->stream(); |
| 3229 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3230 | auto resources = mImpl->resources(); |
| 3231 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3232 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3233 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3234 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3235 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3236 | uint32_t local_queryCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3237 | size_t local_dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3238 | VkDeviceSize local_stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3239 | VkQueryResultFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3240 | local_device = device; |
| 3241 | local_queryPool = queryPool; |
| 3242 | local_firstQuery = firstQuery; |
| 3243 | local_queryCount = queryCount; |
| 3244 | local_dataSize = dataSize; |
| 3245 | local_stride = stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3246 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3247 | countingStream->rewind(); |
| 3248 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3249 | uint64_t cgen_var_225; |
| 3250 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_225, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3251 | countingStream->write((uint64_t*)&cgen_var_225, 1 * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3252 | uint64_t cgen_var_226; |
| 3253 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_226, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3254 | countingStream->write((uint64_t*)&cgen_var_226, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3255 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 3256 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3257 | uint64_t cgen_var_227 = (uint64_t)local_dataSize; |
| 3258 | countingStream->putBe64(cgen_var_227); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3259 | countingStream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3260 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 3261 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3262 | } |
| 3263 | uint32_t packetSize_vkGetQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3264 | countingStream->rewind(); |
| 3265 | uint32_t opcode_vkGetQueryPoolResults = OP_vkGetQueryPoolResults; |
| 3266 | stream->write(&opcode_vkGetQueryPoolResults, sizeof(uint32_t)); |
| 3267 | stream->write(&packetSize_vkGetQueryPoolResults, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3268 | uint64_t cgen_var_228; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3269 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_228, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3270 | stream->write((uint64_t*)&cgen_var_228, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3271 | uint64_t cgen_var_229; |
| 3272 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_229, 1); |
| 3273 | stream->write((uint64_t*)&cgen_var_229, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3274 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 3275 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3276 | uint64_t cgen_var_230 = (uint64_t)local_dataSize; |
| 3277 | stream->putBe64(cgen_var_230); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3278 | stream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3279 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 3280 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3281 | stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| 3282 | VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0; |
| 3283 | stream->read(&vkGetQueryPoolResults_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3284 | countingStream->clearPool(); |
| 3285 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3286 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3287 | mImpl->log("finish vkGetQueryPoolResults");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3288 | return vkGetQueryPoolResults_VkResult_return; |
| 3289 | } |
| 3290 | |
| 3291 | VkResult VkEncoder::vkCreateBuffer( |
| 3292 | VkDevice device, |
| 3293 | const VkBufferCreateInfo* pCreateInfo, |
| 3294 | const VkAllocationCallbacks* pAllocator, |
| 3295 | VkBuffer* pBuffer) |
| 3296 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3297 | mImpl->log("start vkCreateBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3298 | auto stream = mImpl->stream(); |
| 3299 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3300 | auto resources = mImpl->resources(); |
| 3301 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3302 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3303 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3304 | VkBufferCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3305 | VkAllocationCallbacks* local_pAllocator; |
| 3306 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3307 | local_pCreateInfo = nullptr; |
| 3308 | if (pCreateInfo) |
| 3309 | { |
| 3310 | local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo)); |
| 3311 | deepcopy_VkBufferCreateInfo(pool, pCreateInfo, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 3312 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3313 | local_pAllocator = nullptr; |
| 3314 | if (pAllocator) |
| 3315 | { |
| 3316 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3317 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3318 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3319 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3320 | if (local_pCreateInfo) |
| 3321 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3322 | transform_tohost_VkBufferCreateInfo(mImpl->resources(), (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3323 | } |
| 3324 | if (local_pAllocator) |
| 3325 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3326 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3327 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3328 | countingStream->rewind(); |
| 3329 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3330 | uint64_t cgen_var_231; |
| 3331 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_231, 1); |
| 3332 | countingStream->write((uint64_t*)&cgen_var_231, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3333 | marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3334 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3335 | uint64_t cgen_var_232 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3336 | countingStream->putBe64(cgen_var_232); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3337 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3338 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3339 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3340 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3341 | uint64_t cgen_var_233; |
| 3342 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_233, 1); |
| 3343 | countingStream->write((uint64_t*)&cgen_var_233, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3344 | } |
| 3345 | uint32_t packetSize_vkCreateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3346 | countingStream->rewind(); |
| 3347 | uint32_t opcode_vkCreateBuffer = OP_vkCreateBuffer; |
| 3348 | stream->write(&opcode_vkCreateBuffer, sizeof(uint32_t)); |
| 3349 | stream->write(&packetSize_vkCreateBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3350 | uint64_t cgen_var_234; |
| 3351 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_234, 1); |
| 3352 | stream->write((uint64_t*)&cgen_var_234, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3353 | marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3354 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3355 | uint64_t cgen_var_235 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3356 | stream->putBe64(cgen_var_235); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3357 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3358 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3359 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3360 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3361 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3362 | uint64_t cgen_var_236; |
| 3363 | stream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_236, 1); |
| 3364 | stream->write((uint64_t*)&cgen_var_236, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3365 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3366 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3367 | uint64_t cgen_var_237; |
| 3368 | stream->read((uint64_t*)&cgen_var_237, 8); |
| 3369 | stream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_237, (VkBuffer*)pBuffer, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3370 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3371 | VkResult vkCreateBuffer_VkResult_return = (VkResult)0; |
| 3372 | stream->read(&vkCreateBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3373 | countingStream->clearPool(); |
| 3374 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3375 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3376 | mImpl->log("finish vkCreateBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3377 | return vkCreateBuffer_VkResult_return; |
| 3378 | } |
| 3379 | |
| 3380 | void VkEncoder::vkDestroyBuffer( |
| 3381 | VkDevice device, |
| 3382 | VkBuffer buffer, |
| 3383 | const VkAllocationCallbacks* pAllocator) |
| 3384 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3385 | mImpl->log("start vkDestroyBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3386 | auto stream = mImpl->stream(); |
| 3387 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3388 | auto resources = mImpl->resources(); |
| 3389 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3390 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3391 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3392 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3393 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3394 | local_device = device; |
| 3395 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3396 | local_pAllocator = nullptr; |
| 3397 | if (pAllocator) |
| 3398 | { |
| 3399 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3400 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3401 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3402 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3403 | if (local_pAllocator) |
| 3404 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3405 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3406 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3407 | countingStream->rewind(); |
| 3408 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3409 | uint64_t cgen_var_238; |
| 3410 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_238, 1); |
| 3411 | countingStream->write((uint64_t*)&cgen_var_238, 1 * 8); |
| 3412 | uint64_t cgen_var_239; |
| 3413 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_239, 1); |
| 3414 | countingStream->write((uint64_t*)&cgen_var_239, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3415 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3416 | uint64_t cgen_var_240 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3417 | countingStream->putBe64(cgen_var_240); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3418 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3419 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3420 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3421 | } |
| 3422 | } |
| 3423 | uint32_t packetSize_vkDestroyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3424 | countingStream->rewind(); |
| 3425 | uint32_t opcode_vkDestroyBuffer = OP_vkDestroyBuffer; |
| 3426 | stream->write(&opcode_vkDestroyBuffer, sizeof(uint32_t)); |
| 3427 | stream->write(&packetSize_vkDestroyBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3428 | uint64_t cgen_var_241; |
| 3429 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_241, 1); |
| 3430 | stream->write((uint64_t*)&cgen_var_241, 1 * 8); |
| 3431 | uint64_t cgen_var_242; |
| 3432 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_242, 1); |
| 3433 | stream->write((uint64_t*)&cgen_var_242, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3434 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3435 | uint64_t cgen_var_243 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3436 | stream->putBe64(cgen_var_243); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3437 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3438 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3439 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3440 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3441 | resources->destroyMapping()->mapHandles_VkBuffer((VkBuffer*)&buffer); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3442 | mImpl->log("finish vkDestroyBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3443 | } |
| 3444 | |
| 3445 | VkResult VkEncoder::vkCreateBufferView( |
| 3446 | VkDevice device, |
| 3447 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3448 | const VkAllocationCallbacks* pAllocator, |
| 3449 | VkBufferView* pView) |
| 3450 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3451 | mImpl->log("start vkCreateBufferView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3452 | auto stream = mImpl->stream(); |
| 3453 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3454 | auto resources = mImpl->resources(); |
| 3455 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3456 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3457 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3458 | VkBufferViewCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3459 | VkAllocationCallbacks* local_pAllocator; |
| 3460 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3461 | local_pCreateInfo = nullptr; |
| 3462 | if (pCreateInfo) |
| 3463 | { |
| 3464 | local_pCreateInfo = (VkBufferViewCreateInfo*)pool->alloc(sizeof(const VkBufferViewCreateInfo)); |
| 3465 | deepcopy_VkBufferViewCreateInfo(pool, pCreateInfo, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| 3466 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3467 | local_pAllocator = nullptr; |
| 3468 | if (pAllocator) |
| 3469 | { |
| 3470 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3471 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3472 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3473 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3474 | if (local_pCreateInfo) |
| 3475 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3476 | transform_tohost_VkBufferViewCreateInfo(mImpl->resources(), (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3477 | } |
| 3478 | if (local_pAllocator) |
| 3479 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3480 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3481 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3482 | countingStream->rewind(); |
| 3483 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3484 | uint64_t cgen_var_244; |
| 3485 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_244, 1); |
| 3486 | countingStream->write((uint64_t*)&cgen_var_244, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3487 | marshal_VkBufferViewCreateInfo(countingStream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3488 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3489 | uint64_t cgen_var_245 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3490 | countingStream->putBe64(cgen_var_245); |
| 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(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3494 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3495 | uint64_t cgen_var_246; |
| 3496 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_246, 1); |
| 3497 | countingStream->write((uint64_t*)&cgen_var_246, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3498 | } |
| 3499 | uint32_t packetSize_vkCreateBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3500 | countingStream->rewind(); |
| 3501 | uint32_t opcode_vkCreateBufferView = OP_vkCreateBufferView; |
| 3502 | stream->write(&opcode_vkCreateBufferView, sizeof(uint32_t)); |
| 3503 | stream->write(&packetSize_vkCreateBufferView, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3504 | uint64_t cgen_var_247; |
| 3505 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_247, 1); |
| 3506 | stream->write((uint64_t*)&cgen_var_247, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3507 | marshal_VkBufferViewCreateInfo(stream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3508 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3509 | uint64_t cgen_var_248 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3510 | stream->putBe64(cgen_var_248); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3511 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3512 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3513 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3514 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3515 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3516 | uint64_t cgen_var_249; |
| 3517 | stream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_249, 1); |
| 3518 | stream->write((uint64_t*)&cgen_var_249, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3519 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3520 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3521 | uint64_t cgen_var_250; |
| 3522 | stream->read((uint64_t*)&cgen_var_250, 8); |
| 3523 | stream->handleMapping()->mapHandles_u64_VkBufferView(&cgen_var_250, (VkBufferView*)pView, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3524 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3525 | VkResult vkCreateBufferView_VkResult_return = (VkResult)0; |
| 3526 | stream->read(&vkCreateBufferView_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3527 | countingStream->clearPool(); |
| 3528 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3529 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3530 | mImpl->log("finish vkCreateBufferView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3531 | return vkCreateBufferView_VkResult_return; |
| 3532 | } |
| 3533 | |
| 3534 | void VkEncoder::vkDestroyBufferView( |
| 3535 | VkDevice device, |
| 3536 | VkBufferView bufferView, |
| 3537 | const VkAllocationCallbacks* pAllocator) |
| 3538 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3539 | mImpl->log("start vkDestroyBufferView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3540 | auto stream = mImpl->stream(); |
| 3541 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3542 | auto resources = mImpl->resources(); |
| 3543 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3544 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3545 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3546 | VkBufferView local_bufferView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3547 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3548 | local_device = device; |
| 3549 | local_bufferView = bufferView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3550 | local_pAllocator = nullptr; |
| 3551 | if (pAllocator) |
| 3552 | { |
| 3553 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3554 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3555 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3556 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3557 | if (local_pAllocator) |
| 3558 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3559 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3560 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3561 | countingStream->rewind(); |
| 3562 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3563 | uint64_t cgen_var_251; |
| 3564 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_251, 1); |
| 3565 | countingStream->write((uint64_t*)&cgen_var_251, 1 * 8); |
| 3566 | uint64_t cgen_var_252; |
| 3567 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_252, 1); |
| 3568 | countingStream->write((uint64_t*)&cgen_var_252, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3569 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3570 | uint64_t cgen_var_253 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3571 | countingStream->putBe64(cgen_var_253); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3572 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3573 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3574 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3575 | } |
| 3576 | } |
| 3577 | uint32_t packetSize_vkDestroyBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3578 | countingStream->rewind(); |
| 3579 | uint32_t opcode_vkDestroyBufferView = OP_vkDestroyBufferView; |
| 3580 | stream->write(&opcode_vkDestroyBufferView, sizeof(uint32_t)); |
| 3581 | stream->write(&packetSize_vkDestroyBufferView, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3582 | uint64_t cgen_var_254; |
| 3583 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_254, 1); |
| 3584 | stream->write((uint64_t*)&cgen_var_254, 1 * 8); |
| 3585 | uint64_t cgen_var_255; |
| 3586 | stream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_255, 1); |
| 3587 | stream->write((uint64_t*)&cgen_var_255, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3588 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3589 | uint64_t cgen_var_256 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3590 | stream->putBe64(cgen_var_256); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3591 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3592 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3593 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3594 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3595 | resources->destroyMapping()->mapHandles_VkBufferView((VkBufferView*)&bufferView); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3596 | mImpl->log("finish vkDestroyBufferView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3597 | } |
| 3598 | |
| 3599 | VkResult VkEncoder::vkCreateImage( |
| 3600 | VkDevice device, |
| 3601 | const VkImageCreateInfo* pCreateInfo, |
| 3602 | const VkAllocationCallbacks* pAllocator, |
| 3603 | VkImage* pImage) |
| 3604 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3605 | mImpl->log("start vkCreateImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3606 | auto stream = mImpl->stream(); |
| 3607 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3608 | auto resources = mImpl->resources(); |
| 3609 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3610 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3611 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3612 | VkImageCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3613 | VkAllocationCallbacks* local_pAllocator; |
| 3614 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3615 | local_pCreateInfo = nullptr; |
| 3616 | if (pCreateInfo) |
| 3617 | { |
| 3618 | local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo)); |
| 3619 | deepcopy_VkImageCreateInfo(pool, pCreateInfo, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 3620 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3621 | local_pAllocator = nullptr; |
| 3622 | if (pAllocator) |
| 3623 | { |
| 3624 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3625 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3626 | } |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 3627 | mImpl->resources()->unwrap_VkNativeBufferANDROID(pCreateInfo, local_pCreateInfo); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3628 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3629 | if (local_pCreateInfo) |
| 3630 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3631 | transform_tohost_VkImageCreateInfo(mImpl->resources(), (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3632 | } |
| 3633 | if (local_pAllocator) |
| 3634 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3635 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3636 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3637 | countingStream->rewind(); |
| 3638 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3639 | uint64_t cgen_var_257; |
| 3640 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_257, 1); |
| 3641 | countingStream->write((uint64_t*)&cgen_var_257, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3642 | marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3643 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3644 | uint64_t cgen_var_258 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3645 | countingStream->putBe64(cgen_var_258); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3646 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3647 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3648 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3649 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3650 | uint64_t cgen_var_259; |
| 3651 | countingStream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_259, 1); |
| 3652 | countingStream->write((uint64_t*)&cgen_var_259, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3653 | } |
| 3654 | uint32_t packetSize_vkCreateImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3655 | countingStream->rewind(); |
| 3656 | uint32_t opcode_vkCreateImage = OP_vkCreateImage; |
| 3657 | stream->write(&opcode_vkCreateImage, sizeof(uint32_t)); |
| 3658 | stream->write(&packetSize_vkCreateImage, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3659 | uint64_t cgen_var_260; |
| 3660 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_260, 1); |
| 3661 | stream->write((uint64_t*)&cgen_var_260, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3662 | marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3663 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3664 | uint64_t cgen_var_261 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3665 | stream->putBe64(cgen_var_261); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3666 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3667 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3668 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3669 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3670 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3671 | uint64_t cgen_var_262; |
| 3672 | stream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_262, 1); |
| 3673 | stream->write((uint64_t*)&cgen_var_262, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3674 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3675 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3676 | uint64_t cgen_var_263; |
| 3677 | stream->read((uint64_t*)&cgen_var_263, 8); |
| 3678 | stream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_263, (VkImage*)pImage, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3679 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3680 | VkResult vkCreateImage_VkResult_return = (VkResult)0; |
| 3681 | stream->read(&vkCreateImage_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3682 | countingStream->clearPool(); |
| 3683 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3684 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3685 | mImpl->log("finish vkCreateImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3686 | return vkCreateImage_VkResult_return; |
| 3687 | } |
| 3688 | |
| 3689 | void VkEncoder::vkDestroyImage( |
| 3690 | VkDevice device, |
| 3691 | VkImage image, |
| 3692 | const VkAllocationCallbacks* pAllocator) |
| 3693 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3694 | mImpl->log("start vkDestroyImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3695 | auto stream = mImpl->stream(); |
| 3696 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3697 | auto resources = mImpl->resources(); |
| 3698 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3699 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3700 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3701 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3702 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3703 | local_device = device; |
| 3704 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3705 | local_pAllocator = nullptr; |
| 3706 | if (pAllocator) |
| 3707 | { |
| 3708 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3709 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3710 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3711 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3712 | if (local_pAllocator) |
| 3713 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3714 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3715 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3716 | countingStream->rewind(); |
| 3717 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3718 | uint64_t cgen_var_264; |
| 3719 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_264, 1); |
| 3720 | countingStream->write((uint64_t*)&cgen_var_264, 1 * 8); |
| 3721 | uint64_t cgen_var_265; |
| 3722 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_265, 1); |
| 3723 | countingStream->write((uint64_t*)&cgen_var_265, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3724 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3725 | uint64_t cgen_var_266 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3726 | countingStream->putBe64(cgen_var_266); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3727 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3728 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3729 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3730 | } |
| 3731 | } |
| 3732 | uint32_t packetSize_vkDestroyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3733 | countingStream->rewind(); |
| 3734 | uint32_t opcode_vkDestroyImage = OP_vkDestroyImage; |
| 3735 | stream->write(&opcode_vkDestroyImage, sizeof(uint32_t)); |
| 3736 | stream->write(&packetSize_vkDestroyImage, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3737 | uint64_t cgen_var_267; |
| 3738 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_267, 1); |
| 3739 | stream->write((uint64_t*)&cgen_var_267, 1 * 8); |
| 3740 | uint64_t cgen_var_268; |
| 3741 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_268, 1); |
| 3742 | stream->write((uint64_t*)&cgen_var_268, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3743 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3744 | uint64_t cgen_var_269 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3745 | stream->putBe64(cgen_var_269); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3746 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3747 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3748 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3749 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3750 | resources->destroyMapping()->mapHandles_VkImage((VkImage*)&image); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3751 | mImpl->log("finish vkDestroyImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3752 | } |
| 3753 | |
| 3754 | void VkEncoder::vkGetImageSubresourceLayout( |
| 3755 | VkDevice device, |
| 3756 | VkImage image, |
| 3757 | const VkImageSubresource* pSubresource, |
| 3758 | VkSubresourceLayout* pLayout) |
| 3759 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3760 | mImpl->log("start vkGetImageSubresourceLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3761 | auto stream = mImpl->stream(); |
| 3762 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3763 | auto resources = mImpl->resources(); |
| 3764 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3765 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3766 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3767 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3768 | VkImageSubresource* local_pSubresource; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3769 | local_device = device; |
| 3770 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3771 | local_pSubresource = nullptr; |
| 3772 | if (pSubresource) |
| 3773 | { |
| 3774 | local_pSubresource = (VkImageSubresource*)pool->alloc(sizeof(const VkImageSubresource)); |
| 3775 | deepcopy_VkImageSubresource(pool, pSubresource, (VkImageSubresource*)(local_pSubresource)); |
| 3776 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3777 | if (local_pSubresource) |
| 3778 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3779 | transform_tohost_VkImageSubresource(mImpl->resources(), (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3780 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3781 | countingStream->rewind(); |
| 3782 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3783 | uint64_t cgen_var_270; |
| 3784 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_270, 1); |
| 3785 | countingStream->write((uint64_t*)&cgen_var_270, 1 * 8); |
| 3786 | uint64_t cgen_var_271; |
| 3787 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_271, 1); |
| 3788 | countingStream->write((uint64_t*)&cgen_var_271, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3789 | marshal_VkImageSubresource(countingStream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3790 | marshal_VkSubresourceLayout(countingStream, (VkSubresourceLayout*)(pLayout)); |
| 3791 | } |
| 3792 | uint32_t packetSize_vkGetImageSubresourceLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3793 | countingStream->rewind(); |
| 3794 | uint32_t opcode_vkGetImageSubresourceLayout = OP_vkGetImageSubresourceLayout; |
| 3795 | stream->write(&opcode_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| 3796 | stream->write(&packetSize_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3797 | uint64_t cgen_var_272; |
| 3798 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_272, 1); |
| 3799 | stream->write((uint64_t*)&cgen_var_272, 1 * 8); |
| 3800 | uint64_t cgen_var_273; |
| 3801 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_273, 1); |
| 3802 | stream->write((uint64_t*)&cgen_var_273, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3803 | marshal_VkImageSubresource(stream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3804 | marshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| 3805 | unmarshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3806 | if (pLayout) |
| 3807 | { |
| 3808 | transform_fromhost_VkSubresourceLayout(mImpl->resources(), (VkSubresourceLayout*)(pLayout)); |
| 3809 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3810 | mImpl->log("finish vkGetImageSubresourceLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3811 | } |
| 3812 | |
| 3813 | VkResult VkEncoder::vkCreateImageView( |
| 3814 | VkDevice device, |
| 3815 | const VkImageViewCreateInfo* pCreateInfo, |
| 3816 | const VkAllocationCallbacks* pAllocator, |
| 3817 | VkImageView* pView) |
| 3818 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3819 | mImpl->log("start vkCreateImageView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3820 | auto stream = mImpl->stream(); |
| 3821 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3822 | auto resources = mImpl->resources(); |
| 3823 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3824 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3825 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3826 | VkImageViewCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3827 | VkAllocationCallbacks* local_pAllocator; |
| 3828 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3829 | local_pCreateInfo = nullptr; |
| 3830 | if (pCreateInfo) |
| 3831 | { |
| 3832 | local_pCreateInfo = (VkImageViewCreateInfo*)pool->alloc(sizeof(const VkImageViewCreateInfo)); |
| 3833 | deepcopy_VkImageViewCreateInfo(pool, pCreateInfo, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| 3834 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3835 | local_pAllocator = nullptr; |
| 3836 | if (pAllocator) |
| 3837 | { |
| 3838 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3839 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3840 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3841 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3842 | if (local_pCreateInfo) |
| 3843 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3844 | transform_tohost_VkImageViewCreateInfo(mImpl->resources(), (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3845 | } |
| 3846 | if (local_pAllocator) |
| 3847 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3848 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3849 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3850 | countingStream->rewind(); |
| 3851 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3852 | uint64_t cgen_var_274; |
| 3853 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_274, 1); |
| 3854 | countingStream->write((uint64_t*)&cgen_var_274, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3855 | marshal_VkImageViewCreateInfo(countingStream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3856 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3857 | uint64_t cgen_var_275 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3858 | countingStream->putBe64(cgen_var_275); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3859 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3860 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3861 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3862 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3863 | uint64_t cgen_var_276; |
| 3864 | countingStream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_276, 1); |
| 3865 | countingStream->write((uint64_t*)&cgen_var_276, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3866 | } |
| 3867 | uint32_t packetSize_vkCreateImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3868 | countingStream->rewind(); |
| 3869 | uint32_t opcode_vkCreateImageView = OP_vkCreateImageView; |
| 3870 | stream->write(&opcode_vkCreateImageView, sizeof(uint32_t)); |
| 3871 | stream->write(&packetSize_vkCreateImageView, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3872 | uint64_t cgen_var_277; |
| 3873 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_277, 1); |
| 3874 | stream->write((uint64_t*)&cgen_var_277, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3875 | marshal_VkImageViewCreateInfo(stream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3876 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3877 | uint64_t cgen_var_278 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3878 | stream->putBe64(cgen_var_278); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3879 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3880 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3881 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3882 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3883 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3884 | uint64_t cgen_var_279; |
| 3885 | stream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_279, 1); |
| 3886 | stream->write((uint64_t*)&cgen_var_279, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3887 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3888 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3889 | uint64_t cgen_var_280; |
| 3890 | stream->read((uint64_t*)&cgen_var_280, 8); |
| 3891 | stream->handleMapping()->mapHandles_u64_VkImageView(&cgen_var_280, (VkImageView*)pView, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3892 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3893 | VkResult vkCreateImageView_VkResult_return = (VkResult)0; |
| 3894 | stream->read(&vkCreateImageView_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3895 | countingStream->clearPool(); |
| 3896 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3897 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3898 | mImpl->log("finish vkCreateImageView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3899 | return vkCreateImageView_VkResult_return; |
| 3900 | } |
| 3901 | |
| 3902 | void VkEncoder::vkDestroyImageView( |
| 3903 | VkDevice device, |
| 3904 | VkImageView imageView, |
| 3905 | const VkAllocationCallbacks* pAllocator) |
| 3906 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3907 | mImpl->log("start vkDestroyImageView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3908 | auto stream = mImpl->stream(); |
| 3909 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3910 | auto resources = mImpl->resources(); |
| 3911 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3912 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3913 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3914 | VkImageView local_imageView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3915 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3916 | local_device = device; |
| 3917 | local_imageView = imageView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3918 | local_pAllocator = nullptr; |
| 3919 | if (pAllocator) |
| 3920 | { |
| 3921 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3922 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3923 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3924 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3925 | if (local_pAllocator) |
| 3926 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3927 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3928 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3929 | countingStream->rewind(); |
| 3930 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3931 | uint64_t cgen_var_281; |
| 3932 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_281, 1); |
| 3933 | countingStream->write((uint64_t*)&cgen_var_281, 1 * 8); |
| 3934 | uint64_t cgen_var_282; |
| 3935 | countingStream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_282, 1); |
| 3936 | countingStream->write((uint64_t*)&cgen_var_282, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3937 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3938 | uint64_t cgen_var_283 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3939 | countingStream->putBe64(cgen_var_283); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3940 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3941 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3942 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3943 | } |
| 3944 | } |
| 3945 | uint32_t packetSize_vkDestroyImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3946 | countingStream->rewind(); |
| 3947 | uint32_t opcode_vkDestroyImageView = OP_vkDestroyImageView; |
| 3948 | stream->write(&opcode_vkDestroyImageView, sizeof(uint32_t)); |
| 3949 | stream->write(&packetSize_vkDestroyImageView, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3950 | uint64_t cgen_var_284; |
| 3951 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_284, 1); |
| 3952 | stream->write((uint64_t*)&cgen_var_284, 1 * 8); |
| 3953 | uint64_t cgen_var_285; |
| 3954 | stream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_285, 1); |
| 3955 | stream->write((uint64_t*)&cgen_var_285, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3956 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 3957 | uint64_t cgen_var_286 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3958 | stream->putBe64(cgen_var_286); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3959 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3960 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3961 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3962 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3963 | resources->destroyMapping()->mapHandles_VkImageView((VkImageView*)&imageView); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3964 | mImpl->log("finish vkDestroyImageView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3965 | } |
| 3966 | |
| 3967 | VkResult VkEncoder::vkCreateShaderModule( |
| 3968 | VkDevice device, |
| 3969 | const VkShaderModuleCreateInfo* pCreateInfo, |
| 3970 | const VkAllocationCallbacks* pAllocator, |
| 3971 | VkShaderModule* pShaderModule) |
| 3972 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3973 | mImpl->log("start vkCreateShaderModule"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3974 | auto stream = mImpl->stream(); |
| 3975 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3976 | auto resources = mImpl->resources(); |
| 3977 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3978 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3979 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3980 | VkShaderModuleCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3981 | VkAllocationCallbacks* local_pAllocator; |
| 3982 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3983 | local_pCreateInfo = nullptr; |
| 3984 | if (pCreateInfo) |
| 3985 | { |
| 3986 | local_pCreateInfo = (VkShaderModuleCreateInfo*)pool->alloc(sizeof(const VkShaderModuleCreateInfo)); |
| 3987 | deepcopy_VkShaderModuleCreateInfo(pool, pCreateInfo, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| 3988 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3989 | local_pAllocator = nullptr; |
| 3990 | if (pAllocator) |
| 3991 | { |
| 3992 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3993 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3994 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3995 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3996 | if (local_pCreateInfo) |
| 3997 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3998 | transform_tohost_VkShaderModuleCreateInfo(mImpl->resources(), (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3999 | } |
| 4000 | if (local_pAllocator) |
| 4001 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4002 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4003 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4004 | countingStream->rewind(); |
| 4005 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4006 | uint64_t cgen_var_287; |
| 4007 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_287, 1); |
| 4008 | countingStream->write((uint64_t*)&cgen_var_287, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4009 | marshal_VkShaderModuleCreateInfo(countingStream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4010 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4011 | uint64_t cgen_var_288 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4012 | countingStream->putBe64(cgen_var_288); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4013 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4014 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4015 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4016 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4017 | uint64_t cgen_var_289; |
| 4018 | countingStream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_289, 1); |
| 4019 | countingStream->write((uint64_t*)&cgen_var_289, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4020 | } |
| 4021 | uint32_t packetSize_vkCreateShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4022 | countingStream->rewind(); |
| 4023 | uint32_t opcode_vkCreateShaderModule = OP_vkCreateShaderModule; |
| 4024 | stream->write(&opcode_vkCreateShaderModule, sizeof(uint32_t)); |
| 4025 | stream->write(&packetSize_vkCreateShaderModule, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4026 | uint64_t cgen_var_290; |
| 4027 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_290, 1); |
| 4028 | stream->write((uint64_t*)&cgen_var_290, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4029 | marshal_VkShaderModuleCreateInfo(stream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4030 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4031 | uint64_t cgen_var_291 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4032 | stream->putBe64(cgen_var_291); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4033 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4034 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4035 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4036 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4037 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4038 | uint64_t cgen_var_292; |
| 4039 | stream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_292, 1); |
| 4040 | stream->write((uint64_t*)&cgen_var_292, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4041 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4042 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4043 | uint64_t cgen_var_293; |
| 4044 | stream->read((uint64_t*)&cgen_var_293, 8); |
| 4045 | stream->handleMapping()->mapHandles_u64_VkShaderModule(&cgen_var_293, (VkShaderModule*)pShaderModule, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4046 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4047 | VkResult vkCreateShaderModule_VkResult_return = (VkResult)0; |
| 4048 | stream->read(&vkCreateShaderModule_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4049 | countingStream->clearPool(); |
| 4050 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4051 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4052 | mImpl->log("finish vkCreateShaderModule");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4053 | return vkCreateShaderModule_VkResult_return; |
| 4054 | } |
| 4055 | |
| 4056 | void VkEncoder::vkDestroyShaderModule( |
| 4057 | VkDevice device, |
| 4058 | VkShaderModule shaderModule, |
| 4059 | const VkAllocationCallbacks* pAllocator) |
| 4060 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4061 | mImpl->log("start vkDestroyShaderModule"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4062 | auto stream = mImpl->stream(); |
| 4063 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4064 | auto resources = mImpl->resources(); |
| 4065 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4066 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4067 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4068 | VkShaderModule local_shaderModule; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4069 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4070 | local_device = device; |
| 4071 | local_shaderModule = shaderModule; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4072 | local_pAllocator = nullptr; |
| 4073 | if (pAllocator) |
| 4074 | { |
| 4075 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4076 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4077 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4078 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4079 | if (local_pAllocator) |
| 4080 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4081 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4082 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4083 | countingStream->rewind(); |
| 4084 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4085 | uint64_t cgen_var_294; |
| 4086 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_294, 1); |
| 4087 | countingStream->write((uint64_t*)&cgen_var_294, 1 * 8); |
| 4088 | uint64_t cgen_var_295; |
| 4089 | countingStream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_295, 1); |
| 4090 | countingStream->write((uint64_t*)&cgen_var_295, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4091 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4092 | uint64_t cgen_var_296 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4093 | countingStream->putBe64(cgen_var_296); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4094 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4095 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4096 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4097 | } |
| 4098 | } |
| 4099 | uint32_t packetSize_vkDestroyShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4100 | countingStream->rewind(); |
| 4101 | uint32_t opcode_vkDestroyShaderModule = OP_vkDestroyShaderModule; |
| 4102 | stream->write(&opcode_vkDestroyShaderModule, sizeof(uint32_t)); |
| 4103 | stream->write(&packetSize_vkDestroyShaderModule, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4104 | uint64_t cgen_var_297; |
| 4105 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_297, 1); |
| 4106 | stream->write((uint64_t*)&cgen_var_297, 1 * 8); |
| 4107 | uint64_t cgen_var_298; |
| 4108 | stream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_298, 1); |
| 4109 | stream->write((uint64_t*)&cgen_var_298, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4110 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4111 | uint64_t cgen_var_299 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4112 | stream->putBe64(cgen_var_299); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4113 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4114 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4115 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4116 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4117 | resources->destroyMapping()->mapHandles_VkShaderModule((VkShaderModule*)&shaderModule); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4118 | mImpl->log("finish vkDestroyShaderModule");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4119 | } |
| 4120 | |
| 4121 | VkResult VkEncoder::vkCreatePipelineCache( |
| 4122 | VkDevice device, |
| 4123 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 4124 | const VkAllocationCallbacks* pAllocator, |
| 4125 | VkPipelineCache* pPipelineCache) |
| 4126 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4127 | mImpl->log("start vkCreatePipelineCache"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4128 | auto stream = mImpl->stream(); |
| 4129 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4130 | auto resources = mImpl->resources(); |
| 4131 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4132 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4133 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4134 | VkPipelineCacheCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4135 | VkAllocationCallbacks* local_pAllocator; |
| 4136 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4137 | local_pCreateInfo = nullptr; |
| 4138 | if (pCreateInfo) |
| 4139 | { |
| 4140 | local_pCreateInfo = (VkPipelineCacheCreateInfo*)pool->alloc(sizeof(const VkPipelineCacheCreateInfo)); |
| 4141 | deepcopy_VkPipelineCacheCreateInfo(pool, pCreateInfo, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| 4142 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4143 | local_pAllocator = nullptr; |
| 4144 | if (pAllocator) |
| 4145 | { |
| 4146 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4147 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4148 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4149 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4150 | if (local_pCreateInfo) |
| 4151 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4152 | transform_tohost_VkPipelineCacheCreateInfo(mImpl->resources(), (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4153 | } |
| 4154 | if (local_pAllocator) |
| 4155 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4156 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4157 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4158 | countingStream->rewind(); |
| 4159 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4160 | uint64_t cgen_var_300; |
| 4161 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_300, 1); |
| 4162 | countingStream->write((uint64_t*)&cgen_var_300, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4163 | marshal_VkPipelineCacheCreateInfo(countingStream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4164 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4165 | uint64_t cgen_var_301 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4166 | countingStream->putBe64(cgen_var_301); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4167 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4168 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4169 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4170 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4171 | uint64_t cgen_var_302; |
| 4172 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_302, 1); |
| 4173 | countingStream->write((uint64_t*)&cgen_var_302, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4174 | } |
| 4175 | uint32_t packetSize_vkCreatePipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4176 | countingStream->rewind(); |
| 4177 | uint32_t opcode_vkCreatePipelineCache = OP_vkCreatePipelineCache; |
| 4178 | stream->write(&opcode_vkCreatePipelineCache, sizeof(uint32_t)); |
| 4179 | stream->write(&packetSize_vkCreatePipelineCache, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4180 | uint64_t cgen_var_303; |
| 4181 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_303, 1); |
| 4182 | stream->write((uint64_t*)&cgen_var_303, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4183 | marshal_VkPipelineCacheCreateInfo(stream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4184 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4185 | uint64_t cgen_var_304 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4186 | stream->putBe64(cgen_var_304); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4187 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4188 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4189 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4190 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4191 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4192 | uint64_t cgen_var_305; |
| 4193 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_305, 1); |
| 4194 | stream->write((uint64_t*)&cgen_var_305, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4195 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4196 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4197 | uint64_t cgen_var_306; |
| 4198 | stream->read((uint64_t*)&cgen_var_306, 8); |
| 4199 | stream->handleMapping()->mapHandles_u64_VkPipelineCache(&cgen_var_306, (VkPipelineCache*)pPipelineCache, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4200 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4201 | VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0; |
| 4202 | stream->read(&vkCreatePipelineCache_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4203 | countingStream->clearPool(); |
| 4204 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4205 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4206 | mImpl->log("finish vkCreatePipelineCache");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4207 | return vkCreatePipelineCache_VkResult_return; |
| 4208 | } |
| 4209 | |
| 4210 | void VkEncoder::vkDestroyPipelineCache( |
| 4211 | VkDevice device, |
| 4212 | VkPipelineCache pipelineCache, |
| 4213 | const VkAllocationCallbacks* pAllocator) |
| 4214 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4215 | mImpl->log("start vkDestroyPipelineCache"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4216 | auto stream = mImpl->stream(); |
| 4217 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4218 | auto resources = mImpl->resources(); |
| 4219 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4220 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4221 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4222 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4223 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4224 | local_device = device; |
| 4225 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4226 | local_pAllocator = nullptr; |
| 4227 | if (pAllocator) |
| 4228 | { |
| 4229 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4230 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4231 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4232 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4233 | if (local_pAllocator) |
| 4234 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4235 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4236 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4237 | countingStream->rewind(); |
| 4238 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4239 | uint64_t cgen_var_307; |
| 4240 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_307, 1); |
| 4241 | countingStream->write((uint64_t*)&cgen_var_307, 1 * 8); |
| 4242 | uint64_t cgen_var_308; |
| 4243 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_308, 1); |
| 4244 | countingStream->write((uint64_t*)&cgen_var_308, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4245 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4246 | uint64_t cgen_var_309 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4247 | countingStream->putBe64(cgen_var_309); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4248 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4249 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4250 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4251 | } |
| 4252 | } |
| 4253 | uint32_t packetSize_vkDestroyPipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4254 | countingStream->rewind(); |
| 4255 | uint32_t opcode_vkDestroyPipelineCache = OP_vkDestroyPipelineCache; |
| 4256 | stream->write(&opcode_vkDestroyPipelineCache, sizeof(uint32_t)); |
| 4257 | stream->write(&packetSize_vkDestroyPipelineCache, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4258 | uint64_t cgen_var_310; |
| 4259 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_310, 1); |
| 4260 | stream->write((uint64_t*)&cgen_var_310, 1 * 8); |
| 4261 | uint64_t cgen_var_311; |
| 4262 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_311, 1); |
| 4263 | stream->write((uint64_t*)&cgen_var_311, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4264 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4265 | uint64_t cgen_var_312 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4266 | stream->putBe64(cgen_var_312); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4267 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4268 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4269 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(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 | resources->destroyMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&pipelineCache); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4272 | mImpl->log("finish vkDestroyPipelineCache");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4273 | } |
| 4274 | |
| 4275 | VkResult VkEncoder::vkGetPipelineCacheData( |
| 4276 | VkDevice device, |
| 4277 | VkPipelineCache pipelineCache, |
| 4278 | size_t* pDataSize, |
| 4279 | void* pData) |
| 4280 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4281 | mImpl->log("start vkGetPipelineCacheData"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4282 | auto stream = mImpl->stream(); |
| 4283 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4284 | auto resources = mImpl->resources(); |
| 4285 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4286 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4287 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4288 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4289 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4290 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4291 | countingStream->rewind(); |
| 4292 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4293 | uint64_t cgen_var_313; |
| 4294 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_313, 1); |
| 4295 | countingStream->write((uint64_t*)&cgen_var_313, 1 * 8); |
| 4296 | uint64_t cgen_var_314; |
| 4297 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_314, 1); |
| 4298 | countingStream->write((uint64_t*)&cgen_var_314, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4299 | // WARNING PTR CHECK |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4300 | uint64_t cgen_var_315 = (uint64_t)(uintptr_t)pDataSize; |
| 4301 | countingStream->putBe64(cgen_var_315); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4302 | if (pDataSize) |
| 4303 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4304 | uint64_t cgen_var_316 = (uint64_t)(*pDataSize); |
| 4305 | countingStream->putBe64(cgen_var_316); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4306 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4307 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4308 | uint64_t cgen_var_317 = (uint64_t)(uintptr_t)pData; |
| 4309 | countingStream->putBe64(cgen_var_317); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4310 | if (pData) |
| 4311 | { |
| 4312 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4313 | } |
| 4314 | } |
| 4315 | uint32_t packetSize_vkGetPipelineCacheData = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4316 | countingStream->rewind(); |
| 4317 | uint32_t opcode_vkGetPipelineCacheData = OP_vkGetPipelineCacheData; |
| 4318 | stream->write(&opcode_vkGetPipelineCacheData, sizeof(uint32_t)); |
| 4319 | stream->write(&packetSize_vkGetPipelineCacheData, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4320 | uint64_t cgen_var_318; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4321 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_318, 1); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 4322 | stream->write((uint64_t*)&cgen_var_318, 1 * 8); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4323 | uint64_t cgen_var_319; |
| 4324 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_319, 1); |
| 4325 | stream->write((uint64_t*)&cgen_var_319, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4326 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4327 | uint64_t cgen_var_320 = (uint64_t)(uintptr_t)pDataSize; |
| 4328 | stream->putBe64(cgen_var_320); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4329 | if (pDataSize) |
| 4330 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4331 | uint64_t cgen_var_321 = (uint64_t)(*pDataSize); |
| 4332 | stream->putBe64(cgen_var_321); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4333 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4334 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4335 | uint64_t cgen_var_322 = (uint64_t)(uintptr_t)pData; |
| 4336 | stream->putBe64(cgen_var_322); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4337 | if (pData) |
| 4338 | { |
| 4339 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4340 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4341 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4342 | size_t* check_pDataSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4343 | check_pDataSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4344 | if (pDataSize) |
| 4345 | { |
| 4346 | if (!(check_pDataSize)) |
| 4347 | { |
| 4348 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 4349 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4350 | (*pDataSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4351 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4352 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4353 | void* check_pData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4354 | check_pData = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4355 | if (pData) |
| 4356 | { |
| 4357 | if (!(check_pData)) |
| 4358 | { |
| 4359 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 4360 | } |
| 4361 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4362 | } |
| 4363 | VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0; |
| 4364 | stream->read(&vkGetPipelineCacheData_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4365 | countingStream->clearPool(); |
| 4366 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4367 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4368 | mImpl->log("finish vkGetPipelineCacheData");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4369 | return vkGetPipelineCacheData_VkResult_return; |
| 4370 | } |
| 4371 | |
| 4372 | VkResult VkEncoder::vkMergePipelineCaches( |
| 4373 | VkDevice device, |
| 4374 | VkPipelineCache dstCache, |
| 4375 | uint32_t srcCacheCount, |
| 4376 | const VkPipelineCache* pSrcCaches) |
| 4377 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4378 | mImpl->log("start vkMergePipelineCaches"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 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; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4385 | VkPipelineCache local_dstCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4386 | uint32_t local_srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4387 | VkPipelineCache* local_pSrcCaches; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4388 | local_device = device; |
| 4389 | local_dstCache = dstCache; |
| 4390 | local_srcCacheCount = srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4391 | local_pSrcCaches = nullptr; |
| 4392 | if (pSrcCaches) |
| 4393 | { |
| 4394 | local_pSrcCaches = (VkPipelineCache*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkPipelineCache)); |
| 4395 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4396 | countingStream->rewind(); |
| 4397 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4398 | uint64_t cgen_var_326; |
| 4399 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_326, 1); |
| 4400 | countingStream->write((uint64_t*)&cgen_var_326, 1 * 8); |
| 4401 | uint64_t cgen_var_327; |
| 4402 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_327, 1); |
| 4403 | countingStream->write((uint64_t*)&cgen_var_327, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4404 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4405 | if (((srcCacheCount))) |
| 4406 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4407 | uint64_t* cgen_var_328; |
| 4408 | countingStream->alloc((void**)&cgen_var_328, ((srcCacheCount)) * 8); |
| 4409 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_328, ((srcCacheCount))); |
| 4410 | countingStream->write((uint64_t*)cgen_var_328, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4411 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4412 | } |
| 4413 | uint32_t packetSize_vkMergePipelineCaches = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4414 | countingStream->rewind(); |
| 4415 | uint32_t opcode_vkMergePipelineCaches = OP_vkMergePipelineCaches; |
| 4416 | stream->write(&opcode_vkMergePipelineCaches, sizeof(uint32_t)); |
| 4417 | stream->write(&packetSize_vkMergePipelineCaches, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4418 | uint64_t cgen_var_329; |
| 4419 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_329, 1); |
| 4420 | stream->write((uint64_t*)&cgen_var_329, 1 * 8); |
| 4421 | uint64_t cgen_var_330; |
| 4422 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_330, 1); |
| 4423 | stream->write((uint64_t*)&cgen_var_330, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4424 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4425 | if (((srcCacheCount))) |
| 4426 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4427 | uint64_t* cgen_var_331; |
| 4428 | stream->alloc((void**)&cgen_var_331, ((srcCacheCount)) * 8); |
| 4429 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_331, ((srcCacheCount))); |
| 4430 | stream->write((uint64_t*)cgen_var_331, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4431 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4432 | VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0; |
| 4433 | stream->read(&vkMergePipelineCaches_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4434 | countingStream->clearPool(); |
| 4435 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4436 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4437 | mImpl->log("finish vkMergePipelineCaches");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4438 | return vkMergePipelineCaches_VkResult_return; |
| 4439 | } |
| 4440 | |
| 4441 | VkResult VkEncoder::vkCreateGraphicsPipelines( |
| 4442 | VkDevice device, |
| 4443 | VkPipelineCache pipelineCache, |
| 4444 | uint32_t createInfoCount, |
| 4445 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 4446 | const VkAllocationCallbacks* pAllocator, |
| 4447 | VkPipeline* pPipelines) |
| 4448 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4449 | mImpl->log("start vkCreateGraphicsPipelines"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4450 | auto stream = mImpl->stream(); |
| 4451 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4452 | auto resources = mImpl->resources(); |
| 4453 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4454 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4455 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4456 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4457 | uint32_t local_createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4458 | VkGraphicsPipelineCreateInfo* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4459 | VkAllocationCallbacks* local_pAllocator; |
| 4460 | local_device = device; |
| 4461 | local_pipelineCache = pipelineCache; |
| 4462 | local_createInfoCount = createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4463 | local_pCreateInfos = nullptr; |
| 4464 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4465 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4466 | local_pCreateInfos = (VkGraphicsPipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkGraphicsPipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4467 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4468 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4469 | deepcopy_VkGraphicsPipelineCreateInfo(pool, pCreateInfos + i, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4470 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4471 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4472 | local_pAllocator = nullptr; |
| 4473 | if (pAllocator) |
| 4474 | { |
| 4475 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4476 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4477 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4478 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4479 | if (local_pCreateInfos) |
| 4480 | { |
| 4481 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4482 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4483 | transform_tohost_VkGraphicsPipelineCreateInfo(mImpl->resources(), (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4484 | } |
| 4485 | } |
| 4486 | if (local_pAllocator) |
| 4487 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4488 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4489 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4490 | countingStream->rewind(); |
| 4491 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4492 | uint64_t cgen_var_332; |
| 4493 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_332, 1); |
| 4494 | countingStream->write((uint64_t*)&cgen_var_332, 1 * 8); |
| 4495 | uint64_t cgen_var_333; |
| 4496 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_333, 1); |
| 4497 | countingStream->write((uint64_t*)&cgen_var_333, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4498 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 4499 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4500 | { |
| 4501 | marshal_VkGraphicsPipelineCreateInfo(countingStream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| 4502 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4503 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4504 | uint64_t cgen_var_334 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4505 | countingStream->putBe64(cgen_var_334); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4506 | if (local_pAllocator) |
| 4507 | { |
| 4508 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4509 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4510 | if (((createInfoCount))) |
| 4511 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4512 | uint64_t* cgen_var_335; |
| 4513 | countingStream->alloc((void**)&cgen_var_335, ((createInfoCount)) * 8); |
| 4514 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_335, ((createInfoCount))); |
| 4515 | countingStream->write((uint64_t*)cgen_var_335, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4516 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4517 | } |
| 4518 | uint32_t packetSize_vkCreateGraphicsPipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4519 | countingStream->rewind(); |
| 4520 | uint32_t opcode_vkCreateGraphicsPipelines = OP_vkCreateGraphicsPipelines; |
| 4521 | stream->write(&opcode_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| 4522 | stream->write(&packetSize_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4523 | uint64_t cgen_var_336; |
| 4524 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_336, 1); |
| 4525 | stream->write((uint64_t*)&cgen_var_336, 1 * 8); |
| 4526 | uint64_t cgen_var_337; |
| 4527 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_337, 1); |
| 4528 | stream->write((uint64_t*)&cgen_var_337, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4529 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4530 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4531 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4532 | marshal_VkGraphicsPipelineCreateInfo(stream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4533 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4534 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4535 | uint64_t cgen_var_338 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4536 | stream->putBe64(cgen_var_338); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4537 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4538 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4539 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4540 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4541 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4542 | if (((createInfoCount))) |
| 4543 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4544 | uint64_t* cgen_var_339; |
| 4545 | stream->alloc((void**)&cgen_var_339, ((createInfoCount)) * 8); |
| 4546 | stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_339, ((createInfoCount))); |
| 4547 | stream->write((uint64_t*)cgen_var_339, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4548 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4549 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4550 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4551 | if (((createInfoCount))) |
| 4552 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4553 | uint64_t* cgen_var_340; |
| 4554 | stream->alloc((void**)&cgen_var_340, ((createInfoCount)) * 8); |
| 4555 | stream->read((uint64_t*)cgen_var_340, ((createInfoCount)) * 8); |
| 4556 | stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_340, (VkPipeline*)pPipelines, ((createInfoCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4557 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4558 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4559 | VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0; |
| 4560 | stream->read(&vkCreateGraphicsPipelines_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4561 | countingStream->clearPool(); |
| 4562 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4563 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4564 | mImpl->log("finish vkCreateGraphicsPipelines");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4565 | return vkCreateGraphicsPipelines_VkResult_return; |
| 4566 | } |
| 4567 | |
| 4568 | VkResult VkEncoder::vkCreateComputePipelines( |
| 4569 | VkDevice device, |
| 4570 | VkPipelineCache pipelineCache, |
| 4571 | uint32_t createInfoCount, |
| 4572 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 4573 | const VkAllocationCallbacks* pAllocator, |
| 4574 | VkPipeline* pPipelines) |
| 4575 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4576 | mImpl->log("start vkCreateComputePipelines"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 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; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4583 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4584 | uint32_t local_createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4585 | VkComputePipelineCreateInfo* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4586 | VkAllocationCallbacks* local_pAllocator; |
| 4587 | local_device = device; |
| 4588 | local_pipelineCache = pipelineCache; |
| 4589 | local_createInfoCount = createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4590 | local_pCreateInfos = nullptr; |
| 4591 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4592 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4593 | local_pCreateInfos = (VkComputePipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkComputePipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4594 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4595 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4596 | deepcopy_VkComputePipelineCreateInfo(pool, pCreateInfos + i, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4597 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4598 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4599 | local_pAllocator = nullptr; |
| 4600 | if (pAllocator) |
| 4601 | { |
| 4602 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4603 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4604 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4605 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4606 | if (local_pCreateInfos) |
| 4607 | { |
| 4608 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4609 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4610 | transform_tohost_VkComputePipelineCreateInfo(mImpl->resources(), (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4611 | } |
| 4612 | } |
| 4613 | if (local_pAllocator) |
| 4614 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4615 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4616 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4617 | countingStream->rewind(); |
| 4618 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4619 | uint64_t cgen_var_341; |
| 4620 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_341, 1); |
| 4621 | countingStream->write((uint64_t*)&cgen_var_341, 1 * 8); |
| 4622 | uint64_t cgen_var_342; |
| 4623 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_342, 1); |
| 4624 | countingStream->write((uint64_t*)&cgen_var_342, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4625 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 4626 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4627 | { |
| 4628 | marshal_VkComputePipelineCreateInfo(countingStream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| 4629 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4630 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4631 | uint64_t cgen_var_343 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4632 | countingStream->putBe64(cgen_var_343); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4633 | if (local_pAllocator) |
| 4634 | { |
| 4635 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4636 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4637 | if (((createInfoCount))) |
| 4638 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4639 | uint64_t* cgen_var_344; |
| 4640 | countingStream->alloc((void**)&cgen_var_344, ((createInfoCount)) * 8); |
| 4641 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_344, ((createInfoCount))); |
| 4642 | countingStream->write((uint64_t*)cgen_var_344, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4643 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4644 | } |
| 4645 | uint32_t packetSize_vkCreateComputePipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4646 | countingStream->rewind(); |
| 4647 | uint32_t opcode_vkCreateComputePipelines = OP_vkCreateComputePipelines; |
| 4648 | stream->write(&opcode_vkCreateComputePipelines, sizeof(uint32_t)); |
| 4649 | stream->write(&packetSize_vkCreateComputePipelines, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4650 | uint64_t cgen_var_345; |
| 4651 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_345, 1); |
| 4652 | stream->write((uint64_t*)&cgen_var_345, 1 * 8); |
| 4653 | uint64_t cgen_var_346; |
| 4654 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_346, 1); |
| 4655 | stream->write((uint64_t*)&cgen_var_346, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4656 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4657 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4658 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4659 | marshal_VkComputePipelineCreateInfo(stream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4660 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4661 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4662 | uint64_t cgen_var_347 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4663 | stream->putBe64(cgen_var_347); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4664 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4665 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4666 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4667 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4668 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4669 | if (((createInfoCount))) |
| 4670 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4671 | uint64_t* cgen_var_348; |
| 4672 | stream->alloc((void**)&cgen_var_348, ((createInfoCount)) * 8); |
| 4673 | stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_348, ((createInfoCount))); |
| 4674 | stream->write((uint64_t*)cgen_var_348, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4675 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4676 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4677 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4678 | if (((createInfoCount))) |
| 4679 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4680 | uint64_t* cgen_var_349; |
| 4681 | stream->alloc((void**)&cgen_var_349, ((createInfoCount)) * 8); |
| 4682 | stream->read((uint64_t*)cgen_var_349, ((createInfoCount)) * 8); |
| 4683 | stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_349, (VkPipeline*)pPipelines, ((createInfoCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4684 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4685 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4686 | VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0; |
| 4687 | stream->read(&vkCreateComputePipelines_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4688 | countingStream->clearPool(); |
| 4689 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4690 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4691 | mImpl->log("finish vkCreateComputePipelines");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4692 | return vkCreateComputePipelines_VkResult_return; |
| 4693 | } |
| 4694 | |
| 4695 | void VkEncoder::vkDestroyPipeline( |
| 4696 | VkDevice device, |
| 4697 | VkPipeline pipeline, |
| 4698 | const VkAllocationCallbacks* pAllocator) |
| 4699 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4700 | mImpl->log("start vkDestroyPipeline"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4701 | auto stream = mImpl->stream(); |
| 4702 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4703 | auto resources = mImpl->resources(); |
| 4704 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4705 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4706 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4707 | VkPipeline local_pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4708 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4709 | local_device = device; |
| 4710 | local_pipeline = pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4711 | local_pAllocator = nullptr; |
| 4712 | if (pAllocator) |
| 4713 | { |
| 4714 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4715 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4716 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4717 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4718 | if (local_pAllocator) |
| 4719 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4720 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4721 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4722 | countingStream->rewind(); |
| 4723 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4724 | uint64_t cgen_var_350; |
| 4725 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_350, 1); |
| 4726 | countingStream->write((uint64_t*)&cgen_var_350, 1 * 8); |
| 4727 | uint64_t cgen_var_351; |
| 4728 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_351, 1); |
| 4729 | countingStream->write((uint64_t*)&cgen_var_351, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4730 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4731 | uint64_t cgen_var_352 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4732 | countingStream->putBe64(cgen_var_352); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4733 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4734 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4735 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4736 | } |
| 4737 | } |
| 4738 | uint32_t packetSize_vkDestroyPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4739 | countingStream->rewind(); |
| 4740 | uint32_t opcode_vkDestroyPipeline = OP_vkDestroyPipeline; |
| 4741 | stream->write(&opcode_vkDestroyPipeline, sizeof(uint32_t)); |
| 4742 | stream->write(&packetSize_vkDestroyPipeline, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4743 | uint64_t cgen_var_353; |
| 4744 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_353, 1); |
| 4745 | stream->write((uint64_t*)&cgen_var_353, 1 * 8); |
| 4746 | uint64_t cgen_var_354; |
| 4747 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_354, 1); |
| 4748 | stream->write((uint64_t*)&cgen_var_354, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4749 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4750 | uint64_t cgen_var_355 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4751 | stream->putBe64(cgen_var_355); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4752 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4753 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4754 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4755 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4756 | resources->destroyMapping()->mapHandles_VkPipeline((VkPipeline*)&pipeline); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4757 | mImpl->log("finish vkDestroyPipeline");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4758 | } |
| 4759 | |
| 4760 | VkResult VkEncoder::vkCreatePipelineLayout( |
| 4761 | VkDevice device, |
| 4762 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 4763 | const VkAllocationCallbacks* pAllocator, |
| 4764 | VkPipelineLayout* pPipelineLayout) |
| 4765 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4766 | mImpl->log("start vkCreatePipelineLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4767 | auto stream = mImpl->stream(); |
| 4768 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4769 | auto resources = mImpl->resources(); |
| 4770 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4771 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4772 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4773 | VkPipelineLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4774 | VkAllocationCallbacks* local_pAllocator; |
| 4775 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4776 | local_pCreateInfo = nullptr; |
| 4777 | if (pCreateInfo) |
| 4778 | { |
| 4779 | local_pCreateInfo = (VkPipelineLayoutCreateInfo*)pool->alloc(sizeof(const VkPipelineLayoutCreateInfo)); |
| 4780 | deepcopy_VkPipelineLayoutCreateInfo(pool, pCreateInfo, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| 4781 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4782 | local_pAllocator = nullptr; |
| 4783 | if (pAllocator) |
| 4784 | { |
| 4785 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4786 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4787 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4788 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4789 | if (local_pCreateInfo) |
| 4790 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4791 | transform_tohost_VkPipelineLayoutCreateInfo(mImpl->resources(), (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4792 | } |
| 4793 | if (local_pAllocator) |
| 4794 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4795 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4796 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4797 | countingStream->rewind(); |
| 4798 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4799 | uint64_t cgen_var_356; |
| 4800 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_356, 1); |
| 4801 | countingStream->write((uint64_t*)&cgen_var_356, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4802 | marshal_VkPipelineLayoutCreateInfo(countingStream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4803 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4804 | uint64_t cgen_var_357 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4805 | countingStream->putBe64(cgen_var_357); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4806 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4807 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4808 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4809 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4810 | uint64_t cgen_var_358; |
| 4811 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_358, 1); |
| 4812 | countingStream->write((uint64_t*)&cgen_var_358, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4813 | } |
| 4814 | uint32_t packetSize_vkCreatePipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4815 | countingStream->rewind(); |
| 4816 | uint32_t opcode_vkCreatePipelineLayout = OP_vkCreatePipelineLayout; |
| 4817 | stream->write(&opcode_vkCreatePipelineLayout, sizeof(uint32_t)); |
| 4818 | stream->write(&packetSize_vkCreatePipelineLayout, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4819 | uint64_t cgen_var_359; |
| 4820 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_359, 1); |
| 4821 | stream->write((uint64_t*)&cgen_var_359, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4822 | marshal_VkPipelineLayoutCreateInfo(stream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4823 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4824 | uint64_t cgen_var_360 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4825 | stream->putBe64(cgen_var_360); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4826 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4827 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4828 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4829 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4830 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4831 | uint64_t cgen_var_361; |
| 4832 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_361, 1); |
| 4833 | stream->write((uint64_t*)&cgen_var_361, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4834 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4835 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4836 | uint64_t cgen_var_362; |
| 4837 | stream->read((uint64_t*)&cgen_var_362, 8); |
| 4838 | stream->handleMapping()->mapHandles_u64_VkPipelineLayout(&cgen_var_362, (VkPipelineLayout*)pPipelineLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4839 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4840 | VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0; |
| 4841 | stream->read(&vkCreatePipelineLayout_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4842 | countingStream->clearPool(); |
| 4843 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4844 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4845 | mImpl->log("finish vkCreatePipelineLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4846 | return vkCreatePipelineLayout_VkResult_return; |
| 4847 | } |
| 4848 | |
| 4849 | void VkEncoder::vkDestroyPipelineLayout( |
| 4850 | VkDevice device, |
| 4851 | VkPipelineLayout pipelineLayout, |
| 4852 | const VkAllocationCallbacks* pAllocator) |
| 4853 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4854 | mImpl->log("start vkDestroyPipelineLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4855 | auto stream = mImpl->stream(); |
| 4856 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4857 | auto resources = mImpl->resources(); |
| 4858 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4859 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4860 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4861 | VkPipelineLayout local_pipelineLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4862 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4863 | local_device = device; |
| 4864 | local_pipelineLayout = pipelineLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4865 | local_pAllocator = nullptr; |
| 4866 | if (pAllocator) |
| 4867 | { |
| 4868 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4869 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4870 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4871 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4872 | if (local_pAllocator) |
| 4873 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4874 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4875 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4876 | countingStream->rewind(); |
| 4877 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4878 | uint64_t cgen_var_363; |
| 4879 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_363, 1); |
| 4880 | countingStream->write((uint64_t*)&cgen_var_363, 1 * 8); |
| 4881 | uint64_t cgen_var_364; |
| 4882 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_364, 1); |
| 4883 | countingStream->write((uint64_t*)&cgen_var_364, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4884 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4885 | uint64_t cgen_var_365 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4886 | countingStream->putBe64(cgen_var_365); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4887 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4888 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4889 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4890 | } |
| 4891 | } |
| 4892 | uint32_t packetSize_vkDestroyPipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4893 | countingStream->rewind(); |
| 4894 | uint32_t opcode_vkDestroyPipelineLayout = OP_vkDestroyPipelineLayout; |
| 4895 | stream->write(&opcode_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| 4896 | stream->write(&packetSize_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4897 | uint64_t cgen_var_366; |
| 4898 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_366, 1); |
| 4899 | stream->write((uint64_t*)&cgen_var_366, 1 * 8); |
| 4900 | uint64_t cgen_var_367; |
| 4901 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_367, 1); |
| 4902 | stream->write((uint64_t*)&cgen_var_367, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4903 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4904 | uint64_t cgen_var_368 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4905 | stream->putBe64(cgen_var_368); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4906 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4907 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4908 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4909 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4910 | resources->destroyMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&pipelineLayout); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4911 | mImpl->log("finish vkDestroyPipelineLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4912 | } |
| 4913 | |
| 4914 | VkResult VkEncoder::vkCreateSampler( |
| 4915 | VkDevice device, |
| 4916 | const VkSamplerCreateInfo* pCreateInfo, |
| 4917 | const VkAllocationCallbacks* pAllocator, |
| 4918 | VkSampler* pSampler) |
| 4919 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4920 | mImpl->log("start vkCreateSampler"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4921 | auto stream = mImpl->stream(); |
| 4922 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4923 | auto resources = mImpl->resources(); |
| 4924 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4925 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4926 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4927 | VkSamplerCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4928 | VkAllocationCallbacks* local_pAllocator; |
| 4929 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4930 | local_pCreateInfo = nullptr; |
| 4931 | if (pCreateInfo) |
| 4932 | { |
| 4933 | local_pCreateInfo = (VkSamplerCreateInfo*)pool->alloc(sizeof(const VkSamplerCreateInfo)); |
| 4934 | deepcopy_VkSamplerCreateInfo(pool, pCreateInfo, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| 4935 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4936 | local_pAllocator = nullptr; |
| 4937 | if (pAllocator) |
| 4938 | { |
| 4939 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4940 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4941 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4942 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4943 | if (local_pCreateInfo) |
| 4944 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4945 | transform_tohost_VkSamplerCreateInfo(mImpl->resources(), (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4946 | } |
| 4947 | if (local_pAllocator) |
| 4948 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4949 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4950 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4951 | countingStream->rewind(); |
| 4952 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4953 | uint64_t cgen_var_369; |
| 4954 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_369, 1); |
| 4955 | countingStream->write((uint64_t*)&cgen_var_369, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4956 | marshal_VkSamplerCreateInfo(countingStream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4957 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4958 | uint64_t cgen_var_370 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4959 | countingStream->putBe64(cgen_var_370); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4960 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4961 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4962 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4963 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4964 | uint64_t cgen_var_371; |
| 4965 | countingStream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_371, 1); |
| 4966 | countingStream->write((uint64_t*)&cgen_var_371, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4967 | } |
| 4968 | uint32_t packetSize_vkCreateSampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4969 | countingStream->rewind(); |
| 4970 | uint32_t opcode_vkCreateSampler = OP_vkCreateSampler; |
| 4971 | stream->write(&opcode_vkCreateSampler, sizeof(uint32_t)); |
| 4972 | stream->write(&packetSize_vkCreateSampler, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4973 | uint64_t cgen_var_372; |
| 4974 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_372, 1); |
| 4975 | stream->write((uint64_t*)&cgen_var_372, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4976 | marshal_VkSamplerCreateInfo(stream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4977 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4978 | uint64_t cgen_var_373 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4979 | stream->putBe64(cgen_var_373); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4980 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4981 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4982 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4983 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4984 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4985 | uint64_t cgen_var_374; |
| 4986 | stream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_374, 1); |
| 4987 | stream->write((uint64_t*)&cgen_var_374, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4988 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4989 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4990 | uint64_t cgen_var_375; |
| 4991 | stream->read((uint64_t*)&cgen_var_375, 8); |
| 4992 | stream->handleMapping()->mapHandles_u64_VkSampler(&cgen_var_375, (VkSampler*)pSampler, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4993 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4994 | VkResult vkCreateSampler_VkResult_return = (VkResult)0; |
| 4995 | stream->read(&vkCreateSampler_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4996 | countingStream->clearPool(); |
| 4997 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4998 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4999 | mImpl->log("finish vkCreateSampler");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5000 | return vkCreateSampler_VkResult_return; |
| 5001 | } |
| 5002 | |
| 5003 | void VkEncoder::vkDestroySampler( |
| 5004 | VkDevice device, |
| 5005 | VkSampler sampler, |
| 5006 | const VkAllocationCallbacks* pAllocator) |
| 5007 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5008 | mImpl->log("start vkDestroySampler"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5009 | auto stream = mImpl->stream(); |
| 5010 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5011 | auto resources = mImpl->resources(); |
| 5012 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5013 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5014 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5015 | VkSampler local_sampler; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5016 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5017 | local_device = device; |
| 5018 | local_sampler = sampler; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5019 | local_pAllocator = nullptr; |
| 5020 | if (pAllocator) |
| 5021 | { |
| 5022 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5023 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5024 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5025 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5026 | if (local_pAllocator) |
| 5027 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5028 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5029 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5030 | countingStream->rewind(); |
| 5031 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5032 | uint64_t cgen_var_376; |
| 5033 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_376, 1); |
| 5034 | countingStream->write((uint64_t*)&cgen_var_376, 1 * 8); |
| 5035 | uint64_t cgen_var_377; |
| 5036 | countingStream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_377, 1); |
| 5037 | countingStream->write((uint64_t*)&cgen_var_377, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5038 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5039 | uint64_t cgen_var_378 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5040 | countingStream->putBe64(cgen_var_378); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5041 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5042 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5043 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5044 | } |
| 5045 | } |
| 5046 | uint32_t packetSize_vkDestroySampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5047 | countingStream->rewind(); |
| 5048 | uint32_t opcode_vkDestroySampler = OP_vkDestroySampler; |
| 5049 | stream->write(&opcode_vkDestroySampler, sizeof(uint32_t)); |
| 5050 | stream->write(&packetSize_vkDestroySampler, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5051 | uint64_t cgen_var_379; |
| 5052 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_379, 1); |
| 5053 | stream->write((uint64_t*)&cgen_var_379, 1 * 8); |
| 5054 | uint64_t cgen_var_380; |
| 5055 | stream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_380, 1); |
| 5056 | stream->write((uint64_t*)&cgen_var_380, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5057 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5058 | uint64_t cgen_var_381 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5059 | stream->putBe64(cgen_var_381); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5060 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5061 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5062 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 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 | resources->destroyMapping()->mapHandles_VkSampler((VkSampler*)&sampler); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5065 | mImpl->log("finish vkDestroySampler");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5066 | } |
| 5067 | |
| 5068 | VkResult VkEncoder::vkCreateDescriptorSetLayout( |
| 5069 | VkDevice device, |
| 5070 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 5071 | const VkAllocationCallbacks* pAllocator, |
| 5072 | VkDescriptorSetLayout* pSetLayout) |
| 5073 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5074 | mImpl->log("start vkCreateDescriptorSetLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5075 | auto stream = mImpl->stream(); |
| 5076 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5077 | auto resources = mImpl->resources(); |
| 5078 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5079 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5080 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5081 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5082 | VkAllocationCallbacks* local_pAllocator; |
| 5083 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5084 | local_pCreateInfo = nullptr; |
| 5085 | if (pCreateInfo) |
| 5086 | { |
| 5087 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 5088 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 5089 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5090 | local_pAllocator = nullptr; |
| 5091 | if (pAllocator) |
| 5092 | { |
| 5093 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5094 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5095 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5096 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5097 | if (local_pCreateInfo) |
| 5098 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5099 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5100 | } |
| 5101 | if (local_pAllocator) |
| 5102 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5103 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5104 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5105 | countingStream->rewind(); |
| 5106 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5107 | uint64_t cgen_var_382; |
| 5108 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_382, 1); |
| 5109 | countingStream->write((uint64_t*)&cgen_var_382, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5110 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5111 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5112 | uint64_t cgen_var_383 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5113 | countingStream->putBe64(cgen_var_383); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5114 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5115 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5116 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5117 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5118 | uint64_t cgen_var_384; |
| 5119 | countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_384, 1); |
| 5120 | countingStream->write((uint64_t*)&cgen_var_384, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5121 | } |
| 5122 | uint32_t packetSize_vkCreateDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5123 | countingStream->rewind(); |
| 5124 | uint32_t opcode_vkCreateDescriptorSetLayout = OP_vkCreateDescriptorSetLayout; |
| 5125 | stream->write(&opcode_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| 5126 | stream->write(&packetSize_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5127 | uint64_t cgen_var_385; |
| 5128 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_385, 1); |
| 5129 | stream->write((uint64_t*)&cgen_var_385, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5130 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5131 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5132 | uint64_t cgen_var_386 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5133 | stream->putBe64(cgen_var_386); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5134 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5135 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5136 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5137 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5138 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5139 | uint64_t cgen_var_387; |
| 5140 | stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_387, 1); |
| 5141 | stream->write((uint64_t*)&cgen_var_387, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5142 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5143 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5144 | uint64_t cgen_var_388; |
| 5145 | stream->read((uint64_t*)&cgen_var_388, 8); |
| 5146 | stream->handleMapping()->mapHandles_u64_VkDescriptorSetLayout(&cgen_var_388, (VkDescriptorSetLayout*)pSetLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5147 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5148 | VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0; |
| 5149 | stream->read(&vkCreateDescriptorSetLayout_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5150 | countingStream->clearPool(); |
| 5151 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5152 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5153 | mImpl->log("finish vkCreateDescriptorSetLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5154 | return vkCreateDescriptorSetLayout_VkResult_return; |
| 5155 | } |
| 5156 | |
| 5157 | void VkEncoder::vkDestroyDescriptorSetLayout( |
| 5158 | VkDevice device, |
| 5159 | VkDescriptorSetLayout descriptorSetLayout, |
| 5160 | const VkAllocationCallbacks* pAllocator) |
| 5161 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5162 | mImpl->log("start vkDestroyDescriptorSetLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5163 | auto stream = mImpl->stream(); |
| 5164 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5165 | auto resources = mImpl->resources(); |
| 5166 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5167 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5168 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5169 | VkDescriptorSetLayout local_descriptorSetLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5170 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5171 | local_device = device; |
| 5172 | local_descriptorSetLayout = descriptorSetLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5173 | local_pAllocator = nullptr; |
| 5174 | if (pAllocator) |
| 5175 | { |
| 5176 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5177 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5178 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5179 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5180 | if (local_pAllocator) |
| 5181 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5182 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5183 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5184 | countingStream->rewind(); |
| 5185 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5186 | uint64_t cgen_var_389; |
| 5187 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_389, 1); |
| 5188 | countingStream->write((uint64_t*)&cgen_var_389, 1 * 8); |
| 5189 | uint64_t cgen_var_390; |
| 5190 | countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_390, 1); |
| 5191 | countingStream->write((uint64_t*)&cgen_var_390, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5192 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5193 | uint64_t cgen_var_391 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5194 | countingStream->putBe64(cgen_var_391); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5195 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5196 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5197 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5198 | } |
| 5199 | } |
| 5200 | uint32_t packetSize_vkDestroyDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5201 | countingStream->rewind(); |
| 5202 | uint32_t opcode_vkDestroyDescriptorSetLayout = OP_vkDestroyDescriptorSetLayout; |
| 5203 | stream->write(&opcode_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| 5204 | stream->write(&packetSize_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5205 | uint64_t cgen_var_392; |
| 5206 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_392, 1); |
| 5207 | stream->write((uint64_t*)&cgen_var_392, 1 * 8); |
| 5208 | uint64_t cgen_var_393; |
| 5209 | stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_393, 1); |
| 5210 | stream->write((uint64_t*)&cgen_var_393, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5211 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5212 | uint64_t cgen_var_394 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5213 | stream->putBe64(cgen_var_394); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5214 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5215 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5216 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5217 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5218 | resources->destroyMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)&descriptorSetLayout); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5219 | mImpl->log("finish vkDestroyDescriptorSetLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5220 | } |
| 5221 | |
| 5222 | VkResult VkEncoder::vkCreateDescriptorPool( |
| 5223 | VkDevice device, |
| 5224 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 5225 | const VkAllocationCallbacks* pAllocator, |
| 5226 | VkDescriptorPool* pDescriptorPool) |
| 5227 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5228 | mImpl->log("start vkCreateDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5229 | auto stream = mImpl->stream(); |
| 5230 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5231 | auto resources = mImpl->resources(); |
| 5232 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5233 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5234 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5235 | VkDescriptorPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5236 | VkAllocationCallbacks* local_pAllocator; |
| 5237 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5238 | local_pCreateInfo = nullptr; |
| 5239 | if (pCreateInfo) |
| 5240 | { |
| 5241 | local_pCreateInfo = (VkDescriptorPoolCreateInfo*)pool->alloc(sizeof(const VkDescriptorPoolCreateInfo)); |
| 5242 | deepcopy_VkDescriptorPoolCreateInfo(pool, pCreateInfo, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| 5243 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5244 | local_pAllocator = nullptr; |
| 5245 | if (pAllocator) |
| 5246 | { |
| 5247 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5248 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5249 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5250 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5251 | if (local_pCreateInfo) |
| 5252 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5253 | transform_tohost_VkDescriptorPoolCreateInfo(mImpl->resources(), (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5254 | } |
| 5255 | if (local_pAllocator) |
| 5256 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5257 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5258 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5259 | countingStream->rewind(); |
| 5260 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5261 | uint64_t cgen_var_395; |
| 5262 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_395, 1); |
| 5263 | countingStream->write((uint64_t*)&cgen_var_395, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5264 | marshal_VkDescriptorPoolCreateInfo(countingStream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5265 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5266 | uint64_t cgen_var_396 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5267 | countingStream->putBe64(cgen_var_396); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5268 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5269 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5270 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5271 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5272 | uint64_t cgen_var_397; |
| 5273 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_397, 1); |
| 5274 | countingStream->write((uint64_t*)&cgen_var_397, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5275 | } |
| 5276 | uint32_t packetSize_vkCreateDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5277 | countingStream->rewind(); |
| 5278 | uint32_t opcode_vkCreateDescriptorPool = OP_vkCreateDescriptorPool; |
| 5279 | stream->write(&opcode_vkCreateDescriptorPool, sizeof(uint32_t)); |
| 5280 | stream->write(&packetSize_vkCreateDescriptorPool, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5281 | uint64_t cgen_var_398; |
| 5282 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_398, 1); |
| 5283 | stream->write((uint64_t*)&cgen_var_398, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5284 | marshal_VkDescriptorPoolCreateInfo(stream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5285 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5286 | uint64_t cgen_var_399 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5287 | stream->putBe64(cgen_var_399); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5288 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5289 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5290 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5291 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5292 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5293 | uint64_t cgen_var_400; |
| 5294 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_400, 1); |
| 5295 | stream->write((uint64_t*)&cgen_var_400, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5296 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5297 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5298 | uint64_t cgen_var_401; |
| 5299 | stream->read((uint64_t*)&cgen_var_401, 8); |
| 5300 | stream->handleMapping()->mapHandles_u64_VkDescriptorPool(&cgen_var_401, (VkDescriptorPool*)pDescriptorPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5301 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5302 | VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0; |
| 5303 | stream->read(&vkCreateDescriptorPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5304 | countingStream->clearPool(); |
| 5305 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5306 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5307 | mImpl->log("finish vkCreateDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5308 | return vkCreateDescriptorPool_VkResult_return; |
| 5309 | } |
| 5310 | |
| 5311 | void VkEncoder::vkDestroyDescriptorPool( |
| 5312 | VkDevice device, |
| 5313 | VkDescriptorPool descriptorPool, |
| 5314 | const VkAllocationCallbacks* pAllocator) |
| 5315 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5316 | mImpl->log("start vkDestroyDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5317 | auto stream = mImpl->stream(); |
| 5318 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5319 | auto resources = mImpl->resources(); |
| 5320 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5321 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5322 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5323 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5324 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5325 | local_device = device; |
| 5326 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5327 | local_pAllocator = nullptr; |
| 5328 | if (pAllocator) |
| 5329 | { |
| 5330 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5331 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5332 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5333 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5334 | if (local_pAllocator) |
| 5335 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5336 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5337 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5338 | countingStream->rewind(); |
| 5339 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5340 | uint64_t cgen_var_402; |
| 5341 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_402, 1); |
| 5342 | countingStream->write((uint64_t*)&cgen_var_402, 1 * 8); |
| 5343 | uint64_t cgen_var_403; |
| 5344 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_403, 1); |
| 5345 | countingStream->write((uint64_t*)&cgen_var_403, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5346 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5347 | uint64_t cgen_var_404 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5348 | countingStream->putBe64(cgen_var_404); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5349 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5350 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5351 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5352 | } |
| 5353 | } |
| 5354 | uint32_t packetSize_vkDestroyDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5355 | countingStream->rewind(); |
| 5356 | uint32_t opcode_vkDestroyDescriptorPool = OP_vkDestroyDescriptorPool; |
| 5357 | stream->write(&opcode_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| 5358 | stream->write(&packetSize_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5359 | uint64_t cgen_var_405; |
| 5360 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_405, 1); |
| 5361 | stream->write((uint64_t*)&cgen_var_405, 1 * 8); |
| 5362 | uint64_t cgen_var_406; |
| 5363 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_406, 1); |
| 5364 | stream->write((uint64_t*)&cgen_var_406, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5365 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5366 | uint64_t cgen_var_407 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5367 | stream->putBe64(cgen_var_407); |
| 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(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5371 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5372 | resources->destroyMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&descriptorPool); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5373 | mImpl->log("finish vkDestroyDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5374 | } |
| 5375 | |
| 5376 | VkResult VkEncoder::vkResetDescriptorPool( |
| 5377 | VkDevice device, |
| 5378 | VkDescriptorPool descriptorPool, |
| 5379 | VkDescriptorPoolResetFlags flags) |
| 5380 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5381 | mImpl->log("start vkResetDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5382 | auto stream = mImpl->stream(); |
| 5383 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5384 | auto resources = mImpl->resources(); |
| 5385 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5386 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5387 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5388 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5389 | VkDescriptorPoolResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5390 | local_device = device; |
| 5391 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5392 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5393 | countingStream->rewind(); |
| 5394 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5395 | uint64_t cgen_var_408; |
| 5396 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_408, 1); |
| 5397 | countingStream->write((uint64_t*)&cgen_var_408, 1 * 8); |
| 5398 | uint64_t cgen_var_409; |
| 5399 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_409, 1); |
| 5400 | countingStream->write((uint64_t*)&cgen_var_409, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5401 | countingStream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5402 | } |
| 5403 | uint32_t packetSize_vkResetDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5404 | countingStream->rewind(); |
| 5405 | uint32_t opcode_vkResetDescriptorPool = OP_vkResetDescriptorPool; |
| 5406 | stream->write(&opcode_vkResetDescriptorPool, sizeof(uint32_t)); |
| 5407 | stream->write(&packetSize_vkResetDescriptorPool, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5408 | uint64_t cgen_var_410; |
| 5409 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_410, 1); |
| 5410 | stream->write((uint64_t*)&cgen_var_410, 1 * 8); |
| 5411 | uint64_t cgen_var_411; |
| 5412 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_411, 1); |
| 5413 | stream->write((uint64_t*)&cgen_var_411, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5414 | stream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5415 | VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0; |
| 5416 | stream->read(&vkResetDescriptorPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5417 | countingStream->clearPool(); |
| 5418 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5419 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5420 | mImpl->log("finish vkResetDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5421 | return vkResetDescriptorPool_VkResult_return; |
| 5422 | } |
| 5423 | |
| 5424 | VkResult VkEncoder::vkAllocateDescriptorSets( |
| 5425 | VkDevice device, |
| 5426 | const VkDescriptorSetAllocateInfo* pAllocateInfo, |
| 5427 | VkDescriptorSet* pDescriptorSets) |
| 5428 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5429 | mImpl->log("start vkAllocateDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5430 | auto stream = mImpl->stream(); |
| 5431 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5432 | auto resources = mImpl->resources(); |
| 5433 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5434 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5435 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5436 | VkDescriptorSetAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5437 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5438 | local_pAllocateInfo = nullptr; |
| 5439 | if (pAllocateInfo) |
| 5440 | { |
| 5441 | local_pAllocateInfo = (VkDescriptorSetAllocateInfo*)pool->alloc(sizeof(const VkDescriptorSetAllocateInfo)); |
| 5442 | deepcopy_VkDescriptorSetAllocateInfo(pool, pAllocateInfo, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| 5443 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5444 | if (local_pAllocateInfo) |
| 5445 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5446 | transform_tohost_VkDescriptorSetAllocateInfo(mImpl->resources(), (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5447 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5448 | countingStream->rewind(); |
| 5449 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5450 | uint64_t cgen_var_412; |
| 5451 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_412, 1); |
| 5452 | countingStream->write((uint64_t*)&cgen_var_412, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5453 | marshal_VkDescriptorSetAllocateInfo(countingStream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5454 | if (pAllocateInfo->descriptorSetCount) |
| 5455 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5456 | uint64_t* cgen_var_413; |
| 5457 | countingStream->alloc((void**)&cgen_var_413, pAllocateInfo->descriptorSetCount * 8); |
| 5458 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_413, pAllocateInfo->descriptorSetCount); |
| 5459 | countingStream->write((uint64_t*)cgen_var_413, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5460 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5461 | } |
| 5462 | uint32_t packetSize_vkAllocateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5463 | countingStream->rewind(); |
| 5464 | uint32_t opcode_vkAllocateDescriptorSets = OP_vkAllocateDescriptorSets; |
| 5465 | stream->write(&opcode_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| 5466 | stream->write(&packetSize_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5467 | uint64_t cgen_var_414; |
| 5468 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_414, 1); |
| 5469 | stream->write((uint64_t*)&cgen_var_414, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5470 | marshal_VkDescriptorSetAllocateInfo(stream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5471 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5472 | if (pAllocateInfo->descriptorSetCount) |
| 5473 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5474 | uint64_t* cgen_var_415; |
| 5475 | stream->alloc((void**)&cgen_var_415, pAllocateInfo->descriptorSetCount * 8); |
| 5476 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_415, pAllocateInfo->descriptorSetCount); |
| 5477 | stream->write((uint64_t*)cgen_var_415, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5478 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5479 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5480 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5481 | if (pAllocateInfo->descriptorSetCount) |
| 5482 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5483 | uint64_t* cgen_var_416; |
| 5484 | stream->alloc((void**)&cgen_var_416, pAllocateInfo->descriptorSetCount * 8); |
| 5485 | stream->read((uint64_t*)cgen_var_416, pAllocateInfo->descriptorSetCount * 8); |
| 5486 | stream->handleMapping()->mapHandles_u64_VkDescriptorSet(cgen_var_416, (VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5487 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5488 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5489 | VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0; |
| 5490 | stream->read(&vkAllocateDescriptorSets_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5491 | countingStream->clearPool(); |
| 5492 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5493 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5494 | mImpl->log("finish vkAllocateDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5495 | return vkAllocateDescriptorSets_VkResult_return; |
| 5496 | } |
| 5497 | |
| 5498 | VkResult VkEncoder::vkFreeDescriptorSets( |
| 5499 | VkDevice device, |
| 5500 | VkDescriptorPool descriptorPool, |
| 5501 | uint32_t descriptorSetCount, |
| 5502 | const VkDescriptorSet* pDescriptorSets) |
| 5503 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5504 | mImpl->log("start vkFreeDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5505 | auto stream = mImpl->stream(); |
| 5506 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5507 | auto resources = mImpl->resources(); |
| 5508 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5509 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5510 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5511 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5512 | uint32_t local_descriptorSetCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5513 | VkDescriptorSet* local_pDescriptorSets; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5514 | local_device = device; |
| 5515 | local_descriptorPool = descriptorPool; |
| 5516 | local_descriptorSetCount = descriptorSetCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5517 | local_pDescriptorSets = nullptr; |
| 5518 | if (pDescriptorSets) |
| 5519 | { |
| 5520 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 5521 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5522 | countingStream->rewind(); |
| 5523 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5524 | uint64_t cgen_var_417; |
| 5525 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_417, 1); |
| 5526 | countingStream->write((uint64_t*)&cgen_var_417, 1 * 8); |
| 5527 | uint64_t cgen_var_418; |
| 5528 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_418, 1); |
| 5529 | countingStream->write((uint64_t*)&cgen_var_418, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5530 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5531 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5532 | uint64_t cgen_var_419 = (uint64_t)(uintptr_t)local_pDescriptorSets; |
| 5533 | countingStream->putBe64(cgen_var_419); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5534 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5535 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5536 | if (((descriptorSetCount))) |
| 5537 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5538 | uint64_t* cgen_var_420; |
| 5539 | countingStream->alloc((void**)&cgen_var_420, ((descriptorSetCount)) * 8); |
| 5540 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_420, ((descriptorSetCount))); |
| 5541 | countingStream->write((uint64_t*)cgen_var_420, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5542 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5543 | } |
| 5544 | } |
| 5545 | uint32_t packetSize_vkFreeDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5546 | countingStream->rewind(); |
| 5547 | uint32_t opcode_vkFreeDescriptorSets = OP_vkFreeDescriptorSets; |
| 5548 | stream->write(&opcode_vkFreeDescriptorSets, sizeof(uint32_t)); |
| 5549 | stream->write(&packetSize_vkFreeDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5550 | uint64_t cgen_var_421; |
| 5551 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_421, 1); |
| 5552 | stream->write((uint64_t*)&cgen_var_421, 1 * 8); |
| 5553 | uint64_t cgen_var_422; |
| 5554 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_422, 1); |
| 5555 | stream->write((uint64_t*)&cgen_var_422, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5556 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5557 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5558 | uint64_t cgen_var_423 = (uint64_t)(uintptr_t)local_pDescriptorSets; |
| 5559 | stream->putBe64(cgen_var_423); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5560 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5561 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5562 | if (((descriptorSetCount))) |
| 5563 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5564 | uint64_t* cgen_var_424; |
| 5565 | stream->alloc((void**)&cgen_var_424, ((descriptorSetCount)) * 8); |
| 5566 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_424, ((descriptorSetCount))); |
| 5567 | stream->write((uint64_t*)cgen_var_424, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5568 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5569 | } |
| 5570 | VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0; |
| 5571 | stream->read(&vkFreeDescriptorSets_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5572 | countingStream->clearPool(); |
| 5573 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5574 | pool->freeAll(); |
| Lingfeng Yang | 6ab1b0d | 2018-11-27 23:36:03 -0800 | [diff] [blame] | 5575 | if (pDescriptorSets) |
| 5576 | { |
| 5577 | resources->destroyMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount))); |
| 5578 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5579 | mImpl->log("finish vkFreeDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5580 | return vkFreeDescriptorSets_VkResult_return; |
| 5581 | } |
| 5582 | |
| 5583 | void VkEncoder::vkUpdateDescriptorSets( |
| 5584 | VkDevice device, |
| 5585 | uint32_t descriptorWriteCount, |
| 5586 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 5587 | uint32_t descriptorCopyCount, |
| 5588 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 5589 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5590 | mImpl->log("start vkUpdateDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5591 | auto stream = mImpl->stream(); |
| 5592 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5593 | auto resources = mImpl->resources(); |
| 5594 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5595 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5596 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5597 | uint32_t local_descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5598 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5599 | uint32_t local_descriptorCopyCount; |
| 5600 | VkCopyDescriptorSet* local_pDescriptorCopies; |
| 5601 | local_device = device; |
| 5602 | local_descriptorWriteCount = descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5603 | local_pDescriptorWrites = nullptr; |
| 5604 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5605 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5606 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5607 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5608 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5609 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5610 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5611 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5612 | local_descriptorCopyCount = descriptorCopyCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5613 | local_pDescriptorCopies = nullptr; |
| 5614 | if (pDescriptorCopies) |
| 5615 | { |
| 5616 | local_pDescriptorCopies = (VkCopyDescriptorSet*)pool->alloc(((descriptorCopyCount)) * sizeof(const VkCopyDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5617 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5618 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5619 | deepcopy_VkCopyDescriptorSet(pool, pDescriptorCopies + i, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| 5620 | } |
| 5621 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5622 | if (local_pDescriptorWrites) |
| 5623 | { |
| 5624 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5625 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5626 | transform_tohost_VkWriteDescriptorSet(mImpl->resources(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5627 | } |
| 5628 | } |
| 5629 | if (local_pDescriptorCopies) |
| 5630 | { |
| 5631 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5632 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5633 | transform_tohost_VkCopyDescriptorSet(mImpl->resources(), (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5634 | } |
| 5635 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5636 | countingStream->rewind(); |
| 5637 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5638 | uint64_t cgen_var_425; |
| 5639 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_425, 1); |
| 5640 | countingStream->write((uint64_t*)&cgen_var_425, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5641 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 5642 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5643 | { |
| 5644 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 5645 | } |
| 5646 | countingStream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| 5647 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5648 | { |
| 5649 | marshal_VkCopyDescriptorSet(countingStream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5650 | } |
| 5651 | } |
| 5652 | uint32_t packetSize_vkUpdateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5653 | countingStream->rewind(); |
| 5654 | uint32_t opcode_vkUpdateDescriptorSets = OP_vkUpdateDescriptorSets; |
| 5655 | stream->write(&opcode_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| 5656 | stream->write(&packetSize_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5657 | uint64_t cgen_var_426; |
| 5658 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_426, 1); |
| 5659 | stream->write((uint64_t*)&cgen_var_426, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5660 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5661 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5662 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5663 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5664 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5665 | stream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5666 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5667 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5668 | marshal_VkCopyDescriptorSet(stream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5669 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5670 | mImpl->log("finish vkUpdateDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5671 | } |
| 5672 | |
| 5673 | VkResult VkEncoder::vkCreateFramebuffer( |
| 5674 | VkDevice device, |
| 5675 | const VkFramebufferCreateInfo* pCreateInfo, |
| 5676 | const VkAllocationCallbacks* pAllocator, |
| 5677 | VkFramebuffer* pFramebuffer) |
| 5678 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5679 | mImpl->log("start vkCreateFramebuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5680 | auto stream = mImpl->stream(); |
| 5681 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5682 | auto resources = mImpl->resources(); |
| 5683 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5684 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5685 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5686 | VkFramebufferCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5687 | VkAllocationCallbacks* local_pAllocator; |
| 5688 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5689 | local_pCreateInfo = nullptr; |
| 5690 | if (pCreateInfo) |
| 5691 | { |
| 5692 | local_pCreateInfo = (VkFramebufferCreateInfo*)pool->alloc(sizeof(const VkFramebufferCreateInfo)); |
| 5693 | deepcopy_VkFramebufferCreateInfo(pool, pCreateInfo, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| 5694 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5695 | local_pAllocator = nullptr; |
| 5696 | if (pAllocator) |
| 5697 | { |
| 5698 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5699 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5700 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5701 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5702 | if (local_pCreateInfo) |
| 5703 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5704 | transform_tohost_VkFramebufferCreateInfo(mImpl->resources(), (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5705 | } |
| 5706 | if (local_pAllocator) |
| 5707 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5708 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5709 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5710 | countingStream->rewind(); |
| 5711 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5712 | uint64_t cgen_var_427; |
| 5713 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_427, 1); |
| 5714 | countingStream->write((uint64_t*)&cgen_var_427, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5715 | marshal_VkFramebufferCreateInfo(countingStream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5716 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5717 | uint64_t cgen_var_428 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5718 | countingStream->putBe64(cgen_var_428); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5719 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5720 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5721 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5722 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5723 | uint64_t cgen_var_429; |
| 5724 | countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_429, 1); |
| 5725 | countingStream->write((uint64_t*)&cgen_var_429, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5726 | } |
| 5727 | uint32_t packetSize_vkCreateFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5728 | countingStream->rewind(); |
| 5729 | uint32_t opcode_vkCreateFramebuffer = OP_vkCreateFramebuffer; |
| 5730 | stream->write(&opcode_vkCreateFramebuffer, sizeof(uint32_t)); |
| 5731 | stream->write(&packetSize_vkCreateFramebuffer, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5732 | uint64_t cgen_var_430; |
| 5733 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_430, 1); |
| 5734 | stream->write((uint64_t*)&cgen_var_430, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5735 | marshal_VkFramebufferCreateInfo(stream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5736 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5737 | uint64_t cgen_var_431 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5738 | stream->putBe64(cgen_var_431); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5739 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5740 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5741 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5742 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5743 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5744 | uint64_t cgen_var_432; |
| 5745 | stream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_432, 1); |
| 5746 | stream->write((uint64_t*)&cgen_var_432, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5747 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5748 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5749 | uint64_t cgen_var_433; |
| 5750 | stream->read((uint64_t*)&cgen_var_433, 8); |
| 5751 | stream->handleMapping()->mapHandles_u64_VkFramebuffer(&cgen_var_433, (VkFramebuffer*)pFramebuffer, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5752 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5753 | VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0; |
| 5754 | stream->read(&vkCreateFramebuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5755 | countingStream->clearPool(); |
| 5756 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5757 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5758 | mImpl->log("finish vkCreateFramebuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5759 | return vkCreateFramebuffer_VkResult_return; |
| 5760 | } |
| 5761 | |
| 5762 | void VkEncoder::vkDestroyFramebuffer( |
| 5763 | VkDevice device, |
| 5764 | VkFramebuffer framebuffer, |
| 5765 | const VkAllocationCallbacks* pAllocator) |
| 5766 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5767 | mImpl->log("start vkDestroyFramebuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5768 | auto stream = mImpl->stream(); |
| 5769 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5770 | auto resources = mImpl->resources(); |
| 5771 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5772 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5773 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5774 | VkFramebuffer local_framebuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5775 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5776 | local_device = device; |
| 5777 | local_framebuffer = framebuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5778 | local_pAllocator = nullptr; |
| 5779 | if (pAllocator) |
| 5780 | { |
| 5781 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5782 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5783 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5784 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5785 | if (local_pAllocator) |
| 5786 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5787 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5788 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5789 | countingStream->rewind(); |
| 5790 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5791 | uint64_t cgen_var_434; |
| 5792 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_434, 1); |
| 5793 | countingStream->write((uint64_t*)&cgen_var_434, 1 * 8); |
| 5794 | uint64_t cgen_var_435; |
| 5795 | countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_435, 1); |
| 5796 | countingStream->write((uint64_t*)&cgen_var_435, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5797 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5798 | uint64_t cgen_var_436 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5799 | countingStream->putBe64(cgen_var_436); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5800 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5801 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5802 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5803 | } |
| 5804 | } |
| 5805 | uint32_t packetSize_vkDestroyFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5806 | countingStream->rewind(); |
| 5807 | uint32_t opcode_vkDestroyFramebuffer = OP_vkDestroyFramebuffer; |
| 5808 | stream->write(&opcode_vkDestroyFramebuffer, sizeof(uint32_t)); |
| 5809 | stream->write(&packetSize_vkDestroyFramebuffer, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5810 | uint64_t cgen_var_437; |
| 5811 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_437, 1); |
| 5812 | stream->write((uint64_t*)&cgen_var_437, 1 * 8); |
| 5813 | uint64_t cgen_var_438; |
| 5814 | stream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_438, 1); |
| 5815 | stream->write((uint64_t*)&cgen_var_438, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5816 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5817 | uint64_t cgen_var_439 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5818 | stream->putBe64(cgen_var_439); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5819 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5820 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5821 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5822 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5823 | resources->destroyMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&framebuffer); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5824 | mImpl->log("finish vkDestroyFramebuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5825 | } |
| 5826 | |
| 5827 | VkResult VkEncoder::vkCreateRenderPass( |
| 5828 | VkDevice device, |
| 5829 | const VkRenderPassCreateInfo* pCreateInfo, |
| 5830 | const VkAllocationCallbacks* pAllocator, |
| 5831 | VkRenderPass* pRenderPass) |
| 5832 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5833 | mImpl->log("start vkCreateRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5834 | auto stream = mImpl->stream(); |
| 5835 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5836 | auto resources = mImpl->resources(); |
| 5837 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5838 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5839 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5840 | VkRenderPassCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5841 | VkAllocationCallbacks* local_pAllocator; |
| 5842 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5843 | local_pCreateInfo = nullptr; |
| 5844 | if (pCreateInfo) |
| 5845 | { |
| 5846 | local_pCreateInfo = (VkRenderPassCreateInfo*)pool->alloc(sizeof(const VkRenderPassCreateInfo)); |
| 5847 | deepcopy_VkRenderPassCreateInfo(pool, pCreateInfo, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| 5848 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5849 | local_pAllocator = nullptr; |
| 5850 | if (pAllocator) |
| 5851 | { |
| 5852 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5853 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5854 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5855 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5856 | if (local_pCreateInfo) |
| 5857 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5858 | transform_tohost_VkRenderPassCreateInfo(mImpl->resources(), (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5859 | } |
| 5860 | if (local_pAllocator) |
| 5861 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5862 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5863 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5864 | countingStream->rewind(); |
| 5865 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5866 | uint64_t cgen_var_440; |
| 5867 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_440, 1); |
| 5868 | countingStream->write((uint64_t*)&cgen_var_440, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5869 | marshal_VkRenderPassCreateInfo(countingStream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5870 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5871 | uint64_t cgen_var_441 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5872 | countingStream->putBe64(cgen_var_441); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5873 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5874 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5875 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5876 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5877 | uint64_t cgen_var_442; |
| 5878 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_442, 1); |
| 5879 | countingStream->write((uint64_t*)&cgen_var_442, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5880 | } |
| 5881 | uint32_t packetSize_vkCreateRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5882 | countingStream->rewind(); |
| 5883 | uint32_t opcode_vkCreateRenderPass = OP_vkCreateRenderPass; |
| 5884 | stream->write(&opcode_vkCreateRenderPass, sizeof(uint32_t)); |
| 5885 | stream->write(&packetSize_vkCreateRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5886 | uint64_t cgen_var_443; |
| 5887 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_443, 1); |
| 5888 | stream->write((uint64_t*)&cgen_var_443, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5889 | marshal_VkRenderPassCreateInfo(stream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5890 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5891 | uint64_t cgen_var_444 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5892 | stream->putBe64(cgen_var_444); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5893 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5894 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5895 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5896 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5897 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5898 | uint64_t cgen_var_445; |
| 5899 | stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_445, 1); |
| 5900 | stream->write((uint64_t*)&cgen_var_445, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5901 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5902 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5903 | uint64_t cgen_var_446; |
| 5904 | stream->read((uint64_t*)&cgen_var_446, 8); |
| 5905 | stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_446, (VkRenderPass*)pRenderPass, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5906 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5907 | VkResult vkCreateRenderPass_VkResult_return = (VkResult)0; |
| 5908 | stream->read(&vkCreateRenderPass_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5909 | countingStream->clearPool(); |
| 5910 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5911 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5912 | mImpl->log("finish vkCreateRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5913 | return vkCreateRenderPass_VkResult_return; |
| 5914 | } |
| 5915 | |
| 5916 | void VkEncoder::vkDestroyRenderPass( |
| 5917 | VkDevice device, |
| 5918 | VkRenderPass renderPass, |
| 5919 | const VkAllocationCallbacks* pAllocator) |
| 5920 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5921 | mImpl->log("start vkDestroyRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5922 | auto stream = mImpl->stream(); |
| 5923 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5924 | auto resources = mImpl->resources(); |
| 5925 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5926 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5927 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5928 | VkRenderPass local_renderPass; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5929 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5930 | local_device = device; |
| 5931 | local_renderPass = renderPass; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5932 | local_pAllocator = nullptr; |
| 5933 | if (pAllocator) |
| 5934 | { |
| 5935 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5936 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5937 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5938 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5939 | if (local_pAllocator) |
| 5940 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5941 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5942 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5943 | countingStream->rewind(); |
| 5944 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5945 | uint64_t cgen_var_447; |
| 5946 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_447, 1); |
| 5947 | countingStream->write((uint64_t*)&cgen_var_447, 1 * 8); |
| 5948 | uint64_t cgen_var_448; |
| 5949 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_448, 1); |
| 5950 | countingStream->write((uint64_t*)&cgen_var_448, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5951 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5952 | uint64_t cgen_var_449 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5953 | countingStream->putBe64(cgen_var_449); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5954 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5955 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5956 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5957 | } |
| 5958 | } |
| 5959 | uint32_t packetSize_vkDestroyRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5960 | countingStream->rewind(); |
| 5961 | uint32_t opcode_vkDestroyRenderPass = OP_vkDestroyRenderPass; |
| 5962 | stream->write(&opcode_vkDestroyRenderPass, sizeof(uint32_t)); |
| 5963 | stream->write(&packetSize_vkDestroyRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5964 | uint64_t cgen_var_450; |
| 5965 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_450, 1); |
| 5966 | stream->write((uint64_t*)&cgen_var_450, 1 * 8); |
| 5967 | uint64_t cgen_var_451; |
| 5968 | stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_451, 1); |
| 5969 | stream->write((uint64_t*)&cgen_var_451, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5970 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5971 | uint64_t cgen_var_452 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5972 | stream->putBe64(cgen_var_452); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5973 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5974 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5975 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5976 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5977 | resources->destroyMapping()->mapHandles_VkRenderPass((VkRenderPass*)&renderPass); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5978 | mImpl->log("finish vkDestroyRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5979 | } |
| 5980 | |
| 5981 | void VkEncoder::vkGetRenderAreaGranularity( |
| 5982 | VkDevice device, |
| 5983 | VkRenderPass renderPass, |
| 5984 | VkExtent2D* pGranularity) |
| 5985 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5986 | mImpl->log("start vkGetRenderAreaGranularity"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5987 | auto stream = mImpl->stream(); |
| 5988 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5989 | auto resources = mImpl->resources(); |
| 5990 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5991 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5992 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5993 | VkRenderPass local_renderPass; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5994 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5995 | local_renderPass = renderPass; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5996 | countingStream->rewind(); |
| 5997 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 5998 | uint64_t cgen_var_453; |
| 5999 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_453, 1); |
| 6000 | countingStream->write((uint64_t*)&cgen_var_453, 1 * 8); |
| 6001 | uint64_t cgen_var_454; |
| 6002 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_454, 1); |
| 6003 | countingStream->write((uint64_t*)&cgen_var_454, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6004 | marshal_VkExtent2D(countingStream, (VkExtent2D*)(pGranularity)); |
| 6005 | } |
| 6006 | uint32_t packetSize_vkGetRenderAreaGranularity = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6007 | countingStream->rewind(); |
| 6008 | uint32_t opcode_vkGetRenderAreaGranularity = OP_vkGetRenderAreaGranularity; |
| 6009 | stream->write(&opcode_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| 6010 | stream->write(&packetSize_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6011 | uint64_t cgen_var_455; |
| 6012 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_455, 1); |
| 6013 | stream->write((uint64_t*)&cgen_var_455, 1 * 8); |
| 6014 | uint64_t cgen_var_456; |
| 6015 | stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_456, 1); |
| 6016 | stream->write((uint64_t*)&cgen_var_456, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6017 | marshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| 6018 | unmarshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6019 | if (pGranularity) |
| 6020 | { |
| 6021 | transform_fromhost_VkExtent2D(mImpl->resources(), (VkExtent2D*)(pGranularity)); |
| 6022 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6023 | mImpl->log("finish vkGetRenderAreaGranularity");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6024 | } |
| 6025 | |
| 6026 | VkResult VkEncoder::vkCreateCommandPool( |
| 6027 | VkDevice device, |
| 6028 | const VkCommandPoolCreateInfo* pCreateInfo, |
| 6029 | const VkAllocationCallbacks* pAllocator, |
| 6030 | VkCommandPool* pCommandPool) |
| 6031 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6032 | mImpl->log("start vkCreateCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6033 | auto stream = mImpl->stream(); |
| 6034 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6035 | auto resources = mImpl->resources(); |
| 6036 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6037 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6038 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6039 | VkCommandPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6040 | VkAllocationCallbacks* local_pAllocator; |
| 6041 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6042 | local_pCreateInfo = nullptr; |
| 6043 | if (pCreateInfo) |
| 6044 | { |
| 6045 | local_pCreateInfo = (VkCommandPoolCreateInfo*)pool->alloc(sizeof(const VkCommandPoolCreateInfo)); |
| 6046 | deepcopy_VkCommandPoolCreateInfo(pool, pCreateInfo, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| 6047 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6048 | local_pAllocator = nullptr; |
| 6049 | if (pAllocator) |
| 6050 | { |
| 6051 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6052 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6053 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6054 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6055 | if (local_pCreateInfo) |
| 6056 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6057 | transform_tohost_VkCommandPoolCreateInfo(mImpl->resources(), (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6058 | } |
| 6059 | if (local_pAllocator) |
| 6060 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6061 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6062 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6063 | countingStream->rewind(); |
| 6064 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6065 | uint64_t cgen_var_457; |
| 6066 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_457, 1); |
| 6067 | countingStream->write((uint64_t*)&cgen_var_457, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6068 | marshal_VkCommandPoolCreateInfo(countingStream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6069 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6070 | uint64_t cgen_var_458 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6071 | countingStream->putBe64(cgen_var_458); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6072 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6073 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6074 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6075 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6076 | uint64_t cgen_var_459; |
| 6077 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_459, 1); |
| 6078 | countingStream->write((uint64_t*)&cgen_var_459, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6079 | } |
| 6080 | uint32_t packetSize_vkCreateCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6081 | countingStream->rewind(); |
| 6082 | uint32_t opcode_vkCreateCommandPool = OP_vkCreateCommandPool; |
| 6083 | stream->write(&opcode_vkCreateCommandPool, sizeof(uint32_t)); |
| 6084 | stream->write(&packetSize_vkCreateCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6085 | uint64_t cgen_var_460; |
| 6086 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_460, 1); |
| 6087 | stream->write((uint64_t*)&cgen_var_460, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6088 | marshal_VkCommandPoolCreateInfo(stream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6089 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6090 | uint64_t cgen_var_461 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6091 | stream->putBe64(cgen_var_461); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6092 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6093 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6094 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6095 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6096 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6097 | uint64_t cgen_var_462; |
| 6098 | stream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_462, 1); |
| 6099 | stream->write((uint64_t*)&cgen_var_462, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6100 | stream->setHandleMapping(resources->unwrapMapping()); |
| 6101 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6102 | uint64_t cgen_var_463; |
| 6103 | stream->read((uint64_t*)&cgen_var_463, 8); |
| 6104 | stream->handleMapping()->mapHandles_u64_VkCommandPool(&cgen_var_463, (VkCommandPool*)pCommandPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6105 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6106 | VkResult vkCreateCommandPool_VkResult_return = (VkResult)0; |
| 6107 | stream->read(&vkCreateCommandPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6108 | countingStream->clearPool(); |
| 6109 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6110 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6111 | mImpl->log("finish vkCreateCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6112 | return vkCreateCommandPool_VkResult_return; |
| 6113 | } |
| 6114 | |
| 6115 | void VkEncoder::vkDestroyCommandPool( |
| 6116 | VkDevice device, |
| 6117 | VkCommandPool commandPool, |
| 6118 | const VkAllocationCallbacks* pAllocator) |
| 6119 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6120 | mImpl->log("start vkDestroyCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6121 | auto stream = mImpl->stream(); |
| 6122 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6123 | auto resources = mImpl->resources(); |
| 6124 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6125 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6126 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6127 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6128 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6129 | local_device = device; |
| 6130 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6131 | local_pAllocator = nullptr; |
| 6132 | if (pAllocator) |
| 6133 | { |
| 6134 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6135 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6136 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6137 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6138 | if (local_pAllocator) |
| 6139 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6140 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6141 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6142 | countingStream->rewind(); |
| 6143 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6144 | uint64_t cgen_var_464; |
| 6145 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_464, 1); |
| 6146 | countingStream->write((uint64_t*)&cgen_var_464, 1 * 8); |
| 6147 | uint64_t cgen_var_465; |
| 6148 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_465, 1); |
| 6149 | countingStream->write((uint64_t*)&cgen_var_465, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6150 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6151 | uint64_t cgen_var_466 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6152 | countingStream->putBe64(cgen_var_466); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6153 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6154 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6155 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6156 | } |
| 6157 | } |
| 6158 | uint32_t packetSize_vkDestroyCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6159 | countingStream->rewind(); |
| 6160 | uint32_t opcode_vkDestroyCommandPool = OP_vkDestroyCommandPool; |
| 6161 | stream->write(&opcode_vkDestroyCommandPool, sizeof(uint32_t)); |
| 6162 | stream->write(&packetSize_vkDestroyCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6163 | uint64_t cgen_var_467; |
| 6164 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_467, 1); |
| 6165 | stream->write((uint64_t*)&cgen_var_467, 1 * 8); |
| 6166 | uint64_t cgen_var_468; |
| 6167 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_468, 1); |
| 6168 | stream->write((uint64_t*)&cgen_var_468, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6169 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6170 | uint64_t cgen_var_469 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6171 | stream->putBe64(cgen_var_469); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6172 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6173 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6174 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6175 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6176 | resources->destroyMapping()->mapHandles_VkCommandPool((VkCommandPool*)&commandPool); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6177 | mImpl->log("finish vkDestroyCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6178 | } |
| 6179 | |
| 6180 | VkResult VkEncoder::vkResetCommandPool( |
| 6181 | VkDevice device, |
| 6182 | VkCommandPool commandPool, |
| 6183 | VkCommandPoolResetFlags flags) |
| 6184 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6185 | mImpl->log("start vkResetCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6186 | auto stream = mImpl->stream(); |
| 6187 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6188 | auto resources = mImpl->resources(); |
| 6189 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6190 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6191 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6192 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6193 | VkCommandPoolResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6194 | local_device = device; |
| 6195 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6196 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6197 | countingStream->rewind(); |
| 6198 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6199 | uint64_t cgen_var_470; |
| 6200 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_470, 1); |
| 6201 | countingStream->write((uint64_t*)&cgen_var_470, 1 * 8); |
| 6202 | uint64_t cgen_var_471; |
| 6203 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_471, 1); |
| 6204 | countingStream->write((uint64_t*)&cgen_var_471, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6205 | countingStream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6206 | } |
| 6207 | uint32_t packetSize_vkResetCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6208 | countingStream->rewind(); |
| 6209 | uint32_t opcode_vkResetCommandPool = OP_vkResetCommandPool; |
| 6210 | stream->write(&opcode_vkResetCommandPool, sizeof(uint32_t)); |
| 6211 | stream->write(&packetSize_vkResetCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6212 | uint64_t cgen_var_472; |
| 6213 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_472, 1); |
| 6214 | stream->write((uint64_t*)&cgen_var_472, 1 * 8); |
| 6215 | uint64_t cgen_var_473; |
| 6216 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_473, 1); |
| 6217 | stream->write((uint64_t*)&cgen_var_473, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6218 | stream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6219 | VkResult vkResetCommandPool_VkResult_return = (VkResult)0; |
| 6220 | stream->read(&vkResetCommandPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6221 | countingStream->clearPool(); |
| 6222 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6223 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6224 | mImpl->log("finish vkResetCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6225 | return vkResetCommandPool_VkResult_return; |
| 6226 | } |
| 6227 | |
| 6228 | VkResult VkEncoder::vkAllocateCommandBuffers( |
| 6229 | VkDevice device, |
| 6230 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 6231 | VkCommandBuffer* pCommandBuffers) |
| 6232 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6233 | mImpl->log("start vkAllocateCommandBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6234 | auto stream = mImpl->stream(); |
| 6235 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6236 | auto resources = mImpl->resources(); |
| 6237 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6238 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6239 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6240 | VkCommandBufferAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6241 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6242 | local_pAllocateInfo = nullptr; |
| 6243 | if (pAllocateInfo) |
| 6244 | { |
| 6245 | local_pAllocateInfo = (VkCommandBufferAllocateInfo*)pool->alloc(sizeof(const VkCommandBufferAllocateInfo)); |
| 6246 | deepcopy_VkCommandBufferAllocateInfo(pool, pAllocateInfo, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| 6247 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6248 | if (local_pAllocateInfo) |
| 6249 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6250 | transform_tohost_VkCommandBufferAllocateInfo(mImpl->resources(), (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6251 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6252 | countingStream->rewind(); |
| 6253 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6254 | uint64_t cgen_var_474; |
| 6255 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_474, 1); |
| 6256 | countingStream->write((uint64_t*)&cgen_var_474, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6257 | marshal_VkCommandBufferAllocateInfo(countingStream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6258 | if (pAllocateInfo->commandBufferCount) |
| 6259 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6260 | uint64_t* cgen_var_475; |
| 6261 | countingStream->alloc((void**)&cgen_var_475, pAllocateInfo->commandBufferCount * 8); |
| 6262 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_475, pAllocateInfo->commandBufferCount); |
| 6263 | countingStream->write((uint64_t*)cgen_var_475, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6264 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6265 | } |
| 6266 | uint32_t packetSize_vkAllocateCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6267 | countingStream->rewind(); |
| 6268 | uint32_t opcode_vkAllocateCommandBuffers = OP_vkAllocateCommandBuffers; |
| 6269 | stream->write(&opcode_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| 6270 | stream->write(&packetSize_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6271 | uint64_t cgen_var_476; |
| 6272 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_476, 1); |
| 6273 | stream->write((uint64_t*)&cgen_var_476, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6274 | marshal_VkCommandBufferAllocateInfo(stream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6275 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6276 | if (pAllocateInfo->commandBufferCount) |
| 6277 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6278 | uint64_t* cgen_var_477; |
| 6279 | stream->alloc((void**)&cgen_var_477, pAllocateInfo->commandBufferCount * 8); |
| 6280 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_477, pAllocateInfo->commandBufferCount); |
| 6281 | stream->write((uint64_t*)cgen_var_477, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6282 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6283 | stream->setHandleMapping(resources->unwrapMapping()); |
| 6284 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6285 | if (pAllocateInfo->commandBufferCount) |
| 6286 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6287 | uint64_t* cgen_var_478; |
| 6288 | stream->alloc((void**)&cgen_var_478, pAllocateInfo->commandBufferCount * 8); |
| 6289 | stream->read((uint64_t*)cgen_var_478, pAllocateInfo->commandBufferCount * 8); |
| 6290 | stream->handleMapping()->mapHandles_u64_VkCommandBuffer(cgen_var_478, (VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6291 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6292 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6293 | VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0; |
| 6294 | stream->read(&vkAllocateCommandBuffers_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6295 | countingStream->clearPool(); |
| 6296 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6297 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6298 | mImpl->log("finish vkAllocateCommandBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6299 | return vkAllocateCommandBuffers_VkResult_return; |
| 6300 | } |
| 6301 | |
| 6302 | void VkEncoder::vkFreeCommandBuffers( |
| 6303 | VkDevice device, |
| 6304 | VkCommandPool commandPool, |
| 6305 | uint32_t commandBufferCount, |
| 6306 | const VkCommandBuffer* pCommandBuffers) |
| 6307 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6308 | mImpl->log("start vkFreeCommandBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6309 | auto stream = mImpl->stream(); |
| 6310 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6311 | auto resources = mImpl->resources(); |
| 6312 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6313 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6314 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6315 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6316 | uint32_t local_commandBufferCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6317 | VkCommandBuffer* local_pCommandBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6318 | local_device = device; |
| 6319 | local_commandPool = commandPool; |
| 6320 | local_commandBufferCount = commandBufferCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6321 | local_pCommandBuffers = nullptr; |
| 6322 | if (pCommandBuffers) |
| 6323 | { |
| 6324 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 6325 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6326 | countingStream->rewind(); |
| 6327 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6328 | uint64_t cgen_var_479; |
| 6329 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_479, 1); |
| 6330 | countingStream->write((uint64_t*)&cgen_var_479, 1 * 8); |
| 6331 | uint64_t cgen_var_480; |
| 6332 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_480, 1); |
| 6333 | countingStream->write((uint64_t*)&cgen_var_480, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6334 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6335 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6336 | uint64_t cgen_var_481 = (uint64_t)(uintptr_t)local_pCommandBuffers; |
| 6337 | countingStream->putBe64(cgen_var_481); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6338 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6339 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6340 | if (((commandBufferCount))) |
| 6341 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6342 | uint64_t* cgen_var_482; |
| 6343 | countingStream->alloc((void**)&cgen_var_482, ((commandBufferCount)) * 8); |
| 6344 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_482, ((commandBufferCount))); |
| 6345 | countingStream->write((uint64_t*)cgen_var_482, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6346 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6347 | } |
| 6348 | } |
| 6349 | uint32_t packetSize_vkFreeCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6350 | countingStream->rewind(); |
| 6351 | uint32_t opcode_vkFreeCommandBuffers = OP_vkFreeCommandBuffers; |
| 6352 | stream->write(&opcode_vkFreeCommandBuffers, sizeof(uint32_t)); |
| 6353 | stream->write(&packetSize_vkFreeCommandBuffers, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6354 | uint64_t cgen_var_483; |
| 6355 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_483, 1); |
| 6356 | stream->write((uint64_t*)&cgen_var_483, 1 * 8); |
| 6357 | uint64_t cgen_var_484; |
| 6358 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_484, 1); |
| 6359 | stream->write((uint64_t*)&cgen_var_484, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6360 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6361 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6362 | uint64_t cgen_var_485 = (uint64_t)(uintptr_t)local_pCommandBuffers; |
| 6363 | stream->putBe64(cgen_var_485); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6364 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6365 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6366 | if (((commandBufferCount))) |
| 6367 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6368 | uint64_t* cgen_var_486; |
| 6369 | stream->alloc((void**)&cgen_var_486, ((commandBufferCount)) * 8); |
| 6370 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_486, ((commandBufferCount))); |
| 6371 | stream->write((uint64_t*)cgen_var_486, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6372 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6373 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6374 | if (pCommandBuffers) |
| 6375 | { |
| 6376 | resources->destroyMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, ((commandBufferCount))); |
| 6377 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6378 | mImpl->log("finish vkFreeCommandBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6379 | } |
| 6380 | |
| 6381 | VkResult VkEncoder::vkBeginCommandBuffer( |
| 6382 | VkCommandBuffer commandBuffer, |
| 6383 | const VkCommandBufferBeginInfo* pBeginInfo) |
| 6384 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6385 | mImpl->log("start vkBeginCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6386 | auto stream = mImpl->stream(); |
| 6387 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6388 | auto resources = mImpl->resources(); |
| 6389 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6390 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6391 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6392 | VkCommandBufferBeginInfo* local_pBeginInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6393 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6394 | local_pBeginInfo = nullptr; |
| 6395 | if (pBeginInfo) |
| 6396 | { |
| 6397 | local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo)); |
| 6398 | deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 6399 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6400 | if (local_pBeginInfo) |
| 6401 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6402 | transform_tohost_VkCommandBufferBeginInfo(mImpl->resources(), (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6403 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6404 | countingStream->rewind(); |
| 6405 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6406 | uint64_t cgen_var_487; |
| 6407 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_487, 1); |
| 6408 | countingStream->write((uint64_t*)&cgen_var_487, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6409 | marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6410 | } |
| 6411 | uint32_t packetSize_vkBeginCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6412 | countingStream->rewind(); |
| 6413 | uint32_t opcode_vkBeginCommandBuffer = OP_vkBeginCommandBuffer; |
| 6414 | stream->write(&opcode_vkBeginCommandBuffer, sizeof(uint32_t)); |
| 6415 | stream->write(&packetSize_vkBeginCommandBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6416 | uint64_t cgen_var_488; |
| 6417 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_488, 1); |
| 6418 | stream->write((uint64_t*)&cgen_var_488, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6419 | marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6420 | VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0; |
| 6421 | stream->read(&vkBeginCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6422 | countingStream->clearPool(); |
| 6423 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6424 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6425 | mImpl->log("finish vkBeginCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6426 | return vkBeginCommandBuffer_VkResult_return; |
| 6427 | } |
| 6428 | |
| 6429 | VkResult VkEncoder::vkEndCommandBuffer( |
| 6430 | VkCommandBuffer commandBuffer) |
| 6431 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6432 | mImpl->log("start vkEndCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6433 | auto stream = mImpl->stream(); |
| 6434 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6435 | auto resources = mImpl->resources(); |
| 6436 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6437 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6438 | VkCommandBuffer local_commandBuffer; |
| 6439 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6440 | countingStream->rewind(); |
| 6441 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6442 | uint64_t cgen_var_489; |
| 6443 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_489, 1); |
| 6444 | countingStream->write((uint64_t*)&cgen_var_489, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6445 | } |
| 6446 | uint32_t packetSize_vkEndCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6447 | countingStream->rewind(); |
| 6448 | uint32_t opcode_vkEndCommandBuffer = OP_vkEndCommandBuffer; |
| 6449 | stream->write(&opcode_vkEndCommandBuffer, sizeof(uint32_t)); |
| 6450 | stream->write(&packetSize_vkEndCommandBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6451 | uint64_t cgen_var_490; |
| 6452 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_490, 1); |
| 6453 | stream->write((uint64_t*)&cgen_var_490, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6454 | VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0; |
| 6455 | stream->read(&vkEndCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6456 | countingStream->clearPool(); |
| 6457 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6458 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6459 | mImpl->log("finish vkEndCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6460 | return vkEndCommandBuffer_VkResult_return; |
| 6461 | } |
| 6462 | |
| 6463 | VkResult VkEncoder::vkResetCommandBuffer( |
| 6464 | VkCommandBuffer commandBuffer, |
| 6465 | VkCommandBufferResetFlags flags) |
| 6466 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6467 | mImpl->log("start vkResetCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6468 | auto stream = mImpl->stream(); |
| 6469 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6470 | auto resources = mImpl->resources(); |
| 6471 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6472 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6473 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6474 | VkCommandBufferResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6475 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6476 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6477 | countingStream->rewind(); |
| 6478 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6479 | uint64_t cgen_var_491; |
| 6480 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_491, 1); |
| 6481 | countingStream->write((uint64_t*)&cgen_var_491, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6482 | countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6483 | } |
| 6484 | uint32_t packetSize_vkResetCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6485 | countingStream->rewind(); |
| 6486 | uint32_t opcode_vkResetCommandBuffer = OP_vkResetCommandBuffer; |
| 6487 | stream->write(&opcode_vkResetCommandBuffer, sizeof(uint32_t)); |
| 6488 | stream->write(&packetSize_vkResetCommandBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6489 | uint64_t cgen_var_492; |
| 6490 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_492, 1); |
| 6491 | stream->write((uint64_t*)&cgen_var_492, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6492 | stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6493 | VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0; |
| 6494 | stream->read(&vkResetCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6495 | countingStream->clearPool(); |
| 6496 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6497 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6498 | mImpl->log("finish vkResetCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6499 | return vkResetCommandBuffer_VkResult_return; |
| 6500 | } |
| 6501 | |
| 6502 | void VkEncoder::vkCmdBindPipeline( |
| 6503 | VkCommandBuffer commandBuffer, |
| 6504 | VkPipelineBindPoint pipelineBindPoint, |
| 6505 | VkPipeline pipeline) |
| 6506 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6507 | mImpl->log("start vkCmdBindPipeline"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6508 | auto stream = mImpl->stream(); |
| 6509 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6510 | auto resources = mImpl->resources(); |
| 6511 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6512 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6513 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6514 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6515 | VkPipeline local_pipeline; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6516 | local_commandBuffer = commandBuffer; |
| 6517 | local_pipelineBindPoint = pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6518 | local_pipeline = pipeline; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6519 | countingStream->rewind(); |
| 6520 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6521 | uint64_t cgen_var_493; |
| 6522 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_493, 1); |
| 6523 | countingStream->write((uint64_t*)&cgen_var_493, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6524 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6525 | uint64_t cgen_var_494; |
| 6526 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_494, 1); |
| 6527 | countingStream->write((uint64_t*)&cgen_var_494, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6528 | } |
| 6529 | uint32_t packetSize_vkCmdBindPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6530 | countingStream->rewind(); |
| 6531 | uint32_t opcode_vkCmdBindPipeline = OP_vkCmdBindPipeline; |
| 6532 | stream->write(&opcode_vkCmdBindPipeline, sizeof(uint32_t)); |
| 6533 | stream->write(&packetSize_vkCmdBindPipeline, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6534 | uint64_t cgen_var_495; |
| 6535 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_495, 1); |
| 6536 | stream->write((uint64_t*)&cgen_var_495, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6537 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6538 | uint64_t cgen_var_496; |
| 6539 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_496, 1); |
| 6540 | stream->write((uint64_t*)&cgen_var_496, 1 * 8); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6541 | mImpl->log("finish vkCmdBindPipeline");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6542 | } |
| 6543 | |
| 6544 | void VkEncoder::vkCmdSetViewport( |
| 6545 | VkCommandBuffer commandBuffer, |
| 6546 | uint32_t firstViewport, |
| 6547 | uint32_t viewportCount, |
| 6548 | const VkViewport* pViewports) |
| 6549 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6550 | mImpl->log("start vkCmdSetViewport"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6551 | auto stream = mImpl->stream(); |
| 6552 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6553 | auto resources = mImpl->resources(); |
| 6554 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6555 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6556 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6557 | uint32_t local_firstViewport; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6558 | uint32_t local_viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6559 | VkViewport* local_pViewports; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6560 | local_commandBuffer = commandBuffer; |
| 6561 | local_firstViewport = firstViewport; |
| 6562 | local_viewportCount = viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6563 | local_pViewports = nullptr; |
| 6564 | if (pViewports) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6565 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6566 | local_pViewports = (VkViewport*)pool->alloc(((viewportCount)) * sizeof(const VkViewport)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6567 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 6568 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6569 | deepcopy_VkViewport(pool, pViewports + i, (VkViewport*)(local_pViewports + i)); |
| 6570 | } |
| 6571 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6572 | if (local_pViewports) |
| 6573 | { |
| 6574 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 6575 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6576 | transform_tohost_VkViewport(mImpl->resources(), (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6577 | } |
| 6578 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6579 | countingStream->rewind(); |
| 6580 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6581 | uint64_t cgen_var_497; |
| 6582 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_497, 1); |
| 6583 | countingStream->write((uint64_t*)&cgen_var_497, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6584 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 6585 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 6586 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 6587 | { |
| 6588 | marshal_VkViewport(countingStream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6589 | } |
| 6590 | } |
| 6591 | uint32_t packetSize_vkCmdSetViewport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6592 | countingStream->rewind(); |
| 6593 | uint32_t opcode_vkCmdSetViewport = OP_vkCmdSetViewport; |
| 6594 | stream->write(&opcode_vkCmdSetViewport, sizeof(uint32_t)); |
| 6595 | stream->write(&packetSize_vkCmdSetViewport, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6596 | uint64_t cgen_var_498; |
| 6597 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_498, 1); |
| 6598 | stream->write((uint64_t*)&cgen_var_498, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6599 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 6600 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6601 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 6602 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6603 | marshal_VkViewport(stream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6604 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6605 | mImpl->log("finish vkCmdSetViewport");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6606 | } |
| 6607 | |
| 6608 | void VkEncoder::vkCmdSetScissor( |
| 6609 | VkCommandBuffer commandBuffer, |
| 6610 | uint32_t firstScissor, |
| 6611 | uint32_t scissorCount, |
| 6612 | const VkRect2D* pScissors) |
| 6613 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6614 | mImpl->log("start vkCmdSetScissor"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6615 | auto stream = mImpl->stream(); |
| 6616 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6617 | auto resources = mImpl->resources(); |
| 6618 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6619 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6620 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6621 | uint32_t local_firstScissor; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6622 | uint32_t local_scissorCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6623 | VkRect2D* local_pScissors; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6624 | local_commandBuffer = commandBuffer; |
| 6625 | local_firstScissor = firstScissor; |
| 6626 | local_scissorCount = scissorCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6627 | local_pScissors = nullptr; |
| 6628 | if (pScissors) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6629 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6630 | local_pScissors = (VkRect2D*)pool->alloc(((scissorCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6631 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 6632 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6633 | deepcopy_VkRect2D(pool, pScissors + i, (VkRect2D*)(local_pScissors + i)); |
| 6634 | } |
| 6635 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6636 | if (local_pScissors) |
| 6637 | { |
| 6638 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 6639 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6640 | transform_tohost_VkRect2D(mImpl->resources(), (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6641 | } |
| 6642 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6643 | countingStream->rewind(); |
| 6644 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6645 | uint64_t cgen_var_499; |
| 6646 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_499, 1); |
| 6647 | countingStream->write((uint64_t*)&cgen_var_499, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6648 | countingStream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 6649 | countingStream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| 6650 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 6651 | { |
| 6652 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6653 | } |
| 6654 | } |
| 6655 | uint32_t packetSize_vkCmdSetScissor = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6656 | countingStream->rewind(); |
| 6657 | uint32_t opcode_vkCmdSetScissor = OP_vkCmdSetScissor; |
| 6658 | stream->write(&opcode_vkCmdSetScissor, sizeof(uint32_t)); |
| 6659 | stream->write(&packetSize_vkCmdSetScissor, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6660 | uint64_t cgen_var_500; |
| 6661 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_500, 1); |
| 6662 | stream->write((uint64_t*)&cgen_var_500, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6663 | stream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 6664 | stream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6665 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 6666 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6667 | marshal_VkRect2D(stream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6668 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6669 | mImpl->log("finish vkCmdSetScissor");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6670 | } |
| 6671 | |
| 6672 | void VkEncoder::vkCmdSetLineWidth( |
| 6673 | VkCommandBuffer commandBuffer, |
| 6674 | float lineWidth) |
| 6675 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6676 | mImpl->log("start vkCmdSetLineWidth"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6677 | auto stream = mImpl->stream(); |
| 6678 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6679 | auto resources = mImpl->resources(); |
| 6680 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6681 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6682 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6683 | float local_lineWidth; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6684 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6685 | local_lineWidth = lineWidth; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6686 | countingStream->rewind(); |
| 6687 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6688 | uint64_t cgen_var_501; |
| 6689 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_501, 1); |
| 6690 | countingStream->write((uint64_t*)&cgen_var_501, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6691 | countingStream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6692 | } |
| 6693 | uint32_t packetSize_vkCmdSetLineWidth = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6694 | countingStream->rewind(); |
| 6695 | uint32_t opcode_vkCmdSetLineWidth = OP_vkCmdSetLineWidth; |
| 6696 | stream->write(&opcode_vkCmdSetLineWidth, sizeof(uint32_t)); |
| 6697 | stream->write(&packetSize_vkCmdSetLineWidth, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6698 | uint64_t cgen_var_502; |
| 6699 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_502, 1); |
| 6700 | stream->write((uint64_t*)&cgen_var_502, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6701 | stream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6702 | mImpl->log("finish vkCmdSetLineWidth");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6703 | } |
| 6704 | |
| 6705 | void VkEncoder::vkCmdSetDepthBias( |
| 6706 | VkCommandBuffer commandBuffer, |
| 6707 | float depthBiasConstantFactor, |
| 6708 | float depthBiasClamp, |
| 6709 | float depthBiasSlopeFactor) |
| 6710 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6711 | mImpl->log("start vkCmdSetDepthBias"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6712 | auto stream = mImpl->stream(); |
| 6713 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6714 | auto resources = mImpl->resources(); |
| 6715 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6716 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6717 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6718 | float local_depthBiasConstantFactor; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6719 | float local_depthBiasClamp; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6720 | float local_depthBiasSlopeFactor; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6721 | local_commandBuffer = commandBuffer; |
| 6722 | local_depthBiasConstantFactor = depthBiasConstantFactor; |
| 6723 | local_depthBiasClamp = depthBiasClamp; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6724 | local_depthBiasSlopeFactor = depthBiasSlopeFactor; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6725 | countingStream->rewind(); |
| 6726 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6727 | uint64_t cgen_var_503; |
| 6728 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_503, 1); |
| 6729 | countingStream->write((uint64_t*)&cgen_var_503, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6730 | countingStream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 6731 | countingStream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 6732 | countingStream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6733 | } |
| 6734 | uint32_t packetSize_vkCmdSetDepthBias = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6735 | countingStream->rewind(); |
| 6736 | uint32_t opcode_vkCmdSetDepthBias = OP_vkCmdSetDepthBias; |
| 6737 | stream->write(&opcode_vkCmdSetDepthBias, sizeof(uint32_t)); |
| 6738 | stream->write(&packetSize_vkCmdSetDepthBias, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6739 | uint64_t cgen_var_504; |
| 6740 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_504, 1); |
| 6741 | stream->write((uint64_t*)&cgen_var_504, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6742 | stream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 6743 | stream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 6744 | stream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6745 | mImpl->log("finish vkCmdSetDepthBias");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6746 | } |
| 6747 | |
| 6748 | void VkEncoder::vkCmdSetBlendConstants( |
| 6749 | VkCommandBuffer commandBuffer, |
| 6750 | const float blendConstants) |
| 6751 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6752 | mImpl->log("start vkCmdSetBlendConstants"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6753 | auto stream = mImpl->stream(); |
| 6754 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6755 | auto resources = mImpl->resources(); |
| 6756 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6757 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6758 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6759 | float local_blendConstants[4]; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6760 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6761 | memcpy(&local_blendConstants, &blendConstants, 4 * sizeof(const float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6762 | countingStream->rewind(); |
| 6763 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6764 | uint64_t cgen_var_505; |
| 6765 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_505, 1); |
| 6766 | countingStream->write((uint64_t*)&cgen_var_505, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6767 | countingStream->write((float*)&local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6768 | } |
| 6769 | uint32_t packetSize_vkCmdSetBlendConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6770 | countingStream->rewind(); |
| 6771 | uint32_t opcode_vkCmdSetBlendConstants = OP_vkCmdSetBlendConstants; |
| 6772 | stream->write(&opcode_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| 6773 | stream->write(&packetSize_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6774 | uint64_t cgen_var_506; |
| 6775 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_506, 1); |
| 6776 | stream->write((uint64_t*)&cgen_var_506, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6777 | stream->write((float*)&local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6778 | mImpl->log("finish vkCmdSetBlendConstants");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6779 | } |
| 6780 | |
| 6781 | void VkEncoder::vkCmdSetDepthBounds( |
| 6782 | VkCommandBuffer commandBuffer, |
| 6783 | float minDepthBounds, |
| 6784 | float maxDepthBounds) |
| 6785 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6786 | mImpl->log("start vkCmdSetDepthBounds"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6787 | auto stream = mImpl->stream(); |
| 6788 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6789 | auto resources = mImpl->resources(); |
| 6790 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6791 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6792 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6793 | float local_minDepthBounds; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6794 | float local_maxDepthBounds; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6795 | local_commandBuffer = commandBuffer; |
| 6796 | local_minDepthBounds = minDepthBounds; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6797 | local_maxDepthBounds = maxDepthBounds; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6798 | countingStream->rewind(); |
| 6799 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6800 | uint64_t cgen_var_507; |
| 6801 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_507, 1); |
| 6802 | countingStream->write((uint64_t*)&cgen_var_507, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6803 | countingStream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 6804 | countingStream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6805 | } |
| 6806 | uint32_t packetSize_vkCmdSetDepthBounds = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6807 | countingStream->rewind(); |
| 6808 | uint32_t opcode_vkCmdSetDepthBounds = OP_vkCmdSetDepthBounds; |
| 6809 | stream->write(&opcode_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| 6810 | stream->write(&packetSize_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6811 | uint64_t cgen_var_508; |
| 6812 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_508, 1); |
| 6813 | stream->write((uint64_t*)&cgen_var_508, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6814 | stream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 6815 | stream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6816 | mImpl->log("finish vkCmdSetDepthBounds");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6817 | } |
| 6818 | |
| 6819 | void VkEncoder::vkCmdSetStencilCompareMask( |
| 6820 | VkCommandBuffer commandBuffer, |
| 6821 | VkStencilFaceFlags faceMask, |
| 6822 | uint32_t compareMask) |
| 6823 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6824 | mImpl->log("start vkCmdSetStencilCompareMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6825 | auto stream = mImpl->stream(); |
| 6826 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6827 | auto resources = mImpl->resources(); |
| 6828 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6829 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6830 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6831 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6832 | uint32_t local_compareMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6833 | local_commandBuffer = commandBuffer; |
| 6834 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6835 | local_compareMask = compareMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6836 | countingStream->rewind(); |
| 6837 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6838 | uint64_t cgen_var_509; |
| 6839 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_509, 1); |
| 6840 | countingStream->write((uint64_t*)&cgen_var_509, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6841 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6842 | countingStream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6843 | } |
| 6844 | uint32_t packetSize_vkCmdSetStencilCompareMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6845 | countingStream->rewind(); |
| 6846 | uint32_t opcode_vkCmdSetStencilCompareMask = OP_vkCmdSetStencilCompareMask; |
| 6847 | stream->write(&opcode_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| 6848 | stream->write(&packetSize_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6849 | uint64_t cgen_var_510; |
| 6850 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_510, 1); |
| 6851 | stream->write((uint64_t*)&cgen_var_510, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6852 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6853 | stream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6854 | mImpl->log("finish vkCmdSetStencilCompareMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6855 | } |
| 6856 | |
| 6857 | void VkEncoder::vkCmdSetStencilWriteMask( |
| 6858 | VkCommandBuffer commandBuffer, |
| 6859 | VkStencilFaceFlags faceMask, |
| 6860 | uint32_t writeMask) |
| 6861 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6862 | mImpl->log("start vkCmdSetStencilWriteMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6863 | auto stream = mImpl->stream(); |
| 6864 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6865 | auto resources = mImpl->resources(); |
| 6866 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6867 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6868 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6869 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6870 | uint32_t local_writeMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6871 | local_commandBuffer = commandBuffer; |
| 6872 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6873 | local_writeMask = writeMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6874 | countingStream->rewind(); |
| 6875 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6876 | uint64_t cgen_var_511; |
| 6877 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_511, 1); |
| 6878 | countingStream->write((uint64_t*)&cgen_var_511, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6879 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6880 | countingStream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6881 | } |
| 6882 | uint32_t packetSize_vkCmdSetStencilWriteMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6883 | countingStream->rewind(); |
| 6884 | uint32_t opcode_vkCmdSetStencilWriteMask = OP_vkCmdSetStencilWriteMask; |
| 6885 | stream->write(&opcode_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| 6886 | stream->write(&packetSize_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6887 | uint64_t cgen_var_512; |
| 6888 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_512, 1); |
| 6889 | stream->write((uint64_t*)&cgen_var_512, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6890 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6891 | stream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6892 | mImpl->log("finish vkCmdSetStencilWriteMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6893 | } |
| 6894 | |
| 6895 | void VkEncoder::vkCmdSetStencilReference( |
| 6896 | VkCommandBuffer commandBuffer, |
| 6897 | VkStencilFaceFlags faceMask, |
| 6898 | uint32_t reference) |
| 6899 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6900 | mImpl->log("start vkCmdSetStencilReference"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6901 | auto stream = mImpl->stream(); |
| 6902 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6903 | auto resources = mImpl->resources(); |
| 6904 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6905 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6906 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6907 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6908 | uint32_t local_reference; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6909 | local_commandBuffer = commandBuffer; |
| 6910 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6911 | local_reference = reference; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6912 | countingStream->rewind(); |
| 6913 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6914 | uint64_t cgen_var_513; |
| 6915 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_513, 1); |
| 6916 | countingStream->write((uint64_t*)&cgen_var_513, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6917 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6918 | countingStream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6919 | } |
| 6920 | uint32_t packetSize_vkCmdSetStencilReference = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6921 | countingStream->rewind(); |
| 6922 | uint32_t opcode_vkCmdSetStencilReference = OP_vkCmdSetStencilReference; |
| 6923 | stream->write(&opcode_vkCmdSetStencilReference, sizeof(uint32_t)); |
| 6924 | stream->write(&packetSize_vkCmdSetStencilReference, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6925 | uint64_t cgen_var_514; |
| 6926 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_514, 1); |
| 6927 | stream->write((uint64_t*)&cgen_var_514, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6928 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 6929 | stream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6930 | mImpl->log("finish vkCmdSetStencilReference");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6931 | } |
| 6932 | |
| 6933 | void VkEncoder::vkCmdBindDescriptorSets( |
| 6934 | VkCommandBuffer commandBuffer, |
| 6935 | VkPipelineBindPoint pipelineBindPoint, |
| 6936 | VkPipelineLayout layout, |
| 6937 | uint32_t firstSet, |
| 6938 | uint32_t descriptorSetCount, |
| 6939 | const VkDescriptorSet* pDescriptorSets, |
| 6940 | uint32_t dynamicOffsetCount, |
| 6941 | const uint32_t* pDynamicOffsets) |
| 6942 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6943 | mImpl->log("start vkCmdBindDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6944 | auto stream = mImpl->stream(); |
| 6945 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6946 | auto resources = mImpl->resources(); |
| 6947 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6948 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6949 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6950 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6951 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6952 | uint32_t local_firstSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6953 | uint32_t local_descriptorSetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6954 | VkDescriptorSet* local_pDescriptorSets; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6955 | uint32_t local_dynamicOffsetCount; |
| 6956 | uint32_t* local_pDynamicOffsets; |
| 6957 | local_commandBuffer = commandBuffer; |
| 6958 | local_pipelineBindPoint = pipelineBindPoint; |
| 6959 | local_layout = layout; |
| 6960 | local_firstSet = firstSet; |
| 6961 | local_descriptorSetCount = descriptorSetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6962 | local_pDescriptorSets = nullptr; |
| 6963 | if (pDescriptorSets) |
| 6964 | { |
| 6965 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 6966 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6967 | local_dynamicOffsetCount = dynamicOffsetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6968 | local_pDynamicOffsets = nullptr; |
| 6969 | if (pDynamicOffsets) |
| 6970 | { |
| 6971 | local_pDynamicOffsets = (uint32_t*)pool->dupArray(pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(const uint32_t)); |
| 6972 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6973 | countingStream->rewind(); |
| 6974 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6975 | uint64_t cgen_var_515; |
| 6976 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_515, 1); |
| 6977 | countingStream->write((uint64_t*)&cgen_var_515, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6978 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6979 | uint64_t cgen_var_516; |
| 6980 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_516, 1); |
| 6981 | countingStream->write((uint64_t*)&cgen_var_516, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6982 | countingStream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 6983 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6984 | if (((descriptorSetCount))) |
| 6985 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6986 | uint64_t* cgen_var_517; |
| 6987 | countingStream->alloc((void**)&cgen_var_517, ((descriptorSetCount)) * 8); |
| 6988 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_517, ((descriptorSetCount))); |
| 6989 | countingStream->write((uint64_t*)cgen_var_517, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6990 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6991 | countingStream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 6992 | countingStream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6993 | } |
| 6994 | uint32_t packetSize_vkCmdBindDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6995 | countingStream->rewind(); |
| 6996 | uint32_t opcode_vkCmdBindDescriptorSets = OP_vkCmdBindDescriptorSets; |
| 6997 | stream->write(&opcode_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| 6998 | stream->write(&packetSize_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 6999 | uint64_t cgen_var_518; |
| 7000 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_518, 1); |
| 7001 | stream->write((uint64_t*)&cgen_var_518, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7002 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7003 | uint64_t cgen_var_519; |
| 7004 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_519, 1); |
| 7005 | stream->write((uint64_t*)&cgen_var_519, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7006 | stream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 7007 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7008 | if (((descriptorSetCount))) |
| 7009 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7010 | uint64_t* cgen_var_520; |
| 7011 | stream->alloc((void**)&cgen_var_520, ((descriptorSetCount)) * 8); |
| 7012 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_520, ((descriptorSetCount))); |
| 7013 | stream->write((uint64_t*)cgen_var_520, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7014 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7015 | stream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 7016 | stream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7017 | mImpl->log("finish vkCmdBindDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7018 | } |
| 7019 | |
| 7020 | void VkEncoder::vkCmdBindIndexBuffer( |
| 7021 | VkCommandBuffer commandBuffer, |
| 7022 | VkBuffer buffer, |
| 7023 | VkDeviceSize offset, |
| 7024 | VkIndexType indexType) |
| 7025 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7026 | mImpl->log("start vkCmdBindIndexBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7027 | auto stream = mImpl->stream(); |
| 7028 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7029 | auto resources = mImpl->resources(); |
| 7030 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7031 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7032 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7033 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7034 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7035 | VkIndexType local_indexType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7036 | local_commandBuffer = commandBuffer; |
| 7037 | local_buffer = buffer; |
| 7038 | local_offset = offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7039 | local_indexType = indexType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7040 | countingStream->rewind(); |
| 7041 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7042 | uint64_t cgen_var_521; |
| 7043 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_521, 1); |
| 7044 | countingStream->write((uint64_t*)&cgen_var_521, 1 * 8); |
| 7045 | uint64_t cgen_var_522; |
| 7046 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_522, 1); |
| 7047 | countingStream->write((uint64_t*)&cgen_var_522, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7048 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7049 | countingStream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7050 | } |
| 7051 | uint32_t packetSize_vkCmdBindIndexBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7052 | countingStream->rewind(); |
| 7053 | uint32_t opcode_vkCmdBindIndexBuffer = OP_vkCmdBindIndexBuffer; |
| 7054 | stream->write(&opcode_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| 7055 | stream->write(&packetSize_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7056 | uint64_t cgen_var_523; |
| 7057 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_523, 1); |
| 7058 | stream->write((uint64_t*)&cgen_var_523, 1 * 8); |
| 7059 | uint64_t cgen_var_524; |
| 7060 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_524, 1); |
| 7061 | stream->write((uint64_t*)&cgen_var_524, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7062 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7063 | stream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7064 | mImpl->log("finish vkCmdBindIndexBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7065 | } |
| 7066 | |
| 7067 | void VkEncoder::vkCmdBindVertexBuffers( |
| 7068 | VkCommandBuffer commandBuffer, |
| 7069 | uint32_t firstBinding, |
| 7070 | uint32_t bindingCount, |
| 7071 | const VkBuffer* pBuffers, |
| 7072 | const VkDeviceSize* pOffsets) |
| 7073 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7074 | mImpl->log("start vkCmdBindVertexBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7075 | auto stream = mImpl->stream(); |
| 7076 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7077 | auto resources = mImpl->resources(); |
| 7078 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7079 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7080 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7081 | uint32_t local_firstBinding; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7082 | uint32_t local_bindingCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7083 | VkBuffer* local_pBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7084 | VkDeviceSize* local_pOffsets; |
| 7085 | local_commandBuffer = commandBuffer; |
| 7086 | local_firstBinding = firstBinding; |
| 7087 | local_bindingCount = bindingCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7088 | local_pBuffers = nullptr; |
| 7089 | if (pBuffers) |
| 7090 | { |
| 7091 | local_pBuffers = (VkBuffer*)pool->dupArray(pBuffers, ((bindingCount)) * sizeof(const VkBuffer)); |
| 7092 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7093 | local_pOffsets = nullptr; |
| 7094 | if (pOffsets) |
| 7095 | { |
| 7096 | local_pOffsets = (VkDeviceSize*)pool->dupArray(pOffsets, ((bindingCount)) * sizeof(const VkDeviceSize)); |
| 7097 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7098 | countingStream->rewind(); |
| 7099 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7100 | uint64_t cgen_var_525; |
| 7101 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_525, 1); |
| 7102 | countingStream->write((uint64_t*)&cgen_var_525, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7103 | countingStream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 7104 | countingStream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7105 | if (((bindingCount))) |
| 7106 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7107 | uint64_t* cgen_var_526; |
| 7108 | countingStream->alloc((void**)&cgen_var_526, ((bindingCount)) * 8); |
| 7109 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_526, ((bindingCount))); |
| 7110 | countingStream->write((uint64_t*)cgen_var_526, ((bindingCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7111 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7112 | countingStream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7113 | } |
| 7114 | uint32_t packetSize_vkCmdBindVertexBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7115 | countingStream->rewind(); |
| 7116 | uint32_t opcode_vkCmdBindVertexBuffers = OP_vkCmdBindVertexBuffers; |
| 7117 | stream->write(&opcode_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| 7118 | stream->write(&packetSize_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7119 | uint64_t cgen_var_527; |
| 7120 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_527, 1); |
| 7121 | stream->write((uint64_t*)&cgen_var_527, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7122 | stream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 7123 | stream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7124 | if (((bindingCount))) |
| 7125 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7126 | uint64_t* cgen_var_528; |
| 7127 | stream->alloc((void**)&cgen_var_528, ((bindingCount)) * 8); |
| 7128 | stream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_528, ((bindingCount))); |
| 7129 | stream->write((uint64_t*)cgen_var_528, ((bindingCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7130 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7131 | stream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7132 | mImpl->log("finish vkCmdBindVertexBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7133 | } |
| 7134 | |
| 7135 | void VkEncoder::vkCmdDraw( |
| 7136 | VkCommandBuffer commandBuffer, |
| 7137 | uint32_t vertexCount, |
| 7138 | uint32_t instanceCount, |
| 7139 | uint32_t firstVertex, |
| 7140 | uint32_t firstInstance) |
| 7141 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7142 | mImpl->log("start vkCmdDraw"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7143 | auto stream = mImpl->stream(); |
| 7144 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7145 | auto resources = mImpl->resources(); |
| 7146 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7147 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7148 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7149 | uint32_t local_vertexCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7150 | uint32_t local_instanceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7151 | uint32_t local_firstVertex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7152 | uint32_t local_firstInstance; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7153 | local_commandBuffer = commandBuffer; |
| 7154 | local_vertexCount = vertexCount; |
| 7155 | local_instanceCount = instanceCount; |
| 7156 | local_firstVertex = firstVertex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7157 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7158 | countingStream->rewind(); |
| 7159 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7160 | uint64_t cgen_var_529; |
| 7161 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_529, 1); |
| 7162 | countingStream->write((uint64_t*)&cgen_var_529, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7163 | countingStream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 7164 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7165 | countingStream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 7166 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7167 | } |
| 7168 | uint32_t packetSize_vkCmdDraw = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7169 | countingStream->rewind(); |
| 7170 | uint32_t opcode_vkCmdDraw = OP_vkCmdDraw; |
| 7171 | stream->write(&opcode_vkCmdDraw, sizeof(uint32_t)); |
| 7172 | stream->write(&packetSize_vkCmdDraw, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7173 | uint64_t cgen_var_530; |
| 7174 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_530, 1); |
| 7175 | stream->write((uint64_t*)&cgen_var_530, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7176 | stream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 7177 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7178 | stream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 7179 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7180 | mImpl->log("finish vkCmdDraw");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7181 | } |
| 7182 | |
| 7183 | void VkEncoder::vkCmdDrawIndexed( |
| 7184 | VkCommandBuffer commandBuffer, |
| 7185 | uint32_t indexCount, |
| 7186 | uint32_t instanceCount, |
| 7187 | uint32_t firstIndex, |
| 7188 | int32_t vertexOffset, |
| 7189 | uint32_t firstInstance) |
| 7190 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7191 | mImpl->log("start vkCmdDrawIndexed"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7192 | auto stream = mImpl->stream(); |
| 7193 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7194 | auto resources = mImpl->resources(); |
| 7195 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7196 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7197 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7198 | uint32_t local_indexCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7199 | uint32_t local_instanceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7200 | uint32_t local_firstIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7201 | int32_t local_vertexOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7202 | uint32_t local_firstInstance; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7203 | local_commandBuffer = commandBuffer; |
| 7204 | local_indexCount = indexCount; |
| 7205 | local_instanceCount = instanceCount; |
| 7206 | local_firstIndex = firstIndex; |
| 7207 | local_vertexOffset = vertexOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7208 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7209 | countingStream->rewind(); |
| 7210 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7211 | uint64_t cgen_var_531; |
| 7212 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_531, 1); |
| 7213 | countingStream->write((uint64_t*)&cgen_var_531, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7214 | countingStream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 7215 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7216 | countingStream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 7217 | countingStream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 7218 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7219 | } |
| 7220 | uint32_t packetSize_vkCmdDrawIndexed = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7221 | countingStream->rewind(); |
| 7222 | uint32_t opcode_vkCmdDrawIndexed = OP_vkCmdDrawIndexed; |
| 7223 | stream->write(&opcode_vkCmdDrawIndexed, sizeof(uint32_t)); |
| 7224 | stream->write(&packetSize_vkCmdDrawIndexed, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7225 | uint64_t cgen_var_532; |
| 7226 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_532, 1); |
| 7227 | stream->write((uint64_t*)&cgen_var_532, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7228 | stream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 7229 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7230 | stream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 7231 | stream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 7232 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7233 | mImpl->log("finish vkCmdDrawIndexed");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7234 | } |
| 7235 | |
| 7236 | void VkEncoder::vkCmdDrawIndirect( |
| 7237 | VkCommandBuffer commandBuffer, |
| 7238 | VkBuffer buffer, |
| 7239 | VkDeviceSize offset, |
| 7240 | uint32_t drawCount, |
| 7241 | uint32_t stride) |
| 7242 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7243 | mImpl->log("start vkCmdDrawIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7244 | auto stream = mImpl->stream(); |
| 7245 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7246 | auto resources = mImpl->resources(); |
| 7247 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7248 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7249 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7250 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7251 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7252 | uint32_t local_drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7253 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7254 | local_commandBuffer = commandBuffer; |
| 7255 | local_buffer = buffer; |
| 7256 | local_offset = offset; |
| 7257 | local_drawCount = drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7258 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7259 | countingStream->rewind(); |
| 7260 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7261 | uint64_t cgen_var_533; |
| 7262 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_533, 1); |
| 7263 | countingStream->write((uint64_t*)&cgen_var_533, 1 * 8); |
| 7264 | uint64_t cgen_var_534; |
| 7265 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_534, 1); |
| 7266 | countingStream->write((uint64_t*)&cgen_var_534, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7267 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7268 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7269 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7270 | } |
| 7271 | uint32_t packetSize_vkCmdDrawIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7272 | countingStream->rewind(); |
| 7273 | uint32_t opcode_vkCmdDrawIndirect = OP_vkCmdDrawIndirect; |
| 7274 | stream->write(&opcode_vkCmdDrawIndirect, sizeof(uint32_t)); |
| 7275 | stream->write(&packetSize_vkCmdDrawIndirect, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7276 | uint64_t cgen_var_535; |
| 7277 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_535, 1); |
| 7278 | stream->write((uint64_t*)&cgen_var_535, 1 * 8); |
| 7279 | uint64_t cgen_var_536; |
| 7280 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_536, 1); |
| 7281 | stream->write((uint64_t*)&cgen_var_536, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7282 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7283 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7284 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7285 | mImpl->log("finish vkCmdDrawIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7286 | } |
| 7287 | |
| 7288 | void VkEncoder::vkCmdDrawIndexedIndirect( |
| 7289 | VkCommandBuffer commandBuffer, |
| 7290 | VkBuffer buffer, |
| 7291 | VkDeviceSize offset, |
| 7292 | uint32_t drawCount, |
| 7293 | uint32_t stride) |
| 7294 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7295 | mImpl->log("start vkCmdDrawIndexedIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7296 | auto stream = mImpl->stream(); |
| 7297 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7298 | auto resources = mImpl->resources(); |
| 7299 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7300 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7301 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7302 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7303 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7304 | uint32_t local_drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7305 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7306 | local_commandBuffer = commandBuffer; |
| 7307 | local_buffer = buffer; |
| 7308 | local_offset = offset; |
| 7309 | local_drawCount = drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7310 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7311 | countingStream->rewind(); |
| 7312 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7313 | uint64_t cgen_var_537; |
| 7314 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_537, 1); |
| 7315 | countingStream->write((uint64_t*)&cgen_var_537, 1 * 8); |
| 7316 | uint64_t cgen_var_538; |
| 7317 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_538, 1); |
| 7318 | countingStream->write((uint64_t*)&cgen_var_538, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7319 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7320 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7321 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7322 | } |
| 7323 | uint32_t packetSize_vkCmdDrawIndexedIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7324 | countingStream->rewind(); |
| 7325 | uint32_t opcode_vkCmdDrawIndexedIndirect = OP_vkCmdDrawIndexedIndirect; |
| 7326 | stream->write(&opcode_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| 7327 | stream->write(&packetSize_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7328 | uint64_t cgen_var_539; |
| 7329 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_539, 1); |
| 7330 | stream->write((uint64_t*)&cgen_var_539, 1 * 8); |
| 7331 | uint64_t cgen_var_540; |
| 7332 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_540, 1); |
| 7333 | stream->write((uint64_t*)&cgen_var_540, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7334 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7335 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7336 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7337 | mImpl->log("finish vkCmdDrawIndexedIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7338 | } |
| 7339 | |
| 7340 | void VkEncoder::vkCmdDispatch( |
| 7341 | VkCommandBuffer commandBuffer, |
| 7342 | uint32_t groupCountX, |
| 7343 | uint32_t groupCountY, |
| 7344 | uint32_t groupCountZ) |
| 7345 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7346 | mImpl->log("start vkCmdDispatch"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7347 | auto stream = mImpl->stream(); |
| 7348 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7349 | auto resources = mImpl->resources(); |
| 7350 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7351 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7352 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7353 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7354 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7355 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7356 | local_commandBuffer = commandBuffer; |
| 7357 | local_groupCountX = groupCountX; |
| 7358 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7359 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7360 | countingStream->rewind(); |
| 7361 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7362 | uint64_t cgen_var_541; |
| 7363 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_541, 1); |
| 7364 | countingStream->write((uint64_t*)&cgen_var_541, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7365 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 7366 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 7367 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7368 | } |
| 7369 | uint32_t packetSize_vkCmdDispatch = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7370 | countingStream->rewind(); |
| 7371 | uint32_t opcode_vkCmdDispatch = OP_vkCmdDispatch; |
| 7372 | stream->write(&opcode_vkCmdDispatch, sizeof(uint32_t)); |
| 7373 | stream->write(&packetSize_vkCmdDispatch, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7374 | uint64_t cgen_var_542; |
| 7375 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_542, 1); |
| 7376 | stream->write((uint64_t*)&cgen_var_542, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7377 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 7378 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 7379 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7380 | mImpl->log("finish vkCmdDispatch");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7381 | } |
| 7382 | |
| 7383 | void VkEncoder::vkCmdDispatchIndirect( |
| 7384 | VkCommandBuffer commandBuffer, |
| 7385 | VkBuffer buffer, |
| 7386 | VkDeviceSize offset) |
| 7387 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7388 | mImpl->log("start vkCmdDispatchIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7389 | auto stream = mImpl->stream(); |
| 7390 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7391 | auto resources = mImpl->resources(); |
| 7392 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7393 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7394 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7395 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7396 | VkDeviceSize local_offset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7397 | local_commandBuffer = commandBuffer; |
| 7398 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7399 | local_offset = offset; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7400 | countingStream->rewind(); |
| 7401 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7402 | uint64_t cgen_var_543; |
| 7403 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_543, 1); |
| 7404 | countingStream->write((uint64_t*)&cgen_var_543, 1 * 8); |
| 7405 | uint64_t cgen_var_544; |
| 7406 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_544, 1); |
| 7407 | countingStream->write((uint64_t*)&cgen_var_544, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7408 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7409 | } |
| 7410 | uint32_t packetSize_vkCmdDispatchIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7411 | countingStream->rewind(); |
| 7412 | uint32_t opcode_vkCmdDispatchIndirect = OP_vkCmdDispatchIndirect; |
| 7413 | stream->write(&opcode_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| 7414 | stream->write(&packetSize_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7415 | uint64_t cgen_var_545; |
| 7416 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_545, 1); |
| 7417 | stream->write((uint64_t*)&cgen_var_545, 1 * 8); |
| 7418 | uint64_t cgen_var_546; |
| 7419 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_546, 1); |
| 7420 | stream->write((uint64_t*)&cgen_var_546, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7421 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7422 | mImpl->log("finish vkCmdDispatchIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7423 | } |
| 7424 | |
| 7425 | void VkEncoder::vkCmdCopyBuffer( |
| 7426 | VkCommandBuffer commandBuffer, |
| 7427 | VkBuffer srcBuffer, |
| 7428 | VkBuffer dstBuffer, |
| 7429 | uint32_t regionCount, |
| 7430 | const VkBufferCopy* pRegions) |
| 7431 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7432 | mImpl->log("start vkCmdCopyBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7433 | auto stream = mImpl->stream(); |
| 7434 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7435 | auto resources = mImpl->resources(); |
| 7436 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7437 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7438 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7439 | VkBuffer local_srcBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7440 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7441 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7442 | VkBufferCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7443 | local_commandBuffer = commandBuffer; |
| 7444 | local_srcBuffer = srcBuffer; |
| 7445 | local_dstBuffer = dstBuffer; |
| 7446 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7447 | local_pRegions = nullptr; |
| 7448 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7449 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7450 | local_pRegions = (VkBufferCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7451 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7452 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7453 | deepcopy_VkBufferCopy(pool, pRegions + i, (VkBufferCopy*)(local_pRegions + i)); |
| 7454 | } |
| 7455 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7456 | if (local_pRegions) |
| 7457 | { |
| 7458 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7459 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7460 | transform_tohost_VkBufferCopy(mImpl->resources(), (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7461 | } |
| 7462 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7463 | countingStream->rewind(); |
| 7464 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7465 | uint64_t cgen_var_547; |
| 7466 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_547, 1); |
| 7467 | countingStream->write((uint64_t*)&cgen_var_547, 1 * 8); |
| 7468 | uint64_t cgen_var_548; |
| 7469 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_548, 1); |
| 7470 | countingStream->write((uint64_t*)&cgen_var_548, 1 * 8); |
| 7471 | uint64_t cgen_var_549; |
| 7472 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_549, 1); |
| 7473 | countingStream->write((uint64_t*)&cgen_var_549, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7474 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 7475 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7476 | { |
| 7477 | marshal_VkBufferCopy(countingStream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7478 | } |
| 7479 | } |
| 7480 | uint32_t packetSize_vkCmdCopyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7481 | countingStream->rewind(); |
| 7482 | uint32_t opcode_vkCmdCopyBuffer = OP_vkCmdCopyBuffer; |
| 7483 | stream->write(&opcode_vkCmdCopyBuffer, sizeof(uint32_t)); |
| 7484 | stream->write(&packetSize_vkCmdCopyBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7485 | uint64_t cgen_var_550; |
| 7486 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_550, 1); |
| 7487 | stream->write((uint64_t*)&cgen_var_550, 1 * 8); |
| 7488 | uint64_t cgen_var_551; |
| 7489 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_551, 1); |
| 7490 | stream->write((uint64_t*)&cgen_var_551, 1 * 8); |
| 7491 | uint64_t cgen_var_552; |
| 7492 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_552, 1); |
| 7493 | stream->write((uint64_t*)&cgen_var_552, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7494 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7495 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7496 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7497 | marshal_VkBufferCopy(stream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7498 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7499 | mImpl->log("finish vkCmdCopyBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7500 | } |
| 7501 | |
| 7502 | void VkEncoder::vkCmdCopyImage( |
| 7503 | VkCommandBuffer commandBuffer, |
| 7504 | VkImage srcImage, |
| 7505 | VkImageLayout srcImageLayout, |
| 7506 | VkImage dstImage, |
| 7507 | VkImageLayout dstImageLayout, |
| 7508 | uint32_t regionCount, |
| 7509 | const VkImageCopy* pRegions) |
| 7510 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7511 | mImpl->log("start vkCmdCopyImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7512 | auto stream = mImpl->stream(); |
| 7513 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7514 | auto resources = mImpl->resources(); |
| 7515 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7516 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7517 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7518 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7519 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7520 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7521 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7522 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7523 | VkImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7524 | local_commandBuffer = commandBuffer; |
| 7525 | local_srcImage = srcImage; |
| 7526 | local_srcImageLayout = srcImageLayout; |
| 7527 | local_dstImage = dstImage; |
| 7528 | local_dstImageLayout = dstImageLayout; |
| 7529 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7530 | local_pRegions = nullptr; |
| 7531 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7532 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7533 | local_pRegions = (VkImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7534 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7535 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7536 | deepcopy_VkImageCopy(pool, pRegions + i, (VkImageCopy*)(local_pRegions + i)); |
| 7537 | } |
| 7538 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7539 | if (local_pRegions) |
| 7540 | { |
| 7541 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7542 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7543 | transform_tohost_VkImageCopy(mImpl->resources(), (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7544 | } |
| 7545 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7546 | countingStream->rewind(); |
| 7547 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7548 | uint64_t cgen_var_553; |
| 7549 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_553, 1); |
| 7550 | countingStream->write((uint64_t*)&cgen_var_553, 1 * 8); |
| 7551 | uint64_t cgen_var_554; |
| 7552 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_554, 1); |
| 7553 | countingStream->write((uint64_t*)&cgen_var_554, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 7554 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7555 | uint64_t cgen_var_555; |
| 7556 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_555, 1); |
| 7557 | countingStream->write((uint64_t*)&cgen_var_555, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7558 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7559 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 7560 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7561 | { |
| 7562 | marshal_VkImageCopy(countingStream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7563 | } |
| 7564 | } |
| 7565 | uint32_t packetSize_vkCmdCopyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7566 | countingStream->rewind(); |
| 7567 | uint32_t opcode_vkCmdCopyImage = OP_vkCmdCopyImage; |
| 7568 | stream->write(&opcode_vkCmdCopyImage, sizeof(uint32_t)); |
| 7569 | stream->write(&packetSize_vkCmdCopyImage, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7570 | uint64_t cgen_var_556; |
| 7571 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_556, 1); |
| 7572 | stream->write((uint64_t*)&cgen_var_556, 1 * 8); |
| 7573 | uint64_t cgen_var_557; |
| 7574 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_557, 1); |
| 7575 | stream->write((uint64_t*)&cgen_var_557, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 7576 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7577 | uint64_t cgen_var_558; |
| 7578 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_558, 1); |
| 7579 | stream->write((uint64_t*)&cgen_var_558, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7580 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7581 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7582 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7583 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7584 | marshal_VkImageCopy(stream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7585 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7586 | mImpl->log("finish vkCmdCopyImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7587 | } |
| 7588 | |
| 7589 | void VkEncoder::vkCmdBlitImage( |
| 7590 | VkCommandBuffer commandBuffer, |
| 7591 | VkImage srcImage, |
| 7592 | VkImageLayout srcImageLayout, |
| 7593 | VkImage dstImage, |
| 7594 | VkImageLayout dstImageLayout, |
| 7595 | uint32_t regionCount, |
| 7596 | const VkImageBlit* pRegions, |
| 7597 | VkFilter filter) |
| 7598 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7599 | mImpl->log("start vkCmdBlitImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7600 | auto stream = mImpl->stream(); |
| 7601 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7602 | auto resources = mImpl->resources(); |
| 7603 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7604 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7605 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7606 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7607 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7608 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7609 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7610 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7611 | VkImageBlit* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7612 | VkFilter local_filter; |
| 7613 | local_commandBuffer = commandBuffer; |
| 7614 | local_srcImage = srcImage; |
| 7615 | local_srcImageLayout = srcImageLayout; |
| 7616 | local_dstImage = dstImage; |
| 7617 | local_dstImageLayout = dstImageLayout; |
| 7618 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7619 | local_pRegions = nullptr; |
| 7620 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7621 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7622 | local_pRegions = (VkImageBlit*)pool->alloc(((regionCount)) * sizeof(const VkImageBlit)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7623 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7624 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7625 | deepcopy_VkImageBlit(pool, pRegions + i, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7626 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7627 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7628 | local_filter = filter; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7629 | if (local_pRegions) |
| 7630 | { |
| 7631 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7632 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7633 | transform_tohost_VkImageBlit(mImpl->resources(), (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7634 | } |
| 7635 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7636 | countingStream->rewind(); |
| 7637 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7638 | uint64_t cgen_var_559; |
| 7639 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_559, 1); |
| 7640 | countingStream->write((uint64_t*)&cgen_var_559, 1 * 8); |
| 7641 | uint64_t cgen_var_560; |
| 7642 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_560, 1); |
| 7643 | countingStream->write((uint64_t*)&cgen_var_560, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 7644 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7645 | uint64_t cgen_var_561; |
| 7646 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_561, 1); |
| 7647 | countingStream->write((uint64_t*)&cgen_var_561, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7648 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7649 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 7650 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7651 | { |
| 7652 | marshal_VkImageBlit(countingStream, (VkImageBlit*)(local_pRegions + i)); |
| 7653 | } |
| 7654 | countingStream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7655 | } |
| 7656 | uint32_t packetSize_vkCmdBlitImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7657 | countingStream->rewind(); |
| 7658 | uint32_t opcode_vkCmdBlitImage = OP_vkCmdBlitImage; |
| 7659 | stream->write(&opcode_vkCmdBlitImage, sizeof(uint32_t)); |
| 7660 | stream->write(&packetSize_vkCmdBlitImage, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7661 | uint64_t cgen_var_562; |
| 7662 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_562, 1); |
| 7663 | stream->write((uint64_t*)&cgen_var_562, 1 * 8); |
| 7664 | uint64_t cgen_var_563; |
| 7665 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_563, 1); |
| 7666 | stream->write((uint64_t*)&cgen_var_563, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 7667 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7668 | uint64_t cgen_var_564; |
| 7669 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_564, 1); |
| 7670 | stream->write((uint64_t*)&cgen_var_564, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7671 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7672 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7673 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7674 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7675 | marshal_VkImageBlit(stream, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7676 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7677 | stream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7678 | mImpl->log("finish vkCmdBlitImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7679 | } |
| 7680 | |
| 7681 | void VkEncoder::vkCmdCopyBufferToImage( |
| 7682 | VkCommandBuffer commandBuffer, |
| 7683 | VkBuffer srcBuffer, |
| 7684 | VkImage dstImage, |
| 7685 | VkImageLayout dstImageLayout, |
| 7686 | uint32_t regionCount, |
| 7687 | const VkBufferImageCopy* pRegions) |
| 7688 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7689 | mImpl->log("start vkCmdCopyBufferToImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7690 | auto stream = mImpl->stream(); |
| 7691 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7692 | auto resources = mImpl->resources(); |
| 7693 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7694 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7695 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7696 | VkBuffer local_srcBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7697 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7698 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7699 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7700 | VkBufferImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7701 | local_commandBuffer = commandBuffer; |
| 7702 | local_srcBuffer = srcBuffer; |
| 7703 | local_dstImage = dstImage; |
| 7704 | local_dstImageLayout = dstImageLayout; |
| 7705 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7706 | local_pRegions = nullptr; |
| 7707 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7708 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7709 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7710 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7711 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7712 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 7713 | } |
| 7714 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7715 | if (local_pRegions) |
| 7716 | { |
| 7717 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7718 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7719 | transform_tohost_VkBufferImageCopy(mImpl->resources(), (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7720 | } |
| 7721 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7722 | countingStream->rewind(); |
| 7723 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7724 | uint64_t cgen_var_565; |
| 7725 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_565, 1); |
| 7726 | countingStream->write((uint64_t*)&cgen_var_565, 1 * 8); |
| 7727 | uint64_t cgen_var_566; |
| 7728 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_566, 1); |
| 7729 | countingStream->write((uint64_t*)&cgen_var_566, 1 * 8); |
| 7730 | uint64_t cgen_var_567; |
| 7731 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_567, 1); |
| 7732 | countingStream->write((uint64_t*)&cgen_var_567, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7733 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7734 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 7735 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7736 | { |
| 7737 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7738 | } |
| 7739 | } |
| 7740 | uint32_t packetSize_vkCmdCopyBufferToImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7741 | countingStream->rewind(); |
| 7742 | uint32_t opcode_vkCmdCopyBufferToImage = OP_vkCmdCopyBufferToImage; |
| 7743 | stream->write(&opcode_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| 7744 | stream->write(&packetSize_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7745 | uint64_t cgen_var_568; |
| 7746 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_568, 1); |
| 7747 | stream->write((uint64_t*)&cgen_var_568, 1 * 8); |
| 7748 | uint64_t cgen_var_569; |
| 7749 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_569, 1); |
| 7750 | stream->write((uint64_t*)&cgen_var_569, 1 * 8); |
| 7751 | uint64_t cgen_var_570; |
| 7752 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_570, 1); |
| 7753 | stream->write((uint64_t*)&cgen_var_570, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7754 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7755 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7756 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7757 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7758 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7759 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7760 | mImpl->log("finish vkCmdCopyBufferToImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7761 | } |
| 7762 | |
| 7763 | void VkEncoder::vkCmdCopyImageToBuffer( |
| 7764 | VkCommandBuffer commandBuffer, |
| 7765 | VkImage srcImage, |
| 7766 | VkImageLayout srcImageLayout, |
| 7767 | VkBuffer dstBuffer, |
| 7768 | uint32_t regionCount, |
| 7769 | const VkBufferImageCopy* pRegions) |
| 7770 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7771 | mImpl->log("start vkCmdCopyImageToBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7772 | auto stream = mImpl->stream(); |
| 7773 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7774 | auto resources = mImpl->resources(); |
| 7775 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7776 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7777 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7778 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7779 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7780 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7781 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7782 | VkBufferImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7783 | local_commandBuffer = commandBuffer; |
| 7784 | local_srcImage = srcImage; |
| 7785 | local_srcImageLayout = srcImageLayout; |
| 7786 | local_dstBuffer = dstBuffer; |
| 7787 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7788 | local_pRegions = nullptr; |
| 7789 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7790 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7791 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7792 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7793 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7794 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 7795 | } |
| 7796 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7797 | if (local_pRegions) |
| 7798 | { |
| 7799 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7800 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7801 | transform_tohost_VkBufferImageCopy(mImpl->resources(), (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7802 | } |
| 7803 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7804 | countingStream->rewind(); |
| 7805 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7806 | uint64_t cgen_var_571; |
| 7807 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_571, 1); |
| 7808 | countingStream->write((uint64_t*)&cgen_var_571, 1 * 8); |
| 7809 | uint64_t cgen_var_572; |
| 7810 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_572, 1); |
| 7811 | countingStream->write((uint64_t*)&cgen_var_572, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 7812 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7813 | uint64_t cgen_var_573; |
| 7814 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_573, 1); |
| 7815 | countingStream->write((uint64_t*)&cgen_var_573, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7816 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 7817 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7818 | { |
| 7819 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7820 | } |
| 7821 | } |
| 7822 | uint32_t packetSize_vkCmdCopyImageToBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7823 | countingStream->rewind(); |
| 7824 | uint32_t opcode_vkCmdCopyImageToBuffer = OP_vkCmdCopyImageToBuffer; |
| 7825 | stream->write(&opcode_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| 7826 | stream->write(&packetSize_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7827 | uint64_t cgen_var_574; |
| 7828 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_574, 1); |
| 7829 | stream->write((uint64_t*)&cgen_var_574, 1 * 8); |
| 7830 | uint64_t cgen_var_575; |
| 7831 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_575, 1); |
| 7832 | stream->write((uint64_t*)&cgen_var_575, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 7833 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7834 | uint64_t cgen_var_576; |
| 7835 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_576, 1); |
| 7836 | stream->write((uint64_t*)&cgen_var_576, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7837 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7838 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7839 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7840 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7841 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7842 | mImpl->log("finish vkCmdCopyImageToBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7843 | } |
| 7844 | |
| 7845 | void VkEncoder::vkCmdUpdateBuffer( |
| 7846 | VkCommandBuffer commandBuffer, |
| 7847 | VkBuffer dstBuffer, |
| 7848 | VkDeviceSize dstOffset, |
| 7849 | VkDeviceSize dataSize, |
| 7850 | const void* pData) |
| 7851 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7852 | mImpl->log("start vkCmdUpdateBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7853 | auto stream = mImpl->stream(); |
| 7854 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7855 | auto resources = mImpl->resources(); |
| 7856 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7857 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7858 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7859 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7860 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7861 | VkDeviceSize local_dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7862 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7863 | local_commandBuffer = commandBuffer; |
| 7864 | local_dstBuffer = dstBuffer; |
| 7865 | local_dstOffset = dstOffset; |
| 7866 | local_dataSize = dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7867 | local_pData = nullptr; |
| 7868 | if (pData) |
| 7869 | { |
| 7870 | local_pData = (void*)pool->dupArray(pData, ((dataSize)) * sizeof(const uint8_t)); |
| 7871 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7872 | countingStream->rewind(); |
| 7873 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7874 | uint64_t cgen_var_577; |
| 7875 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_577, 1); |
| 7876 | countingStream->write((uint64_t*)&cgen_var_577, 1 * 8); |
| 7877 | uint64_t cgen_var_578; |
| 7878 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_578, 1); |
| 7879 | countingStream->write((uint64_t*)&cgen_var_578, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7880 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 7881 | countingStream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 7882 | countingStream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7883 | } |
| 7884 | uint32_t packetSize_vkCmdUpdateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7885 | countingStream->rewind(); |
| 7886 | uint32_t opcode_vkCmdUpdateBuffer = OP_vkCmdUpdateBuffer; |
| 7887 | stream->write(&opcode_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| 7888 | stream->write(&packetSize_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7889 | uint64_t cgen_var_579; |
| 7890 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_579, 1); |
| 7891 | stream->write((uint64_t*)&cgen_var_579, 1 * 8); |
| 7892 | uint64_t cgen_var_580; |
| 7893 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_580, 1); |
| 7894 | stream->write((uint64_t*)&cgen_var_580, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7895 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 7896 | stream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 7897 | stream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7898 | mImpl->log("finish vkCmdUpdateBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7899 | } |
| 7900 | |
| 7901 | void VkEncoder::vkCmdFillBuffer( |
| 7902 | VkCommandBuffer commandBuffer, |
| 7903 | VkBuffer dstBuffer, |
| 7904 | VkDeviceSize dstOffset, |
| 7905 | VkDeviceSize size, |
| 7906 | uint32_t data) |
| 7907 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7908 | mImpl->log("start vkCmdFillBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7909 | auto stream = mImpl->stream(); |
| 7910 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7911 | auto resources = mImpl->resources(); |
| 7912 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7913 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7914 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7915 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7916 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7917 | VkDeviceSize local_size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7918 | uint32_t local_data; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7919 | local_commandBuffer = commandBuffer; |
| 7920 | local_dstBuffer = dstBuffer; |
| 7921 | local_dstOffset = dstOffset; |
| 7922 | local_size = size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7923 | local_data = data; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7924 | countingStream->rewind(); |
| 7925 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7926 | uint64_t cgen_var_581; |
| 7927 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_581, 1); |
| 7928 | countingStream->write((uint64_t*)&cgen_var_581, 1 * 8); |
| 7929 | uint64_t cgen_var_582; |
| 7930 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_582, 1); |
| 7931 | countingStream->write((uint64_t*)&cgen_var_582, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7932 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 7933 | countingStream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 7934 | countingStream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7935 | } |
| 7936 | uint32_t packetSize_vkCmdFillBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7937 | countingStream->rewind(); |
| 7938 | uint32_t opcode_vkCmdFillBuffer = OP_vkCmdFillBuffer; |
| 7939 | stream->write(&opcode_vkCmdFillBuffer, sizeof(uint32_t)); |
| 7940 | stream->write(&packetSize_vkCmdFillBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 7941 | uint64_t cgen_var_583; |
| 7942 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_583, 1); |
| 7943 | stream->write((uint64_t*)&cgen_var_583, 1 * 8); |
| 7944 | uint64_t cgen_var_584; |
| 7945 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_584, 1); |
| 7946 | stream->write((uint64_t*)&cgen_var_584, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7947 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 7948 | stream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 7949 | stream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7950 | mImpl->log("finish vkCmdFillBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7951 | } |
| 7952 | |
| 7953 | void VkEncoder::vkCmdClearColorImage( |
| 7954 | VkCommandBuffer commandBuffer, |
| 7955 | VkImage image, |
| 7956 | VkImageLayout imageLayout, |
| 7957 | const VkClearColorValue* pColor, |
| 7958 | uint32_t rangeCount, |
| 7959 | const VkImageSubresourceRange* pRanges) |
| 7960 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7961 | mImpl->log("start vkCmdClearColorImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7962 | auto stream = mImpl->stream(); |
| 7963 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7964 | auto resources = mImpl->resources(); |
| 7965 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7966 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7967 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7968 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7969 | VkImageLayout local_imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7970 | VkClearColorValue* local_pColor; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7971 | uint32_t local_rangeCount; |
| 7972 | VkImageSubresourceRange* local_pRanges; |
| 7973 | local_commandBuffer = commandBuffer; |
| 7974 | local_image = image; |
| 7975 | local_imageLayout = imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7976 | local_pColor = nullptr; |
| 7977 | if (pColor) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7978 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7979 | local_pColor = (VkClearColorValue*)pool->alloc(sizeof(const VkClearColorValue)); |
| 7980 | deepcopy_VkClearColorValue(pool, pColor, (VkClearColorValue*)(local_pColor)); |
| 7981 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7982 | local_rangeCount = rangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7983 | local_pRanges = nullptr; |
| 7984 | if (pRanges) |
| 7985 | { |
| 7986 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7987 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 7988 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7989 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 7990 | } |
| 7991 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7992 | if (local_pColor) |
| 7993 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7994 | transform_tohost_VkClearColorValue(mImpl->resources(), (VkClearColorValue*)(local_pColor)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7995 | } |
| 7996 | if (local_pRanges) |
| 7997 | { |
| 7998 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 7999 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8000 | transform_tohost_VkImageSubresourceRange(mImpl->resources(), (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8001 | } |
| 8002 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8003 | countingStream->rewind(); |
| 8004 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8005 | uint64_t cgen_var_585; |
| 8006 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_585, 1); |
| 8007 | countingStream->write((uint64_t*)&cgen_var_585, 1 * 8); |
| 8008 | uint64_t cgen_var_586; |
| 8009 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_586, 1); |
| 8010 | countingStream->write((uint64_t*)&cgen_var_586, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8011 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8012 | marshal_VkClearColorValue(countingStream, (VkClearColorValue*)(local_pColor)); |
| 8013 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 8014 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8015 | { |
| 8016 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8017 | } |
| 8018 | } |
| 8019 | uint32_t packetSize_vkCmdClearColorImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8020 | countingStream->rewind(); |
| 8021 | uint32_t opcode_vkCmdClearColorImage = OP_vkCmdClearColorImage; |
| 8022 | stream->write(&opcode_vkCmdClearColorImage, sizeof(uint32_t)); |
| 8023 | stream->write(&packetSize_vkCmdClearColorImage, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8024 | uint64_t cgen_var_587; |
| 8025 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_587, 1); |
| 8026 | stream->write((uint64_t*)&cgen_var_587, 1 * 8); |
| 8027 | uint64_t cgen_var_588; |
| 8028 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_588, 1); |
| 8029 | stream->write((uint64_t*)&cgen_var_588, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8030 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8031 | marshal_VkClearColorValue(stream, (VkClearColorValue*)(local_pColor)); |
| 8032 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8033 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8034 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8035 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8036 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8037 | mImpl->log("finish vkCmdClearColorImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8038 | } |
| 8039 | |
| 8040 | void VkEncoder::vkCmdClearDepthStencilImage( |
| 8041 | VkCommandBuffer commandBuffer, |
| 8042 | VkImage image, |
| 8043 | VkImageLayout imageLayout, |
| 8044 | const VkClearDepthStencilValue* pDepthStencil, |
| 8045 | uint32_t rangeCount, |
| 8046 | const VkImageSubresourceRange* pRanges) |
| 8047 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8048 | mImpl->log("start vkCmdClearDepthStencilImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8049 | auto stream = mImpl->stream(); |
| 8050 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8051 | auto resources = mImpl->resources(); |
| 8052 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8053 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8054 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8055 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8056 | VkImageLayout local_imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8057 | VkClearDepthStencilValue* local_pDepthStencil; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8058 | uint32_t local_rangeCount; |
| 8059 | VkImageSubresourceRange* local_pRanges; |
| 8060 | local_commandBuffer = commandBuffer; |
| 8061 | local_image = image; |
| 8062 | local_imageLayout = imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8063 | local_pDepthStencil = nullptr; |
| 8064 | if (pDepthStencil) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8065 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8066 | local_pDepthStencil = (VkClearDepthStencilValue*)pool->alloc(sizeof(const VkClearDepthStencilValue)); |
| 8067 | deepcopy_VkClearDepthStencilValue(pool, pDepthStencil, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8068 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8069 | local_rangeCount = rangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8070 | local_pRanges = nullptr; |
| 8071 | if (pRanges) |
| 8072 | { |
| 8073 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8074 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8075 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8076 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 8077 | } |
| 8078 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8079 | if (local_pDepthStencil) |
| 8080 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8081 | transform_tohost_VkClearDepthStencilValue(mImpl->resources(), (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8082 | } |
| 8083 | if (local_pRanges) |
| 8084 | { |
| 8085 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8086 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8087 | transform_tohost_VkImageSubresourceRange(mImpl->resources(), (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8088 | } |
| 8089 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8090 | countingStream->rewind(); |
| 8091 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8092 | uint64_t cgen_var_589; |
| 8093 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_589, 1); |
| 8094 | countingStream->write((uint64_t*)&cgen_var_589, 1 * 8); |
| 8095 | uint64_t cgen_var_590; |
| 8096 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_590, 1); |
| 8097 | countingStream->write((uint64_t*)&cgen_var_590, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8098 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8099 | marshal_VkClearDepthStencilValue(countingStream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8100 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 8101 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8102 | { |
| 8103 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8104 | } |
| 8105 | } |
| 8106 | uint32_t packetSize_vkCmdClearDepthStencilImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8107 | countingStream->rewind(); |
| 8108 | uint32_t opcode_vkCmdClearDepthStencilImage = OP_vkCmdClearDepthStencilImage; |
| 8109 | stream->write(&opcode_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| 8110 | stream->write(&packetSize_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8111 | uint64_t cgen_var_591; |
| 8112 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_591, 1); |
| 8113 | stream->write((uint64_t*)&cgen_var_591, 1 * 8); |
| 8114 | uint64_t cgen_var_592; |
| 8115 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_592, 1); |
| 8116 | stream->write((uint64_t*)&cgen_var_592, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8117 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8118 | marshal_VkClearDepthStencilValue(stream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8119 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8120 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8121 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8122 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8123 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8124 | mImpl->log("finish vkCmdClearDepthStencilImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8125 | } |
| 8126 | |
| 8127 | void VkEncoder::vkCmdClearAttachments( |
| 8128 | VkCommandBuffer commandBuffer, |
| 8129 | uint32_t attachmentCount, |
| 8130 | const VkClearAttachment* pAttachments, |
| 8131 | uint32_t rectCount, |
| 8132 | const VkClearRect* pRects) |
| 8133 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8134 | mImpl->log("start vkCmdClearAttachments"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8135 | auto stream = mImpl->stream(); |
| 8136 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8137 | auto resources = mImpl->resources(); |
| 8138 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8139 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8140 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8141 | uint32_t local_attachmentCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8142 | VkClearAttachment* local_pAttachments; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8143 | uint32_t local_rectCount; |
| 8144 | VkClearRect* local_pRects; |
| 8145 | local_commandBuffer = commandBuffer; |
| 8146 | local_attachmentCount = attachmentCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8147 | local_pAttachments = nullptr; |
| 8148 | if (pAttachments) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8149 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8150 | local_pAttachments = (VkClearAttachment*)pool->alloc(((attachmentCount)) * sizeof(const VkClearAttachment)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8151 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8152 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8153 | deepcopy_VkClearAttachment(pool, pAttachments + i, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8154 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8155 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8156 | local_rectCount = rectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8157 | local_pRects = nullptr; |
| 8158 | if (pRects) |
| 8159 | { |
| 8160 | local_pRects = (VkClearRect*)pool->alloc(((rectCount)) * sizeof(const VkClearRect)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8161 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8162 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8163 | deepcopy_VkClearRect(pool, pRects + i, (VkClearRect*)(local_pRects + i)); |
| 8164 | } |
| 8165 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8166 | if (local_pAttachments) |
| 8167 | { |
| 8168 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8169 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8170 | transform_tohost_VkClearAttachment(mImpl->resources(), (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8171 | } |
| 8172 | } |
| 8173 | if (local_pRects) |
| 8174 | { |
| 8175 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8176 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8177 | transform_tohost_VkClearRect(mImpl->resources(), (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8178 | } |
| 8179 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8180 | countingStream->rewind(); |
| 8181 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8182 | uint64_t cgen_var_593; |
| 8183 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_593, 1); |
| 8184 | countingStream->write((uint64_t*)&cgen_var_593, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8185 | countingStream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| 8186 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8187 | { |
| 8188 | marshal_VkClearAttachment(countingStream, (VkClearAttachment*)(local_pAttachments + i)); |
| 8189 | } |
| 8190 | countingStream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| 8191 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8192 | { |
| 8193 | marshal_VkClearRect(countingStream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8194 | } |
| 8195 | } |
| 8196 | uint32_t packetSize_vkCmdClearAttachments = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8197 | countingStream->rewind(); |
| 8198 | uint32_t opcode_vkCmdClearAttachments = OP_vkCmdClearAttachments; |
| 8199 | stream->write(&opcode_vkCmdClearAttachments, sizeof(uint32_t)); |
| 8200 | stream->write(&packetSize_vkCmdClearAttachments, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8201 | uint64_t cgen_var_594; |
| 8202 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_594, 1); |
| 8203 | stream->write((uint64_t*)&cgen_var_594, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8204 | stream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8205 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8206 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8207 | marshal_VkClearAttachment(stream, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8208 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8209 | stream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8210 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8211 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8212 | marshal_VkClearRect(stream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8213 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8214 | mImpl->log("finish vkCmdClearAttachments");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8215 | } |
| 8216 | |
| 8217 | void VkEncoder::vkCmdResolveImage( |
| 8218 | VkCommandBuffer commandBuffer, |
| 8219 | VkImage srcImage, |
| 8220 | VkImageLayout srcImageLayout, |
| 8221 | VkImage dstImage, |
| 8222 | VkImageLayout dstImageLayout, |
| 8223 | uint32_t regionCount, |
| 8224 | const VkImageResolve* pRegions) |
| 8225 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8226 | mImpl->log("start vkCmdResolveImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8227 | auto stream = mImpl->stream(); |
| 8228 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8229 | auto resources = mImpl->resources(); |
| 8230 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8231 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8232 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8233 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8234 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8235 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8236 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8237 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8238 | VkImageResolve* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8239 | local_commandBuffer = commandBuffer; |
| 8240 | local_srcImage = srcImage; |
| 8241 | local_srcImageLayout = srcImageLayout; |
| 8242 | local_dstImage = dstImage; |
| 8243 | local_dstImageLayout = dstImageLayout; |
| 8244 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8245 | local_pRegions = nullptr; |
| 8246 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8247 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8248 | local_pRegions = (VkImageResolve*)pool->alloc(((regionCount)) * sizeof(const VkImageResolve)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8249 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8250 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8251 | deepcopy_VkImageResolve(pool, pRegions + i, (VkImageResolve*)(local_pRegions + i)); |
| 8252 | } |
| 8253 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8254 | if (local_pRegions) |
| 8255 | { |
| 8256 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8257 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8258 | transform_tohost_VkImageResolve(mImpl->resources(), (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8259 | } |
| 8260 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8261 | countingStream->rewind(); |
| 8262 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8263 | uint64_t cgen_var_595; |
| 8264 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_595, 1); |
| 8265 | countingStream->write((uint64_t*)&cgen_var_595, 1 * 8); |
| 8266 | uint64_t cgen_var_596; |
| 8267 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_596, 1); |
| 8268 | countingStream->write((uint64_t*)&cgen_var_596, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8269 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8270 | uint64_t cgen_var_597; |
| 8271 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_597, 1); |
| 8272 | countingStream->write((uint64_t*)&cgen_var_597, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8273 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8274 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8275 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8276 | { |
| 8277 | marshal_VkImageResolve(countingStream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8278 | } |
| 8279 | } |
| 8280 | uint32_t packetSize_vkCmdResolveImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8281 | countingStream->rewind(); |
| 8282 | uint32_t opcode_vkCmdResolveImage = OP_vkCmdResolveImage; |
| 8283 | stream->write(&opcode_vkCmdResolveImage, sizeof(uint32_t)); |
| 8284 | stream->write(&packetSize_vkCmdResolveImage, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8285 | uint64_t cgen_var_598; |
| 8286 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_598, 1); |
| 8287 | stream->write((uint64_t*)&cgen_var_598, 1 * 8); |
| 8288 | uint64_t cgen_var_599; |
| 8289 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_599, 1); |
| 8290 | stream->write((uint64_t*)&cgen_var_599, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8291 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8292 | uint64_t cgen_var_600; |
| 8293 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_600, 1); |
| 8294 | stream->write((uint64_t*)&cgen_var_600, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8295 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8296 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8297 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8298 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8299 | marshal_VkImageResolve(stream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8300 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8301 | mImpl->log("finish vkCmdResolveImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8302 | } |
| 8303 | |
| 8304 | void VkEncoder::vkCmdSetEvent( |
| 8305 | VkCommandBuffer commandBuffer, |
| 8306 | VkEvent event, |
| 8307 | VkPipelineStageFlags stageMask) |
| 8308 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8309 | mImpl->log("start vkCmdSetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8310 | auto stream = mImpl->stream(); |
| 8311 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8312 | auto resources = mImpl->resources(); |
| 8313 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8314 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8315 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8316 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8317 | VkPipelineStageFlags local_stageMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8318 | local_commandBuffer = commandBuffer; |
| 8319 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8320 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8321 | countingStream->rewind(); |
| 8322 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8323 | uint64_t cgen_var_601; |
| 8324 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_601, 1); |
| 8325 | countingStream->write((uint64_t*)&cgen_var_601, 1 * 8); |
| 8326 | uint64_t cgen_var_602; |
| 8327 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_602, 1); |
| 8328 | countingStream->write((uint64_t*)&cgen_var_602, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8329 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8330 | } |
| 8331 | uint32_t packetSize_vkCmdSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8332 | countingStream->rewind(); |
| 8333 | uint32_t opcode_vkCmdSetEvent = OP_vkCmdSetEvent; |
| 8334 | stream->write(&opcode_vkCmdSetEvent, sizeof(uint32_t)); |
| 8335 | stream->write(&packetSize_vkCmdSetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8336 | uint64_t cgen_var_603; |
| 8337 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_603, 1); |
| 8338 | stream->write((uint64_t*)&cgen_var_603, 1 * 8); |
| 8339 | uint64_t cgen_var_604; |
| 8340 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_604, 1); |
| 8341 | stream->write((uint64_t*)&cgen_var_604, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8342 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8343 | mImpl->log("finish vkCmdSetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8344 | } |
| 8345 | |
| 8346 | void VkEncoder::vkCmdResetEvent( |
| 8347 | VkCommandBuffer commandBuffer, |
| 8348 | VkEvent event, |
| 8349 | VkPipelineStageFlags stageMask) |
| 8350 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8351 | mImpl->log("start vkCmdResetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8352 | auto stream = mImpl->stream(); |
| 8353 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8354 | auto resources = mImpl->resources(); |
| 8355 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8356 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8357 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8358 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8359 | VkPipelineStageFlags local_stageMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8360 | local_commandBuffer = commandBuffer; |
| 8361 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8362 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8363 | countingStream->rewind(); |
| 8364 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8365 | uint64_t cgen_var_605; |
| 8366 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_605, 1); |
| 8367 | countingStream->write((uint64_t*)&cgen_var_605, 1 * 8); |
| 8368 | uint64_t cgen_var_606; |
| 8369 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_606, 1); |
| 8370 | countingStream->write((uint64_t*)&cgen_var_606, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8371 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8372 | } |
| 8373 | uint32_t packetSize_vkCmdResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8374 | countingStream->rewind(); |
| 8375 | uint32_t opcode_vkCmdResetEvent = OP_vkCmdResetEvent; |
| 8376 | stream->write(&opcode_vkCmdResetEvent, sizeof(uint32_t)); |
| 8377 | stream->write(&packetSize_vkCmdResetEvent, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8378 | uint64_t cgen_var_607; |
| 8379 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_607, 1); |
| 8380 | stream->write((uint64_t*)&cgen_var_607, 1 * 8); |
| 8381 | uint64_t cgen_var_608; |
| 8382 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_608, 1); |
| 8383 | stream->write((uint64_t*)&cgen_var_608, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8384 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8385 | mImpl->log("finish vkCmdResetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8386 | } |
| 8387 | |
| 8388 | void VkEncoder::vkCmdWaitEvents( |
| 8389 | VkCommandBuffer commandBuffer, |
| 8390 | uint32_t eventCount, |
| 8391 | const VkEvent* pEvents, |
| 8392 | VkPipelineStageFlags srcStageMask, |
| 8393 | VkPipelineStageFlags dstStageMask, |
| 8394 | uint32_t memoryBarrierCount, |
| 8395 | const VkMemoryBarrier* pMemoryBarriers, |
| 8396 | uint32_t bufferMemoryBarrierCount, |
| 8397 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 8398 | uint32_t imageMemoryBarrierCount, |
| 8399 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 8400 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8401 | mImpl->log("start vkCmdWaitEvents"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8402 | auto stream = mImpl->stream(); |
| 8403 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8404 | auto resources = mImpl->resources(); |
| 8405 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8406 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8407 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8408 | uint32_t local_eventCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8409 | VkEvent* local_pEvents; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8410 | VkPipelineStageFlags local_srcStageMask; |
| 8411 | VkPipelineStageFlags local_dstStageMask; |
| 8412 | uint32_t local_memoryBarrierCount; |
| 8413 | VkMemoryBarrier* local_pMemoryBarriers; |
| 8414 | uint32_t local_bufferMemoryBarrierCount; |
| 8415 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 8416 | uint32_t local_imageMemoryBarrierCount; |
| 8417 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 8418 | local_commandBuffer = commandBuffer; |
| 8419 | local_eventCount = eventCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8420 | local_pEvents = nullptr; |
| 8421 | if (pEvents) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8422 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8423 | local_pEvents = (VkEvent*)pool->dupArray(pEvents, ((eventCount)) * sizeof(const VkEvent)); |
| 8424 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8425 | local_srcStageMask = srcStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8426 | local_dstStageMask = dstStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8427 | local_memoryBarrierCount = memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8428 | local_pMemoryBarriers = nullptr; |
| 8429 | if (pMemoryBarriers) |
| 8430 | { |
| 8431 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8432 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8433 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8434 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8435 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8436 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8437 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8438 | local_pBufferMemoryBarriers = nullptr; |
| 8439 | if (pBufferMemoryBarriers) |
| 8440 | { |
| 8441 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8442 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8443 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8444 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8445 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8446 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8447 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8448 | local_pImageMemoryBarriers = nullptr; |
| 8449 | if (pImageMemoryBarriers) |
| 8450 | { |
| 8451 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8452 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8453 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8454 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 8455 | } |
| 8456 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8457 | if (local_pMemoryBarriers) |
| 8458 | { |
| 8459 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8460 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8461 | transform_tohost_VkMemoryBarrier(mImpl->resources(), (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8462 | } |
| 8463 | } |
| 8464 | if (local_pBufferMemoryBarriers) |
| 8465 | { |
| 8466 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8467 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8468 | transform_tohost_VkBufferMemoryBarrier(mImpl->resources(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8469 | } |
| 8470 | } |
| 8471 | if (local_pImageMemoryBarriers) |
| 8472 | { |
| 8473 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8474 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8475 | transform_tohost_VkImageMemoryBarrier(mImpl->resources(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8476 | } |
| 8477 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8478 | countingStream->rewind(); |
| 8479 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8480 | uint64_t cgen_var_609; |
| 8481 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_609, 1); |
| 8482 | countingStream->write((uint64_t*)&cgen_var_609, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8483 | countingStream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8484 | if (((eventCount))) |
| 8485 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8486 | uint64_t* cgen_var_610; |
| 8487 | countingStream->alloc((void**)&cgen_var_610, ((eventCount)) * 8); |
| 8488 | countingStream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_610, ((eventCount))); |
| 8489 | countingStream->write((uint64_t*)cgen_var_610, ((eventCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8490 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8491 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 8492 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 8493 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 8494 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8495 | { |
| 8496 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 8497 | } |
| 8498 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 8499 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8500 | { |
| 8501 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 8502 | } |
| 8503 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 8504 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8505 | { |
| 8506 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8507 | } |
| 8508 | } |
| 8509 | uint32_t packetSize_vkCmdWaitEvents = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8510 | countingStream->rewind(); |
| 8511 | uint32_t opcode_vkCmdWaitEvents = OP_vkCmdWaitEvents; |
| 8512 | stream->write(&opcode_vkCmdWaitEvents, sizeof(uint32_t)); |
| 8513 | stream->write(&packetSize_vkCmdWaitEvents, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8514 | uint64_t cgen_var_611; |
| 8515 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_611, 1); |
| 8516 | stream->write((uint64_t*)&cgen_var_611, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8517 | stream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8518 | if (((eventCount))) |
| 8519 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8520 | uint64_t* cgen_var_612; |
| 8521 | stream->alloc((void**)&cgen_var_612, ((eventCount)) * 8); |
| 8522 | stream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_612, ((eventCount))); |
| 8523 | stream->write((uint64_t*)cgen_var_612, ((eventCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8524 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8525 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 8526 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 8527 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8528 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8529 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8530 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8531 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8532 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8533 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8534 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8535 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8536 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8537 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8538 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8539 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8540 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8541 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8542 | mImpl->log("finish vkCmdWaitEvents");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8543 | } |
| 8544 | |
| 8545 | void VkEncoder::vkCmdPipelineBarrier( |
| 8546 | VkCommandBuffer commandBuffer, |
| 8547 | VkPipelineStageFlags srcStageMask, |
| 8548 | VkPipelineStageFlags dstStageMask, |
| 8549 | VkDependencyFlags dependencyFlags, |
| 8550 | uint32_t memoryBarrierCount, |
| 8551 | const VkMemoryBarrier* pMemoryBarriers, |
| 8552 | uint32_t bufferMemoryBarrierCount, |
| 8553 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 8554 | uint32_t imageMemoryBarrierCount, |
| 8555 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 8556 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8557 | mImpl->log("start vkCmdPipelineBarrier"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8558 | auto stream = mImpl->stream(); |
| 8559 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8560 | auto resources = mImpl->resources(); |
| 8561 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8562 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8563 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8564 | VkPipelineStageFlags local_srcStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8565 | VkPipelineStageFlags local_dstStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8566 | VkDependencyFlags local_dependencyFlags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8567 | uint32_t local_memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8568 | VkMemoryBarrier* local_pMemoryBarriers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8569 | uint32_t local_bufferMemoryBarrierCount; |
| 8570 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 8571 | uint32_t local_imageMemoryBarrierCount; |
| 8572 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 8573 | local_commandBuffer = commandBuffer; |
| 8574 | local_srcStageMask = srcStageMask; |
| 8575 | local_dstStageMask = dstStageMask; |
| 8576 | local_dependencyFlags = dependencyFlags; |
| 8577 | local_memoryBarrierCount = memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8578 | local_pMemoryBarriers = nullptr; |
| 8579 | if (pMemoryBarriers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8580 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8581 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8582 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8583 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8584 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8585 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8586 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8587 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8588 | local_pBufferMemoryBarriers = nullptr; |
| 8589 | if (pBufferMemoryBarriers) |
| 8590 | { |
| 8591 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8592 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8593 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8594 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8595 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8596 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8597 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8598 | local_pImageMemoryBarriers = nullptr; |
| 8599 | if (pImageMemoryBarriers) |
| 8600 | { |
| 8601 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8602 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8603 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8604 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 8605 | } |
| 8606 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8607 | if (local_pMemoryBarriers) |
| 8608 | { |
| 8609 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8610 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8611 | transform_tohost_VkMemoryBarrier(mImpl->resources(), (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8612 | } |
| 8613 | } |
| 8614 | if (local_pBufferMemoryBarriers) |
| 8615 | { |
| 8616 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8617 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8618 | transform_tohost_VkBufferMemoryBarrier(mImpl->resources(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8619 | } |
| 8620 | } |
| 8621 | if (local_pImageMemoryBarriers) |
| 8622 | { |
| 8623 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8624 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8625 | transform_tohost_VkImageMemoryBarrier(mImpl->resources(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8626 | } |
| 8627 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8628 | countingStream->rewind(); |
| 8629 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8630 | uint64_t cgen_var_613; |
| 8631 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_613, 1); |
| 8632 | countingStream->write((uint64_t*)&cgen_var_613, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8633 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 8634 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 8635 | countingStream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 8636 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 8637 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8638 | { |
| 8639 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 8640 | } |
| 8641 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 8642 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8643 | { |
| 8644 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 8645 | } |
| 8646 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 8647 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8648 | { |
| 8649 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8650 | } |
| 8651 | } |
| 8652 | uint32_t packetSize_vkCmdPipelineBarrier = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8653 | countingStream->rewind(); |
| 8654 | uint32_t opcode_vkCmdPipelineBarrier = OP_vkCmdPipelineBarrier; |
| 8655 | stream->write(&opcode_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| 8656 | stream->write(&packetSize_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8657 | uint64_t cgen_var_614; |
| 8658 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_614, 1); |
| 8659 | stream->write((uint64_t*)&cgen_var_614, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8660 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 8661 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 8662 | stream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 8663 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8664 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8665 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8666 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8667 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8668 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8669 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8670 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8671 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8672 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8673 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8674 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8675 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8676 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8677 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8678 | mImpl->log("finish vkCmdPipelineBarrier");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8679 | } |
| 8680 | |
| 8681 | void VkEncoder::vkCmdBeginQuery( |
| 8682 | VkCommandBuffer commandBuffer, |
| 8683 | VkQueryPool queryPool, |
| 8684 | uint32_t query, |
| 8685 | VkQueryControlFlags flags) |
| 8686 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8687 | mImpl->log("start vkCmdBeginQuery"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8688 | auto stream = mImpl->stream(); |
| 8689 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8690 | auto resources = mImpl->resources(); |
| 8691 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8692 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8693 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8694 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8695 | uint32_t local_query; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8696 | VkQueryControlFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8697 | local_commandBuffer = commandBuffer; |
| 8698 | local_queryPool = queryPool; |
| 8699 | local_query = query; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8700 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8701 | countingStream->rewind(); |
| 8702 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8703 | uint64_t cgen_var_615; |
| 8704 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_615, 1); |
| 8705 | countingStream->write((uint64_t*)&cgen_var_615, 1 * 8); |
| 8706 | uint64_t cgen_var_616; |
| 8707 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_616, 1); |
| 8708 | countingStream->write((uint64_t*)&cgen_var_616, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8709 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 8710 | countingStream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8711 | } |
| 8712 | uint32_t packetSize_vkCmdBeginQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8713 | countingStream->rewind(); |
| 8714 | uint32_t opcode_vkCmdBeginQuery = OP_vkCmdBeginQuery; |
| 8715 | stream->write(&opcode_vkCmdBeginQuery, sizeof(uint32_t)); |
| 8716 | stream->write(&packetSize_vkCmdBeginQuery, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8717 | uint64_t cgen_var_617; |
| 8718 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_617, 1); |
| 8719 | stream->write((uint64_t*)&cgen_var_617, 1 * 8); |
| 8720 | uint64_t cgen_var_618; |
| 8721 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_618, 1); |
| 8722 | stream->write((uint64_t*)&cgen_var_618, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8723 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 8724 | stream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8725 | mImpl->log("finish vkCmdBeginQuery");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8726 | } |
| 8727 | |
| 8728 | void VkEncoder::vkCmdEndQuery( |
| 8729 | VkCommandBuffer commandBuffer, |
| 8730 | VkQueryPool queryPool, |
| 8731 | uint32_t query) |
| 8732 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8733 | mImpl->log("start vkCmdEndQuery"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8734 | auto stream = mImpl->stream(); |
| 8735 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8736 | auto resources = mImpl->resources(); |
| 8737 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8738 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8739 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8740 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8741 | uint32_t local_query; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8742 | local_commandBuffer = commandBuffer; |
| 8743 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8744 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8745 | countingStream->rewind(); |
| 8746 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8747 | uint64_t cgen_var_619; |
| 8748 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_619, 1); |
| 8749 | countingStream->write((uint64_t*)&cgen_var_619, 1 * 8); |
| 8750 | uint64_t cgen_var_620; |
| 8751 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_620, 1); |
| 8752 | countingStream->write((uint64_t*)&cgen_var_620, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8753 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8754 | } |
| 8755 | uint32_t packetSize_vkCmdEndQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8756 | countingStream->rewind(); |
| 8757 | uint32_t opcode_vkCmdEndQuery = OP_vkCmdEndQuery; |
| 8758 | stream->write(&opcode_vkCmdEndQuery, sizeof(uint32_t)); |
| 8759 | stream->write(&packetSize_vkCmdEndQuery, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8760 | uint64_t cgen_var_621; |
| 8761 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_621, 1); |
| 8762 | stream->write((uint64_t*)&cgen_var_621, 1 * 8); |
| 8763 | uint64_t cgen_var_622; |
| 8764 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_622, 1); |
| 8765 | stream->write((uint64_t*)&cgen_var_622, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8766 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8767 | mImpl->log("finish vkCmdEndQuery");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8768 | } |
| 8769 | |
| 8770 | void VkEncoder::vkCmdResetQueryPool( |
| 8771 | VkCommandBuffer commandBuffer, |
| 8772 | VkQueryPool queryPool, |
| 8773 | uint32_t firstQuery, |
| 8774 | uint32_t queryCount) |
| 8775 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8776 | mImpl->log("start vkCmdResetQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8777 | auto stream = mImpl->stream(); |
| 8778 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8779 | auto resources = mImpl->resources(); |
| 8780 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8781 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8782 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8783 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8784 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8785 | uint32_t local_queryCount; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8786 | local_commandBuffer = commandBuffer; |
| 8787 | local_queryPool = queryPool; |
| 8788 | local_firstQuery = firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8789 | local_queryCount = queryCount; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8790 | countingStream->rewind(); |
| 8791 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8792 | uint64_t cgen_var_623; |
| 8793 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_623, 1); |
| 8794 | countingStream->write((uint64_t*)&cgen_var_623, 1 * 8); |
| 8795 | uint64_t cgen_var_624; |
| 8796 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_624, 1); |
| 8797 | countingStream->write((uint64_t*)&cgen_var_624, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8798 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 8799 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8800 | } |
| 8801 | uint32_t packetSize_vkCmdResetQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8802 | countingStream->rewind(); |
| 8803 | uint32_t opcode_vkCmdResetQueryPool = OP_vkCmdResetQueryPool; |
| 8804 | stream->write(&opcode_vkCmdResetQueryPool, sizeof(uint32_t)); |
| 8805 | stream->write(&packetSize_vkCmdResetQueryPool, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8806 | uint64_t cgen_var_625; |
| 8807 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_625, 1); |
| 8808 | stream->write((uint64_t*)&cgen_var_625, 1 * 8); |
| 8809 | uint64_t cgen_var_626; |
| 8810 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_626, 1); |
| 8811 | stream->write((uint64_t*)&cgen_var_626, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8812 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 8813 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8814 | mImpl->log("finish vkCmdResetQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8815 | } |
| 8816 | |
| 8817 | void VkEncoder::vkCmdWriteTimestamp( |
| 8818 | VkCommandBuffer commandBuffer, |
| 8819 | VkPipelineStageFlagBits pipelineStage, |
| 8820 | VkQueryPool queryPool, |
| 8821 | uint32_t query) |
| 8822 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8823 | mImpl->log("start vkCmdWriteTimestamp"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8824 | auto stream = mImpl->stream(); |
| 8825 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8826 | auto resources = mImpl->resources(); |
| 8827 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8828 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8829 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8830 | VkPipelineStageFlagBits local_pipelineStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8831 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8832 | uint32_t local_query; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8833 | local_commandBuffer = commandBuffer; |
| 8834 | local_pipelineStage = pipelineStage; |
| 8835 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8836 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8837 | countingStream->rewind(); |
| 8838 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8839 | uint64_t cgen_var_627; |
| 8840 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_627, 1); |
| 8841 | countingStream->write((uint64_t*)&cgen_var_627, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8842 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8843 | uint64_t cgen_var_628; |
| 8844 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_628, 1); |
| 8845 | countingStream->write((uint64_t*)&cgen_var_628, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8846 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8847 | } |
| 8848 | uint32_t packetSize_vkCmdWriteTimestamp = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8849 | countingStream->rewind(); |
| 8850 | uint32_t opcode_vkCmdWriteTimestamp = OP_vkCmdWriteTimestamp; |
| 8851 | stream->write(&opcode_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| 8852 | stream->write(&packetSize_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8853 | uint64_t cgen_var_629; |
| 8854 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_629, 1); |
| 8855 | stream->write((uint64_t*)&cgen_var_629, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8856 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8857 | uint64_t cgen_var_630; |
| 8858 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_630, 1); |
| 8859 | stream->write((uint64_t*)&cgen_var_630, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8860 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8861 | mImpl->log("finish vkCmdWriteTimestamp");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8862 | } |
| 8863 | |
| 8864 | void VkEncoder::vkCmdCopyQueryPoolResults( |
| 8865 | VkCommandBuffer commandBuffer, |
| 8866 | VkQueryPool queryPool, |
| 8867 | uint32_t firstQuery, |
| 8868 | uint32_t queryCount, |
| 8869 | VkBuffer dstBuffer, |
| 8870 | VkDeviceSize dstOffset, |
| 8871 | VkDeviceSize stride, |
| 8872 | VkQueryResultFlags flags) |
| 8873 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8874 | mImpl->log("start vkCmdCopyQueryPoolResults"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8875 | auto stream = mImpl->stream(); |
| 8876 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8877 | auto resources = mImpl->resources(); |
| 8878 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8879 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8880 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8881 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8882 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8883 | uint32_t local_queryCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8884 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8885 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8886 | VkDeviceSize local_stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8887 | VkQueryResultFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8888 | local_commandBuffer = commandBuffer; |
| 8889 | local_queryPool = queryPool; |
| 8890 | local_firstQuery = firstQuery; |
| 8891 | local_queryCount = queryCount; |
| 8892 | local_dstBuffer = dstBuffer; |
| 8893 | local_dstOffset = dstOffset; |
| 8894 | local_stride = stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8895 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8896 | countingStream->rewind(); |
| 8897 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8898 | uint64_t cgen_var_631; |
| 8899 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_631, 1); |
| 8900 | countingStream->write((uint64_t*)&cgen_var_631, 1 * 8); |
| 8901 | uint64_t cgen_var_632; |
| 8902 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_632, 1); |
| 8903 | countingStream->write((uint64_t*)&cgen_var_632, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8904 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 8905 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8906 | uint64_t cgen_var_633; |
| 8907 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_633, 1); |
| 8908 | countingStream->write((uint64_t*)&cgen_var_633, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8909 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8910 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 8911 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8912 | } |
| 8913 | uint32_t packetSize_vkCmdCopyQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8914 | countingStream->rewind(); |
| 8915 | uint32_t opcode_vkCmdCopyQueryPoolResults = OP_vkCmdCopyQueryPoolResults; |
| 8916 | stream->write(&opcode_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| 8917 | stream->write(&packetSize_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8918 | uint64_t cgen_var_634; |
| 8919 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_634, 1); |
| 8920 | stream->write((uint64_t*)&cgen_var_634, 1 * 8); |
| 8921 | uint64_t cgen_var_635; |
| 8922 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_635, 1); |
| 8923 | stream->write((uint64_t*)&cgen_var_635, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8924 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 8925 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8926 | uint64_t cgen_var_636; |
| 8927 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_636, 1); |
| 8928 | stream->write((uint64_t*)&cgen_var_636, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8929 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8930 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 8931 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8932 | mImpl->log("finish vkCmdCopyQueryPoolResults");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8933 | } |
| 8934 | |
| 8935 | void VkEncoder::vkCmdPushConstants( |
| 8936 | VkCommandBuffer commandBuffer, |
| 8937 | VkPipelineLayout layout, |
| 8938 | VkShaderStageFlags stageFlags, |
| 8939 | uint32_t offset, |
| 8940 | uint32_t size, |
| 8941 | const void* pValues) |
| 8942 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8943 | mImpl->log("start vkCmdPushConstants"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8944 | auto stream = mImpl->stream(); |
| 8945 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8946 | auto resources = mImpl->resources(); |
| 8947 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8948 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8949 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8950 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8951 | VkShaderStageFlags local_stageFlags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8952 | uint32_t local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8953 | uint32_t local_size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8954 | void* local_pValues; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8955 | local_commandBuffer = commandBuffer; |
| 8956 | local_layout = layout; |
| 8957 | local_stageFlags = stageFlags; |
| 8958 | local_offset = offset; |
| 8959 | local_size = size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8960 | local_pValues = nullptr; |
| 8961 | if (pValues) |
| 8962 | { |
| 8963 | local_pValues = (void*)pool->dupArray(pValues, ((size)) * sizeof(const uint8_t)); |
| 8964 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8965 | countingStream->rewind(); |
| 8966 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8967 | uint64_t cgen_var_637; |
| 8968 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_637, 1); |
| 8969 | countingStream->write((uint64_t*)&cgen_var_637, 1 * 8); |
| 8970 | uint64_t cgen_var_638; |
| 8971 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_638, 1); |
| 8972 | countingStream->write((uint64_t*)&cgen_var_638, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8973 | countingStream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 8974 | countingStream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 8975 | countingStream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 8976 | countingStream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8977 | } |
| 8978 | uint32_t packetSize_vkCmdPushConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8979 | countingStream->rewind(); |
| 8980 | uint32_t opcode_vkCmdPushConstants = OP_vkCmdPushConstants; |
| 8981 | stream->write(&opcode_vkCmdPushConstants, sizeof(uint32_t)); |
| 8982 | stream->write(&packetSize_vkCmdPushConstants, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 8983 | uint64_t cgen_var_639; |
| 8984 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_639, 1); |
| 8985 | stream->write((uint64_t*)&cgen_var_639, 1 * 8); |
| 8986 | uint64_t cgen_var_640; |
| 8987 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_640, 1); |
| 8988 | stream->write((uint64_t*)&cgen_var_640, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8989 | stream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 8990 | stream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 8991 | stream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 8992 | stream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8993 | mImpl->log("finish vkCmdPushConstants");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8994 | } |
| 8995 | |
| 8996 | void VkEncoder::vkCmdBeginRenderPass( |
| 8997 | VkCommandBuffer commandBuffer, |
| 8998 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 8999 | VkSubpassContents contents) |
| 9000 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9001 | mImpl->log("start vkCmdBeginRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9002 | auto stream = mImpl->stream(); |
| 9003 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9004 | auto resources = mImpl->resources(); |
| 9005 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9006 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9007 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9008 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9009 | VkSubpassContents local_contents; |
| 9010 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9011 | local_pRenderPassBegin = nullptr; |
| 9012 | if (pRenderPassBegin) |
| 9013 | { |
| 9014 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 9015 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9016 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9017 | local_contents = contents; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9018 | if (local_pRenderPassBegin) |
| 9019 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9020 | transform_tohost_VkRenderPassBeginInfo(mImpl->resources(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9021 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9022 | countingStream->rewind(); |
| 9023 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9024 | uint64_t cgen_var_641; |
| 9025 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_641, 1); |
| 9026 | countingStream->write((uint64_t*)&cgen_var_641, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9027 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9028 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9029 | } |
| 9030 | uint32_t packetSize_vkCmdBeginRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9031 | countingStream->rewind(); |
| 9032 | uint32_t opcode_vkCmdBeginRenderPass = OP_vkCmdBeginRenderPass; |
| 9033 | stream->write(&opcode_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| 9034 | stream->write(&packetSize_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9035 | uint64_t cgen_var_642; |
| 9036 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_642, 1); |
| 9037 | stream->write((uint64_t*)&cgen_var_642, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9038 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9039 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9040 | mImpl->log("finish vkCmdBeginRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9041 | } |
| 9042 | |
| 9043 | void VkEncoder::vkCmdNextSubpass( |
| 9044 | VkCommandBuffer commandBuffer, |
| 9045 | VkSubpassContents contents) |
| 9046 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9047 | mImpl->log("start vkCmdNextSubpass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9048 | auto stream = mImpl->stream(); |
| 9049 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9050 | auto resources = mImpl->resources(); |
| 9051 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9052 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9053 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9054 | VkSubpassContents local_contents; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9055 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9056 | local_contents = contents; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9057 | countingStream->rewind(); |
| 9058 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9059 | uint64_t cgen_var_643; |
| 9060 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_643, 1); |
| 9061 | countingStream->write((uint64_t*)&cgen_var_643, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9062 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9063 | } |
| 9064 | uint32_t packetSize_vkCmdNextSubpass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9065 | countingStream->rewind(); |
| 9066 | uint32_t opcode_vkCmdNextSubpass = OP_vkCmdNextSubpass; |
| 9067 | stream->write(&opcode_vkCmdNextSubpass, sizeof(uint32_t)); |
| 9068 | stream->write(&packetSize_vkCmdNextSubpass, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9069 | uint64_t cgen_var_644; |
| 9070 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_644, 1); |
| 9071 | stream->write((uint64_t*)&cgen_var_644, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9072 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9073 | mImpl->log("finish vkCmdNextSubpass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9074 | } |
| 9075 | |
| 9076 | void VkEncoder::vkCmdEndRenderPass( |
| 9077 | VkCommandBuffer commandBuffer) |
| 9078 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9079 | mImpl->log("start vkCmdEndRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9080 | auto stream = mImpl->stream(); |
| 9081 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9082 | auto resources = mImpl->resources(); |
| 9083 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9084 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9085 | VkCommandBuffer local_commandBuffer; |
| 9086 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9087 | countingStream->rewind(); |
| 9088 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9089 | uint64_t cgen_var_645; |
| 9090 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_645, 1); |
| 9091 | countingStream->write((uint64_t*)&cgen_var_645, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9092 | } |
| 9093 | uint32_t packetSize_vkCmdEndRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9094 | countingStream->rewind(); |
| 9095 | uint32_t opcode_vkCmdEndRenderPass = OP_vkCmdEndRenderPass; |
| 9096 | stream->write(&opcode_vkCmdEndRenderPass, sizeof(uint32_t)); |
| 9097 | stream->write(&packetSize_vkCmdEndRenderPass, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9098 | uint64_t cgen_var_646; |
| 9099 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_646, 1); |
| 9100 | stream->write((uint64_t*)&cgen_var_646, 1 * 8); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9101 | mImpl->log("finish vkCmdEndRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9102 | } |
| 9103 | |
| 9104 | void VkEncoder::vkCmdExecuteCommands( |
| 9105 | VkCommandBuffer commandBuffer, |
| 9106 | uint32_t commandBufferCount, |
| 9107 | const VkCommandBuffer* pCommandBuffers) |
| 9108 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9109 | mImpl->log("start vkCmdExecuteCommands"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9110 | auto stream = mImpl->stream(); |
| 9111 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9112 | auto resources = mImpl->resources(); |
| 9113 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9114 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9115 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9116 | uint32_t local_commandBufferCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9117 | VkCommandBuffer* local_pCommandBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9118 | local_commandBuffer = commandBuffer; |
| 9119 | local_commandBufferCount = commandBufferCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9120 | local_pCommandBuffers = nullptr; |
| 9121 | if (pCommandBuffers) |
| 9122 | { |
| 9123 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 9124 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9125 | countingStream->rewind(); |
| 9126 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9127 | uint64_t cgen_var_647; |
| 9128 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_647, 1); |
| 9129 | countingStream->write((uint64_t*)&cgen_var_647, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9130 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9131 | if (((commandBufferCount))) |
| 9132 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9133 | uint64_t* cgen_var_648; |
| 9134 | countingStream->alloc((void**)&cgen_var_648, ((commandBufferCount)) * 8); |
| 9135 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_648, ((commandBufferCount))); |
| 9136 | countingStream->write((uint64_t*)cgen_var_648, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9137 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9138 | } |
| 9139 | uint32_t packetSize_vkCmdExecuteCommands = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9140 | countingStream->rewind(); |
| 9141 | uint32_t opcode_vkCmdExecuteCommands = OP_vkCmdExecuteCommands; |
| 9142 | stream->write(&opcode_vkCmdExecuteCommands, sizeof(uint32_t)); |
| 9143 | stream->write(&packetSize_vkCmdExecuteCommands, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9144 | uint64_t cgen_var_649; |
| 9145 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_649, 1); |
| 9146 | stream->write((uint64_t*)&cgen_var_649, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9147 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9148 | if (((commandBufferCount))) |
| 9149 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9150 | uint64_t* cgen_var_650; |
| 9151 | stream->alloc((void**)&cgen_var_650, ((commandBufferCount)) * 8); |
| 9152 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_650, ((commandBufferCount))); |
| 9153 | stream->write((uint64_t*)cgen_var_650, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9154 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9155 | mImpl->log("finish vkCmdExecuteCommands");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9156 | } |
| 9157 | |
| 9158 | #endif |
| 9159 | #ifdef VK_VERSION_1_1 |
| 9160 | VkResult VkEncoder::vkEnumerateInstanceVersion( |
| 9161 | uint32_t* pApiVersion) |
| 9162 | { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9163 | VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0; |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 9164 | vkEnumerateInstanceVersion_VkResult_return = mImpl->resources()->on_vkEnumerateInstanceVersion(this, VK_SUCCESS, pApiVersion); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9165 | mImpl->log("finish vkEnumerateInstanceVersion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9166 | return vkEnumerateInstanceVersion_VkResult_return; |
| 9167 | } |
| 9168 | |
| 9169 | VkResult VkEncoder::vkBindBufferMemory2( |
| 9170 | VkDevice device, |
| 9171 | uint32_t bindInfoCount, |
| 9172 | const VkBindBufferMemoryInfo* pBindInfos) |
| 9173 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9174 | mImpl->log("start vkBindBufferMemory2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9175 | auto stream = mImpl->stream(); |
| 9176 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9177 | auto resources = mImpl->resources(); |
| 9178 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9179 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9180 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9181 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9182 | VkBindBufferMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9183 | local_device = device; |
| 9184 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9185 | local_pBindInfos = nullptr; |
| 9186 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9187 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9188 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9189 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9190 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9191 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 9192 | } |
| 9193 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9194 | if (local_pBindInfos) |
| 9195 | { |
| 9196 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9197 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9198 | transform_tohost_VkBindBufferMemoryInfo(mImpl->resources(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9199 | } |
| 9200 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9201 | countingStream->rewind(); |
| 9202 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9203 | uint64_t cgen_var_651; |
| 9204 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_651, 1); |
| 9205 | countingStream->write((uint64_t*)&cgen_var_651, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9206 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 9207 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9208 | { |
| 9209 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9210 | } |
| 9211 | } |
| 9212 | uint32_t packetSize_vkBindBufferMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9213 | countingStream->rewind(); |
| 9214 | uint32_t opcode_vkBindBufferMemory2 = OP_vkBindBufferMemory2; |
| 9215 | stream->write(&opcode_vkBindBufferMemory2, sizeof(uint32_t)); |
| 9216 | stream->write(&packetSize_vkBindBufferMemory2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9217 | uint64_t cgen_var_652; |
| 9218 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_652, 1); |
| 9219 | stream->write((uint64_t*)&cgen_var_652, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9220 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9221 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9222 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9223 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9224 | } |
| 9225 | VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0; |
| 9226 | stream->read(&vkBindBufferMemory2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9227 | countingStream->clearPool(); |
| 9228 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9229 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9230 | mImpl->log("finish vkBindBufferMemory2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9231 | return vkBindBufferMemory2_VkResult_return; |
| 9232 | } |
| 9233 | |
| 9234 | VkResult VkEncoder::vkBindImageMemory2( |
| 9235 | VkDevice device, |
| 9236 | uint32_t bindInfoCount, |
| 9237 | const VkBindImageMemoryInfo* pBindInfos) |
| 9238 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9239 | mImpl->log("start vkBindImageMemory2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9240 | auto stream = mImpl->stream(); |
| 9241 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9242 | auto resources = mImpl->resources(); |
| 9243 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9244 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9245 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9246 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9247 | VkBindImageMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9248 | local_device = device; |
| 9249 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9250 | local_pBindInfos = nullptr; |
| 9251 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9252 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9253 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9254 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9255 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9256 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 9257 | } |
| 9258 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9259 | if (local_pBindInfos) |
| 9260 | { |
| 9261 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9262 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9263 | transform_tohost_VkBindImageMemoryInfo(mImpl->resources(), (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9264 | } |
| 9265 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9266 | countingStream->rewind(); |
| 9267 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9268 | uint64_t cgen_var_653; |
| 9269 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_653, 1); |
| 9270 | countingStream->write((uint64_t*)&cgen_var_653, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9271 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 9272 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9273 | { |
| 9274 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9275 | } |
| 9276 | } |
| 9277 | uint32_t packetSize_vkBindImageMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9278 | countingStream->rewind(); |
| 9279 | uint32_t opcode_vkBindImageMemory2 = OP_vkBindImageMemory2; |
| 9280 | stream->write(&opcode_vkBindImageMemory2, sizeof(uint32_t)); |
| 9281 | stream->write(&packetSize_vkBindImageMemory2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9282 | uint64_t cgen_var_654; |
| 9283 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_654, 1); |
| 9284 | stream->write((uint64_t*)&cgen_var_654, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9285 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9286 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9287 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9288 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9289 | } |
| 9290 | VkResult vkBindImageMemory2_VkResult_return = (VkResult)0; |
| 9291 | stream->read(&vkBindImageMemory2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9292 | countingStream->clearPool(); |
| 9293 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9294 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9295 | mImpl->log("finish vkBindImageMemory2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9296 | return vkBindImageMemory2_VkResult_return; |
| 9297 | } |
| 9298 | |
| 9299 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeatures( |
| 9300 | VkDevice device, |
| 9301 | uint32_t heapIndex, |
| 9302 | uint32_t localDeviceIndex, |
| 9303 | uint32_t remoteDeviceIndex, |
| 9304 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 9305 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9306 | mImpl->log("start vkGetDeviceGroupPeerMemoryFeatures"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9307 | auto stream = mImpl->stream(); |
| 9308 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9309 | auto resources = mImpl->resources(); |
| 9310 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9311 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9312 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9313 | uint32_t local_heapIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9314 | uint32_t local_localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9315 | uint32_t local_remoteDeviceIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9316 | local_device = device; |
| 9317 | local_heapIndex = heapIndex; |
| 9318 | local_localDeviceIndex = localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9319 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9320 | countingStream->rewind(); |
| 9321 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9322 | uint64_t cgen_var_655; |
| 9323 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_655, 1); |
| 9324 | countingStream->write((uint64_t*)&cgen_var_655, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9325 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 9326 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 9327 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9328 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 9329 | } |
| 9330 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9331 | countingStream->rewind(); |
| 9332 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeatures = OP_vkGetDeviceGroupPeerMemoryFeatures; |
| 9333 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| 9334 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9335 | uint64_t cgen_var_656; |
| 9336 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_656, 1); |
| 9337 | stream->write((uint64_t*)&cgen_var_656, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9338 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 9339 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 9340 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9341 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 9342 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9343 | mImpl->log("finish vkGetDeviceGroupPeerMemoryFeatures");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9344 | } |
| 9345 | |
| 9346 | void VkEncoder::vkCmdSetDeviceMask( |
| 9347 | VkCommandBuffer commandBuffer, |
| 9348 | uint32_t deviceMask) |
| 9349 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9350 | mImpl->log("start vkCmdSetDeviceMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9351 | auto stream = mImpl->stream(); |
| 9352 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9353 | auto resources = mImpl->resources(); |
| 9354 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9355 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9356 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9357 | uint32_t local_deviceMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9358 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9359 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9360 | countingStream->rewind(); |
| 9361 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9362 | uint64_t cgen_var_657; |
| 9363 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_657, 1); |
| 9364 | countingStream->write((uint64_t*)&cgen_var_657, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9365 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9366 | } |
| 9367 | uint32_t packetSize_vkCmdSetDeviceMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9368 | countingStream->rewind(); |
| 9369 | uint32_t opcode_vkCmdSetDeviceMask = OP_vkCmdSetDeviceMask; |
| 9370 | stream->write(&opcode_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| 9371 | stream->write(&packetSize_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9372 | uint64_t cgen_var_658; |
| 9373 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_658, 1); |
| 9374 | stream->write((uint64_t*)&cgen_var_658, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9375 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9376 | mImpl->log("finish vkCmdSetDeviceMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9377 | } |
| 9378 | |
| 9379 | void VkEncoder::vkCmdDispatchBase( |
| 9380 | VkCommandBuffer commandBuffer, |
| 9381 | uint32_t baseGroupX, |
| 9382 | uint32_t baseGroupY, |
| 9383 | uint32_t baseGroupZ, |
| 9384 | uint32_t groupCountX, |
| 9385 | uint32_t groupCountY, |
| 9386 | uint32_t groupCountZ) |
| 9387 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9388 | mImpl->log("start vkCmdDispatchBase"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9389 | auto stream = mImpl->stream(); |
| 9390 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9391 | auto resources = mImpl->resources(); |
| 9392 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9393 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9394 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9395 | uint32_t local_baseGroupX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9396 | uint32_t local_baseGroupY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9397 | uint32_t local_baseGroupZ; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9398 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9399 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9400 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9401 | local_commandBuffer = commandBuffer; |
| 9402 | local_baseGroupX = baseGroupX; |
| 9403 | local_baseGroupY = baseGroupY; |
| 9404 | local_baseGroupZ = baseGroupZ; |
| 9405 | local_groupCountX = groupCountX; |
| 9406 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9407 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9408 | countingStream->rewind(); |
| 9409 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9410 | uint64_t cgen_var_659; |
| 9411 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_659, 1); |
| 9412 | countingStream->write((uint64_t*)&cgen_var_659, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9413 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 9414 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 9415 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 9416 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 9417 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 9418 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9419 | } |
| 9420 | uint32_t packetSize_vkCmdDispatchBase = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9421 | countingStream->rewind(); |
| 9422 | uint32_t opcode_vkCmdDispatchBase = OP_vkCmdDispatchBase; |
| 9423 | stream->write(&opcode_vkCmdDispatchBase, sizeof(uint32_t)); |
| 9424 | stream->write(&packetSize_vkCmdDispatchBase, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9425 | uint64_t cgen_var_660; |
| 9426 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_660, 1); |
| 9427 | stream->write((uint64_t*)&cgen_var_660, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9428 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 9429 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 9430 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 9431 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 9432 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 9433 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9434 | mImpl->log("finish vkCmdDispatchBase");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9435 | } |
| 9436 | |
| 9437 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroups( |
| 9438 | VkInstance instance, |
| 9439 | uint32_t* pPhysicalDeviceGroupCount, |
| 9440 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 9441 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9442 | mImpl->log("start vkEnumeratePhysicalDeviceGroups"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9443 | auto stream = mImpl->stream(); |
| 9444 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9445 | auto resources = mImpl->resources(); |
| 9446 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9447 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9448 | VkInstance local_instance; |
| 9449 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9450 | countingStream->rewind(); |
| 9451 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9452 | uint64_t cgen_var_661; |
| 9453 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_661, 1); |
| 9454 | countingStream->write((uint64_t*)&cgen_var_661, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9455 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9456 | uint64_t cgen_var_662 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 9457 | countingStream->putBe64(cgen_var_662); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9458 | if (pPhysicalDeviceGroupCount) |
| 9459 | { |
| 9460 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 9461 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9462 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9463 | uint64_t cgen_var_663 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 9464 | countingStream->putBe64(cgen_var_663); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9465 | if (pPhysicalDeviceGroupProperties) |
| 9466 | { |
| 9467 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 9468 | { |
| 9469 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 9470 | } |
| 9471 | } |
| 9472 | } |
| 9473 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroups = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9474 | countingStream->rewind(); |
| 9475 | uint32_t opcode_vkEnumeratePhysicalDeviceGroups = OP_vkEnumeratePhysicalDeviceGroups; |
| 9476 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| 9477 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9478 | uint64_t cgen_var_664; |
| 9479 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_664, 1); |
| 9480 | stream->write((uint64_t*)&cgen_var_664, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9481 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9482 | uint64_t cgen_var_665 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 9483 | stream->putBe64(cgen_var_665); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9484 | if (pPhysicalDeviceGroupCount) |
| 9485 | { |
| 9486 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 9487 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9488 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9489 | uint64_t cgen_var_666 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 9490 | stream->putBe64(cgen_var_666); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9491 | if (pPhysicalDeviceGroupProperties) |
| 9492 | { |
| 9493 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 9494 | { |
| 9495 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 9496 | } |
| 9497 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9498 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9499 | uint32_t* check_pPhysicalDeviceGroupCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9500 | check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9501 | if (pPhysicalDeviceGroupCount) |
| 9502 | { |
| 9503 | if (!(check_pPhysicalDeviceGroupCount)) |
| 9504 | { |
| 9505 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 9506 | } |
| 9507 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 9508 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9509 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9510 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9511 | check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9512 | if (pPhysicalDeviceGroupProperties) |
| 9513 | { |
| 9514 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 9515 | { |
| 9516 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 9517 | } |
| 9518 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 9519 | { |
| 9520 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 9521 | } |
| 9522 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9523 | if (pPhysicalDeviceGroupProperties) |
| 9524 | { |
| 9525 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 9526 | { |
| 9527 | transform_fromhost_VkPhysicalDeviceGroupProperties(mImpl->resources(), (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 9528 | } |
| 9529 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9530 | VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0; |
| 9531 | stream->read(&vkEnumeratePhysicalDeviceGroups_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9532 | countingStream->clearPool(); |
| 9533 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9534 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9535 | mImpl->log("finish vkEnumeratePhysicalDeviceGroups");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9536 | return vkEnumeratePhysicalDeviceGroups_VkResult_return; |
| 9537 | } |
| 9538 | |
| 9539 | void VkEncoder::vkGetImageMemoryRequirements2( |
| 9540 | VkDevice device, |
| 9541 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 9542 | VkMemoryRequirements2* pMemoryRequirements) |
| 9543 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9544 | mImpl->log("start vkGetImageMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9545 | auto stream = mImpl->stream(); |
| 9546 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9547 | auto resources = mImpl->resources(); |
| 9548 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9549 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9550 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9551 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9552 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9553 | local_pInfo = nullptr; |
| 9554 | if (pInfo) |
| 9555 | { |
| 9556 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 9557 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 9558 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9559 | if (local_pInfo) |
| 9560 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9561 | transform_tohost_VkImageMemoryRequirementsInfo2(mImpl->resources(), (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9562 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9563 | countingStream->rewind(); |
| 9564 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9565 | uint64_t cgen_var_669; |
| 9566 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_669, 1); |
| 9567 | countingStream->write((uint64_t*)&cgen_var_669, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9568 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9569 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 9570 | } |
| 9571 | uint32_t packetSize_vkGetImageMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9572 | countingStream->rewind(); |
| 9573 | uint32_t opcode_vkGetImageMemoryRequirements2 = OP_vkGetImageMemoryRequirements2; |
| 9574 | stream->write(&opcode_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| 9575 | stream->write(&packetSize_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9576 | uint64_t cgen_var_670; |
| 9577 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_670, 1); |
| 9578 | stream->write((uint64_t*)&cgen_var_670, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9579 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9580 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 9581 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9582 | if (pMemoryRequirements) |
| 9583 | { |
| 9584 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 9585 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9586 | mImpl->log("finish vkGetImageMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9587 | } |
| 9588 | |
| 9589 | void VkEncoder::vkGetBufferMemoryRequirements2( |
| 9590 | VkDevice device, |
| 9591 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 9592 | VkMemoryRequirements2* pMemoryRequirements) |
| 9593 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9594 | mImpl->log("start vkGetBufferMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9595 | auto stream = mImpl->stream(); |
| 9596 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9597 | auto resources = mImpl->resources(); |
| 9598 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9599 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9600 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9601 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9602 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9603 | local_pInfo = nullptr; |
| 9604 | if (pInfo) |
| 9605 | { |
| 9606 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 9607 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 9608 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9609 | if (local_pInfo) |
| 9610 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9611 | transform_tohost_VkBufferMemoryRequirementsInfo2(mImpl->resources(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9612 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9613 | countingStream->rewind(); |
| 9614 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9615 | uint64_t cgen_var_671; |
| 9616 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_671, 1); |
| 9617 | countingStream->write((uint64_t*)&cgen_var_671, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9618 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9619 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 9620 | } |
| 9621 | uint32_t packetSize_vkGetBufferMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9622 | countingStream->rewind(); |
| 9623 | uint32_t opcode_vkGetBufferMemoryRequirements2 = OP_vkGetBufferMemoryRequirements2; |
| 9624 | stream->write(&opcode_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| 9625 | stream->write(&packetSize_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9626 | uint64_t cgen_var_672; |
| 9627 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_672, 1); |
| 9628 | stream->write((uint64_t*)&cgen_var_672, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9629 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9630 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 9631 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9632 | if (pMemoryRequirements) |
| 9633 | { |
| 9634 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 9635 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9636 | mImpl->log("finish vkGetBufferMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9637 | } |
| 9638 | |
| 9639 | void VkEncoder::vkGetImageSparseMemoryRequirements2( |
| 9640 | VkDevice device, |
| 9641 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 9642 | uint32_t* pSparseMemoryRequirementCount, |
| 9643 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 9644 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9645 | mImpl->log("start vkGetImageSparseMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9646 | auto stream = mImpl->stream(); |
| 9647 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9648 | auto resources = mImpl->resources(); |
| 9649 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9650 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9651 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9652 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9653 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9654 | local_pInfo = nullptr; |
| 9655 | if (pInfo) |
| 9656 | { |
| 9657 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 9658 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 9659 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9660 | if (local_pInfo) |
| 9661 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9662 | transform_tohost_VkImageSparseMemoryRequirementsInfo2(mImpl->resources(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9663 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9664 | countingStream->rewind(); |
| 9665 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9666 | uint64_t cgen_var_673; |
| 9667 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_673, 1); |
| 9668 | countingStream->write((uint64_t*)&cgen_var_673, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9669 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9670 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9671 | uint64_t cgen_var_674 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 9672 | countingStream->putBe64(cgen_var_674); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9673 | if (pSparseMemoryRequirementCount) |
| 9674 | { |
| 9675 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 9676 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9677 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9678 | uint64_t cgen_var_675 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 9679 | countingStream->putBe64(cgen_var_675); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9680 | if (pSparseMemoryRequirements) |
| 9681 | { |
| 9682 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 9683 | { |
| 9684 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 9685 | } |
| 9686 | } |
| 9687 | } |
| 9688 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9689 | countingStream->rewind(); |
| 9690 | uint32_t opcode_vkGetImageSparseMemoryRequirements2 = OP_vkGetImageSparseMemoryRequirements2; |
| 9691 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| 9692 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9693 | uint64_t cgen_var_676; |
| 9694 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_676, 1); |
| 9695 | stream->write((uint64_t*)&cgen_var_676, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9696 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9697 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9698 | uint64_t cgen_var_677 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 9699 | stream->putBe64(cgen_var_677); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9700 | if (pSparseMemoryRequirementCount) |
| 9701 | { |
| 9702 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 9703 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9704 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9705 | uint64_t cgen_var_678 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 9706 | stream->putBe64(cgen_var_678); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9707 | if (pSparseMemoryRequirements) |
| 9708 | { |
| 9709 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 9710 | { |
| 9711 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 9712 | } |
| 9713 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9714 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9715 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9716 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9717 | if (pSparseMemoryRequirementCount) |
| 9718 | { |
| 9719 | if (!(check_pSparseMemoryRequirementCount)) |
| 9720 | { |
| 9721 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 9722 | } |
| 9723 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 9724 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9725 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9726 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9727 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9728 | if (pSparseMemoryRequirements) |
| 9729 | { |
| 9730 | if (!(check_pSparseMemoryRequirements)) |
| 9731 | { |
| 9732 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 9733 | } |
| 9734 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 9735 | { |
| 9736 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 9737 | } |
| 9738 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9739 | if (pSparseMemoryRequirements) |
| 9740 | { |
| 9741 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 9742 | { |
| 9743 | transform_fromhost_VkSparseImageMemoryRequirements2(mImpl->resources(), (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 9744 | } |
| 9745 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9746 | mImpl->log("finish vkGetImageSparseMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9747 | } |
| 9748 | |
| 9749 | void VkEncoder::vkGetPhysicalDeviceFeatures2( |
| 9750 | VkPhysicalDevice physicalDevice, |
| 9751 | VkPhysicalDeviceFeatures2* pFeatures) |
| 9752 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9753 | mImpl->log("start vkGetPhysicalDeviceFeatures2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9754 | auto stream = mImpl->stream(); |
| 9755 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9756 | auto resources = mImpl->resources(); |
| 9757 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9758 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9759 | VkPhysicalDevice local_physicalDevice; |
| 9760 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9761 | countingStream->rewind(); |
| 9762 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9763 | uint64_t cgen_var_681; |
| 9764 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_681, 1); |
| 9765 | countingStream->write((uint64_t*)&cgen_var_681, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9766 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 9767 | } |
| 9768 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9769 | countingStream->rewind(); |
| 9770 | uint32_t opcode_vkGetPhysicalDeviceFeatures2 = OP_vkGetPhysicalDeviceFeatures2; |
| 9771 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| 9772 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9773 | uint64_t cgen_var_682; |
| 9774 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_682, 1); |
| 9775 | stream->write((uint64_t*)&cgen_var_682, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9776 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 9777 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9778 | if (pFeatures) |
| 9779 | { |
| 9780 | transform_fromhost_VkPhysicalDeviceFeatures2(mImpl->resources(), (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 9781 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9782 | mImpl->log("finish vkGetPhysicalDeviceFeatures2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9783 | } |
| 9784 | |
| 9785 | void VkEncoder::vkGetPhysicalDeviceProperties2( |
| 9786 | VkPhysicalDevice physicalDevice, |
| 9787 | VkPhysicalDeviceProperties2* pProperties) |
| 9788 | { |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 9789 | mImpl->resources()->on_vkGetPhysicalDeviceProperties2(this, physicalDevice, pProperties); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9790 | } |
| 9791 | |
| 9792 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2( |
| 9793 | VkPhysicalDevice physicalDevice, |
| 9794 | VkFormat format, |
| 9795 | VkFormatProperties2* pFormatProperties) |
| 9796 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9797 | mImpl->log("start vkGetPhysicalDeviceFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9798 | auto stream = mImpl->stream(); |
| 9799 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9800 | auto resources = mImpl->resources(); |
| 9801 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9802 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9803 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9804 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9805 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9806 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9807 | countingStream->rewind(); |
| 9808 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9809 | uint64_t cgen_var_683; |
| 9810 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_683, 1); |
| 9811 | countingStream->write((uint64_t*)&cgen_var_683, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9812 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9813 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 9814 | } |
| 9815 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9816 | countingStream->rewind(); |
| 9817 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2 = OP_vkGetPhysicalDeviceFormatProperties2; |
| 9818 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| 9819 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9820 | uint64_t cgen_var_684; |
| 9821 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_684, 1); |
| 9822 | stream->write((uint64_t*)&cgen_var_684, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9823 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9824 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| 9825 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9826 | if (pFormatProperties) |
| 9827 | { |
| 9828 | transform_fromhost_VkFormatProperties2(mImpl->resources(), (VkFormatProperties2*)(pFormatProperties)); |
| 9829 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9830 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9831 | } |
| 9832 | |
| 9833 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2( |
| 9834 | VkPhysicalDevice physicalDevice, |
| 9835 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 9836 | VkImageFormatProperties2* pImageFormatProperties) |
| 9837 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9838 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9839 | auto stream = mImpl->stream(); |
| 9840 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9841 | auto resources = mImpl->resources(); |
| 9842 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9843 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9844 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9845 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9846 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9847 | local_pImageFormatInfo = nullptr; |
| 9848 | if (pImageFormatInfo) |
| 9849 | { |
| 9850 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 9851 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 9852 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9853 | if (local_pImageFormatInfo) |
| 9854 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9855 | transform_tohost_VkPhysicalDeviceImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9856 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9857 | countingStream->rewind(); |
| 9858 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9859 | uint64_t cgen_var_685; |
| 9860 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_685, 1); |
| 9861 | countingStream->write((uint64_t*)&cgen_var_685, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9862 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9863 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 9864 | } |
| 9865 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9866 | countingStream->rewind(); |
| 9867 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2 = OP_vkGetPhysicalDeviceImageFormatProperties2; |
| 9868 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| 9869 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9870 | uint64_t cgen_var_686; |
| 9871 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_686, 1); |
| 9872 | stream->write((uint64_t*)&cgen_var_686, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9873 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9874 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 9875 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9876 | if (pImageFormatProperties) |
| 9877 | { |
| 9878 | transform_fromhost_VkImageFormatProperties2(mImpl->resources(), (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 9879 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9880 | VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0; |
| 9881 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9882 | countingStream->clearPool(); |
| 9883 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9884 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9885 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9886 | return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return; |
| 9887 | } |
| 9888 | |
| 9889 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2( |
| 9890 | VkPhysicalDevice physicalDevice, |
| 9891 | uint32_t* pQueueFamilyPropertyCount, |
| 9892 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 9893 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9894 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9895 | auto stream = mImpl->stream(); |
| 9896 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9897 | auto resources = mImpl->resources(); |
| 9898 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9899 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9900 | VkPhysicalDevice local_physicalDevice; |
| 9901 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9902 | countingStream->rewind(); |
| 9903 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9904 | uint64_t cgen_var_687; |
| 9905 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_687, 1); |
| 9906 | countingStream->write((uint64_t*)&cgen_var_687, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9907 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9908 | uint64_t cgen_var_688 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 9909 | countingStream->putBe64(cgen_var_688); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9910 | if (pQueueFamilyPropertyCount) |
| 9911 | { |
| 9912 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 9913 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9914 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9915 | uint64_t cgen_var_689 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 9916 | countingStream->putBe64(cgen_var_689); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9917 | if (pQueueFamilyProperties) |
| 9918 | { |
| 9919 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 9920 | { |
| 9921 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 9922 | } |
| 9923 | } |
| 9924 | } |
| 9925 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9926 | countingStream->rewind(); |
| 9927 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2 = OP_vkGetPhysicalDeviceQueueFamilyProperties2; |
| 9928 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| 9929 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9930 | uint64_t cgen_var_690; |
| 9931 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_690, 1); |
| 9932 | stream->write((uint64_t*)&cgen_var_690, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9933 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9934 | uint64_t cgen_var_691 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 9935 | stream->putBe64(cgen_var_691); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9936 | if (pQueueFamilyPropertyCount) |
| 9937 | { |
| 9938 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 9939 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9940 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9941 | uint64_t cgen_var_692 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 9942 | stream->putBe64(cgen_var_692); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9943 | if (pQueueFamilyProperties) |
| 9944 | { |
| 9945 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 9946 | { |
| 9947 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 9948 | } |
| 9949 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9950 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9951 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9952 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9953 | if (pQueueFamilyPropertyCount) |
| 9954 | { |
| 9955 | if (!(check_pQueueFamilyPropertyCount)) |
| 9956 | { |
| 9957 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 9958 | } |
| 9959 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 9960 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9961 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9962 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9963 | check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9964 | if (pQueueFamilyProperties) |
| 9965 | { |
| 9966 | if (!(check_pQueueFamilyProperties)) |
| 9967 | { |
| 9968 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 9969 | } |
| 9970 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 9971 | { |
| 9972 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 9973 | } |
| 9974 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9975 | if (pQueueFamilyProperties) |
| 9976 | { |
| 9977 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 9978 | { |
| 9979 | transform_fromhost_VkQueueFamilyProperties2(mImpl->resources(), (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 9980 | } |
| 9981 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9982 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9983 | } |
| 9984 | |
| 9985 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2( |
| 9986 | VkPhysicalDevice physicalDevice, |
| 9987 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 9988 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9989 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9990 | auto stream = mImpl->stream(); |
| 9991 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9992 | auto resources = mImpl->resources(); |
| 9993 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9994 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9995 | VkPhysicalDevice local_physicalDevice; |
| 9996 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9997 | countingStream->rewind(); |
| 9998 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 9999 | uint64_t cgen_var_695; |
| 10000 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_695, 1); |
| 10001 | countingStream->write((uint64_t*)&cgen_var_695, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10002 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10003 | } |
| 10004 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10005 | countingStream->rewind(); |
| 10006 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2 = OP_vkGetPhysicalDeviceMemoryProperties2; |
| 10007 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| 10008 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10009 | uint64_t cgen_var_696; |
| 10010 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_696, 1); |
| 10011 | stream->write((uint64_t*)&cgen_var_696, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10012 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10013 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10014 | if (pMemoryProperties) |
| 10015 | { |
| 10016 | transform_fromhost_VkPhysicalDeviceMemoryProperties2(mImpl->resources(), (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10017 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10018 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10019 | } |
| 10020 | |
| 10021 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2( |
| 10022 | VkPhysicalDevice physicalDevice, |
| 10023 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 10024 | uint32_t* pPropertyCount, |
| 10025 | VkSparseImageFormatProperties2* pProperties) |
| 10026 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10027 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10028 | auto stream = mImpl->stream(); |
| 10029 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10030 | auto resources = mImpl->resources(); |
| 10031 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10032 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10033 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10034 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10035 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10036 | local_pFormatInfo = nullptr; |
| 10037 | if (pFormatInfo) |
| 10038 | { |
| 10039 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 10040 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 10041 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10042 | if (local_pFormatInfo) |
| 10043 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10044 | transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10045 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10046 | countingStream->rewind(); |
| 10047 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10048 | uint64_t cgen_var_697; |
| 10049 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_697, 1); |
| 10050 | countingStream->write((uint64_t*)&cgen_var_697, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10051 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10052 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10053 | uint64_t cgen_var_698 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10054 | countingStream->putBe64(cgen_var_698); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10055 | if (pPropertyCount) |
| 10056 | { |
| 10057 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10058 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10059 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10060 | uint64_t cgen_var_699 = (uint64_t)(uintptr_t)pProperties; |
| 10061 | countingStream->putBe64(cgen_var_699); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10062 | if (pProperties) |
| 10063 | { |
| 10064 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10065 | { |
| 10066 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10067 | } |
| 10068 | } |
| 10069 | } |
| 10070 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10071 | countingStream->rewind(); |
| 10072 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2 = OP_vkGetPhysicalDeviceSparseImageFormatProperties2; |
| 10073 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| 10074 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10075 | uint64_t cgen_var_700; |
| 10076 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_700, 1); |
| 10077 | stream->write((uint64_t*)&cgen_var_700, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10078 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10079 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10080 | uint64_t cgen_var_701 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10081 | stream->putBe64(cgen_var_701); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10082 | if (pPropertyCount) |
| 10083 | { |
| 10084 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10085 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10086 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10087 | uint64_t cgen_var_702 = (uint64_t)(uintptr_t)pProperties; |
| 10088 | stream->putBe64(cgen_var_702); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10089 | if (pProperties) |
| 10090 | { |
| 10091 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10092 | { |
| 10093 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10094 | } |
| 10095 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10096 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10097 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10098 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10099 | if (pPropertyCount) |
| 10100 | { |
| 10101 | if (!(check_pPropertyCount)) |
| 10102 | { |
| 10103 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 10104 | } |
| 10105 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10106 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10107 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10108 | VkSparseImageFormatProperties2* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10109 | check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10110 | if (pProperties) |
| 10111 | { |
| 10112 | if (!(check_pProperties)) |
| 10113 | { |
| 10114 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 10115 | } |
| 10116 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10117 | { |
| 10118 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10119 | } |
| 10120 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10121 | if (pProperties) |
| 10122 | { |
| 10123 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10124 | { |
| 10125 | transform_fromhost_VkSparseImageFormatProperties2(mImpl->resources(), (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10126 | } |
| 10127 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10128 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10129 | } |
| 10130 | |
| 10131 | void VkEncoder::vkTrimCommandPool( |
| 10132 | VkDevice device, |
| 10133 | VkCommandPool commandPool, |
| 10134 | VkCommandPoolTrimFlags flags) |
| 10135 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10136 | mImpl->log("start vkTrimCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10137 | auto stream = mImpl->stream(); |
| 10138 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10139 | auto resources = mImpl->resources(); |
| 10140 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10141 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10142 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10143 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10144 | VkCommandPoolTrimFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10145 | local_device = device; |
| 10146 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10147 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10148 | countingStream->rewind(); |
| 10149 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10150 | uint64_t cgen_var_705; |
| 10151 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_705, 1); |
| 10152 | countingStream->write((uint64_t*)&cgen_var_705, 1 * 8); |
| 10153 | uint64_t cgen_var_706; |
| 10154 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_706, 1); |
| 10155 | countingStream->write((uint64_t*)&cgen_var_706, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10156 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10157 | } |
| 10158 | uint32_t packetSize_vkTrimCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10159 | countingStream->rewind(); |
| 10160 | uint32_t opcode_vkTrimCommandPool = OP_vkTrimCommandPool; |
| 10161 | stream->write(&opcode_vkTrimCommandPool, sizeof(uint32_t)); |
| 10162 | stream->write(&packetSize_vkTrimCommandPool, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10163 | uint64_t cgen_var_707; |
| 10164 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_707, 1); |
| 10165 | stream->write((uint64_t*)&cgen_var_707, 1 * 8); |
| 10166 | uint64_t cgen_var_708; |
| 10167 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_708, 1); |
| 10168 | stream->write((uint64_t*)&cgen_var_708, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10169 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10170 | mImpl->log("finish vkTrimCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10171 | } |
| 10172 | |
| 10173 | void VkEncoder::vkGetDeviceQueue2( |
| 10174 | VkDevice device, |
| 10175 | const VkDeviceQueueInfo2* pQueueInfo, |
| 10176 | VkQueue* pQueue) |
| 10177 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10178 | mImpl->log("start vkGetDeviceQueue2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10179 | auto stream = mImpl->stream(); |
| 10180 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10181 | auto resources = mImpl->resources(); |
| 10182 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10183 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10184 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10185 | VkDeviceQueueInfo2* local_pQueueInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10186 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10187 | local_pQueueInfo = nullptr; |
| 10188 | if (pQueueInfo) |
| 10189 | { |
| 10190 | local_pQueueInfo = (VkDeviceQueueInfo2*)pool->alloc(sizeof(const VkDeviceQueueInfo2)); |
| 10191 | deepcopy_VkDeviceQueueInfo2(pool, pQueueInfo, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| 10192 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10193 | if (local_pQueueInfo) |
| 10194 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10195 | transform_tohost_VkDeviceQueueInfo2(mImpl->resources(), (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10196 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10197 | countingStream->rewind(); |
| 10198 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10199 | uint64_t cgen_var_709; |
| 10200 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_709, 1); |
| 10201 | countingStream->write((uint64_t*)&cgen_var_709, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10202 | marshal_VkDeviceQueueInfo2(countingStream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10203 | uint64_t cgen_var_710; |
| 10204 | countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_710, 1); |
| 10205 | countingStream->write((uint64_t*)&cgen_var_710, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10206 | } |
| 10207 | uint32_t packetSize_vkGetDeviceQueue2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10208 | countingStream->rewind(); |
| 10209 | uint32_t opcode_vkGetDeviceQueue2 = OP_vkGetDeviceQueue2; |
| 10210 | stream->write(&opcode_vkGetDeviceQueue2, sizeof(uint32_t)); |
| 10211 | stream->write(&packetSize_vkGetDeviceQueue2, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10212 | uint64_t cgen_var_711; |
| 10213 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_711, 1); |
| 10214 | stream->write((uint64_t*)&cgen_var_711, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10215 | marshal_VkDeviceQueueInfo2(stream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10216 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10217 | uint64_t cgen_var_712; |
| 10218 | stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_712, 1); |
| 10219 | stream->write((uint64_t*)&cgen_var_712, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10220 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10221 | uint64_t cgen_var_713; |
| 10222 | stream->read((uint64_t*)&cgen_var_713, 8); |
| 10223 | stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_713, (VkQueue*)pQueue, 1); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10224 | mImpl->log("finish vkGetDeviceQueue2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10225 | } |
| 10226 | |
| 10227 | VkResult VkEncoder::vkCreateSamplerYcbcrConversion( |
| 10228 | VkDevice device, |
| 10229 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 10230 | const VkAllocationCallbacks* pAllocator, |
| 10231 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 10232 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10233 | mImpl->log("start vkCreateSamplerYcbcrConversion"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10234 | auto stream = mImpl->stream(); |
| 10235 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10236 | auto resources = mImpl->resources(); |
| 10237 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10238 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10239 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10240 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10241 | VkAllocationCallbacks* local_pAllocator; |
| 10242 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10243 | local_pCreateInfo = nullptr; |
| 10244 | if (pCreateInfo) |
| 10245 | { |
| 10246 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 10247 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 10248 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10249 | local_pAllocator = nullptr; |
| 10250 | if (pAllocator) |
| 10251 | { |
| 10252 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10253 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10254 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10255 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10256 | if (local_pCreateInfo) |
| 10257 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10258 | transform_tohost_VkSamplerYcbcrConversionCreateInfo(mImpl->resources(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10259 | } |
| 10260 | if (local_pAllocator) |
| 10261 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10262 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10263 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10264 | countingStream->rewind(); |
| 10265 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10266 | uint64_t cgen_var_714; |
| 10267 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_714, 1); |
| 10268 | countingStream->write((uint64_t*)&cgen_var_714, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10269 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10270 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10271 | uint64_t cgen_var_715 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10272 | countingStream->putBe64(cgen_var_715); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10273 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10274 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10275 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10276 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10277 | uint64_t cgen_var_716; |
| 10278 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_716, 1); |
| 10279 | countingStream->write((uint64_t*)&cgen_var_716, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10280 | } |
| 10281 | uint32_t packetSize_vkCreateSamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10282 | countingStream->rewind(); |
| 10283 | uint32_t opcode_vkCreateSamplerYcbcrConversion = OP_vkCreateSamplerYcbcrConversion; |
| 10284 | stream->write(&opcode_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| 10285 | stream->write(&packetSize_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10286 | uint64_t cgen_var_717; |
| 10287 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_717, 1); |
| 10288 | stream->write((uint64_t*)&cgen_var_717, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10289 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10290 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10291 | uint64_t cgen_var_718 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10292 | stream->putBe64(cgen_var_718); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10293 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10294 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10295 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10296 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10297 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10298 | uint64_t cgen_var_719; |
| 10299 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_719, 1); |
| 10300 | stream->write((uint64_t*)&cgen_var_719, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10301 | stream->setHandleMapping(resources->unwrapMapping()); |
| 10302 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10303 | uint64_t cgen_var_720; |
| 10304 | stream->read((uint64_t*)&cgen_var_720, 8); |
| 10305 | stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_720, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10306 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10307 | VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0; |
| 10308 | stream->read(&vkCreateSamplerYcbcrConversion_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10309 | countingStream->clearPool(); |
| 10310 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10311 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10312 | mImpl->log("finish vkCreateSamplerYcbcrConversion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10313 | return vkCreateSamplerYcbcrConversion_VkResult_return; |
| 10314 | } |
| 10315 | |
| 10316 | void VkEncoder::vkDestroySamplerYcbcrConversion( |
| 10317 | VkDevice device, |
| 10318 | VkSamplerYcbcrConversion ycbcrConversion, |
| 10319 | const VkAllocationCallbacks* pAllocator) |
| 10320 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10321 | mImpl->log("start vkDestroySamplerYcbcrConversion"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10322 | auto stream = mImpl->stream(); |
| 10323 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10324 | auto resources = mImpl->resources(); |
| 10325 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10326 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10327 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10328 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10329 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10330 | local_device = device; |
| 10331 | local_ycbcrConversion = ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10332 | local_pAllocator = nullptr; |
| 10333 | if (pAllocator) |
| 10334 | { |
| 10335 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10336 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10337 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10338 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10339 | if (local_pAllocator) |
| 10340 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10341 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10342 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10343 | countingStream->rewind(); |
| 10344 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10345 | uint64_t cgen_var_721; |
| 10346 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_721, 1); |
| 10347 | countingStream->write((uint64_t*)&cgen_var_721, 1 * 8); |
| 10348 | uint64_t cgen_var_722; |
| 10349 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_722, 1); |
| 10350 | countingStream->write((uint64_t*)&cgen_var_722, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10351 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10352 | uint64_t cgen_var_723 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10353 | countingStream->putBe64(cgen_var_723); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10354 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10355 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10356 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10357 | } |
| 10358 | } |
| 10359 | uint32_t packetSize_vkDestroySamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10360 | countingStream->rewind(); |
| 10361 | uint32_t opcode_vkDestroySamplerYcbcrConversion = OP_vkDestroySamplerYcbcrConversion; |
| 10362 | stream->write(&opcode_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| 10363 | stream->write(&packetSize_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10364 | uint64_t cgen_var_724; |
| 10365 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_724, 1); |
| 10366 | stream->write((uint64_t*)&cgen_var_724, 1 * 8); |
| 10367 | uint64_t cgen_var_725; |
| 10368 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_725, 1); |
| 10369 | stream->write((uint64_t*)&cgen_var_725, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10370 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10371 | uint64_t cgen_var_726 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10372 | stream->putBe64(cgen_var_726); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10373 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10374 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10375 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10376 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10377 | resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10378 | mImpl->log("finish vkDestroySamplerYcbcrConversion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10379 | } |
| 10380 | |
| 10381 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplate( |
| 10382 | VkDevice device, |
| 10383 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 10384 | const VkAllocationCallbacks* pAllocator, |
| 10385 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 10386 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10387 | mImpl->log("start vkCreateDescriptorUpdateTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10388 | auto stream = mImpl->stream(); |
| 10389 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10390 | auto resources = mImpl->resources(); |
| 10391 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10392 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10393 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10394 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10395 | VkAllocationCallbacks* local_pAllocator; |
| 10396 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10397 | local_pCreateInfo = nullptr; |
| 10398 | if (pCreateInfo) |
| 10399 | { |
| 10400 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 10401 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 10402 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10403 | local_pAllocator = nullptr; |
| 10404 | if (pAllocator) |
| 10405 | { |
| 10406 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10407 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10408 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10409 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10410 | if (local_pCreateInfo) |
| 10411 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10412 | transform_tohost_VkDescriptorUpdateTemplateCreateInfo(mImpl->resources(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10413 | } |
| 10414 | if (local_pAllocator) |
| 10415 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10416 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10417 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10418 | countingStream->rewind(); |
| 10419 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10420 | uint64_t cgen_var_727; |
| 10421 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_727, 1); |
| 10422 | countingStream->write((uint64_t*)&cgen_var_727, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10423 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10424 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10425 | uint64_t cgen_var_728 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10426 | countingStream->putBe64(cgen_var_728); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10427 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10428 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10429 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10430 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10431 | uint64_t cgen_var_729; |
| 10432 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_729, 1); |
| 10433 | countingStream->write((uint64_t*)&cgen_var_729, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10434 | } |
| 10435 | uint32_t packetSize_vkCreateDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10436 | countingStream->rewind(); |
| 10437 | uint32_t opcode_vkCreateDescriptorUpdateTemplate = OP_vkCreateDescriptorUpdateTemplate; |
| 10438 | stream->write(&opcode_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 10439 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10440 | uint64_t cgen_var_730; |
| 10441 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_730, 1); |
| 10442 | stream->write((uint64_t*)&cgen_var_730, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10443 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10444 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10445 | uint64_t cgen_var_731 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10446 | stream->putBe64(cgen_var_731); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10447 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10448 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10449 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10450 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10451 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10452 | uint64_t cgen_var_732; |
| 10453 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_732, 1); |
| 10454 | stream->write((uint64_t*)&cgen_var_732, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10455 | stream->setHandleMapping(resources->unwrapMapping()); |
| 10456 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10457 | uint64_t cgen_var_733; |
| 10458 | stream->read((uint64_t*)&cgen_var_733, 8); |
| 10459 | stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_733, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10460 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10461 | VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0; |
| 10462 | stream->read(&vkCreateDescriptorUpdateTemplate_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10463 | countingStream->clearPool(); |
| 10464 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10465 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10466 | mImpl->log("finish vkCreateDescriptorUpdateTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10467 | return vkCreateDescriptorUpdateTemplate_VkResult_return; |
| 10468 | } |
| 10469 | |
| 10470 | void VkEncoder::vkDestroyDescriptorUpdateTemplate( |
| 10471 | VkDevice device, |
| 10472 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 10473 | const VkAllocationCallbacks* pAllocator) |
| 10474 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10475 | mImpl->log("start vkDestroyDescriptorUpdateTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10476 | auto stream = mImpl->stream(); |
| 10477 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10478 | auto resources = mImpl->resources(); |
| 10479 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10480 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10481 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10482 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10483 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10484 | local_device = device; |
| 10485 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10486 | local_pAllocator = nullptr; |
| 10487 | if (pAllocator) |
| 10488 | { |
| 10489 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10490 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10491 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10492 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10493 | if (local_pAllocator) |
| 10494 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10495 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10496 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10497 | countingStream->rewind(); |
| 10498 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10499 | uint64_t cgen_var_734; |
| 10500 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_734, 1); |
| 10501 | countingStream->write((uint64_t*)&cgen_var_734, 1 * 8); |
| 10502 | uint64_t cgen_var_735; |
| 10503 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_735, 1); |
| 10504 | countingStream->write((uint64_t*)&cgen_var_735, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10505 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10506 | uint64_t cgen_var_736 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10507 | countingStream->putBe64(cgen_var_736); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10508 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10509 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10510 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10511 | } |
| 10512 | } |
| 10513 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10514 | countingStream->rewind(); |
| 10515 | uint32_t opcode_vkDestroyDescriptorUpdateTemplate = OP_vkDestroyDescriptorUpdateTemplate; |
| 10516 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 10517 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10518 | uint64_t cgen_var_737; |
| 10519 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_737, 1); |
| 10520 | stream->write((uint64_t*)&cgen_var_737, 1 * 8); |
| 10521 | uint64_t cgen_var_738; |
| 10522 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_738, 1); |
| 10523 | stream->write((uint64_t*)&cgen_var_738, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10524 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10525 | uint64_t cgen_var_739 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10526 | stream->putBe64(cgen_var_739); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10527 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10528 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10529 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10530 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10531 | resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10532 | mImpl->log("finish vkDestroyDescriptorUpdateTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10533 | } |
| 10534 | |
| 10535 | void VkEncoder::vkUpdateDescriptorSetWithTemplate( |
| 10536 | VkDevice device, |
| 10537 | VkDescriptorSet descriptorSet, |
| 10538 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 10539 | const void* pData) |
| 10540 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10541 | mImpl->log("start vkUpdateDescriptorSetWithTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10542 | auto stream = mImpl->stream(); |
| 10543 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10544 | auto resources = mImpl->resources(); |
| 10545 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10546 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10547 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10548 | VkDescriptorSet local_descriptorSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10549 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10550 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10551 | local_device = device; |
| 10552 | local_descriptorSet = descriptorSet; |
| 10553 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10554 | local_pData = nullptr; |
| 10555 | if (pData) |
| 10556 | { |
| 10557 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 10558 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10559 | countingStream->rewind(); |
| 10560 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10561 | uint64_t cgen_var_740; |
| 10562 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_740, 1); |
| 10563 | countingStream->write((uint64_t*)&cgen_var_740, 1 * 8); |
| 10564 | uint64_t cgen_var_741; |
| 10565 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_741, 1); |
| 10566 | countingStream->write((uint64_t*)&cgen_var_741, 1 * 8); |
| 10567 | uint64_t cgen_var_742; |
| 10568 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_742, 1); |
| 10569 | countingStream->write((uint64_t*)&cgen_var_742, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10570 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10571 | uint64_t cgen_var_743 = (uint64_t)(uintptr_t)local_pData; |
| 10572 | countingStream->putBe64(cgen_var_743); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10573 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10574 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10575 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10576 | } |
| 10577 | } |
| 10578 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10579 | countingStream->rewind(); |
| 10580 | uint32_t opcode_vkUpdateDescriptorSetWithTemplate = OP_vkUpdateDescriptorSetWithTemplate; |
| 10581 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t)); |
| 10582 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10583 | uint64_t cgen_var_744; |
| 10584 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_744, 1); |
| 10585 | stream->write((uint64_t*)&cgen_var_744, 1 * 8); |
| 10586 | uint64_t cgen_var_745; |
| 10587 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_745, 1); |
| 10588 | stream->write((uint64_t*)&cgen_var_745, 1 * 8); |
| 10589 | uint64_t cgen_var_746; |
| 10590 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_746, 1); |
| 10591 | stream->write((uint64_t*)&cgen_var_746, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10592 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10593 | uint64_t cgen_var_747 = (uint64_t)(uintptr_t)local_pData; |
| 10594 | stream->putBe64(cgen_var_747); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10595 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10596 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10597 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10598 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10599 | mImpl->log("finish vkUpdateDescriptorSetWithTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10600 | } |
| 10601 | |
| 10602 | void VkEncoder::vkGetPhysicalDeviceExternalBufferProperties( |
| 10603 | VkPhysicalDevice physicalDevice, |
| 10604 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 10605 | VkExternalBufferProperties* pExternalBufferProperties) |
| 10606 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10607 | mImpl->log("start vkGetPhysicalDeviceExternalBufferProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10608 | auto stream = mImpl->stream(); |
| 10609 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10610 | auto resources = mImpl->resources(); |
| 10611 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10612 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10613 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10614 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10615 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10616 | local_pExternalBufferInfo = nullptr; |
| 10617 | if (pExternalBufferInfo) |
| 10618 | { |
| 10619 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 10620 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 10621 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10622 | if (local_pExternalBufferInfo) |
| 10623 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10624 | transform_tohost_VkPhysicalDeviceExternalBufferInfo(mImpl->resources(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10625 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10626 | countingStream->rewind(); |
| 10627 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10628 | uint64_t cgen_var_748; |
| 10629 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_748, 1); |
| 10630 | countingStream->write((uint64_t*)&cgen_var_748, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10631 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10632 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 10633 | } |
| 10634 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10635 | countingStream->rewind(); |
| 10636 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferProperties = OP_vkGetPhysicalDeviceExternalBufferProperties; |
| 10637 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t)); |
| 10638 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10639 | uint64_t cgen_var_749; |
| 10640 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_749, 1); |
| 10641 | stream->write((uint64_t*)&cgen_var_749, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10642 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10643 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 10644 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10645 | if (pExternalBufferProperties) |
| 10646 | { |
| 10647 | transform_fromhost_VkExternalBufferProperties(mImpl->resources(), (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 10648 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10649 | mImpl->log("finish vkGetPhysicalDeviceExternalBufferProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10650 | } |
| 10651 | |
| 10652 | void VkEncoder::vkGetPhysicalDeviceExternalFenceProperties( |
| 10653 | VkPhysicalDevice physicalDevice, |
| 10654 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 10655 | VkExternalFenceProperties* pExternalFenceProperties) |
| 10656 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10657 | mImpl->log("start vkGetPhysicalDeviceExternalFenceProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10658 | auto stream = mImpl->stream(); |
| 10659 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10660 | auto resources = mImpl->resources(); |
| 10661 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10662 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10663 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10664 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10665 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10666 | local_pExternalFenceInfo = nullptr; |
| 10667 | if (pExternalFenceInfo) |
| 10668 | { |
| 10669 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 10670 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 10671 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10672 | if (local_pExternalFenceInfo) |
| 10673 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10674 | transform_tohost_VkPhysicalDeviceExternalFenceInfo(mImpl->resources(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10675 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10676 | countingStream->rewind(); |
| 10677 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10678 | uint64_t cgen_var_750; |
| 10679 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_750, 1); |
| 10680 | countingStream->write((uint64_t*)&cgen_var_750, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10681 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10682 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 10683 | } |
| 10684 | uint32_t packetSize_vkGetPhysicalDeviceExternalFenceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10685 | countingStream->rewind(); |
| 10686 | uint32_t opcode_vkGetPhysicalDeviceExternalFenceProperties = OP_vkGetPhysicalDeviceExternalFenceProperties; |
| 10687 | stream->write(&opcode_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t)); |
| 10688 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10689 | uint64_t cgen_var_751; |
| 10690 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_751, 1); |
| 10691 | stream->write((uint64_t*)&cgen_var_751, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10692 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10693 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 10694 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10695 | if (pExternalFenceProperties) |
| 10696 | { |
| 10697 | transform_fromhost_VkExternalFenceProperties(mImpl->resources(), (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 10698 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10699 | mImpl->log("finish vkGetPhysicalDeviceExternalFenceProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10700 | } |
| 10701 | |
| 10702 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphoreProperties( |
| 10703 | VkPhysicalDevice physicalDevice, |
| 10704 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 10705 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 10706 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10707 | mImpl->log("start vkGetPhysicalDeviceExternalSemaphoreProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10708 | auto stream = mImpl->stream(); |
| 10709 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10710 | auto resources = mImpl->resources(); |
| 10711 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10712 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10713 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10714 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10715 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10716 | local_pExternalSemaphoreInfo = nullptr; |
| 10717 | if (pExternalSemaphoreInfo) |
| 10718 | { |
| 10719 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 10720 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 10721 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10722 | if (local_pExternalSemaphoreInfo) |
| 10723 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10724 | transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(mImpl->resources(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10725 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10726 | countingStream->rewind(); |
| 10727 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10728 | uint64_t cgen_var_752; |
| 10729 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_752, 1); |
| 10730 | countingStream->write((uint64_t*)&cgen_var_752, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10731 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10732 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 10733 | } |
| 10734 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10735 | countingStream->rewind(); |
| 10736 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphoreProperties = OP_vkGetPhysicalDeviceExternalSemaphoreProperties; |
| 10737 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t)); |
| 10738 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10739 | uint64_t cgen_var_753; |
| 10740 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_753, 1); |
| 10741 | stream->write((uint64_t*)&cgen_var_753, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10742 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10743 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 10744 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10745 | if (pExternalSemaphoreProperties) |
| 10746 | { |
| 10747 | transform_fromhost_VkExternalSemaphoreProperties(mImpl->resources(), (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 10748 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10749 | mImpl->log("finish vkGetPhysicalDeviceExternalSemaphoreProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10750 | } |
| 10751 | |
| 10752 | void VkEncoder::vkGetDescriptorSetLayoutSupport( |
| 10753 | VkDevice device, |
| 10754 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 10755 | VkDescriptorSetLayoutSupport* pSupport) |
| 10756 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10757 | mImpl->log("start vkGetDescriptorSetLayoutSupport"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10758 | auto stream = mImpl->stream(); |
| 10759 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10760 | auto resources = mImpl->resources(); |
| 10761 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10762 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10763 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10764 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10765 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10766 | local_pCreateInfo = nullptr; |
| 10767 | if (pCreateInfo) |
| 10768 | { |
| 10769 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 10770 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 10771 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10772 | if (local_pCreateInfo) |
| 10773 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10774 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10775 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10776 | countingStream->rewind(); |
| 10777 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10778 | uint64_t cgen_var_754; |
| 10779 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_754, 1); |
| 10780 | countingStream->write((uint64_t*)&cgen_var_754, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10781 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10782 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 10783 | } |
| 10784 | uint32_t packetSize_vkGetDescriptorSetLayoutSupport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10785 | countingStream->rewind(); |
| 10786 | uint32_t opcode_vkGetDescriptorSetLayoutSupport = OP_vkGetDescriptorSetLayoutSupport; |
| 10787 | stream->write(&opcode_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t)); |
| 10788 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10789 | uint64_t cgen_var_755; |
| 10790 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_755, 1); |
| 10791 | stream->write((uint64_t*)&cgen_var_755, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10792 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10793 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 10794 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10795 | if (pSupport) |
| 10796 | { |
| 10797 | transform_fromhost_VkDescriptorSetLayoutSupport(mImpl->resources(), (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 10798 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10799 | mImpl->log("finish vkGetDescriptorSetLayoutSupport");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10800 | } |
| 10801 | |
| 10802 | #endif |
| 10803 | #ifdef VK_KHR_surface |
| 10804 | void VkEncoder::vkDestroySurfaceKHR( |
| 10805 | VkInstance instance, |
| 10806 | VkSurfaceKHR surface, |
| 10807 | const VkAllocationCallbacks* pAllocator) |
| 10808 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10809 | mImpl->log("start vkDestroySurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10810 | auto stream = mImpl->stream(); |
| 10811 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10812 | auto resources = mImpl->resources(); |
| 10813 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10814 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10815 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10816 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10817 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10818 | local_instance = instance; |
| 10819 | local_surface = surface; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10820 | local_pAllocator = nullptr; |
| 10821 | if (pAllocator) |
| 10822 | { |
| 10823 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10824 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10825 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10826 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10827 | if (local_pAllocator) |
| 10828 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10829 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10830 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10831 | countingStream->rewind(); |
| 10832 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10833 | uint64_t cgen_var_756; |
| 10834 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_756, 1); |
| 10835 | countingStream->write((uint64_t*)&cgen_var_756, 1 * 8); |
| 10836 | uint64_t cgen_var_757; |
| 10837 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_757, 1); |
| 10838 | countingStream->write((uint64_t*)&cgen_var_757, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10839 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10840 | uint64_t cgen_var_758 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10841 | countingStream->putBe64(cgen_var_758); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10842 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10843 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10844 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10845 | } |
| 10846 | } |
| 10847 | uint32_t packetSize_vkDestroySurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10848 | countingStream->rewind(); |
| 10849 | uint32_t opcode_vkDestroySurfaceKHR = OP_vkDestroySurfaceKHR; |
| 10850 | stream->write(&opcode_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| 10851 | stream->write(&packetSize_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10852 | uint64_t cgen_var_759; |
| 10853 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_759, 1); |
| 10854 | stream->write((uint64_t*)&cgen_var_759, 1 * 8); |
| 10855 | uint64_t cgen_var_760; |
| 10856 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_760, 1); |
| 10857 | stream->write((uint64_t*)&cgen_var_760, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10858 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10859 | uint64_t cgen_var_761 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10860 | stream->putBe64(cgen_var_761); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10861 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10862 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10863 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10864 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10865 | resources->destroyMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&surface); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10866 | mImpl->log("finish vkDestroySurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10867 | } |
| 10868 | |
| 10869 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceSupportKHR( |
| 10870 | VkPhysicalDevice physicalDevice, |
| 10871 | uint32_t queueFamilyIndex, |
| 10872 | VkSurfaceKHR surface, |
| 10873 | VkBool32* pSupported) |
| 10874 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10875 | mImpl->log("start vkGetPhysicalDeviceSurfaceSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10876 | auto stream = mImpl->stream(); |
| 10877 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10878 | auto resources = mImpl->resources(); |
| 10879 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10880 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10881 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10882 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10883 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10884 | local_physicalDevice = physicalDevice; |
| 10885 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10886 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10887 | countingStream->rewind(); |
| 10888 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10889 | uint64_t cgen_var_762; |
| 10890 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_762, 1); |
| 10891 | countingStream->write((uint64_t*)&cgen_var_762, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10892 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10893 | uint64_t cgen_var_763; |
| 10894 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_763, 1); |
| 10895 | countingStream->write((uint64_t*)&cgen_var_763, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10896 | countingStream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| 10897 | } |
| 10898 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10899 | countingStream->rewind(); |
| 10900 | uint32_t opcode_vkGetPhysicalDeviceSurfaceSupportKHR = OP_vkGetPhysicalDeviceSurfaceSupportKHR; |
| 10901 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| 10902 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10903 | uint64_t cgen_var_764; |
| 10904 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_764, 1); |
| 10905 | stream->write((uint64_t*)&cgen_var_764, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10906 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10907 | uint64_t cgen_var_765; |
| 10908 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_765, 1); |
| 10909 | stream->write((uint64_t*)&cgen_var_765, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10910 | stream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| 10911 | stream->read((VkBool32*)pSupported, sizeof(VkBool32)); |
| 10912 | VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0; |
| 10913 | stream->read(&vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10914 | countingStream->clearPool(); |
| 10915 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10916 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10917 | mImpl->log("finish vkGetPhysicalDeviceSurfaceSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10918 | return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return; |
| 10919 | } |
| 10920 | |
| 10921 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilitiesKHR( |
| 10922 | VkPhysicalDevice physicalDevice, |
| 10923 | VkSurfaceKHR surface, |
| 10924 | VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) |
| 10925 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10926 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10927 | auto stream = mImpl->stream(); |
| 10928 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10929 | auto resources = mImpl->resources(); |
| 10930 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10931 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10932 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10933 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10934 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10935 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10936 | countingStream->rewind(); |
| 10937 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10938 | uint64_t cgen_var_766; |
| 10939 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_766, 1); |
| 10940 | countingStream->write((uint64_t*)&cgen_var_766, 1 * 8); |
| 10941 | uint64_t cgen_var_767; |
| 10942 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_767, 1); |
| 10943 | countingStream->write((uint64_t*)&cgen_var_767, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10944 | marshal_VkSurfaceCapabilitiesKHR(countingStream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 10945 | } |
| 10946 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10947 | countingStream->rewind(); |
| 10948 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR; |
| 10949 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| 10950 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10951 | uint64_t cgen_var_768; |
| 10952 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_768, 1); |
| 10953 | stream->write((uint64_t*)&cgen_var_768, 1 * 8); |
| 10954 | uint64_t cgen_var_769; |
| 10955 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_769, 1); |
| 10956 | stream->write((uint64_t*)&cgen_var_769, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10957 | marshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 10958 | unmarshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10959 | if (pSurfaceCapabilities) |
| 10960 | { |
| 10961 | transform_fromhost_VkSurfaceCapabilitiesKHR(mImpl->resources(), (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 10962 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10963 | VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 10964 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10965 | countingStream->clearPool(); |
| 10966 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10967 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10968 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10969 | return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return; |
| 10970 | } |
| 10971 | |
| 10972 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormatsKHR( |
| 10973 | VkPhysicalDevice physicalDevice, |
| 10974 | VkSurfaceKHR surface, |
| 10975 | uint32_t* pSurfaceFormatCount, |
| 10976 | VkSurfaceFormatKHR* pSurfaceFormats) |
| 10977 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10978 | mImpl->log("start vkGetPhysicalDeviceSurfaceFormatsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10979 | auto stream = mImpl->stream(); |
| 10980 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10981 | auto resources = mImpl->resources(); |
| 10982 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10983 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10984 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10985 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10986 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10987 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10988 | countingStream->rewind(); |
| 10989 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10990 | uint64_t cgen_var_770; |
| 10991 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_770, 1); |
| 10992 | countingStream->write((uint64_t*)&cgen_var_770, 1 * 8); |
| 10993 | uint64_t cgen_var_771; |
| 10994 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_771, 1); |
| 10995 | countingStream->write((uint64_t*)&cgen_var_771, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10996 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 10997 | uint64_t cgen_var_772 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 10998 | countingStream->putBe64(cgen_var_772); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10999 | if (pSurfaceFormatCount) |
| 11000 | { |
| 11001 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11002 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11003 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11004 | uint64_t cgen_var_773 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 11005 | countingStream->putBe64(cgen_var_773); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11006 | if (pSurfaceFormats) |
| 11007 | { |
| 11008 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11009 | { |
| 11010 | marshal_VkSurfaceFormatKHR(countingStream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11011 | } |
| 11012 | } |
| 11013 | } |
| 11014 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11015 | countingStream->rewind(); |
| 11016 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormatsKHR = OP_vkGetPhysicalDeviceSurfaceFormatsKHR; |
| 11017 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| 11018 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11019 | uint64_t cgen_var_774; |
| 11020 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_774, 1); |
| 11021 | stream->write((uint64_t*)&cgen_var_774, 1 * 8); |
| 11022 | uint64_t cgen_var_775; |
| 11023 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_775, 1); |
| 11024 | stream->write((uint64_t*)&cgen_var_775, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11025 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11026 | uint64_t cgen_var_776 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 11027 | stream->putBe64(cgen_var_776); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11028 | if (pSurfaceFormatCount) |
| 11029 | { |
| 11030 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11031 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11032 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11033 | uint64_t cgen_var_777 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 11034 | stream->putBe64(cgen_var_777); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11035 | if (pSurfaceFormats) |
| 11036 | { |
| 11037 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11038 | { |
| 11039 | marshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11040 | } |
| 11041 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11042 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11043 | uint32_t* check_pSurfaceFormatCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11044 | check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11045 | if (pSurfaceFormatCount) |
| 11046 | { |
| 11047 | if (!(check_pSurfaceFormatCount)) |
| 11048 | { |
| 11049 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 11050 | } |
| 11051 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11052 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11053 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11054 | VkSurfaceFormatKHR* check_pSurfaceFormats; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11055 | check_pSurfaceFormats = (VkSurfaceFormatKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11056 | if (pSurfaceFormats) |
| 11057 | { |
| 11058 | if (!(check_pSurfaceFormats)) |
| 11059 | { |
| 11060 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 11061 | } |
| 11062 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11063 | { |
| 11064 | unmarshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11065 | } |
| 11066 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11067 | if (pSurfaceFormats) |
| 11068 | { |
| 11069 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11070 | { |
| 11071 | transform_fromhost_VkSurfaceFormatKHR(mImpl->resources(), (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11072 | } |
| 11073 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11074 | VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0; |
| 11075 | stream->read(&vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11076 | countingStream->clearPool(); |
| 11077 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11078 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11079 | mImpl->log("finish vkGetPhysicalDeviceSurfaceFormatsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11080 | return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return; |
| 11081 | } |
| 11082 | |
| 11083 | VkResult VkEncoder::vkGetPhysicalDeviceSurfacePresentModesKHR( |
| 11084 | VkPhysicalDevice physicalDevice, |
| 11085 | VkSurfaceKHR surface, |
| 11086 | uint32_t* pPresentModeCount, |
| 11087 | VkPresentModeKHR* pPresentModes) |
| 11088 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11089 | mImpl->log("start vkGetPhysicalDeviceSurfacePresentModesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11090 | auto stream = mImpl->stream(); |
| 11091 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11092 | auto resources = mImpl->resources(); |
| 11093 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11094 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11095 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11096 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11097 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11098 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11099 | countingStream->rewind(); |
| 11100 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11101 | uint64_t cgen_var_780; |
| 11102 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_780, 1); |
| 11103 | countingStream->write((uint64_t*)&cgen_var_780, 1 * 8); |
| 11104 | uint64_t cgen_var_781; |
| 11105 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_781, 1); |
| 11106 | countingStream->write((uint64_t*)&cgen_var_781, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11107 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11108 | uint64_t cgen_var_782 = (uint64_t)(uintptr_t)pPresentModeCount; |
| 11109 | countingStream->putBe64(cgen_var_782); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11110 | if (pPresentModeCount) |
| 11111 | { |
| 11112 | countingStream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 11113 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11114 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11115 | uint64_t cgen_var_783 = (uint64_t)(uintptr_t)pPresentModes; |
| 11116 | countingStream->putBe64(cgen_var_783); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11117 | if (pPresentModes) |
| 11118 | { |
| 11119 | countingStream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 11120 | } |
| 11121 | } |
| 11122 | uint32_t packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11123 | countingStream->rewind(); |
| 11124 | uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModesKHR = OP_vkGetPhysicalDeviceSurfacePresentModesKHR; |
| 11125 | stream->write(&opcode_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| 11126 | stream->write(&packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11127 | uint64_t cgen_var_784; |
| 11128 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_784, 1); |
| 11129 | stream->write((uint64_t*)&cgen_var_784, 1 * 8); |
| 11130 | uint64_t cgen_var_785; |
| 11131 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_785, 1); |
| 11132 | stream->write((uint64_t*)&cgen_var_785, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11133 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11134 | uint64_t cgen_var_786 = (uint64_t)(uintptr_t)pPresentModeCount; |
| 11135 | stream->putBe64(cgen_var_786); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11136 | if (pPresentModeCount) |
| 11137 | { |
| 11138 | stream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 11139 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11140 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11141 | uint64_t cgen_var_787 = (uint64_t)(uintptr_t)pPresentModes; |
| 11142 | stream->putBe64(cgen_var_787); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11143 | if (pPresentModes) |
| 11144 | { |
| 11145 | stream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 11146 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11147 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11148 | uint32_t* check_pPresentModeCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11149 | check_pPresentModeCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11150 | if (pPresentModeCount) |
| 11151 | { |
| 11152 | if (!(check_pPresentModeCount)) |
| 11153 | { |
| 11154 | fprintf(stderr, "fatal: pPresentModeCount inconsistent between guest and host\n"); |
| 11155 | } |
| 11156 | stream->read((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 11157 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11158 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11159 | VkPresentModeKHR* check_pPresentModes; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11160 | check_pPresentModes = (VkPresentModeKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11161 | if (pPresentModes) |
| 11162 | { |
| 11163 | if (!(check_pPresentModes)) |
| 11164 | { |
| 11165 | fprintf(stderr, "fatal: pPresentModes inconsistent between guest and host\n"); |
| 11166 | } |
| 11167 | stream->read((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 11168 | } |
| 11169 | VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 11170 | stream->read(&vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11171 | countingStream->clearPool(); |
| 11172 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11173 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11174 | mImpl->log("finish vkGetPhysicalDeviceSurfacePresentModesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11175 | return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return; |
| 11176 | } |
| 11177 | |
| 11178 | #endif |
| 11179 | #ifdef VK_KHR_swapchain |
| 11180 | VkResult VkEncoder::vkCreateSwapchainKHR( |
| 11181 | VkDevice device, |
| 11182 | const VkSwapchainCreateInfoKHR* pCreateInfo, |
| 11183 | const VkAllocationCallbacks* pAllocator, |
| 11184 | VkSwapchainKHR* pSwapchain) |
| 11185 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11186 | mImpl->log("start vkCreateSwapchainKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11187 | auto stream = mImpl->stream(); |
| 11188 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11189 | auto resources = mImpl->resources(); |
| 11190 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11191 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11192 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11193 | VkSwapchainCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11194 | VkAllocationCallbacks* local_pAllocator; |
| 11195 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11196 | local_pCreateInfo = nullptr; |
| 11197 | if (pCreateInfo) |
| 11198 | { |
| 11199 | local_pCreateInfo = (VkSwapchainCreateInfoKHR*)pool->alloc(sizeof(const VkSwapchainCreateInfoKHR)); |
| 11200 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfo, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| 11201 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11202 | local_pAllocator = nullptr; |
| 11203 | if (pAllocator) |
| 11204 | { |
| 11205 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11206 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11207 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11208 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11209 | if (local_pCreateInfo) |
| 11210 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11211 | transform_tohost_VkSwapchainCreateInfoKHR(mImpl->resources(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11212 | } |
| 11213 | if (local_pAllocator) |
| 11214 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11215 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11216 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11217 | countingStream->rewind(); |
| 11218 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11219 | uint64_t cgen_var_790; |
| 11220 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_790, 1); |
| 11221 | countingStream->write((uint64_t*)&cgen_var_790, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11222 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11223 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11224 | uint64_t cgen_var_791 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11225 | countingStream->putBe64(cgen_var_791); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11226 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11227 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11228 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11229 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11230 | uint64_t cgen_var_792; |
| 11231 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_792, 1); |
| 11232 | countingStream->write((uint64_t*)&cgen_var_792, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11233 | } |
| 11234 | uint32_t packetSize_vkCreateSwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11235 | countingStream->rewind(); |
| 11236 | uint32_t opcode_vkCreateSwapchainKHR = OP_vkCreateSwapchainKHR; |
| 11237 | stream->write(&opcode_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| 11238 | stream->write(&packetSize_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11239 | uint64_t cgen_var_793; |
| 11240 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_793, 1); |
| 11241 | stream->write((uint64_t*)&cgen_var_793, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11242 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11243 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11244 | uint64_t cgen_var_794 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11245 | stream->putBe64(cgen_var_794); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11246 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11247 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11248 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11249 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11250 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11251 | uint64_t cgen_var_795; |
| 11252 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_795, 1); |
| 11253 | stream->write((uint64_t*)&cgen_var_795, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11254 | stream->setHandleMapping(resources->unwrapMapping()); |
| 11255 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11256 | uint64_t cgen_var_796; |
| 11257 | stream->read((uint64_t*)&cgen_var_796, 8); |
| 11258 | stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(&cgen_var_796, (VkSwapchainKHR*)pSwapchain, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11259 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11260 | VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0; |
| 11261 | stream->read(&vkCreateSwapchainKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11262 | countingStream->clearPool(); |
| 11263 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11264 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11265 | mImpl->log("finish vkCreateSwapchainKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11266 | return vkCreateSwapchainKHR_VkResult_return; |
| 11267 | } |
| 11268 | |
| 11269 | void VkEncoder::vkDestroySwapchainKHR( |
| 11270 | VkDevice device, |
| 11271 | VkSwapchainKHR swapchain, |
| 11272 | const VkAllocationCallbacks* pAllocator) |
| 11273 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11274 | mImpl->log("start vkDestroySwapchainKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11275 | auto stream = mImpl->stream(); |
| 11276 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11277 | auto resources = mImpl->resources(); |
| 11278 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11279 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11280 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11281 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11282 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11283 | local_device = device; |
| 11284 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11285 | local_pAllocator = nullptr; |
| 11286 | if (pAllocator) |
| 11287 | { |
| 11288 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11289 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11290 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11291 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11292 | if (local_pAllocator) |
| 11293 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11294 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11295 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11296 | countingStream->rewind(); |
| 11297 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11298 | uint64_t cgen_var_797; |
| 11299 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_797, 1); |
| 11300 | countingStream->write((uint64_t*)&cgen_var_797, 1 * 8); |
| 11301 | uint64_t cgen_var_798; |
| 11302 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_798, 1); |
| 11303 | countingStream->write((uint64_t*)&cgen_var_798, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11304 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11305 | uint64_t cgen_var_799 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11306 | countingStream->putBe64(cgen_var_799); |
| 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(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11310 | } |
| 11311 | } |
| 11312 | uint32_t packetSize_vkDestroySwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11313 | countingStream->rewind(); |
| 11314 | uint32_t opcode_vkDestroySwapchainKHR = OP_vkDestroySwapchainKHR; |
| 11315 | stream->write(&opcode_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| 11316 | stream->write(&packetSize_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11317 | uint64_t cgen_var_800; |
| 11318 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_800, 1); |
| 11319 | stream->write((uint64_t*)&cgen_var_800, 1 * 8); |
| 11320 | uint64_t cgen_var_801; |
| 11321 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_801, 1); |
| 11322 | stream->write((uint64_t*)&cgen_var_801, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11323 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11324 | uint64_t cgen_var_802 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11325 | stream->putBe64(cgen_var_802); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11326 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11327 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11328 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11329 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11330 | resources->destroyMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&swapchain); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11331 | mImpl->log("finish vkDestroySwapchainKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11332 | } |
| 11333 | |
| 11334 | VkResult VkEncoder::vkGetSwapchainImagesKHR( |
| 11335 | VkDevice device, |
| 11336 | VkSwapchainKHR swapchain, |
| 11337 | uint32_t* pSwapchainImageCount, |
| 11338 | VkImage* pSwapchainImages) |
| 11339 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11340 | mImpl->log("start vkGetSwapchainImagesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11341 | auto stream = mImpl->stream(); |
| 11342 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11343 | auto resources = mImpl->resources(); |
| 11344 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11345 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11346 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11347 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11348 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11349 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11350 | countingStream->rewind(); |
| 11351 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11352 | uint64_t cgen_var_803; |
| 11353 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_803, 1); |
| 11354 | countingStream->write((uint64_t*)&cgen_var_803, 1 * 8); |
| 11355 | uint64_t cgen_var_804; |
| 11356 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_804, 1); |
| 11357 | countingStream->write((uint64_t*)&cgen_var_804, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11358 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11359 | uint64_t cgen_var_805 = (uint64_t)(uintptr_t)pSwapchainImageCount; |
| 11360 | countingStream->putBe64(cgen_var_805); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11361 | if (pSwapchainImageCount) |
| 11362 | { |
| 11363 | countingStream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 11364 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11365 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11366 | uint64_t cgen_var_806 = (uint64_t)(uintptr_t)pSwapchainImages; |
| 11367 | countingStream->putBe64(cgen_var_806); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11368 | if (pSwapchainImages) |
| 11369 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11370 | if ((*(pSwapchainImageCount))) |
| 11371 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11372 | uint64_t* cgen_var_807; |
| 11373 | countingStream->alloc((void**)&cgen_var_807, (*(pSwapchainImageCount)) * 8); |
| 11374 | countingStream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_807, (*(pSwapchainImageCount))); |
| 11375 | countingStream->write((uint64_t*)cgen_var_807, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11376 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11377 | } |
| 11378 | } |
| 11379 | uint32_t packetSize_vkGetSwapchainImagesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11380 | countingStream->rewind(); |
| 11381 | uint32_t opcode_vkGetSwapchainImagesKHR = OP_vkGetSwapchainImagesKHR; |
| 11382 | stream->write(&opcode_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| 11383 | stream->write(&packetSize_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11384 | uint64_t cgen_var_808; |
| 11385 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_808, 1); |
| 11386 | stream->write((uint64_t*)&cgen_var_808, 1 * 8); |
| 11387 | uint64_t cgen_var_809; |
| 11388 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_809, 1); |
| 11389 | stream->write((uint64_t*)&cgen_var_809, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11390 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11391 | uint64_t cgen_var_810 = (uint64_t)(uintptr_t)pSwapchainImageCount; |
| 11392 | stream->putBe64(cgen_var_810); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11393 | if (pSwapchainImageCount) |
| 11394 | { |
| 11395 | stream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 11396 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11397 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11398 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11399 | uint64_t cgen_var_811 = (uint64_t)(uintptr_t)pSwapchainImages; |
| 11400 | stream->putBe64(cgen_var_811); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11401 | if (pSwapchainImages) |
| 11402 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11403 | if ((*(pSwapchainImageCount))) |
| 11404 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11405 | uint64_t* cgen_var_812; |
| 11406 | stream->alloc((void**)&cgen_var_812, (*(pSwapchainImageCount)) * 8); |
| 11407 | stream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_812, (*(pSwapchainImageCount))); |
| 11408 | stream->write((uint64_t*)cgen_var_812, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11409 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11410 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11411 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11412 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11413 | uint32_t* check_pSwapchainImageCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11414 | check_pSwapchainImageCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11415 | if (pSwapchainImageCount) |
| 11416 | { |
| 11417 | if (!(check_pSwapchainImageCount)) |
| 11418 | { |
| 11419 | fprintf(stderr, "fatal: pSwapchainImageCount inconsistent between guest and host\n"); |
| 11420 | } |
| 11421 | stream->read((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 11422 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11423 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11424 | VkImage* check_pSwapchainImages; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11425 | check_pSwapchainImages = (VkImage*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11426 | if (pSwapchainImages) |
| 11427 | { |
| 11428 | if (!(check_pSwapchainImages)) |
| 11429 | { |
| 11430 | fprintf(stderr, "fatal: pSwapchainImages inconsistent between guest and host\n"); |
| 11431 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11432 | if ((*(pSwapchainImageCount))) |
| 11433 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11434 | uint64_t* cgen_var_815; |
| 11435 | stream->alloc((void**)&cgen_var_815, (*(pSwapchainImageCount)) * 8); |
| 11436 | stream->read((uint64_t*)cgen_var_815, (*(pSwapchainImageCount)) * 8); |
| 11437 | stream->handleMapping()->mapHandles_u64_VkImage(cgen_var_815, (VkImage*)pSwapchainImages, (*(pSwapchainImageCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11438 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11439 | } |
| 11440 | VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0; |
| 11441 | stream->read(&vkGetSwapchainImagesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11442 | countingStream->clearPool(); |
| 11443 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11444 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11445 | mImpl->log("finish vkGetSwapchainImagesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11446 | return vkGetSwapchainImagesKHR_VkResult_return; |
| 11447 | } |
| 11448 | |
| 11449 | VkResult VkEncoder::vkAcquireNextImageKHR( |
| 11450 | VkDevice device, |
| 11451 | VkSwapchainKHR swapchain, |
| 11452 | uint64_t timeout, |
| 11453 | VkSemaphore semaphore, |
| 11454 | VkFence fence, |
| 11455 | uint32_t* pImageIndex) |
| 11456 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11457 | mImpl->log("start vkAcquireNextImageKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11458 | auto stream = mImpl->stream(); |
| 11459 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11460 | auto resources = mImpl->resources(); |
| 11461 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11462 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11463 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11464 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11465 | uint64_t local_timeout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11466 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11467 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11468 | local_device = device; |
| 11469 | local_swapchain = swapchain; |
| 11470 | local_timeout = timeout; |
| 11471 | local_semaphore = semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11472 | local_fence = fence; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11473 | countingStream->rewind(); |
| 11474 | { |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 11475 | uint64_t cgen_var_816; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11476 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_816, 1); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 11477 | countingStream->write((uint64_t*)&cgen_var_816, 1 * 8); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11478 | uint64_t cgen_var_817; |
| 11479 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_817, 1); |
| 11480 | countingStream->write((uint64_t*)&cgen_var_817, 1 * 8); |
| 11481 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| 11482 | uint64_t cgen_var_818; |
| 11483 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_818, 1); |
| 11484 | countingStream->write((uint64_t*)&cgen_var_818, 1 * 8); |
| 11485 | uint64_t cgen_var_819; |
| 11486 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_819, 1); |
| 11487 | countingStream->write((uint64_t*)&cgen_var_819, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11488 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 11489 | } |
| 11490 | uint32_t packetSize_vkAcquireNextImageKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11491 | countingStream->rewind(); |
| 11492 | uint32_t opcode_vkAcquireNextImageKHR = OP_vkAcquireNextImageKHR; |
| 11493 | stream->write(&opcode_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| 11494 | stream->write(&packetSize_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 11495 | uint64_t cgen_var_820; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11496 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_820, 1); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 11497 | stream->write((uint64_t*)&cgen_var_820, 1 * 8); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11498 | uint64_t cgen_var_821; |
| 11499 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_821, 1); |
| 11500 | stream->write((uint64_t*)&cgen_var_821, 1 * 8); |
| 11501 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| 11502 | uint64_t cgen_var_822; |
| 11503 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_822, 1); |
| 11504 | stream->write((uint64_t*)&cgen_var_822, 1 * 8); |
| 11505 | uint64_t cgen_var_823; |
| 11506 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_823, 1); |
| 11507 | stream->write((uint64_t*)&cgen_var_823, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11508 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 11509 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 11510 | VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0; |
| 11511 | stream->read(&vkAcquireNextImageKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11512 | countingStream->clearPool(); |
| 11513 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11514 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11515 | mImpl->log("finish vkAcquireNextImageKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11516 | return vkAcquireNextImageKHR_VkResult_return; |
| 11517 | } |
| 11518 | |
| 11519 | VkResult VkEncoder::vkQueuePresentKHR( |
| 11520 | VkQueue queue, |
| 11521 | const VkPresentInfoKHR* pPresentInfo) |
| 11522 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11523 | mImpl->log("start vkQueuePresentKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11524 | auto stream = mImpl->stream(); |
| 11525 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11526 | auto resources = mImpl->resources(); |
| 11527 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11528 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11529 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11530 | VkPresentInfoKHR* local_pPresentInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11531 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11532 | local_pPresentInfo = nullptr; |
| 11533 | if (pPresentInfo) |
| 11534 | { |
| 11535 | local_pPresentInfo = (VkPresentInfoKHR*)pool->alloc(sizeof(const VkPresentInfoKHR)); |
| 11536 | deepcopy_VkPresentInfoKHR(pool, pPresentInfo, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| 11537 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11538 | if (local_pPresentInfo) |
| 11539 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11540 | transform_tohost_VkPresentInfoKHR(mImpl->resources(), (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11541 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11542 | countingStream->rewind(); |
| 11543 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11544 | uint64_t cgen_var_824; |
| 11545 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_824, 1); |
| 11546 | countingStream->write((uint64_t*)&cgen_var_824, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11547 | marshal_VkPresentInfoKHR(countingStream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11548 | } |
| 11549 | uint32_t packetSize_vkQueuePresentKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11550 | countingStream->rewind(); |
| 11551 | uint32_t opcode_vkQueuePresentKHR = OP_vkQueuePresentKHR; |
| 11552 | stream->write(&opcode_vkQueuePresentKHR, sizeof(uint32_t)); |
| 11553 | stream->write(&packetSize_vkQueuePresentKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11554 | uint64_t cgen_var_825; |
| 11555 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_825, 1); |
| 11556 | stream->write((uint64_t*)&cgen_var_825, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11557 | marshal_VkPresentInfoKHR(stream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11558 | VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0; |
| 11559 | stream->read(&vkQueuePresentKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11560 | countingStream->clearPool(); |
| 11561 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11562 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11563 | mImpl->log("finish vkQueuePresentKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11564 | return vkQueuePresentKHR_VkResult_return; |
| 11565 | } |
| 11566 | |
| 11567 | VkResult VkEncoder::vkGetDeviceGroupPresentCapabilitiesKHR( |
| 11568 | VkDevice device, |
| 11569 | VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) |
| 11570 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11571 | mImpl->log("start vkGetDeviceGroupPresentCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11572 | auto stream = mImpl->stream(); |
| 11573 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11574 | auto resources = mImpl->resources(); |
| 11575 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11576 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11577 | VkDevice local_device; |
| 11578 | local_device = device; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11579 | countingStream->rewind(); |
| 11580 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11581 | uint64_t cgen_var_826; |
| 11582 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_826, 1); |
| 11583 | countingStream->write((uint64_t*)&cgen_var_826, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11584 | marshal_VkDeviceGroupPresentCapabilitiesKHR(countingStream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 11585 | } |
| 11586 | uint32_t packetSize_vkGetDeviceGroupPresentCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11587 | countingStream->rewind(); |
| 11588 | uint32_t opcode_vkGetDeviceGroupPresentCapabilitiesKHR = OP_vkGetDeviceGroupPresentCapabilitiesKHR; |
| 11589 | stream->write(&opcode_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| 11590 | stream->write(&packetSize_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11591 | uint64_t cgen_var_827; |
| 11592 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_827, 1); |
| 11593 | stream->write((uint64_t*)&cgen_var_827, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11594 | marshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 11595 | unmarshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11596 | if (pDeviceGroupPresentCapabilities) |
| 11597 | { |
| 11598 | transform_fromhost_VkDeviceGroupPresentCapabilitiesKHR(mImpl->resources(), (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 11599 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11600 | VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 11601 | stream->read(&vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11602 | countingStream->clearPool(); |
| 11603 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11604 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11605 | mImpl->log("finish vkGetDeviceGroupPresentCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11606 | return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return; |
| 11607 | } |
| 11608 | |
| 11609 | VkResult VkEncoder::vkGetDeviceGroupSurfacePresentModesKHR( |
| 11610 | VkDevice device, |
| 11611 | VkSurfaceKHR surface, |
| 11612 | VkDeviceGroupPresentModeFlagsKHR* pModes) |
| 11613 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11614 | mImpl->log("start vkGetDeviceGroupSurfacePresentModesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11615 | auto stream = mImpl->stream(); |
| 11616 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11617 | auto resources = mImpl->resources(); |
| 11618 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11619 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11620 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11621 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11622 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11623 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11624 | countingStream->rewind(); |
| 11625 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11626 | uint64_t cgen_var_828; |
| 11627 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_828, 1); |
| 11628 | countingStream->write((uint64_t*)&cgen_var_828, 1 * 8); |
| 11629 | uint64_t cgen_var_829; |
| 11630 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_829, 1); |
| 11631 | countingStream->write((uint64_t*)&cgen_var_829, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11632 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11633 | uint64_t cgen_var_830 = (uint64_t)(uintptr_t)pModes; |
| 11634 | countingStream->putBe64(cgen_var_830); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11635 | if (pModes) |
| 11636 | { |
| 11637 | countingStream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 11638 | } |
| 11639 | } |
| 11640 | uint32_t packetSize_vkGetDeviceGroupSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11641 | countingStream->rewind(); |
| 11642 | uint32_t opcode_vkGetDeviceGroupSurfacePresentModesKHR = OP_vkGetDeviceGroupSurfacePresentModesKHR; |
| 11643 | stream->write(&opcode_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| 11644 | stream->write(&packetSize_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11645 | uint64_t cgen_var_831; |
| 11646 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_831, 1); |
| 11647 | stream->write((uint64_t*)&cgen_var_831, 1 * 8); |
| 11648 | uint64_t cgen_var_832; |
| 11649 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_832, 1); |
| 11650 | stream->write((uint64_t*)&cgen_var_832, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11651 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11652 | uint64_t cgen_var_833 = (uint64_t)(uintptr_t)pModes; |
| 11653 | stream->putBe64(cgen_var_833); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11654 | if (pModes) |
| 11655 | { |
| 11656 | stream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 11657 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11658 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11659 | VkDeviceGroupPresentModeFlagsKHR* check_pModes; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11660 | check_pModes = (VkDeviceGroupPresentModeFlagsKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11661 | if (pModes) |
| 11662 | { |
| 11663 | if (!(check_pModes)) |
| 11664 | { |
| 11665 | fprintf(stderr, "fatal: pModes inconsistent between guest and host\n"); |
| 11666 | } |
| 11667 | stream->read((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 11668 | } |
| 11669 | VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 11670 | stream->read(&vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11671 | countingStream->clearPool(); |
| 11672 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11673 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11674 | mImpl->log("finish vkGetDeviceGroupSurfacePresentModesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11675 | return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return; |
| 11676 | } |
| 11677 | |
| 11678 | VkResult VkEncoder::vkGetPhysicalDevicePresentRectanglesKHR( |
| 11679 | VkPhysicalDevice physicalDevice, |
| 11680 | VkSurfaceKHR surface, |
| 11681 | uint32_t* pRectCount, |
| 11682 | VkRect2D* pRects) |
| 11683 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11684 | mImpl->log("start vkGetPhysicalDevicePresentRectanglesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11685 | auto stream = mImpl->stream(); |
| 11686 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11687 | auto resources = mImpl->resources(); |
| 11688 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11689 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11690 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11691 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11692 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11693 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11694 | countingStream->rewind(); |
| 11695 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11696 | uint64_t cgen_var_835; |
| 11697 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_835, 1); |
| 11698 | countingStream->write((uint64_t*)&cgen_var_835, 1 * 8); |
| 11699 | uint64_t cgen_var_836; |
| 11700 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_836, 1); |
| 11701 | countingStream->write((uint64_t*)&cgen_var_836, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11702 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11703 | uint64_t cgen_var_837 = (uint64_t)(uintptr_t)pRectCount; |
| 11704 | countingStream->putBe64(cgen_var_837); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11705 | if (pRectCount) |
| 11706 | { |
| 11707 | countingStream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 11708 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11709 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11710 | uint64_t cgen_var_838 = (uint64_t)(uintptr_t)pRects; |
| 11711 | countingStream->putBe64(cgen_var_838); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11712 | if (pRects) |
| 11713 | { |
| 11714 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 11715 | { |
| 11716 | marshal_VkRect2D(countingStream, (VkRect2D*)(pRects + i)); |
| 11717 | } |
| 11718 | } |
| 11719 | } |
| 11720 | uint32_t packetSize_vkGetPhysicalDevicePresentRectanglesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11721 | countingStream->rewind(); |
| 11722 | uint32_t opcode_vkGetPhysicalDevicePresentRectanglesKHR = OP_vkGetPhysicalDevicePresentRectanglesKHR; |
| 11723 | stream->write(&opcode_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| 11724 | stream->write(&packetSize_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11725 | uint64_t cgen_var_839; |
| 11726 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_839, 1); |
| 11727 | stream->write((uint64_t*)&cgen_var_839, 1 * 8); |
| 11728 | uint64_t cgen_var_840; |
| 11729 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_840, 1); |
| 11730 | stream->write((uint64_t*)&cgen_var_840, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11731 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11732 | uint64_t cgen_var_841 = (uint64_t)(uintptr_t)pRectCount; |
| 11733 | stream->putBe64(cgen_var_841); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11734 | if (pRectCount) |
| 11735 | { |
| 11736 | stream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 11737 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11738 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11739 | uint64_t cgen_var_842 = (uint64_t)(uintptr_t)pRects; |
| 11740 | stream->putBe64(cgen_var_842); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11741 | if (pRects) |
| 11742 | { |
| 11743 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 11744 | { |
| 11745 | marshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 11746 | } |
| 11747 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11748 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11749 | uint32_t* check_pRectCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11750 | check_pRectCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11751 | if (pRectCount) |
| 11752 | { |
| 11753 | if (!(check_pRectCount)) |
| 11754 | { |
| 11755 | fprintf(stderr, "fatal: pRectCount inconsistent between guest and host\n"); |
| 11756 | } |
| 11757 | stream->read((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 11758 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11759 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11760 | VkRect2D* check_pRects; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11761 | check_pRects = (VkRect2D*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11762 | if (pRects) |
| 11763 | { |
| 11764 | if (!(check_pRects)) |
| 11765 | { |
| 11766 | fprintf(stderr, "fatal: pRects inconsistent between guest and host\n"); |
| 11767 | } |
| 11768 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 11769 | { |
| 11770 | unmarshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 11771 | } |
| 11772 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11773 | if (pRects) |
| 11774 | { |
| 11775 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 11776 | { |
| 11777 | transform_fromhost_VkRect2D(mImpl->resources(), (VkRect2D*)(pRects + i)); |
| 11778 | } |
| 11779 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11780 | VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0; |
| 11781 | stream->read(&vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11782 | countingStream->clearPool(); |
| 11783 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11784 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11785 | mImpl->log("finish vkGetPhysicalDevicePresentRectanglesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11786 | return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return; |
| 11787 | } |
| 11788 | |
| 11789 | VkResult VkEncoder::vkAcquireNextImage2KHR( |
| 11790 | VkDevice device, |
| 11791 | const VkAcquireNextImageInfoKHR* pAcquireInfo, |
| 11792 | uint32_t* pImageIndex) |
| 11793 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11794 | mImpl->log("start vkAcquireNextImage2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11795 | auto stream = mImpl->stream(); |
| 11796 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11797 | auto resources = mImpl->resources(); |
| 11798 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11799 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11800 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11801 | VkAcquireNextImageInfoKHR* local_pAcquireInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11802 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11803 | local_pAcquireInfo = nullptr; |
| 11804 | if (pAcquireInfo) |
| 11805 | { |
| 11806 | local_pAcquireInfo = (VkAcquireNextImageInfoKHR*)pool->alloc(sizeof(const VkAcquireNextImageInfoKHR)); |
| 11807 | deepcopy_VkAcquireNextImageInfoKHR(pool, pAcquireInfo, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| 11808 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11809 | if (local_pAcquireInfo) |
| 11810 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11811 | transform_tohost_VkAcquireNextImageInfoKHR(mImpl->resources(), (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11812 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11813 | countingStream->rewind(); |
| 11814 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11815 | uint64_t cgen_var_845; |
| 11816 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_845, 1); |
| 11817 | countingStream->write((uint64_t*)&cgen_var_845, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11818 | marshal_VkAcquireNextImageInfoKHR(countingStream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11819 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 11820 | } |
| 11821 | uint32_t packetSize_vkAcquireNextImage2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11822 | countingStream->rewind(); |
| 11823 | uint32_t opcode_vkAcquireNextImage2KHR = OP_vkAcquireNextImage2KHR; |
| 11824 | stream->write(&opcode_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| 11825 | stream->write(&packetSize_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11826 | uint64_t cgen_var_846; |
| 11827 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_846, 1); |
| 11828 | stream->write((uint64_t*)&cgen_var_846, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11829 | marshal_VkAcquireNextImageInfoKHR(stream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11830 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 11831 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 11832 | VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0; |
| 11833 | stream->read(&vkAcquireNextImage2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11834 | countingStream->clearPool(); |
| 11835 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11836 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11837 | mImpl->log("finish vkAcquireNextImage2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11838 | return vkAcquireNextImage2KHR_VkResult_return; |
| 11839 | } |
| 11840 | |
| 11841 | #endif |
| 11842 | #ifdef VK_KHR_display |
| 11843 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPropertiesKHR( |
| 11844 | VkPhysicalDevice physicalDevice, |
| 11845 | uint32_t* pPropertyCount, |
| 11846 | VkDisplayPropertiesKHR* pProperties) |
| 11847 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11848 | mImpl->log("start vkGetPhysicalDeviceDisplayPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11849 | auto stream = mImpl->stream(); |
| 11850 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11851 | auto resources = mImpl->resources(); |
| 11852 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11853 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11854 | VkPhysicalDevice local_physicalDevice; |
| 11855 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11856 | countingStream->rewind(); |
| 11857 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11858 | uint64_t cgen_var_847; |
| 11859 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_847, 1); |
| 11860 | countingStream->write((uint64_t*)&cgen_var_847, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11861 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11862 | uint64_t cgen_var_848 = (uint64_t)(uintptr_t)pPropertyCount; |
| 11863 | countingStream->putBe64(cgen_var_848); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11864 | if (pPropertyCount) |
| 11865 | { |
| 11866 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11867 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11868 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11869 | uint64_t cgen_var_849 = (uint64_t)(uintptr_t)pProperties; |
| 11870 | countingStream->putBe64(cgen_var_849); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11871 | if (pProperties) |
| 11872 | { |
| 11873 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11874 | { |
| 11875 | marshal_VkDisplayPropertiesKHR(countingStream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 11876 | } |
| 11877 | } |
| 11878 | } |
| 11879 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11880 | countingStream->rewind(); |
| 11881 | uint32_t opcode_vkGetPhysicalDeviceDisplayPropertiesKHR = OP_vkGetPhysicalDeviceDisplayPropertiesKHR; |
| 11882 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| 11883 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11884 | uint64_t cgen_var_850; |
| 11885 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_850, 1); |
| 11886 | stream->write((uint64_t*)&cgen_var_850, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11887 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11888 | uint64_t cgen_var_851 = (uint64_t)(uintptr_t)pPropertyCount; |
| 11889 | stream->putBe64(cgen_var_851); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11890 | if (pPropertyCount) |
| 11891 | { |
| 11892 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11893 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11894 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11895 | uint64_t cgen_var_852 = (uint64_t)(uintptr_t)pProperties; |
| 11896 | stream->putBe64(cgen_var_852); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11897 | if (pProperties) |
| 11898 | { |
| 11899 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11900 | { |
| 11901 | marshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 11902 | } |
| 11903 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11904 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11905 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11906 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11907 | if (pPropertyCount) |
| 11908 | { |
| 11909 | if (!(check_pPropertyCount)) |
| 11910 | { |
| 11911 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 11912 | } |
| 11913 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11914 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11915 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11916 | VkDisplayPropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11917 | check_pProperties = (VkDisplayPropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11918 | if (pProperties) |
| 11919 | { |
| 11920 | if (!(check_pProperties)) |
| 11921 | { |
| 11922 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 11923 | } |
| 11924 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11925 | { |
| 11926 | unmarshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 11927 | } |
| 11928 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11929 | if (pProperties) |
| 11930 | { |
| 11931 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11932 | { |
| 11933 | transform_fromhost_VkDisplayPropertiesKHR(mImpl->resources(), (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 11934 | } |
| 11935 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11936 | VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0; |
| 11937 | stream->read(&vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11938 | countingStream->clearPool(); |
| 11939 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11940 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11941 | mImpl->log("finish vkGetPhysicalDeviceDisplayPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11942 | return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return; |
| 11943 | } |
| 11944 | |
| 11945 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlanePropertiesKHR( |
| 11946 | VkPhysicalDevice physicalDevice, |
| 11947 | uint32_t* pPropertyCount, |
| 11948 | VkDisplayPlanePropertiesKHR* pProperties) |
| 11949 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11950 | mImpl->log("start vkGetPhysicalDeviceDisplayPlanePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11951 | auto stream = mImpl->stream(); |
| 11952 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11953 | auto resources = mImpl->resources(); |
| 11954 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11955 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11956 | VkPhysicalDevice local_physicalDevice; |
| 11957 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11958 | countingStream->rewind(); |
| 11959 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11960 | uint64_t cgen_var_855; |
| 11961 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_855, 1); |
| 11962 | countingStream->write((uint64_t*)&cgen_var_855, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11963 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11964 | uint64_t cgen_var_856 = (uint64_t)(uintptr_t)pPropertyCount; |
| 11965 | countingStream->putBe64(cgen_var_856); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11966 | if (pPropertyCount) |
| 11967 | { |
| 11968 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11969 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11970 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11971 | uint64_t cgen_var_857 = (uint64_t)(uintptr_t)pProperties; |
| 11972 | countingStream->putBe64(cgen_var_857); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11973 | if (pProperties) |
| 11974 | { |
| 11975 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 11976 | { |
| 11977 | marshal_VkDisplayPlanePropertiesKHR(countingStream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 11978 | } |
| 11979 | } |
| 11980 | } |
| 11981 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11982 | countingStream->rewind(); |
| 11983 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR; |
| 11984 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| 11985 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11986 | uint64_t cgen_var_858; |
| 11987 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_858, 1); |
| 11988 | stream->write((uint64_t*)&cgen_var_858, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11989 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11990 | uint64_t cgen_var_859 = (uint64_t)(uintptr_t)pPropertyCount; |
| 11991 | stream->putBe64(cgen_var_859); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11992 | if (pPropertyCount) |
| 11993 | { |
| 11994 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 11995 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11996 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 11997 | uint64_t cgen_var_860 = (uint64_t)(uintptr_t)pProperties; |
| 11998 | stream->putBe64(cgen_var_860); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11999 | if (pProperties) |
| 12000 | { |
| 12001 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12002 | { |
| 12003 | marshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12004 | } |
| 12005 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12006 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12007 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12008 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12009 | if (pPropertyCount) |
| 12010 | { |
| 12011 | if (!(check_pPropertyCount)) |
| 12012 | { |
| 12013 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12014 | } |
| 12015 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12016 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12017 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12018 | VkDisplayPlanePropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12019 | check_pProperties = (VkDisplayPlanePropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12020 | if (pProperties) |
| 12021 | { |
| 12022 | if (!(check_pProperties)) |
| 12023 | { |
| 12024 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12025 | } |
| 12026 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12027 | { |
| 12028 | unmarshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12029 | } |
| 12030 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12031 | if (pProperties) |
| 12032 | { |
| 12033 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12034 | { |
| 12035 | transform_fromhost_VkDisplayPlanePropertiesKHR(mImpl->resources(), (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12036 | } |
| 12037 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12038 | VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0; |
| 12039 | stream->read(&vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12040 | countingStream->clearPool(); |
| 12041 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12042 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12043 | mImpl->log("finish vkGetPhysicalDeviceDisplayPlanePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12044 | return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return; |
| 12045 | } |
| 12046 | |
| 12047 | VkResult VkEncoder::vkGetDisplayPlaneSupportedDisplaysKHR( |
| 12048 | VkPhysicalDevice physicalDevice, |
| 12049 | uint32_t planeIndex, |
| 12050 | uint32_t* pDisplayCount, |
| 12051 | VkDisplayKHR* pDisplays) |
| 12052 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12053 | mImpl->log("start vkGetDisplayPlaneSupportedDisplaysKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12054 | auto stream = mImpl->stream(); |
| 12055 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12056 | auto resources = mImpl->resources(); |
| 12057 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12058 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12059 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12060 | uint32_t local_planeIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12061 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12062 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12063 | countingStream->rewind(); |
| 12064 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12065 | uint64_t cgen_var_863; |
| 12066 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_863, 1); |
| 12067 | countingStream->write((uint64_t*)&cgen_var_863, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12068 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12069 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12070 | uint64_t cgen_var_864 = (uint64_t)(uintptr_t)pDisplayCount; |
| 12071 | countingStream->putBe64(cgen_var_864); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12072 | if (pDisplayCount) |
| 12073 | { |
| 12074 | countingStream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 12075 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12076 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12077 | uint64_t cgen_var_865 = (uint64_t)(uintptr_t)pDisplays; |
| 12078 | countingStream->putBe64(cgen_var_865); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12079 | if (pDisplays) |
| 12080 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12081 | if ((*(pDisplayCount))) |
| 12082 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12083 | uint64_t* cgen_var_866; |
| 12084 | countingStream->alloc((void**)&cgen_var_866, (*(pDisplayCount)) * 8); |
| 12085 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_866, (*(pDisplayCount))); |
| 12086 | countingStream->write((uint64_t*)cgen_var_866, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12087 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12088 | } |
| 12089 | } |
| 12090 | uint32_t packetSize_vkGetDisplayPlaneSupportedDisplaysKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12091 | countingStream->rewind(); |
| 12092 | uint32_t opcode_vkGetDisplayPlaneSupportedDisplaysKHR = OP_vkGetDisplayPlaneSupportedDisplaysKHR; |
| 12093 | stream->write(&opcode_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| 12094 | stream->write(&packetSize_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12095 | uint64_t cgen_var_867; |
| 12096 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_867, 1); |
| 12097 | stream->write((uint64_t*)&cgen_var_867, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12098 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12099 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12100 | uint64_t cgen_var_868 = (uint64_t)(uintptr_t)pDisplayCount; |
| 12101 | stream->putBe64(cgen_var_868); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12102 | if (pDisplayCount) |
| 12103 | { |
| 12104 | stream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 12105 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12106 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12107 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12108 | uint64_t cgen_var_869 = (uint64_t)(uintptr_t)pDisplays; |
| 12109 | stream->putBe64(cgen_var_869); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12110 | if (pDisplays) |
| 12111 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12112 | if ((*(pDisplayCount))) |
| 12113 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12114 | uint64_t* cgen_var_870; |
| 12115 | stream->alloc((void**)&cgen_var_870, (*(pDisplayCount)) * 8); |
| 12116 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_870, (*(pDisplayCount))); |
| 12117 | stream->write((uint64_t*)cgen_var_870, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12118 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12119 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12120 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12121 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12122 | uint32_t* check_pDisplayCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12123 | check_pDisplayCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12124 | if (pDisplayCount) |
| 12125 | { |
| 12126 | if (!(check_pDisplayCount)) |
| 12127 | { |
| 12128 | fprintf(stderr, "fatal: pDisplayCount inconsistent between guest and host\n"); |
| 12129 | } |
| 12130 | stream->read((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 12131 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12132 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12133 | VkDisplayKHR* check_pDisplays; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12134 | check_pDisplays = (VkDisplayKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12135 | if (pDisplays) |
| 12136 | { |
| 12137 | if (!(check_pDisplays)) |
| 12138 | { |
| 12139 | fprintf(stderr, "fatal: pDisplays inconsistent between guest and host\n"); |
| 12140 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12141 | if ((*(pDisplayCount))) |
| 12142 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12143 | uint64_t* cgen_var_873; |
| 12144 | stream->alloc((void**)&cgen_var_873, (*(pDisplayCount)) * 8); |
| 12145 | stream->read((uint64_t*)cgen_var_873, (*(pDisplayCount)) * 8); |
| 12146 | stream->handleMapping()->mapHandles_u64_VkDisplayKHR(cgen_var_873, (VkDisplayKHR*)pDisplays, (*(pDisplayCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12147 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12148 | } |
| 12149 | VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0; |
| 12150 | stream->read(&vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12151 | countingStream->clearPool(); |
| 12152 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12153 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12154 | mImpl->log("finish vkGetDisplayPlaneSupportedDisplaysKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12155 | return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return; |
| 12156 | } |
| 12157 | |
| 12158 | VkResult VkEncoder::vkGetDisplayModePropertiesKHR( |
| 12159 | VkPhysicalDevice physicalDevice, |
| 12160 | VkDisplayKHR display, |
| 12161 | uint32_t* pPropertyCount, |
| 12162 | VkDisplayModePropertiesKHR* pProperties) |
| 12163 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12164 | mImpl->log("start vkGetDisplayModePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12165 | auto stream = mImpl->stream(); |
| 12166 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12167 | auto resources = mImpl->resources(); |
| 12168 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12169 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12170 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12171 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12172 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12173 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12174 | countingStream->rewind(); |
| 12175 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12176 | uint64_t cgen_var_874; |
| 12177 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_874, 1); |
| 12178 | countingStream->write((uint64_t*)&cgen_var_874, 1 * 8); |
| 12179 | uint64_t cgen_var_875; |
| 12180 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_875, 1); |
| 12181 | countingStream->write((uint64_t*)&cgen_var_875, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12182 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12183 | uint64_t cgen_var_876 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12184 | countingStream->putBe64(cgen_var_876); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12185 | if (pPropertyCount) |
| 12186 | { |
| 12187 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12188 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12189 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12190 | uint64_t cgen_var_877 = (uint64_t)(uintptr_t)pProperties; |
| 12191 | countingStream->putBe64(cgen_var_877); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12192 | if (pProperties) |
| 12193 | { |
| 12194 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12195 | { |
| 12196 | marshal_VkDisplayModePropertiesKHR(countingStream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 12197 | } |
| 12198 | } |
| 12199 | } |
| 12200 | uint32_t packetSize_vkGetDisplayModePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12201 | countingStream->rewind(); |
| 12202 | uint32_t opcode_vkGetDisplayModePropertiesKHR = OP_vkGetDisplayModePropertiesKHR; |
| 12203 | stream->write(&opcode_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| 12204 | stream->write(&packetSize_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12205 | uint64_t cgen_var_878; |
| 12206 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_878, 1); |
| 12207 | stream->write((uint64_t*)&cgen_var_878, 1 * 8); |
| 12208 | uint64_t cgen_var_879; |
| 12209 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_879, 1); |
| 12210 | stream->write((uint64_t*)&cgen_var_879, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12211 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12212 | uint64_t cgen_var_880 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12213 | stream->putBe64(cgen_var_880); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12214 | if (pPropertyCount) |
| 12215 | { |
| 12216 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12217 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12218 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12219 | uint64_t cgen_var_881 = (uint64_t)(uintptr_t)pProperties; |
| 12220 | stream->putBe64(cgen_var_881); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12221 | if (pProperties) |
| 12222 | { |
| 12223 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12224 | { |
| 12225 | marshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 12226 | } |
| 12227 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12228 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12229 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12230 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12231 | if (pPropertyCount) |
| 12232 | { |
| 12233 | if (!(check_pPropertyCount)) |
| 12234 | { |
| 12235 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12236 | } |
| 12237 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12238 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12239 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12240 | VkDisplayModePropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12241 | check_pProperties = (VkDisplayModePropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12242 | if (pProperties) |
| 12243 | { |
| 12244 | if (!(check_pProperties)) |
| 12245 | { |
| 12246 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12247 | } |
| 12248 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12249 | { |
| 12250 | unmarshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 12251 | } |
| 12252 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12253 | if (pProperties) |
| 12254 | { |
| 12255 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12256 | { |
| 12257 | transform_fromhost_VkDisplayModePropertiesKHR(mImpl->resources(), (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 12258 | } |
| 12259 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12260 | VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0; |
| 12261 | stream->read(&vkGetDisplayModePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12262 | countingStream->clearPool(); |
| 12263 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12264 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12265 | mImpl->log("finish vkGetDisplayModePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12266 | return vkGetDisplayModePropertiesKHR_VkResult_return; |
| 12267 | } |
| 12268 | |
| 12269 | VkResult VkEncoder::vkCreateDisplayModeKHR( |
| 12270 | VkPhysicalDevice physicalDevice, |
| 12271 | VkDisplayKHR display, |
| 12272 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
| 12273 | const VkAllocationCallbacks* pAllocator, |
| 12274 | VkDisplayModeKHR* pMode) |
| 12275 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12276 | mImpl->log("start vkCreateDisplayModeKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12277 | auto stream = mImpl->stream(); |
| 12278 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12279 | auto resources = mImpl->resources(); |
| 12280 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12281 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12282 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12283 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12284 | VkDisplayModeCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12285 | VkAllocationCallbacks* local_pAllocator; |
| 12286 | local_physicalDevice = physicalDevice; |
| 12287 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12288 | local_pCreateInfo = nullptr; |
| 12289 | if (pCreateInfo) |
| 12290 | { |
| 12291 | local_pCreateInfo = (VkDisplayModeCreateInfoKHR*)pool->alloc(sizeof(const VkDisplayModeCreateInfoKHR)); |
| 12292 | deepcopy_VkDisplayModeCreateInfoKHR(pool, pCreateInfo, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| 12293 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12294 | local_pAllocator = nullptr; |
| 12295 | if (pAllocator) |
| 12296 | { |
| 12297 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12298 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12299 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12300 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12301 | if (local_pCreateInfo) |
| 12302 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12303 | transform_tohost_VkDisplayModeCreateInfoKHR(mImpl->resources(), (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12304 | } |
| 12305 | if (local_pAllocator) |
| 12306 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12307 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12308 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12309 | countingStream->rewind(); |
| 12310 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12311 | uint64_t cgen_var_884; |
| 12312 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_884, 1); |
| 12313 | countingStream->write((uint64_t*)&cgen_var_884, 1 * 8); |
| 12314 | uint64_t cgen_var_885; |
| 12315 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_885, 1); |
| 12316 | countingStream->write((uint64_t*)&cgen_var_885, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12317 | marshal_VkDisplayModeCreateInfoKHR(countingStream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12318 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12319 | uint64_t cgen_var_886 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12320 | countingStream->putBe64(cgen_var_886); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12321 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12322 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12323 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12324 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12325 | uint64_t cgen_var_887; |
| 12326 | countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_887, 1); |
| 12327 | countingStream->write((uint64_t*)&cgen_var_887, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12328 | } |
| 12329 | uint32_t packetSize_vkCreateDisplayModeKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12330 | countingStream->rewind(); |
| 12331 | uint32_t opcode_vkCreateDisplayModeKHR = OP_vkCreateDisplayModeKHR; |
| 12332 | stream->write(&opcode_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| 12333 | stream->write(&packetSize_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12334 | uint64_t cgen_var_888; |
| 12335 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_888, 1); |
| 12336 | stream->write((uint64_t*)&cgen_var_888, 1 * 8); |
| 12337 | uint64_t cgen_var_889; |
| 12338 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_889, 1); |
| 12339 | stream->write((uint64_t*)&cgen_var_889, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12340 | marshal_VkDisplayModeCreateInfoKHR(stream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12341 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12342 | uint64_t cgen_var_890 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12343 | stream->putBe64(cgen_var_890); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12344 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12345 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12346 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12347 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12348 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12349 | uint64_t cgen_var_891; |
| 12350 | stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_891, 1); |
| 12351 | stream->write((uint64_t*)&cgen_var_891, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12352 | stream->setHandleMapping(resources->unwrapMapping()); |
| 12353 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12354 | uint64_t cgen_var_892; |
| 12355 | stream->read((uint64_t*)&cgen_var_892, 8); |
| 12356 | stream->handleMapping()->mapHandles_u64_VkDisplayModeKHR(&cgen_var_892, (VkDisplayModeKHR*)pMode, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12357 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12358 | VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0; |
| 12359 | stream->read(&vkCreateDisplayModeKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12360 | countingStream->clearPool(); |
| 12361 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12362 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12363 | mImpl->log("finish vkCreateDisplayModeKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12364 | return vkCreateDisplayModeKHR_VkResult_return; |
| 12365 | } |
| 12366 | |
| 12367 | VkResult VkEncoder::vkGetDisplayPlaneCapabilitiesKHR( |
| 12368 | VkPhysicalDevice physicalDevice, |
| 12369 | VkDisplayModeKHR mode, |
| 12370 | uint32_t planeIndex, |
| 12371 | VkDisplayPlaneCapabilitiesKHR* pCapabilities) |
| 12372 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12373 | mImpl->log("start vkGetDisplayPlaneCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12374 | auto stream = mImpl->stream(); |
| 12375 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12376 | auto resources = mImpl->resources(); |
| 12377 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12378 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12379 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12380 | VkDisplayModeKHR local_mode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12381 | uint32_t local_planeIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12382 | local_physicalDevice = physicalDevice; |
| 12383 | local_mode = mode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12384 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12385 | countingStream->rewind(); |
| 12386 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12387 | uint64_t cgen_var_893; |
| 12388 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_893, 1); |
| 12389 | countingStream->write((uint64_t*)&cgen_var_893, 1 * 8); |
| 12390 | uint64_t cgen_var_894; |
| 12391 | countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_894, 1); |
| 12392 | countingStream->write((uint64_t*)&cgen_var_894, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12393 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12394 | marshal_VkDisplayPlaneCapabilitiesKHR(countingStream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 12395 | } |
| 12396 | uint32_t packetSize_vkGetDisplayPlaneCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12397 | countingStream->rewind(); |
| 12398 | uint32_t opcode_vkGetDisplayPlaneCapabilitiesKHR = OP_vkGetDisplayPlaneCapabilitiesKHR; |
| 12399 | stream->write(&opcode_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| 12400 | stream->write(&packetSize_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12401 | uint64_t cgen_var_895; |
| 12402 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_895, 1); |
| 12403 | stream->write((uint64_t*)&cgen_var_895, 1 * 8); |
| 12404 | uint64_t cgen_var_896; |
| 12405 | stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_896, 1); |
| 12406 | stream->write((uint64_t*)&cgen_var_896, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12407 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12408 | marshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 12409 | unmarshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12410 | if (pCapabilities) |
| 12411 | { |
| 12412 | transform_fromhost_VkDisplayPlaneCapabilitiesKHR(mImpl->resources(), (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 12413 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12414 | VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 12415 | stream->read(&vkGetDisplayPlaneCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12416 | countingStream->clearPool(); |
| 12417 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12418 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12419 | mImpl->log("finish vkGetDisplayPlaneCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12420 | return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return; |
| 12421 | } |
| 12422 | |
| 12423 | VkResult VkEncoder::vkCreateDisplayPlaneSurfaceKHR( |
| 12424 | VkInstance instance, |
| 12425 | const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, |
| 12426 | const VkAllocationCallbacks* pAllocator, |
| 12427 | VkSurfaceKHR* pSurface) |
| 12428 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12429 | mImpl->log("start vkCreateDisplayPlaneSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12430 | auto stream = mImpl->stream(); |
| 12431 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12432 | auto resources = mImpl->resources(); |
| 12433 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12434 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12435 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12436 | VkDisplaySurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12437 | VkAllocationCallbacks* local_pAllocator; |
| 12438 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12439 | local_pCreateInfo = nullptr; |
| 12440 | if (pCreateInfo) |
| 12441 | { |
| 12442 | local_pCreateInfo = (VkDisplaySurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkDisplaySurfaceCreateInfoKHR)); |
| 12443 | deepcopy_VkDisplaySurfaceCreateInfoKHR(pool, pCreateInfo, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 12444 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12445 | local_pAllocator = nullptr; |
| 12446 | if (pAllocator) |
| 12447 | { |
| 12448 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12449 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12450 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12451 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12452 | if (local_pCreateInfo) |
| 12453 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12454 | transform_tohost_VkDisplaySurfaceCreateInfoKHR(mImpl->resources(), (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12455 | } |
| 12456 | if (local_pAllocator) |
| 12457 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12458 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12459 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12460 | countingStream->rewind(); |
| 12461 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12462 | uint64_t cgen_var_897; |
| 12463 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_897, 1); |
| 12464 | countingStream->write((uint64_t*)&cgen_var_897, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12465 | marshal_VkDisplaySurfaceCreateInfoKHR(countingStream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12466 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12467 | uint64_t cgen_var_898 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12468 | countingStream->putBe64(cgen_var_898); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12469 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12470 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12471 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12472 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12473 | uint64_t cgen_var_899; |
| 12474 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_899, 1); |
| 12475 | countingStream->write((uint64_t*)&cgen_var_899, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12476 | } |
| 12477 | uint32_t packetSize_vkCreateDisplayPlaneSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12478 | countingStream->rewind(); |
| 12479 | uint32_t opcode_vkCreateDisplayPlaneSurfaceKHR = OP_vkCreateDisplayPlaneSurfaceKHR; |
| 12480 | stream->write(&opcode_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| 12481 | stream->write(&packetSize_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12482 | uint64_t cgen_var_900; |
| 12483 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_900, 1); |
| 12484 | stream->write((uint64_t*)&cgen_var_900, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12485 | marshal_VkDisplaySurfaceCreateInfoKHR(stream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12486 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12487 | uint64_t cgen_var_901 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12488 | stream->putBe64(cgen_var_901); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12489 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12490 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12491 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12492 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12493 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12494 | uint64_t cgen_var_902; |
| 12495 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_902, 1); |
| 12496 | stream->write((uint64_t*)&cgen_var_902, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12497 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12498 | uint64_t cgen_var_903; |
| 12499 | stream->read((uint64_t*)&cgen_var_903, 8); |
| 12500 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_903, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12501 | VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0; |
| 12502 | stream->read(&vkCreateDisplayPlaneSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12503 | countingStream->clearPool(); |
| 12504 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12505 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12506 | mImpl->log("finish vkCreateDisplayPlaneSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12507 | return vkCreateDisplayPlaneSurfaceKHR_VkResult_return; |
| 12508 | } |
| 12509 | |
| 12510 | #endif |
| 12511 | #ifdef VK_KHR_display_swapchain |
| 12512 | VkResult VkEncoder::vkCreateSharedSwapchainsKHR( |
| 12513 | VkDevice device, |
| 12514 | uint32_t swapchainCount, |
| 12515 | const VkSwapchainCreateInfoKHR* pCreateInfos, |
| 12516 | const VkAllocationCallbacks* pAllocator, |
| 12517 | VkSwapchainKHR* pSwapchains) |
| 12518 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12519 | mImpl->log("start vkCreateSharedSwapchainsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12520 | auto stream = mImpl->stream(); |
| 12521 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12522 | auto resources = mImpl->resources(); |
| 12523 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12524 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12525 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12526 | uint32_t local_swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12527 | VkSwapchainCreateInfoKHR* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12528 | VkAllocationCallbacks* local_pAllocator; |
| 12529 | local_device = device; |
| 12530 | local_swapchainCount = swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12531 | local_pCreateInfos = nullptr; |
| 12532 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12533 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12534 | local_pCreateInfos = (VkSwapchainCreateInfoKHR*)pool->alloc(((swapchainCount)) * sizeof(const VkSwapchainCreateInfoKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12535 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 12536 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12537 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfos + i, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12538 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12539 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12540 | local_pAllocator = nullptr; |
| 12541 | if (pAllocator) |
| 12542 | { |
| 12543 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12544 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12545 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12546 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12547 | if (local_pCreateInfos) |
| 12548 | { |
| 12549 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 12550 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12551 | transform_tohost_VkSwapchainCreateInfoKHR(mImpl->resources(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12552 | } |
| 12553 | } |
| 12554 | if (local_pAllocator) |
| 12555 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12556 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12557 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12558 | countingStream->rewind(); |
| 12559 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12560 | uint64_t cgen_var_904; |
| 12561 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_904, 1); |
| 12562 | countingStream->write((uint64_t*)&cgen_var_904, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12563 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| 12564 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 12565 | { |
| 12566 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| 12567 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12568 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12569 | uint64_t cgen_var_905 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12570 | countingStream->putBe64(cgen_var_905); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12571 | if (local_pAllocator) |
| 12572 | { |
| 12573 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12574 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12575 | if (((swapchainCount))) |
| 12576 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12577 | uint64_t* cgen_var_906; |
| 12578 | countingStream->alloc((void**)&cgen_var_906, ((swapchainCount)) * 8); |
| 12579 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_906, ((swapchainCount))); |
| 12580 | countingStream->write((uint64_t*)cgen_var_906, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12581 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12582 | } |
| 12583 | uint32_t packetSize_vkCreateSharedSwapchainsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12584 | countingStream->rewind(); |
| 12585 | uint32_t opcode_vkCreateSharedSwapchainsKHR = OP_vkCreateSharedSwapchainsKHR; |
| 12586 | stream->write(&opcode_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| 12587 | stream->write(&packetSize_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12588 | uint64_t cgen_var_907; |
| 12589 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_907, 1); |
| 12590 | stream->write((uint64_t*)&cgen_var_907, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12591 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12592 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 12593 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12594 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12595 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12596 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12597 | uint64_t cgen_var_908 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12598 | stream->putBe64(cgen_var_908); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12599 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12600 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12601 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12602 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12603 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12604 | if (((swapchainCount))) |
| 12605 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12606 | uint64_t* cgen_var_909; |
| 12607 | stream->alloc((void**)&cgen_var_909, ((swapchainCount)) * 8); |
| 12608 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_909, ((swapchainCount))); |
| 12609 | stream->write((uint64_t*)cgen_var_909, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12610 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12611 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12612 | if (((swapchainCount))) |
| 12613 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12614 | uint64_t* cgen_var_910; |
| 12615 | stream->alloc((void**)&cgen_var_910, ((swapchainCount)) * 8); |
| 12616 | stream->read((uint64_t*)cgen_var_910, ((swapchainCount)) * 8); |
| 12617 | stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(cgen_var_910, (VkSwapchainKHR*)pSwapchains, ((swapchainCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12618 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12619 | VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0; |
| 12620 | stream->read(&vkCreateSharedSwapchainsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12621 | countingStream->clearPool(); |
| 12622 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12623 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12624 | mImpl->log("finish vkCreateSharedSwapchainsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12625 | return vkCreateSharedSwapchainsKHR_VkResult_return; |
| 12626 | } |
| 12627 | |
| 12628 | #endif |
| 12629 | #ifdef VK_KHR_xlib_surface |
| 12630 | VkResult VkEncoder::vkCreateXlibSurfaceKHR( |
| 12631 | VkInstance instance, |
| 12632 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, |
| 12633 | const VkAllocationCallbacks* pAllocator, |
| 12634 | VkSurfaceKHR* pSurface) |
| 12635 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12636 | mImpl->log("start vkCreateXlibSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12637 | auto stream = mImpl->stream(); |
| 12638 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12639 | auto resources = mImpl->resources(); |
| 12640 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12641 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12642 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12643 | VkXlibSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12644 | VkAllocationCallbacks* local_pAllocator; |
| 12645 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12646 | local_pCreateInfo = nullptr; |
| 12647 | if (pCreateInfo) |
| 12648 | { |
| 12649 | local_pCreateInfo = (VkXlibSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXlibSurfaceCreateInfoKHR)); |
| 12650 | deepcopy_VkXlibSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 12651 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12652 | local_pAllocator = nullptr; |
| 12653 | if (pAllocator) |
| 12654 | { |
| 12655 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12656 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12657 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12658 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12659 | if (local_pCreateInfo) |
| 12660 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12661 | transform_tohost_VkXlibSurfaceCreateInfoKHR(mImpl->resources(), (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12662 | } |
| 12663 | if (local_pAllocator) |
| 12664 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12665 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12666 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12667 | countingStream->rewind(); |
| 12668 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12669 | uint64_t cgen_var_911; |
| 12670 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_911, 1); |
| 12671 | countingStream->write((uint64_t*)&cgen_var_911, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12672 | marshal_VkXlibSurfaceCreateInfoKHR(countingStream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12673 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12674 | uint64_t cgen_var_912 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12675 | countingStream->putBe64(cgen_var_912); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12676 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12677 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12678 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12679 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12680 | uint64_t cgen_var_913; |
| 12681 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_913, 1); |
| 12682 | countingStream->write((uint64_t*)&cgen_var_913, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12683 | } |
| 12684 | uint32_t packetSize_vkCreateXlibSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12685 | countingStream->rewind(); |
| 12686 | uint32_t opcode_vkCreateXlibSurfaceKHR = OP_vkCreateXlibSurfaceKHR; |
| 12687 | stream->write(&opcode_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| 12688 | stream->write(&packetSize_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12689 | uint64_t cgen_var_914; |
| 12690 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_914, 1); |
| 12691 | stream->write((uint64_t*)&cgen_var_914, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12692 | marshal_VkXlibSurfaceCreateInfoKHR(stream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12693 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12694 | uint64_t cgen_var_915 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12695 | stream->putBe64(cgen_var_915); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12696 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12697 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12698 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12699 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12700 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12701 | uint64_t cgen_var_916; |
| 12702 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_916, 1); |
| 12703 | stream->write((uint64_t*)&cgen_var_916, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12704 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12705 | uint64_t cgen_var_917; |
| 12706 | stream->read((uint64_t*)&cgen_var_917, 8); |
| 12707 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_917, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12708 | VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0; |
| 12709 | stream->read(&vkCreateXlibSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12710 | countingStream->clearPool(); |
| 12711 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12712 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12713 | mImpl->log("finish vkCreateXlibSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12714 | return vkCreateXlibSurfaceKHR_VkResult_return; |
| 12715 | } |
| 12716 | |
| 12717 | VkBool32 VkEncoder::vkGetPhysicalDeviceXlibPresentationSupportKHR( |
| 12718 | VkPhysicalDevice physicalDevice, |
| 12719 | uint32_t queueFamilyIndex, |
| 12720 | Display* dpy, |
| 12721 | VisualID visualID) |
| 12722 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12723 | mImpl->log("start vkGetPhysicalDeviceXlibPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12724 | auto stream = mImpl->stream(); |
| 12725 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12726 | auto resources = mImpl->resources(); |
| 12727 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12728 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12729 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12730 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12731 | VisualID local_visualID; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12732 | local_physicalDevice = physicalDevice; |
| 12733 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12734 | local_visualID = visualID; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12735 | countingStream->rewind(); |
| 12736 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12737 | uint64_t cgen_var_918; |
| 12738 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_918, 1); |
| 12739 | countingStream->write((uint64_t*)&cgen_var_918, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12740 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12741 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12742 | countingStream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12743 | } |
| 12744 | uint32_t packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12745 | countingStream->rewind(); |
| 12746 | uint32_t opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR = OP_vkGetPhysicalDeviceXlibPresentationSupportKHR; |
| 12747 | stream->write(&opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| 12748 | stream->write(&packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12749 | uint64_t cgen_var_919; |
| 12750 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_919, 1); |
| 12751 | stream->write((uint64_t*)&cgen_var_919, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12752 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12753 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12754 | stream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12755 | stream->read((Display*)dpy, sizeof(Display)); |
| 12756 | VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 12757 | stream->read(&vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12758 | countingStream->clearPool(); |
| 12759 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12760 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12761 | mImpl->log("finish vkGetPhysicalDeviceXlibPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12762 | return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return; |
| 12763 | } |
| 12764 | |
| 12765 | #endif |
| 12766 | #ifdef VK_KHR_xcb_surface |
| 12767 | VkResult VkEncoder::vkCreateXcbSurfaceKHR( |
| 12768 | VkInstance instance, |
| 12769 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, |
| 12770 | const VkAllocationCallbacks* pAllocator, |
| 12771 | VkSurfaceKHR* pSurface) |
| 12772 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12773 | mImpl->log("start vkCreateXcbSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12774 | auto stream = mImpl->stream(); |
| 12775 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12776 | auto resources = mImpl->resources(); |
| 12777 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12778 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12779 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12780 | VkXcbSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12781 | VkAllocationCallbacks* local_pAllocator; |
| 12782 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12783 | local_pCreateInfo = nullptr; |
| 12784 | if (pCreateInfo) |
| 12785 | { |
| 12786 | local_pCreateInfo = (VkXcbSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXcbSurfaceCreateInfoKHR)); |
| 12787 | deepcopy_VkXcbSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 12788 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12789 | local_pAllocator = nullptr; |
| 12790 | if (pAllocator) |
| 12791 | { |
| 12792 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12793 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12794 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12795 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12796 | if (local_pCreateInfo) |
| 12797 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12798 | transform_tohost_VkXcbSurfaceCreateInfoKHR(mImpl->resources(), (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12799 | } |
| 12800 | if (local_pAllocator) |
| 12801 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12802 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12803 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12804 | countingStream->rewind(); |
| 12805 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12806 | uint64_t cgen_var_920; |
| 12807 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_920, 1); |
| 12808 | countingStream->write((uint64_t*)&cgen_var_920, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12809 | marshal_VkXcbSurfaceCreateInfoKHR(countingStream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12810 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12811 | uint64_t cgen_var_921 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12812 | countingStream->putBe64(cgen_var_921); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12813 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12814 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12815 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12816 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12817 | uint64_t cgen_var_922; |
| 12818 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_922, 1); |
| 12819 | countingStream->write((uint64_t*)&cgen_var_922, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12820 | } |
| 12821 | uint32_t packetSize_vkCreateXcbSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12822 | countingStream->rewind(); |
| 12823 | uint32_t opcode_vkCreateXcbSurfaceKHR = OP_vkCreateXcbSurfaceKHR; |
| 12824 | stream->write(&opcode_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| 12825 | stream->write(&packetSize_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12826 | uint64_t cgen_var_923; |
| 12827 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_923, 1); |
| 12828 | stream->write((uint64_t*)&cgen_var_923, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12829 | marshal_VkXcbSurfaceCreateInfoKHR(stream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12830 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12831 | uint64_t cgen_var_924 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12832 | stream->putBe64(cgen_var_924); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12833 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12834 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12835 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12836 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12837 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12838 | uint64_t cgen_var_925; |
| 12839 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_925, 1); |
| 12840 | stream->write((uint64_t*)&cgen_var_925, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12841 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12842 | uint64_t cgen_var_926; |
| 12843 | stream->read((uint64_t*)&cgen_var_926, 8); |
| 12844 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_926, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12845 | VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0; |
| 12846 | stream->read(&vkCreateXcbSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12847 | countingStream->clearPool(); |
| 12848 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12849 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12850 | mImpl->log("finish vkCreateXcbSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12851 | return vkCreateXcbSurfaceKHR_VkResult_return; |
| 12852 | } |
| 12853 | |
| 12854 | VkBool32 VkEncoder::vkGetPhysicalDeviceXcbPresentationSupportKHR( |
| 12855 | VkPhysicalDevice physicalDevice, |
| 12856 | uint32_t queueFamilyIndex, |
| 12857 | xcb_connection_t* connection, |
| 12858 | xcb_visualid_t visual_id) |
| 12859 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12860 | mImpl->log("start vkGetPhysicalDeviceXcbPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12861 | auto stream = mImpl->stream(); |
| 12862 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12863 | auto resources = mImpl->resources(); |
| 12864 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12865 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12866 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12867 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12868 | xcb_visualid_t local_visual_id; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12869 | local_physicalDevice = physicalDevice; |
| 12870 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12871 | local_visual_id = visual_id; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12872 | countingStream->rewind(); |
| 12873 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12874 | uint64_t cgen_var_927; |
| 12875 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_927, 1); |
| 12876 | countingStream->write((uint64_t*)&cgen_var_927, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12877 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12878 | countingStream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12879 | countingStream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12880 | } |
| 12881 | uint32_t packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12882 | countingStream->rewind(); |
| 12883 | uint32_t opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR = OP_vkGetPhysicalDeviceXcbPresentationSupportKHR; |
| 12884 | stream->write(&opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| 12885 | stream->write(&packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12886 | uint64_t cgen_var_928; |
| 12887 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_928, 1); |
| 12888 | stream->write((uint64_t*)&cgen_var_928, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12889 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12890 | stream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12891 | stream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12892 | stream->read((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| 12893 | VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 12894 | stream->read(&vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12895 | countingStream->clearPool(); |
| 12896 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12897 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12898 | mImpl->log("finish vkGetPhysicalDeviceXcbPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12899 | return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return; |
| 12900 | } |
| 12901 | |
| 12902 | #endif |
| 12903 | #ifdef VK_KHR_wayland_surface |
| 12904 | VkResult VkEncoder::vkCreateWaylandSurfaceKHR( |
| 12905 | VkInstance instance, |
| 12906 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, |
| 12907 | const VkAllocationCallbacks* pAllocator, |
| 12908 | VkSurfaceKHR* pSurface) |
| 12909 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12910 | mImpl->log("start vkCreateWaylandSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12911 | auto stream = mImpl->stream(); |
| 12912 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12913 | auto resources = mImpl->resources(); |
| 12914 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12915 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12916 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12917 | VkWaylandSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12918 | VkAllocationCallbacks* local_pAllocator; |
| 12919 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12920 | local_pCreateInfo = nullptr; |
| 12921 | if (pCreateInfo) |
| 12922 | { |
| 12923 | local_pCreateInfo = (VkWaylandSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWaylandSurfaceCreateInfoKHR)); |
| 12924 | deepcopy_VkWaylandSurfaceCreateInfoKHR(pool, pCreateInfo, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 12925 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12926 | local_pAllocator = nullptr; |
| 12927 | if (pAllocator) |
| 12928 | { |
| 12929 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12930 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12931 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12932 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12933 | if (local_pCreateInfo) |
| 12934 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12935 | transform_tohost_VkWaylandSurfaceCreateInfoKHR(mImpl->resources(), (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12936 | } |
| 12937 | if (local_pAllocator) |
| 12938 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12939 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12940 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12941 | countingStream->rewind(); |
| 12942 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12943 | uint64_t cgen_var_929; |
| 12944 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_929, 1); |
| 12945 | countingStream->write((uint64_t*)&cgen_var_929, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12946 | marshal_VkWaylandSurfaceCreateInfoKHR(countingStream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12947 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12948 | uint64_t cgen_var_930 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12949 | countingStream->putBe64(cgen_var_930); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12950 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12951 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12952 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12953 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12954 | uint64_t cgen_var_931; |
| 12955 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_931, 1); |
| 12956 | countingStream->write((uint64_t*)&cgen_var_931, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12957 | } |
| 12958 | uint32_t packetSize_vkCreateWaylandSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12959 | countingStream->rewind(); |
| 12960 | uint32_t opcode_vkCreateWaylandSurfaceKHR = OP_vkCreateWaylandSurfaceKHR; |
| 12961 | stream->write(&opcode_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| 12962 | stream->write(&packetSize_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12963 | uint64_t cgen_var_932; |
| 12964 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_932, 1); |
| 12965 | stream->write((uint64_t*)&cgen_var_932, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12966 | marshal_VkWaylandSurfaceCreateInfoKHR(stream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12967 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12968 | uint64_t cgen_var_933 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12969 | stream->putBe64(cgen_var_933); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12970 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12971 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12972 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12973 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12974 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12975 | uint64_t cgen_var_934; |
| 12976 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_934, 1); |
| 12977 | stream->write((uint64_t*)&cgen_var_934, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12978 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12979 | uint64_t cgen_var_935; |
| 12980 | stream->read((uint64_t*)&cgen_var_935, 8); |
| 12981 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_935, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12982 | VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0; |
| 12983 | stream->read(&vkCreateWaylandSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12984 | countingStream->clearPool(); |
| 12985 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12986 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12987 | mImpl->log("finish vkCreateWaylandSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12988 | return vkCreateWaylandSurfaceKHR_VkResult_return; |
| 12989 | } |
| 12990 | |
| 12991 | VkBool32 VkEncoder::vkGetPhysicalDeviceWaylandPresentationSupportKHR( |
| 12992 | VkPhysicalDevice physicalDevice, |
| 12993 | uint32_t queueFamilyIndex, |
| 12994 | wl_display* display) |
| 12995 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12996 | mImpl->log("start vkGetPhysicalDeviceWaylandPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12997 | auto stream = mImpl->stream(); |
| 12998 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12999 | auto resources = mImpl->resources(); |
| 13000 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13001 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13002 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13003 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13004 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13005 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13006 | countingStream->rewind(); |
| 13007 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13008 | uint64_t cgen_var_936; |
| 13009 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_936, 1); |
| 13010 | countingStream->write((uint64_t*)&cgen_var_936, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13011 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13012 | countingStream->write((wl_display*)display, sizeof(wl_display)); |
| 13013 | } |
| 13014 | uint32_t packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13015 | countingStream->rewind(); |
| 13016 | uint32_t opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR = OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR; |
| 13017 | stream->write(&opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| 13018 | stream->write(&packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13019 | uint64_t cgen_var_937; |
| 13020 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_937, 1); |
| 13021 | stream->write((uint64_t*)&cgen_var_937, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13022 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13023 | stream->write((wl_display*)display, sizeof(wl_display)); |
| 13024 | stream->read((wl_display*)display, sizeof(wl_display)); |
| 13025 | VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13026 | stream->read(&vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13027 | countingStream->clearPool(); |
| 13028 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13029 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13030 | mImpl->log("finish vkGetPhysicalDeviceWaylandPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13031 | return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return; |
| 13032 | } |
| 13033 | |
| 13034 | #endif |
| 13035 | #ifdef VK_KHR_mir_surface |
| 13036 | VkResult VkEncoder::vkCreateMirSurfaceKHR( |
| 13037 | VkInstance instance, |
| 13038 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, |
| 13039 | const VkAllocationCallbacks* pAllocator, |
| 13040 | VkSurfaceKHR* pSurface) |
| 13041 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13042 | mImpl->log("start vkCreateMirSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13043 | auto stream = mImpl->stream(); |
| 13044 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13045 | auto resources = mImpl->resources(); |
| 13046 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13047 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13048 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13049 | VkMirSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13050 | VkAllocationCallbacks* local_pAllocator; |
| 13051 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13052 | local_pCreateInfo = nullptr; |
| 13053 | if (pCreateInfo) |
| 13054 | { |
| 13055 | local_pCreateInfo = (VkMirSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkMirSurfaceCreateInfoKHR)); |
| 13056 | deepcopy_VkMirSurfaceCreateInfoKHR(pool, pCreateInfo, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13057 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13058 | local_pAllocator = nullptr; |
| 13059 | if (pAllocator) |
| 13060 | { |
| 13061 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13062 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13063 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13064 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13065 | if (local_pCreateInfo) |
| 13066 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13067 | transform_tohost_VkMirSurfaceCreateInfoKHR(mImpl->resources(), (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13068 | } |
| 13069 | if (local_pAllocator) |
| 13070 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13071 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13072 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13073 | countingStream->rewind(); |
| 13074 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13075 | uint64_t cgen_var_938; |
| 13076 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_938, 1); |
| 13077 | countingStream->write((uint64_t*)&cgen_var_938, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13078 | marshal_VkMirSurfaceCreateInfoKHR(countingStream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13079 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13080 | uint64_t cgen_var_939 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13081 | countingStream->putBe64(cgen_var_939); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13082 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13083 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13084 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13085 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13086 | uint64_t cgen_var_940; |
| 13087 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_940, 1); |
| 13088 | countingStream->write((uint64_t*)&cgen_var_940, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13089 | } |
| 13090 | uint32_t packetSize_vkCreateMirSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13091 | countingStream->rewind(); |
| 13092 | uint32_t opcode_vkCreateMirSurfaceKHR = OP_vkCreateMirSurfaceKHR; |
| 13093 | stream->write(&opcode_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| 13094 | stream->write(&packetSize_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13095 | uint64_t cgen_var_941; |
| 13096 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_941, 1); |
| 13097 | stream->write((uint64_t*)&cgen_var_941, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13098 | marshal_VkMirSurfaceCreateInfoKHR(stream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13099 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13100 | uint64_t cgen_var_942 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13101 | stream->putBe64(cgen_var_942); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13102 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13103 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13104 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13105 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13106 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13107 | uint64_t cgen_var_943; |
| 13108 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_943, 1); |
| 13109 | stream->write((uint64_t*)&cgen_var_943, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13110 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13111 | uint64_t cgen_var_944; |
| 13112 | stream->read((uint64_t*)&cgen_var_944, 8); |
| 13113 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_944, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13114 | VkResult vkCreateMirSurfaceKHR_VkResult_return = (VkResult)0; |
| 13115 | stream->read(&vkCreateMirSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13116 | countingStream->clearPool(); |
| 13117 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13118 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13119 | mImpl->log("finish vkCreateMirSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13120 | return vkCreateMirSurfaceKHR_VkResult_return; |
| 13121 | } |
| 13122 | |
| 13123 | VkBool32 VkEncoder::vkGetPhysicalDeviceMirPresentationSupportKHR( |
| 13124 | VkPhysicalDevice physicalDevice, |
| 13125 | uint32_t queueFamilyIndex, |
| 13126 | MirConnection* connection) |
| 13127 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13128 | mImpl->log("start vkGetPhysicalDeviceMirPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13129 | auto stream = mImpl->stream(); |
| 13130 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13131 | auto resources = mImpl->resources(); |
| 13132 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13133 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13134 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13135 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13136 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13137 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13138 | countingStream->rewind(); |
| 13139 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13140 | uint64_t cgen_var_945; |
| 13141 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_945, 1); |
| 13142 | countingStream->write((uint64_t*)&cgen_var_945, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13143 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13144 | countingStream->write((MirConnection*)connection, sizeof(MirConnection)); |
| 13145 | } |
| 13146 | uint32_t packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13147 | countingStream->rewind(); |
| 13148 | uint32_t opcode_vkGetPhysicalDeviceMirPresentationSupportKHR = OP_vkGetPhysicalDeviceMirPresentationSupportKHR; |
| 13149 | stream->write(&opcode_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| 13150 | stream->write(&packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13151 | uint64_t cgen_var_946; |
| 13152 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_946, 1); |
| 13153 | stream->write((uint64_t*)&cgen_var_946, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13154 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13155 | stream->write((MirConnection*)connection, sizeof(MirConnection)); |
| 13156 | stream->read((MirConnection*)connection, sizeof(MirConnection)); |
| 13157 | VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13158 | stream->read(&vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13159 | countingStream->clearPool(); |
| 13160 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13161 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13162 | mImpl->log("finish vkGetPhysicalDeviceMirPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13163 | return vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return; |
| 13164 | } |
| 13165 | |
| 13166 | #endif |
| 13167 | #ifdef VK_KHR_android_surface |
| 13168 | VkResult VkEncoder::vkCreateAndroidSurfaceKHR( |
| 13169 | VkInstance instance, |
| 13170 | const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
| 13171 | const VkAllocationCallbacks* pAllocator, |
| 13172 | VkSurfaceKHR* pSurface) |
| 13173 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13174 | mImpl->log("start vkCreateAndroidSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13175 | auto stream = mImpl->stream(); |
| 13176 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13177 | auto resources = mImpl->resources(); |
| 13178 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13179 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13180 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13181 | VkAndroidSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13182 | VkAllocationCallbacks* local_pAllocator; |
| 13183 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13184 | local_pCreateInfo = nullptr; |
| 13185 | if (pCreateInfo) |
| 13186 | { |
| 13187 | local_pCreateInfo = (VkAndroidSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkAndroidSurfaceCreateInfoKHR)); |
| 13188 | deepcopy_VkAndroidSurfaceCreateInfoKHR(pool, pCreateInfo, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13189 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13190 | local_pAllocator = nullptr; |
| 13191 | if (pAllocator) |
| 13192 | { |
| 13193 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13194 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13195 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13196 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13197 | if (local_pCreateInfo) |
| 13198 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13199 | transform_tohost_VkAndroidSurfaceCreateInfoKHR(mImpl->resources(), (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13200 | } |
| 13201 | if (local_pAllocator) |
| 13202 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13203 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13204 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13205 | countingStream->rewind(); |
| 13206 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13207 | uint64_t cgen_var_947; |
| 13208 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_947, 1); |
| 13209 | countingStream->write((uint64_t*)&cgen_var_947, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13210 | marshal_VkAndroidSurfaceCreateInfoKHR(countingStream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13211 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13212 | uint64_t cgen_var_948 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13213 | countingStream->putBe64(cgen_var_948); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13214 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13215 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13216 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13217 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13218 | uint64_t cgen_var_949; |
| 13219 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_949, 1); |
| 13220 | countingStream->write((uint64_t*)&cgen_var_949, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13221 | } |
| 13222 | uint32_t packetSize_vkCreateAndroidSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13223 | countingStream->rewind(); |
| 13224 | uint32_t opcode_vkCreateAndroidSurfaceKHR = OP_vkCreateAndroidSurfaceKHR; |
| 13225 | stream->write(&opcode_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| 13226 | stream->write(&packetSize_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13227 | uint64_t cgen_var_950; |
| 13228 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_950, 1); |
| 13229 | stream->write((uint64_t*)&cgen_var_950, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13230 | marshal_VkAndroidSurfaceCreateInfoKHR(stream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13231 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13232 | uint64_t cgen_var_951 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13233 | stream->putBe64(cgen_var_951); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13234 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13235 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13236 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13237 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13238 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13239 | uint64_t cgen_var_952; |
| 13240 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_952, 1); |
| 13241 | stream->write((uint64_t*)&cgen_var_952, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13242 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13243 | uint64_t cgen_var_953; |
| 13244 | stream->read((uint64_t*)&cgen_var_953, 8); |
| 13245 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_953, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13246 | VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0; |
| 13247 | stream->read(&vkCreateAndroidSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13248 | countingStream->clearPool(); |
| 13249 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13250 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13251 | mImpl->log("finish vkCreateAndroidSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13252 | return vkCreateAndroidSurfaceKHR_VkResult_return; |
| 13253 | } |
| 13254 | |
| 13255 | #endif |
| 13256 | #ifdef VK_KHR_win32_surface |
| 13257 | VkResult VkEncoder::vkCreateWin32SurfaceKHR( |
| 13258 | VkInstance instance, |
| 13259 | const VkWin32SurfaceCreateInfoKHR* pCreateInfo, |
| 13260 | const VkAllocationCallbacks* pAllocator, |
| 13261 | VkSurfaceKHR* pSurface) |
| 13262 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13263 | mImpl->log("start vkCreateWin32SurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13264 | auto stream = mImpl->stream(); |
| 13265 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13266 | auto resources = mImpl->resources(); |
| 13267 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13268 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13269 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13270 | VkWin32SurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13271 | VkAllocationCallbacks* local_pAllocator; |
| 13272 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13273 | local_pCreateInfo = nullptr; |
| 13274 | if (pCreateInfo) |
| 13275 | { |
| 13276 | local_pCreateInfo = (VkWin32SurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWin32SurfaceCreateInfoKHR)); |
| 13277 | deepcopy_VkWin32SurfaceCreateInfoKHR(pool, pCreateInfo, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13278 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13279 | local_pAllocator = nullptr; |
| 13280 | if (pAllocator) |
| 13281 | { |
| 13282 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13283 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13284 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13285 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13286 | if (local_pCreateInfo) |
| 13287 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13288 | transform_tohost_VkWin32SurfaceCreateInfoKHR(mImpl->resources(), (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13289 | } |
| 13290 | if (local_pAllocator) |
| 13291 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13292 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13293 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13294 | countingStream->rewind(); |
| 13295 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13296 | uint64_t cgen_var_954; |
| 13297 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_954, 1); |
| 13298 | countingStream->write((uint64_t*)&cgen_var_954, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13299 | marshal_VkWin32SurfaceCreateInfoKHR(countingStream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13300 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13301 | uint64_t cgen_var_955 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13302 | countingStream->putBe64(cgen_var_955); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13303 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13304 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13305 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13306 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13307 | uint64_t cgen_var_956; |
| 13308 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_956, 1); |
| 13309 | countingStream->write((uint64_t*)&cgen_var_956, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13310 | } |
| 13311 | uint32_t packetSize_vkCreateWin32SurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13312 | countingStream->rewind(); |
| 13313 | uint32_t opcode_vkCreateWin32SurfaceKHR = OP_vkCreateWin32SurfaceKHR; |
| 13314 | stream->write(&opcode_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| 13315 | stream->write(&packetSize_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13316 | uint64_t cgen_var_957; |
| 13317 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_957, 1); |
| 13318 | stream->write((uint64_t*)&cgen_var_957, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13319 | marshal_VkWin32SurfaceCreateInfoKHR(stream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13320 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13321 | uint64_t cgen_var_958 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13322 | stream->putBe64(cgen_var_958); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13323 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13324 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13325 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13326 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13327 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13328 | uint64_t cgen_var_959; |
| 13329 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_959, 1); |
| 13330 | stream->write((uint64_t*)&cgen_var_959, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13331 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13332 | uint64_t cgen_var_960; |
| 13333 | stream->read((uint64_t*)&cgen_var_960, 8); |
| 13334 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_960, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13335 | VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0; |
| 13336 | stream->read(&vkCreateWin32SurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13337 | countingStream->clearPool(); |
| 13338 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13339 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13340 | mImpl->log("finish vkCreateWin32SurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13341 | return vkCreateWin32SurfaceKHR_VkResult_return; |
| 13342 | } |
| 13343 | |
| 13344 | VkBool32 VkEncoder::vkGetPhysicalDeviceWin32PresentationSupportKHR( |
| 13345 | VkPhysicalDevice physicalDevice, |
| 13346 | uint32_t queueFamilyIndex) |
| 13347 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13348 | mImpl->log("start vkGetPhysicalDeviceWin32PresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13349 | auto stream = mImpl->stream(); |
| 13350 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13351 | auto resources = mImpl->resources(); |
| 13352 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13353 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13354 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13355 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13356 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13357 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13358 | countingStream->rewind(); |
| 13359 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13360 | uint64_t cgen_var_961; |
| 13361 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_961, 1); |
| 13362 | countingStream->write((uint64_t*)&cgen_var_961, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13363 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13364 | } |
| 13365 | uint32_t packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13366 | countingStream->rewind(); |
| 13367 | uint32_t opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR = OP_vkGetPhysicalDeviceWin32PresentationSupportKHR; |
| 13368 | stream->write(&opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| 13369 | stream->write(&packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13370 | uint64_t cgen_var_962; |
| 13371 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_962, 1); |
| 13372 | stream->write((uint64_t*)&cgen_var_962, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13373 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13374 | VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13375 | stream->read(&vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13376 | countingStream->clearPool(); |
| 13377 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13378 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13379 | mImpl->log("finish vkGetPhysicalDeviceWin32PresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13380 | return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return; |
| 13381 | } |
| 13382 | |
| 13383 | #endif |
| 13384 | #ifdef VK_KHR_sampler_mirror_clamp_to_edge |
| 13385 | #endif |
| 13386 | #ifdef VK_KHR_multiview |
| 13387 | #endif |
| 13388 | #ifdef VK_KHR_get_physical_device_properties2 |
| 13389 | void VkEncoder::vkGetPhysicalDeviceFeatures2KHR( |
| 13390 | VkPhysicalDevice physicalDevice, |
| 13391 | VkPhysicalDeviceFeatures2* pFeatures) |
| 13392 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13393 | mImpl->log("start vkGetPhysicalDeviceFeatures2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13394 | auto stream = mImpl->stream(); |
| 13395 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13396 | auto resources = mImpl->resources(); |
| 13397 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13398 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13399 | VkPhysicalDevice local_physicalDevice; |
| 13400 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13401 | countingStream->rewind(); |
| 13402 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13403 | uint64_t cgen_var_963; |
| 13404 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_963, 1); |
| 13405 | countingStream->write((uint64_t*)&cgen_var_963, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13406 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 13407 | } |
| 13408 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13409 | countingStream->rewind(); |
| 13410 | uint32_t opcode_vkGetPhysicalDeviceFeatures2KHR = OP_vkGetPhysicalDeviceFeatures2KHR; |
| 13411 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| 13412 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13413 | uint64_t cgen_var_964; |
| 13414 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_964, 1); |
| 13415 | stream->write((uint64_t*)&cgen_var_964, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13416 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 13417 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13418 | if (pFeatures) |
| 13419 | { |
| 13420 | transform_fromhost_VkPhysicalDeviceFeatures2(mImpl->resources(), (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 13421 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13422 | mImpl->log("finish vkGetPhysicalDeviceFeatures2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13423 | } |
| 13424 | |
| 13425 | void VkEncoder::vkGetPhysicalDeviceProperties2KHR( |
| 13426 | VkPhysicalDevice physicalDevice, |
| 13427 | VkPhysicalDeviceProperties2* pProperties) |
| 13428 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13429 | mImpl->log("start vkGetPhysicalDeviceProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13430 | auto stream = mImpl->stream(); |
| 13431 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13432 | auto resources = mImpl->resources(); |
| 13433 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13434 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13435 | VkPhysicalDevice local_physicalDevice; |
| 13436 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13437 | countingStream->rewind(); |
| 13438 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13439 | uint64_t cgen_var_965; |
| 13440 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_965, 1); |
| 13441 | countingStream->write((uint64_t*)&cgen_var_965, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13442 | marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 13443 | } |
| 13444 | uint32_t packetSize_vkGetPhysicalDeviceProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13445 | countingStream->rewind(); |
| 13446 | uint32_t opcode_vkGetPhysicalDeviceProperties2KHR = OP_vkGetPhysicalDeviceProperties2KHR; |
| 13447 | stream->write(&opcode_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| 13448 | stream->write(&packetSize_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13449 | uint64_t cgen_var_966; |
| 13450 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_966, 1); |
| 13451 | stream->write((uint64_t*)&cgen_var_966, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13452 | marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 13453 | unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13454 | if (pProperties) |
| 13455 | { |
| 13456 | transform_fromhost_VkPhysicalDeviceProperties2(mImpl->resources(), (VkPhysicalDeviceProperties2*)(pProperties)); |
| 13457 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13458 | mImpl->log("finish vkGetPhysicalDeviceProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13459 | } |
| 13460 | |
| 13461 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2KHR( |
| 13462 | VkPhysicalDevice physicalDevice, |
| 13463 | VkFormat format, |
| 13464 | VkFormatProperties2* pFormatProperties) |
| 13465 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13466 | mImpl->log("start vkGetPhysicalDeviceFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13467 | auto stream = mImpl->stream(); |
| 13468 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13469 | auto resources = mImpl->resources(); |
| 13470 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13471 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13472 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13473 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13474 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13475 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13476 | countingStream->rewind(); |
| 13477 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13478 | uint64_t cgen_var_967; |
| 13479 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_967, 1); |
| 13480 | countingStream->write((uint64_t*)&cgen_var_967, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13481 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13482 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 13483 | } |
| 13484 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13485 | countingStream->rewind(); |
| 13486 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2KHR = OP_vkGetPhysicalDeviceFormatProperties2KHR; |
| 13487 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| 13488 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13489 | uint64_t cgen_var_968; |
| 13490 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_968, 1); |
| 13491 | stream->write((uint64_t*)&cgen_var_968, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13492 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13493 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| 13494 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13495 | if (pFormatProperties) |
| 13496 | { |
| 13497 | transform_fromhost_VkFormatProperties2(mImpl->resources(), (VkFormatProperties2*)(pFormatProperties)); |
| 13498 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13499 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13500 | } |
| 13501 | |
| 13502 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2KHR( |
| 13503 | VkPhysicalDevice physicalDevice, |
| 13504 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 13505 | VkImageFormatProperties2* pImageFormatProperties) |
| 13506 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13507 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13508 | auto stream = mImpl->stream(); |
| 13509 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13510 | auto resources = mImpl->resources(); |
| 13511 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13512 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13513 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13514 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13515 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13516 | local_pImageFormatInfo = nullptr; |
| 13517 | if (pImageFormatInfo) |
| 13518 | { |
| 13519 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 13520 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 13521 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13522 | if (local_pImageFormatInfo) |
| 13523 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13524 | transform_tohost_VkPhysicalDeviceImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13525 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13526 | countingStream->rewind(); |
| 13527 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13528 | uint64_t cgen_var_969; |
| 13529 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_969, 1); |
| 13530 | countingStream->write((uint64_t*)&cgen_var_969, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13531 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13532 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 13533 | } |
| 13534 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13535 | countingStream->rewind(); |
| 13536 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2KHR = OP_vkGetPhysicalDeviceImageFormatProperties2KHR; |
| 13537 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| 13538 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13539 | uint64_t cgen_var_970; |
| 13540 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_970, 1); |
| 13541 | stream->write((uint64_t*)&cgen_var_970, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13542 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13543 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 13544 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13545 | if (pImageFormatProperties) |
| 13546 | { |
| 13547 | transform_fromhost_VkImageFormatProperties2(mImpl->resources(), (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 13548 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13549 | VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0; |
| 13550 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13551 | countingStream->clearPool(); |
| 13552 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13553 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13554 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13555 | return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return; |
| 13556 | } |
| 13557 | |
| 13558 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2KHR( |
| 13559 | VkPhysicalDevice physicalDevice, |
| 13560 | uint32_t* pQueueFamilyPropertyCount, |
| 13561 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 13562 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13563 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 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 | VkPhysicalDevice local_physicalDevice; |
| 13570 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13571 | countingStream->rewind(); |
| 13572 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13573 | uint64_t cgen_var_971; |
| 13574 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_971, 1); |
| 13575 | countingStream->write((uint64_t*)&cgen_var_971, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13576 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13577 | uint64_t cgen_var_972 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 13578 | countingStream->putBe64(cgen_var_972); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13579 | if (pQueueFamilyPropertyCount) |
| 13580 | { |
| 13581 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 13582 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13583 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13584 | uint64_t cgen_var_973 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 13585 | countingStream->putBe64(cgen_var_973); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13586 | if (pQueueFamilyProperties) |
| 13587 | { |
| 13588 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 13589 | { |
| 13590 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 13591 | } |
| 13592 | } |
| 13593 | } |
| 13594 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13595 | countingStream->rewind(); |
| 13596 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR = OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR; |
| 13597 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| 13598 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13599 | uint64_t cgen_var_974; |
| 13600 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_974, 1); |
| 13601 | stream->write((uint64_t*)&cgen_var_974, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13602 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13603 | uint64_t cgen_var_975 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 13604 | stream->putBe64(cgen_var_975); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13605 | if (pQueueFamilyPropertyCount) |
| 13606 | { |
| 13607 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 13608 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13609 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13610 | uint64_t cgen_var_976 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 13611 | stream->putBe64(cgen_var_976); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13612 | if (pQueueFamilyProperties) |
| 13613 | { |
| 13614 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 13615 | { |
| 13616 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 13617 | } |
| 13618 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13619 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13620 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13621 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13622 | if (pQueueFamilyPropertyCount) |
| 13623 | { |
| 13624 | if (!(check_pQueueFamilyPropertyCount)) |
| 13625 | { |
| 13626 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 13627 | } |
| 13628 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 13629 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13630 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13631 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13632 | check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13633 | if (pQueueFamilyProperties) |
| 13634 | { |
| 13635 | if (!(check_pQueueFamilyProperties)) |
| 13636 | { |
| 13637 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 13638 | } |
| 13639 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 13640 | { |
| 13641 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 13642 | } |
| 13643 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13644 | if (pQueueFamilyProperties) |
| 13645 | { |
| 13646 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 13647 | { |
| 13648 | transform_fromhost_VkQueueFamilyProperties2(mImpl->resources(), (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 13649 | } |
| 13650 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13651 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13652 | } |
| 13653 | |
| 13654 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2KHR( |
| 13655 | VkPhysicalDevice physicalDevice, |
| 13656 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 13657 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13658 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13659 | auto stream = mImpl->stream(); |
| 13660 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13661 | auto resources = mImpl->resources(); |
| 13662 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13663 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13664 | VkPhysicalDevice local_physicalDevice; |
| 13665 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13666 | countingStream->rewind(); |
| 13667 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13668 | uint64_t cgen_var_979; |
| 13669 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_979, 1); |
| 13670 | countingStream->write((uint64_t*)&cgen_var_979, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13671 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 13672 | } |
| 13673 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13674 | countingStream->rewind(); |
| 13675 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2KHR = OP_vkGetPhysicalDeviceMemoryProperties2KHR; |
| 13676 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| 13677 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13678 | uint64_t cgen_var_980; |
| 13679 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_980, 1); |
| 13680 | stream->write((uint64_t*)&cgen_var_980, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13681 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 13682 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13683 | if (pMemoryProperties) |
| 13684 | { |
| 13685 | transform_fromhost_VkPhysicalDeviceMemoryProperties2(mImpl->resources(), (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 13686 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13687 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13688 | } |
| 13689 | |
| 13690 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 13691 | VkPhysicalDevice physicalDevice, |
| 13692 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 13693 | uint32_t* pPropertyCount, |
| 13694 | VkSparseImageFormatProperties2* pProperties) |
| 13695 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13696 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13697 | auto stream = mImpl->stream(); |
| 13698 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13699 | auto resources = mImpl->resources(); |
| 13700 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13701 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13702 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13703 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13704 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13705 | local_pFormatInfo = nullptr; |
| 13706 | if (pFormatInfo) |
| 13707 | { |
| 13708 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 13709 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 13710 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13711 | if (local_pFormatInfo) |
| 13712 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13713 | transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13714 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13715 | countingStream->rewind(); |
| 13716 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13717 | uint64_t cgen_var_981; |
| 13718 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_981, 1); |
| 13719 | countingStream->write((uint64_t*)&cgen_var_981, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13720 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13721 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13722 | uint64_t cgen_var_982 = (uint64_t)(uintptr_t)pPropertyCount; |
| 13723 | countingStream->putBe64(cgen_var_982); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13724 | if (pPropertyCount) |
| 13725 | { |
| 13726 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 13727 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13728 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13729 | uint64_t cgen_var_983 = (uint64_t)(uintptr_t)pProperties; |
| 13730 | countingStream->putBe64(cgen_var_983); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13731 | if (pProperties) |
| 13732 | { |
| 13733 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13734 | { |
| 13735 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 13736 | } |
| 13737 | } |
| 13738 | } |
| 13739 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13740 | countingStream->rewind(); |
| 13741 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR; |
| 13742 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| 13743 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13744 | uint64_t cgen_var_984; |
| 13745 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_984, 1); |
| 13746 | stream->write((uint64_t*)&cgen_var_984, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13747 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13748 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13749 | uint64_t cgen_var_985 = (uint64_t)(uintptr_t)pPropertyCount; |
| 13750 | stream->putBe64(cgen_var_985); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13751 | if (pPropertyCount) |
| 13752 | { |
| 13753 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 13754 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13755 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13756 | uint64_t cgen_var_986 = (uint64_t)(uintptr_t)pProperties; |
| 13757 | stream->putBe64(cgen_var_986); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13758 | if (pProperties) |
| 13759 | { |
| 13760 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13761 | { |
| 13762 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 13763 | } |
| 13764 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13765 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13766 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13767 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13768 | if (pPropertyCount) |
| 13769 | { |
| 13770 | if (!(check_pPropertyCount)) |
| 13771 | { |
| 13772 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 13773 | } |
| 13774 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 13775 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13776 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13777 | VkSparseImageFormatProperties2* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13778 | check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13779 | if (pProperties) |
| 13780 | { |
| 13781 | if (!(check_pProperties)) |
| 13782 | { |
| 13783 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 13784 | } |
| 13785 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13786 | { |
| 13787 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 13788 | } |
| 13789 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13790 | if (pProperties) |
| 13791 | { |
| 13792 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13793 | { |
| 13794 | transform_fromhost_VkSparseImageFormatProperties2(mImpl->resources(), (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 13795 | } |
| 13796 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13797 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13798 | } |
| 13799 | |
| 13800 | #endif |
| 13801 | #ifdef VK_KHR_device_group |
| 13802 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeaturesKHR( |
| 13803 | VkDevice device, |
| 13804 | uint32_t heapIndex, |
| 13805 | uint32_t localDeviceIndex, |
| 13806 | uint32_t remoteDeviceIndex, |
| 13807 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 13808 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13809 | mImpl->log("start vkGetDeviceGroupPeerMemoryFeaturesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13810 | auto stream = mImpl->stream(); |
| 13811 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13812 | auto resources = mImpl->resources(); |
| 13813 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13814 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13815 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13816 | uint32_t local_heapIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13817 | uint32_t local_localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13818 | uint32_t local_remoteDeviceIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13819 | local_device = device; |
| 13820 | local_heapIndex = heapIndex; |
| 13821 | local_localDeviceIndex = localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13822 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13823 | countingStream->rewind(); |
| 13824 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13825 | uint64_t cgen_var_989; |
| 13826 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_989, 1); |
| 13827 | countingStream->write((uint64_t*)&cgen_var_989, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13828 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 13829 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 13830 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13831 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 13832 | } |
| 13833 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13834 | countingStream->rewind(); |
| 13835 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR = OP_vkGetDeviceGroupPeerMemoryFeaturesKHR; |
| 13836 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| 13837 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13838 | uint64_t cgen_var_990; |
| 13839 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_990, 1); |
| 13840 | stream->write((uint64_t*)&cgen_var_990, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13841 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 13842 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 13843 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13844 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 13845 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13846 | mImpl->log("finish vkGetDeviceGroupPeerMemoryFeaturesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13847 | } |
| 13848 | |
| 13849 | void VkEncoder::vkCmdSetDeviceMaskKHR( |
| 13850 | VkCommandBuffer commandBuffer, |
| 13851 | uint32_t deviceMask) |
| 13852 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13853 | mImpl->log("start vkCmdSetDeviceMaskKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13854 | auto stream = mImpl->stream(); |
| 13855 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13856 | auto resources = mImpl->resources(); |
| 13857 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13858 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13859 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13860 | uint32_t local_deviceMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13861 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13862 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13863 | countingStream->rewind(); |
| 13864 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13865 | uint64_t cgen_var_991; |
| 13866 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_991, 1); |
| 13867 | countingStream->write((uint64_t*)&cgen_var_991, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13868 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13869 | } |
| 13870 | uint32_t packetSize_vkCmdSetDeviceMaskKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13871 | countingStream->rewind(); |
| 13872 | uint32_t opcode_vkCmdSetDeviceMaskKHR = OP_vkCmdSetDeviceMaskKHR; |
| 13873 | stream->write(&opcode_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| 13874 | stream->write(&packetSize_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13875 | uint64_t cgen_var_992; |
| 13876 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_992, 1); |
| 13877 | stream->write((uint64_t*)&cgen_var_992, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13878 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13879 | mImpl->log("finish vkCmdSetDeviceMaskKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13880 | } |
| 13881 | |
| 13882 | void VkEncoder::vkCmdDispatchBaseKHR( |
| 13883 | VkCommandBuffer commandBuffer, |
| 13884 | uint32_t baseGroupX, |
| 13885 | uint32_t baseGroupY, |
| 13886 | uint32_t baseGroupZ, |
| 13887 | uint32_t groupCountX, |
| 13888 | uint32_t groupCountY, |
| 13889 | uint32_t groupCountZ) |
| 13890 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13891 | mImpl->log("start vkCmdDispatchBaseKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13892 | auto stream = mImpl->stream(); |
| 13893 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13894 | auto resources = mImpl->resources(); |
| 13895 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13896 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13897 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13898 | uint32_t local_baseGroupX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13899 | uint32_t local_baseGroupY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13900 | uint32_t local_baseGroupZ; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13901 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13902 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13903 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13904 | local_commandBuffer = commandBuffer; |
| 13905 | local_baseGroupX = baseGroupX; |
| 13906 | local_baseGroupY = baseGroupY; |
| 13907 | local_baseGroupZ = baseGroupZ; |
| 13908 | local_groupCountX = groupCountX; |
| 13909 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13910 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13911 | countingStream->rewind(); |
| 13912 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13913 | uint64_t cgen_var_993; |
| 13914 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_993, 1); |
| 13915 | countingStream->write((uint64_t*)&cgen_var_993, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13916 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 13917 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 13918 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 13919 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 13920 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 13921 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13922 | } |
| 13923 | uint32_t packetSize_vkCmdDispatchBaseKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13924 | countingStream->rewind(); |
| 13925 | uint32_t opcode_vkCmdDispatchBaseKHR = OP_vkCmdDispatchBaseKHR; |
| 13926 | stream->write(&opcode_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| 13927 | stream->write(&packetSize_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13928 | uint64_t cgen_var_994; |
| 13929 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_994, 1); |
| 13930 | stream->write((uint64_t*)&cgen_var_994, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13931 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 13932 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 13933 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 13934 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 13935 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 13936 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13937 | mImpl->log("finish vkCmdDispatchBaseKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13938 | } |
| 13939 | |
| 13940 | #endif |
| 13941 | #ifdef VK_KHR_shader_draw_parameters |
| 13942 | #endif |
| 13943 | #ifdef VK_KHR_maintenance1 |
| 13944 | void VkEncoder::vkTrimCommandPoolKHR( |
| 13945 | VkDevice device, |
| 13946 | VkCommandPool commandPool, |
| 13947 | VkCommandPoolTrimFlags flags) |
| 13948 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13949 | mImpl->log("start vkTrimCommandPoolKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13950 | auto stream = mImpl->stream(); |
| 13951 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13952 | auto resources = mImpl->resources(); |
| 13953 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13954 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13955 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13956 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13957 | VkCommandPoolTrimFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13958 | local_device = device; |
| 13959 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13960 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13961 | countingStream->rewind(); |
| 13962 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13963 | uint64_t cgen_var_995; |
| 13964 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_995, 1); |
| 13965 | countingStream->write((uint64_t*)&cgen_var_995, 1 * 8); |
| 13966 | uint64_t cgen_var_996; |
| 13967 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_996, 1); |
| 13968 | countingStream->write((uint64_t*)&cgen_var_996, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13969 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13970 | } |
| 13971 | uint32_t packetSize_vkTrimCommandPoolKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13972 | countingStream->rewind(); |
| 13973 | uint32_t opcode_vkTrimCommandPoolKHR = OP_vkTrimCommandPoolKHR; |
| 13974 | stream->write(&opcode_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| 13975 | stream->write(&packetSize_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 13976 | uint64_t cgen_var_997; |
| 13977 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_997, 1); |
| 13978 | stream->write((uint64_t*)&cgen_var_997, 1 * 8); |
| 13979 | uint64_t cgen_var_998; |
| 13980 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_998, 1); |
| 13981 | stream->write((uint64_t*)&cgen_var_998, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13982 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13983 | mImpl->log("finish vkTrimCommandPoolKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13984 | } |
| 13985 | |
| 13986 | #endif |
| 13987 | #ifdef VK_KHR_device_group_creation |
| 13988 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroupsKHR( |
| 13989 | VkInstance instance, |
| 13990 | uint32_t* pPhysicalDeviceGroupCount, |
| 13991 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 13992 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13993 | mImpl->log("start vkEnumeratePhysicalDeviceGroupsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13994 | auto stream = mImpl->stream(); |
| 13995 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13996 | auto resources = mImpl->resources(); |
| 13997 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13998 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13999 | VkInstance local_instance; |
| 14000 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14001 | countingStream->rewind(); |
| 14002 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14003 | uint64_t cgen_var_999; |
| 14004 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_999, 1); |
| 14005 | countingStream->write((uint64_t*)&cgen_var_999, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14006 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14007 | uint64_t cgen_var_1000 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 14008 | countingStream->putBe64(cgen_var_1000); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14009 | if (pPhysicalDeviceGroupCount) |
| 14010 | { |
| 14011 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 14012 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14013 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14014 | uint64_t cgen_var_1001 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 14015 | countingStream->putBe64(cgen_var_1001); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14016 | if (pPhysicalDeviceGroupProperties) |
| 14017 | { |
| 14018 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 14019 | { |
| 14020 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 14021 | } |
| 14022 | } |
| 14023 | } |
| 14024 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroupsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14025 | countingStream->rewind(); |
| 14026 | uint32_t opcode_vkEnumeratePhysicalDeviceGroupsKHR = OP_vkEnumeratePhysicalDeviceGroupsKHR; |
| 14027 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| 14028 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14029 | uint64_t cgen_var_1002; |
| 14030 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1002, 1); |
| 14031 | stream->write((uint64_t*)&cgen_var_1002, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14032 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14033 | uint64_t cgen_var_1003 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 14034 | stream->putBe64(cgen_var_1003); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14035 | if (pPhysicalDeviceGroupCount) |
| 14036 | { |
| 14037 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 14038 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14039 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14040 | uint64_t cgen_var_1004 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 14041 | stream->putBe64(cgen_var_1004); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14042 | if (pPhysicalDeviceGroupProperties) |
| 14043 | { |
| 14044 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 14045 | { |
| 14046 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 14047 | } |
| 14048 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14049 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14050 | uint32_t* check_pPhysicalDeviceGroupCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14051 | check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14052 | if (pPhysicalDeviceGroupCount) |
| 14053 | { |
| 14054 | if (!(check_pPhysicalDeviceGroupCount)) |
| 14055 | { |
| 14056 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 14057 | } |
| 14058 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 14059 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14060 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14061 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14062 | check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14063 | if (pPhysicalDeviceGroupProperties) |
| 14064 | { |
| 14065 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 14066 | { |
| 14067 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 14068 | } |
| 14069 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 14070 | { |
| 14071 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 14072 | } |
| 14073 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14074 | if (pPhysicalDeviceGroupProperties) |
| 14075 | { |
| 14076 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 14077 | { |
| 14078 | transform_fromhost_VkPhysicalDeviceGroupProperties(mImpl->resources(), (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 14079 | } |
| 14080 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14081 | VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0; |
| 14082 | stream->read(&vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14083 | countingStream->clearPool(); |
| 14084 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14085 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14086 | mImpl->log("finish vkEnumeratePhysicalDeviceGroupsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14087 | return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return; |
| 14088 | } |
| 14089 | |
| 14090 | #endif |
| 14091 | #ifdef VK_KHR_external_memory_capabilities |
| 14092 | void VkEncoder::vkGetPhysicalDeviceExternalBufferPropertiesKHR( |
| 14093 | VkPhysicalDevice physicalDevice, |
| 14094 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 14095 | VkExternalBufferProperties* pExternalBufferProperties) |
| 14096 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14097 | mImpl->log("start vkGetPhysicalDeviceExternalBufferPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14098 | auto stream = mImpl->stream(); |
| 14099 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14100 | auto resources = mImpl->resources(); |
| 14101 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14102 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14103 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14104 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14105 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14106 | local_pExternalBufferInfo = nullptr; |
| 14107 | if (pExternalBufferInfo) |
| 14108 | { |
| 14109 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 14110 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 14111 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14112 | if (local_pExternalBufferInfo) |
| 14113 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14114 | transform_tohost_VkPhysicalDeviceExternalBufferInfo(mImpl->resources(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14115 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14116 | countingStream->rewind(); |
| 14117 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14118 | uint64_t cgen_var_1007; |
| 14119 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1007, 1); |
| 14120 | countingStream->write((uint64_t*)&cgen_var_1007, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14121 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14122 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 14123 | } |
| 14124 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14125 | countingStream->rewind(); |
| 14126 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR = OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR; |
| 14127 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| 14128 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14129 | uint64_t cgen_var_1008; |
| 14130 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1008, 1); |
| 14131 | stream->write((uint64_t*)&cgen_var_1008, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14132 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14133 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 14134 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14135 | if (pExternalBufferProperties) |
| 14136 | { |
| 14137 | transform_fromhost_VkExternalBufferProperties(mImpl->resources(), (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 14138 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14139 | mImpl->log("finish vkGetPhysicalDeviceExternalBufferPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14140 | } |
| 14141 | |
| 14142 | #endif |
| 14143 | #ifdef VK_KHR_external_memory |
| 14144 | #endif |
| 14145 | #ifdef VK_KHR_external_memory_win32 |
| 14146 | VkResult VkEncoder::vkGetMemoryWin32HandleKHR( |
| 14147 | VkDevice device, |
| 14148 | const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 14149 | HANDLE* pHandle) |
| 14150 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14151 | mImpl->log("start vkGetMemoryWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14152 | auto stream = mImpl->stream(); |
| 14153 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14154 | auto resources = mImpl->resources(); |
| 14155 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14156 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14157 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14158 | VkMemoryGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14159 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14160 | local_pGetWin32HandleInfo = nullptr; |
| 14161 | if (pGetWin32HandleInfo) |
| 14162 | { |
| 14163 | local_pGetWin32HandleInfo = (VkMemoryGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkMemoryGetWin32HandleInfoKHR)); |
| 14164 | deepcopy_VkMemoryGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 14165 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14166 | if (local_pGetWin32HandleInfo) |
| 14167 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14168 | transform_tohost_VkMemoryGetWin32HandleInfoKHR(mImpl->resources(), (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14169 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14170 | countingStream->rewind(); |
| 14171 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14172 | uint64_t cgen_var_1009; |
| 14173 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1009, 1); |
| 14174 | countingStream->write((uint64_t*)&cgen_var_1009, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14175 | marshal_VkMemoryGetWin32HandleInfoKHR(countingStream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14176 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14177 | } |
| 14178 | uint32_t packetSize_vkGetMemoryWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14179 | countingStream->rewind(); |
| 14180 | uint32_t opcode_vkGetMemoryWin32HandleKHR = OP_vkGetMemoryWin32HandleKHR; |
| 14181 | stream->write(&opcode_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| 14182 | stream->write(&packetSize_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14183 | uint64_t cgen_var_1010; |
| 14184 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1010, 1); |
| 14185 | stream->write((uint64_t*)&cgen_var_1010, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14186 | marshal_VkMemoryGetWin32HandleInfoKHR(stream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14187 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14188 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14189 | VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0; |
| 14190 | stream->read(&vkGetMemoryWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14191 | countingStream->clearPool(); |
| 14192 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14193 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14194 | mImpl->log("finish vkGetMemoryWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14195 | return vkGetMemoryWin32HandleKHR_VkResult_return; |
| 14196 | } |
| 14197 | |
| 14198 | VkResult VkEncoder::vkGetMemoryWin32HandlePropertiesKHR( |
| 14199 | VkDevice device, |
| 14200 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 14201 | HANDLE handle, |
| 14202 | VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) |
| 14203 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14204 | mImpl->log("start vkGetMemoryWin32HandlePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14205 | auto stream = mImpl->stream(); |
| 14206 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14207 | auto resources = mImpl->resources(); |
| 14208 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14209 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14210 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14211 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14212 | HANDLE local_handle; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14213 | local_device = device; |
| 14214 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14215 | local_handle = handle; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14216 | countingStream->rewind(); |
| 14217 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14218 | uint64_t cgen_var_1011; |
| 14219 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1011, 1); |
| 14220 | countingStream->write((uint64_t*)&cgen_var_1011, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14221 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 14222 | countingStream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14223 | marshal_VkMemoryWin32HandlePropertiesKHR(countingStream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 14224 | } |
| 14225 | uint32_t packetSize_vkGetMemoryWin32HandlePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14226 | countingStream->rewind(); |
| 14227 | uint32_t opcode_vkGetMemoryWin32HandlePropertiesKHR = OP_vkGetMemoryWin32HandlePropertiesKHR; |
| 14228 | stream->write(&opcode_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| 14229 | stream->write(&packetSize_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14230 | uint64_t cgen_var_1012; |
| 14231 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1012, 1); |
| 14232 | stream->write((uint64_t*)&cgen_var_1012, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14233 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 14234 | stream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14235 | marshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 14236 | unmarshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14237 | if (pMemoryWin32HandleProperties) |
| 14238 | { |
| 14239 | transform_fromhost_VkMemoryWin32HandlePropertiesKHR(mImpl->resources(), (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 14240 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14241 | VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0; |
| 14242 | stream->read(&vkGetMemoryWin32HandlePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14243 | countingStream->clearPool(); |
| 14244 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14245 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14246 | mImpl->log("finish vkGetMemoryWin32HandlePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14247 | return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return; |
| 14248 | } |
| 14249 | |
| 14250 | #endif |
| 14251 | #ifdef VK_KHR_external_memory_fd |
| 14252 | VkResult VkEncoder::vkGetMemoryFdKHR( |
| 14253 | VkDevice device, |
| 14254 | const VkMemoryGetFdInfoKHR* pGetFdInfo, |
| 14255 | int* pFd) |
| 14256 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14257 | mImpl->log("start vkGetMemoryFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14258 | auto stream = mImpl->stream(); |
| 14259 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14260 | auto resources = mImpl->resources(); |
| 14261 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14262 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14263 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14264 | VkMemoryGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14265 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14266 | local_pGetFdInfo = nullptr; |
| 14267 | if (pGetFdInfo) |
| 14268 | { |
| 14269 | local_pGetFdInfo = (VkMemoryGetFdInfoKHR*)pool->alloc(sizeof(const VkMemoryGetFdInfoKHR)); |
| 14270 | deepcopy_VkMemoryGetFdInfoKHR(pool, pGetFdInfo, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| 14271 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14272 | if (local_pGetFdInfo) |
| 14273 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14274 | transform_tohost_VkMemoryGetFdInfoKHR(mImpl->resources(), (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14275 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14276 | countingStream->rewind(); |
| 14277 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14278 | uint64_t cgen_var_1013; |
| 14279 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1013, 1); |
| 14280 | countingStream->write((uint64_t*)&cgen_var_1013, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14281 | marshal_VkMemoryGetFdInfoKHR(countingStream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14282 | countingStream->write((int*)pFd, sizeof(int)); |
| 14283 | } |
| 14284 | uint32_t packetSize_vkGetMemoryFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14285 | countingStream->rewind(); |
| 14286 | uint32_t opcode_vkGetMemoryFdKHR = OP_vkGetMemoryFdKHR; |
| 14287 | stream->write(&opcode_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| 14288 | stream->write(&packetSize_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14289 | uint64_t cgen_var_1014; |
| 14290 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1014, 1); |
| 14291 | stream->write((uint64_t*)&cgen_var_1014, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14292 | marshal_VkMemoryGetFdInfoKHR(stream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14293 | stream->write((int*)pFd, sizeof(int)); |
| 14294 | stream->read((int*)pFd, sizeof(int)); |
| 14295 | VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0; |
| 14296 | stream->read(&vkGetMemoryFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14297 | countingStream->clearPool(); |
| 14298 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14299 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14300 | mImpl->log("finish vkGetMemoryFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14301 | return vkGetMemoryFdKHR_VkResult_return; |
| 14302 | } |
| 14303 | |
| 14304 | VkResult VkEncoder::vkGetMemoryFdPropertiesKHR( |
| 14305 | VkDevice device, |
| 14306 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 14307 | int fd, |
| 14308 | VkMemoryFdPropertiesKHR* pMemoryFdProperties) |
| 14309 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14310 | mImpl->log("start vkGetMemoryFdPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14311 | auto stream = mImpl->stream(); |
| 14312 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14313 | auto resources = mImpl->resources(); |
| 14314 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14315 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14316 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14317 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14318 | int local_fd; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14319 | local_device = device; |
| 14320 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14321 | local_fd = fd; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14322 | countingStream->rewind(); |
| 14323 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14324 | uint64_t cgen_var_1015; |
| 14325 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1015, 1); |
| 14326 | countingStream->write((uint64_t*)&cgen_var_1015, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14327 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 14328 | countingStream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14329 | marshal_VkMemoryFdPropertiesKHR(countingStream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 14330 | } |
| 14331 | uint32_t packetSize_vkGetMemoryFdPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14332 | countingStream->rewind(); |
| 14333 | uint32_t opcode_vkGetMemoryFdPropertiesKHR = OP_vkGetMemoryFdPropertiesKHR; |
| 14334 | stream->write(&opcode_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| 14335 | stream->write(&packetSize_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14336 | uint64_t cgen_var_1016; |
| 14337 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1016, 1); |
| 14338 | stream->write((uint64_t*)&cgen_var_1016, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14339 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 14340 | stream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14341 | marshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 14342 | unmarshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14343 | if (pMemoryFdProperties) |
| 14344 | { |
| 14345 | transform_fromhost_VkMemoryFdPropertiesKHR(mImpl->resources(), (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 14346 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14347 | VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0; |
| 14348 | stream->read(&vkGetMemoryFdPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14349 | countingStream->clearPool(); |
| 14350 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14351 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14352 | mImpl->log("finish vkGetMemoryFdPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14353 | return vkGetMemoryFdPropertiesKHR_VkResult_return; |
| 14354 | } |
| 14355 | |
| 14356 | #endif |
| 14357 | #ifdef VK_KHR_win32_keyed_mutex |
| 14358 | #endif |
| 14359 | #ifdef VK_KHR_external_semaphore_capabilities |
| 14360 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( |
| 14361 | VkPhysicalDevice physicalDevice, |
| 14362 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 14363 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 14364 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14365 | mImpl->log("start vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14366 | auto stream = mImpl->stream(); |
| 14367 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14368 | auto resources = mImpl->resources(); |
| 14369 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14370 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14371 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14372 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14373 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14374 | local_pExternalSemaphoreInfo = nullptr; |
| 14375 | if (pExternalSemaphoreInfo) |
| 14376 | { |
| 14377 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 14378 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 14379 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14380 | if (local_pExternalSemaphoreInfo) |
| 14381 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14382 | transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(mImpl->resources(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14383 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14384 | countingStream->rewind(); |
| 14385 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14386 | uint64_t cgen_var_1017; |
| 14387 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1017, 1); |
| 14388 | countingStream->write((uint64_t*)&cgen_var_1017, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14389 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14390 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 14391 | } |
| 14392 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14393 | countingStream->rewind(); |
| 14394 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; |
| 14395 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| 14396 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14397 | uint64_t cgen_var_1018; |
| 14398 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1018, 1); |
| 14399 | stream->write((uint64_t*)&cgen_var_1018, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14400 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14401 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 14402 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14403 | if (pExternalSemaphoreProperties) |
| 14404 | { |
| 14405 | transform_fromhost_VkExternalSemaphoreProperties(mImpl->resources(), (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 14406 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14407 | mImpl->log("finish vkGetPhysicalDeviceExternalSemaphorePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14408 | } |
| 14409 | |
| 14410 | #endif |
| 14411 | #ifdef VK_KHR_external_semaphore |
| 14412 | #endif |
| 14413 | #ifdef VK_KHR_external_semaphore_win32 |
| 14414 | VkResult VkEncoder::vkImportSemaphoreWin32HandleKHR( |
| 14415 | VkDevice device, |
| 14416 | const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) |
| 14417 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14418 | mImpl->log("start vkImportSemaphoreWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14419 | auto stream = mImpl->stream(); |
| 14420 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14421 | auto resources = mImpl->resources(); |
| 14422 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14423 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14424 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14425 | VkImportSemaphoreWin32HandleInfoKHR* local_pImportSemaphoreWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14426 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14427 | local_pImportSemaphoreWin32HandleInfo = nullptr; |
| 14428 | if (pImportSemaphoreWin32HandleInfo) |
| 14429 | { |
| 14430 | local_pImportSemaphoreWin32HandleInfo = (VkImportSemaphoreWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreWin32HandleInfoKHR)); |
| 14431 | deepcopy_VkImportSemaphoreWin32HandleInfoKHR(pool, pImportSemaphoreWin32HandleInfo, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| 14432 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14433 | if (local_pImportSemaphoreWin32HandleInfo) |
| 14434 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14435 | transform_tohost_VkImportSemaphoreWin32HandleInfoKHR(mImpl->resources(), (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14436 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14437 | countingStream->rewind(); |
| 14438 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14439 | uint64_t cgen_var_1019; |
| 14440 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1019, 1); |
| 14441 | countingStream->write((uint64_t*)&cgen_var_1019, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14442 | marshal_VkImportSemaphoreWin32HandleInfoKHR(countingStream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14443 | } |
| 14444 | uint32_t packetSize_vkImportSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14445 | countingStream->rewind(); |
| 14446 | uint32_t opcode_vkImportSemaphoreWin32HandleKHR = OP_vkImportSemaphoreWin32HandleKHR; |
| 14447 | stream->write(&opcode_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 14448 | stream->write(&packetSize_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14449 | uint64_t cgen_var_1020; |
| 14450 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1020, 1); |
| 14451 | stream->write((uint64_t*)&cgen_var_1020, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14452 | marshal_VkImportSemaphoreWin32HandleInfoKHR(stream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14453 | VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 14454 | stream->read(&vkImportSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14455 | countingStream->clearPool(); |
| 14456 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14457 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14458 | mImpl->log("finish vkImportSemaphoreWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14459 | return vkImportSemaphoreWin32HandleKHR_VkResult_return; |
| 14460 | } |
| 14461 | |
| 14462 | VkResult VkEncoder::vkGetSemaphoreWin32HandleKHR( |
| 14463 | VkDevice device, |
| 14464 | const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 14465 | HANDLE* pHandle) |
| 14466 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14467 | mImpl->log("start vkGetSemaphoreWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14468 | auto stream = mImpl->stream(); |
| 14469 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14470 | auto resources = mImpl->resources(); |
| 14471 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14472 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14473 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14474 | VkSemaphoreGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14475 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14476 | local_pGetWin32HandleInfo = nullptr; |
| 14477 | if (pGetWin32HandleInfo) |
| 14478 | { |
| 14479 | local_pGetWin32HandleInfo = (VkSemaphoreGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetWin32HandleInfoKHR)); |
| 14480 | deepcopy_VkSemaphoreGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 14481 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14482 | if (local_pGetWin32HandleInfo) |
| 14483 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14484 | transform_tohost_VkSemaphoreGetWin32HandleInfoKHR(mImpl->resources(), (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14485 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14486 | countingStream->rewind(); |
| 14487 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14488 | uint64_t cgen_var_1021; |
| 14489 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1021, 1); |
| 14490 | countingStream->write((uint64_t*)&cgen_var_1021, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14491 | marshal_VkSemaphoreGetWin32HandleInfoKHR(countingStream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14492 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14493 | } |
| 14494 | uint32_t packetSize_vkGetSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14495 | countingStream->rewind(); |
| 14496 | uint32_t opcode_vkGetSemaphoreWin32HandleKHR = OP_vkGetSemaphoreWin32HandleKHR; |
| 14497 | stream->write(&opcode_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 14498 | stream->write(&packetSize_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14499 | uint64_t cgen_var_1022; |
| 14500 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1022, 1); |
| 14501 | stream->write((uint64_t*)&cgen_var_1022, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14502 | marshal_VkSemaphoreGetWin32HandleInfoKHR(stream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14503 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14504 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14505 | VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 14506 | stream->read(&vkGetSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14507 | countingStream->clearPool(); |
| 14508 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14509 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14510 | mImpl->log("finish vkGetSemaphoreWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14511 | return vkGetSemaphoreWin32HandleKHR_VkResult_return; |
| 14512 | } |
| 14513 | |
| 14514 | #endif |
| 14515 | #ifdef VK_KHR_external_semaphore_fd |
| 14516 | VkResult VkEncoder::vkImportSemaphoreFdKHR( |
| 14517 | VkDevice device, |
| 14518 | const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) |
| 14519 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14520 | mImpl->log("start vkImportSemaphoreFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14521 | auto stream = mImpl->stream(); |
| 14522 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14523 | auto resources = mImpl->resources(); |
| 14524 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14525 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14526 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14527 | VkImportSemaphoreFdInfoKHR* local_pImportSemaphoreFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14528 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14529 | local_pImportSemaphoreFdInfo = nullptr; |
| 14530 | if (pImportSemaphoreFdInfo) |
| 14531 | { |
| 14532 | local_pImportSemaphoreFdInfo = (VkImportSemaphoreFdInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreFdInfoKHR)); |
| 14533 | deepcopy_VkImportSemaphoreFdInfoKHR(pool, pImportSemaphoreFdInfo, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| 14534 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14535 | if (local_pImportSemaphoreFdInfo) |
| 14536 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14537 | transform_tohost_VkImportSemaphoreFdInfoKHR(mImpl->resources(), (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14538 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14539 | countingStream->rewind(); |
| 14540 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14541 | uint64_t cgen_var_1023; |
| 14542 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1023, 1); |
| 14543 | countingStream->write((uint64_t*)&cgen_var_1023, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14544 | marshal_VkImportSemaphoreFdInfoKHR(countingStream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14545 | } |
| 14546 | uint32_t packetSize_vkImportSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14547 | countingStream->rewind(); |
| 14548 | uint32_t opcode_vkImportSemaphoreFdKHR = OP_vkImportSemaphoreFdKHR; |
| 14549 | stream->write(&opcode_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| 14550 | stream->write(&packetSize_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14551 | uint64_t cgen_var_1024; |
| 14552 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1024, 1); |
| 14553 | stream->write((uint64_t*)&cgen_var_1024, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14554 | marshal_VkImportSemaphoreFdInfoKHR(stream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14555 | VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 14556 | stream->read(&vkImportSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14557 | countingStream->clearPool(); |
| 14558 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14559 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14560 | mImpl->log("finish vkImportSemaphoreFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14561 | return vkImportSemaphoreFdKHR_VkResult_return; |
| 14562 | } |
| 14563 | |
| 14564 | VkResult VkEncoder::vkGetSemaphoreFdKHR( |
| 14565 | VkDevice device, |
| 14566 | const VkSemaphoreGetFdInfoKHR* pGetFdInfo, |
| 14567 | int* pFd) |
| 14568 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14569 | mImpl->log("start vkGetSemaphoreFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14570 | auto stream = mImpl->stream(); |
| 14571 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14572 | auto resources = mImpl->resources(); |
| 14573 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14574 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14575 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14576 | VkSemaphoreGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14577 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14578 | local_pGetFdInfo = nullptr; |
| 14579 | if (pGetFdInfo) |
| 14580 | { |
| 14581 | local_pGetFdInfo = (VkSemaphoreGetFdInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetFdInfoKHR)); |
| 14582 | deepcopy_VkSemaphoreGetFdInfoKHR(pool, pGetFdInfo, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| 14583 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14584 | if (local_pGetFdInfo) |
| 14585 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14586 | transform_tohost_VkSemaphoreGetFdInfoKHR(mImpl->resources(), (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14587 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14588 | countingStream->rewind(); |
| 14589 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14590 | uint64_t cgen_var_1025; |
| 14591 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1025, 1); |
| 14592 | countingStream->write((uint64_t*)&cgen_var_1025, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14593 | marshal_VkSemaphoreGetFdInfoKHR(countingStream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14594 | countingStream->write((int*)pFd, sizeof(int)); |
| 14595 | } |
| 14596 | uint32_t packetSize_vkGetSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14597 | countingStream->rewind(); |
| 14598 | uint32_t opcode_vkGetSemaphoreFdKHR = OP_vkGetSemaphoreFdKHR; |
| 14599 | stream->write(&opcode_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| 14600 | stream->write(&packetSize_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14601 | uint64_t cgen_var_1026; |
| 14602 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1026, 1); |
| 14603 | stream->write((uint64_t*)&cgen_var_1026, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14604 | marshal_VkSemaphoreGetFdInfoKHR(stream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14605 | stream->write((int*)pFd, sizeof(int)); |
| 14606 | stream->read((int*)pFd, sizeof(int)); |
| 14607 | VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 14608 | stream->read(&vkGetSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14609 | countingStream->clearPool(); |
| 14610 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14611 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14612 | mImpl->log("finish vkGetSemaphoreFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14613 | return vkGetSemaphoreFdKHR_VkResult_return; |
| 14614 | } |
| 14615 | |
| 14616 | #endif |
| 14617 | #ifdef VK_KHR_push_descriptor |
| 14618 | void VkEncoder::vkCmdPushDescriptorSetKHR( |
| 14619 | VkCommandBuffer commandBuffer, |
| 14620 | VkPipelineBindPoint pipelineBindPoint, |
| 14621 | VkPipelineLayout layout, |
| 14622 | uint32_t set, |
| 14623 | uint32_t descriptorWriteCount, |
| 14624 | const VkWriteDescriptorSet* pDescriptorWrites) |
| 14625 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14626 | mImpl->log("start vkCmdPushDescriptorSetKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14627 | auto stream = mImpl->stream(); |
| 14628 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14629 | auto resources = mImpl->resources(); |
| 14630 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14631 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14632 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14633 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14634 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14635 | uint32_t local_set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14636 | uint32_t local_descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14637 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14638 | local_commandBuffer = commandBuffer; |
| 14639 | local_pipelineBindPoint = pipelineBindPoint; |
| 14640 | local_layout = layout; |
| 14641 | local_set = set; |
| 14642 | local_descriptorWriteCount = descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14643 | local_pDescriptorWrites = nullptr; |
| 14644 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14645 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14646 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14647 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 14648 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14649 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 14650 | } |
| 14651 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14652 | if (local_pDescriptorWrites) |
| 14653 | { |
| 14654 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 14655 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14656 | transform_tohost_VkWriteDescriptorSet(mImpl->resources(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14657 | } |
| 14658 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14659 | countingStream->rewind(); |
| 14660 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14661 | uint64_t cgen_var_1027; |
| 14662 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1027, 1); |
| 14663 | countingStream->write((uint64_t*)&cgen_var_1027, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14664 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14665 | uint64_t cgen_var_1028; |
| 14666 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1028, 1); |
| 14667 | countingStream->write((uint64_t*)&cgen_var_1028, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14668 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 14669 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 14670 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 14671 | { |
| 14672 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14673 | } |
| 14674 | } |
| 14675 | uint32_t packetSize_vkCmdPushDescriptorSetKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14676 | countingStream->rewind(); |
| 14677 | uint32_t opcode_vkCmdPushDescriptorSetKHR = OP_vkCmdPushDescriptorSetKHR; |
| 14678 | stream->write(&opcode_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| 14679 | stream->write(&packetSize_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14680 | uint64_t cgen_var_1029; |
| 14681 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1029, 1); |
| 14682 | stream->write((uint64_t*)&cgen_var_1029, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14683 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14684 | uint64_t cgen_var_1030; |
| 14685 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1030, 1); |
| 14686 | stream->write((uint64_t*)&cgen_var_1030, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14687 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 14688 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14689 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 14690 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14691 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14692 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14693 | mImpl->log("finish vkCmdPushDescriptorSetKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14694 | } |
| 14695 | |
| 14696 | void VkEncoder::vkCmdPushDescriptorSetWithTemplateKHR( |
| 14697 | VkCommandBuffer commandBuffer, |
| 14698 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 14699 | VkPipelineLayout layout, |
| 14700 | uint32_t set, |
| 14701 | const void* pData) |
| 14702 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14703 | mImpl->log("start vkCmdPushDescriptorSetWithTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14704 | auto stream = mImpl->stream(); |
| 14705 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14706 | auto resources = mImpl->resources(); |
| 14707 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14708 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14709 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14710 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14711 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14712 | uint32_t local_set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14713 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14714 | local_commandBuffer = commandBuffer; |
| 14715 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 14716 | local_layout = layout; |
| 14717 | local_set = set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14718 | local_pData = nullptr; |
| 14719 | if (pData) |
| 14720 | { |
| 14721 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 14722 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14723 | countingStream->rewind(); |
| 14724 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14725 | uint64_t cgen_var_1031; |
| 14726 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1031, 1); |
| 14727 | countingStream->write((uint64_t*)&cgen_var_1031, 1 * 8); |
| 14728 | uint64_t cgen_var_1032; |
| 14729 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1032, 1); |
| 14730 | countingStream->write((uint64_t*)&cgen_var_1032, 1 * 8); |
| 14731 | uint64_t cgen_var_1033; |
| 14732 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1033, 1); |
| 14733 | countingStream->write((uint64_t*)&cgen_var_1033, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14734 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14735 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14736 | uint64_t cgen_var_1034 = (uint64_t)(uintptr_t)local_pData; |
| 14737 | countingStream->putBe64(cgen_var_1034); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14738 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14739 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14740 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14741 | } |
| 14742 | } |
| 14743 | uint32_t packetSize_vkCmdPushDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14744 | countingStream->rewind(); |
| 14745 | uint32_t opcode_vkCmdPushDescriptorSetWithTemplateKHR = OP_vkCmdPushDescriptorSetWithTemplateKHR; |
| 14746 | stream->write(&opcode_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 14747 | stream->write(&packetSize_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14748 | uint64_t cgen_var_1035; |
| 14749 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1035, 1); |
| 14750 | stream->write((uint64_t*)&cgen_var_1035, 1 * 8); |
| 14751 | uint64_t cgen_var_1036; |
| 14752 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1036, 1); |
| 14753 | stream->write((uint64_t*)&cgen_var_1036, 1 * 8); |
| 14754 | uint64_t cgen_var_1037; |
| 14755 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1037, 1); |
| 14756 | stream->write((uint64_t*)&cgen_var_1037, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14757 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14758 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14759 | uint64_t cgen_var_1038 = (uint64_t)(uintptr_t)local_pData; |
| 14760 | stream->putBe64(cgen_var_1038); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14761 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14762 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14763 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14764 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14765 | mImpl->log("finish vkCmdPushDescriptorSetWithTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14766 | } |
| 14767 | |
| 14768 | #endif |
| 14769 | #ifdef VK_KHR_16bit_storage |
| 14770 | #endif |
| 14771 | #ifdef VK_KHR_incremental_present |
| 14772 | #endif |
| 14773 | #ifdef VK_KHR_descriptor_update_template |
| 14774 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplateKHR( |
| 14775 | VkDevice device, |
| 14776 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 14777 | const VkAllocationCallbacks* pAllocator, |
| 14778 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 14779 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14780 | mImpl->log("start vkCreateDescriptorUpdateTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14781 | auto stream = mImpl->stream(); |
| 14782 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14783 | auto resources = mImpl->resources(); |
| 14784 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14785 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14786 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14787 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14788 | VkAllocationCallbacks* local_pAllocator; |
| 14789 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14790 | local_pCreateInfo = nullptr; |
| 14791 | if (pCreateInfo) |
| 14792 | { |
| 14793 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 14794 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 14795 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14796 | local_pAllocator = nullptr; |
| 14797 | if (pAllocator) |
| 14798 | { |
| 14799 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14800 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14801 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 14802 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14803 | if (local_pCreateInfo) |
| 14804 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14805 | transform_tohost_VkDescriptorUpdateTemplateCreateInfo(mImpl->resources(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14806 | } |
| 14807 | if (local_pAllocator) |
| 14808 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14809 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14810 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14811 | countingStream->rewind(); |
| 14812 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14813 | uint64_t cgen_var_1039; |
| 14814 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1039, 1); |
| 14815 | countingStream->write((uint64_t*)&cgen_var_1039, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14816 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14817 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14818 | uint64_t cgen_var_1040 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14819 | countingStream->putBe64(cgen_var_1040); |
| 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 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14824 | uint64_t cgen_var_1041; |
| 14825 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1041, 1); |
| 14826 | countingStream->write((uint64_t*)&cgen_var_1041, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14827 | } |
| 14828 | uint32_t packetSize_vkCreateDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14829 | countingStream->rewind(); |
| 14830 | uint32_t opcode_vkCreateDescriptorUpdateTemplateKHR = OP_vkCreateDescriptorUpdateTemplateKHR; |
| 14831 | stream->write(&opcode_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 14832 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14833 | uint64_t cgen_var_1042; |
| 14834 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1042, 1); |
| 14835 | stream->write((uint64_t*)&cgen_var_1042, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14836 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14837 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14838 | uint64_t cgen_var_1043 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14839 | stream->putBe64(cgen_var_1043); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14840 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14841 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14842 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14843 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14844 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14845 | uint64_t cgen_var_1044; |
| 14846 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1044, 1); |
| 14847 | stream->write((uint64_t*)&cgen_var_1044, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14848 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14849 | uint64_t cgen_var_1045; |
| 14850 | stream->read((uint64_t*)&cgen_var_1045, 8); |
| 14851 | stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_1045, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14852 | VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0; |
| 14853 | stream->read(&vkCreateDescriptorUpdateTemplateKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14854 | countingStream->clearPool(); |
| 14855 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14856 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14857 | mImpl->log("finish vkCreateDescriptorUpdateTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14858 | return vkCreateDescriptorUpdateTemplateKHR_VkResult_return; |
| 14859 | } |
| 14860 | |
| 14861 | void VkEncoder::vkDestroyDescriptorUpdateTemplateKHR( |
| 14862 | VkDevice device, |
| 14863 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 14864 | const VkAllocationCallbacks* pAllocator) |
| 14865 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14866 | mImpl->log("start vkDestroyDescriptorUpdateTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14867 | auto stream = mImpl->stream(); |
| 14868 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14869 | auto resources = mImpl->resources(); |
| 14870 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14871 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14872 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14873 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14874 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14875 | local_device = device; |
| 14876 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14877 | local_pAllocator = nullptr; |
| 14878 | if (pAllocator) |
| 14879 | { |
| 14880 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14881 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14882 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 14883 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14884 | if (local_pAllocator) |
| 14885 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14886 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14887 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14888 | countingStream->rewind(); |
| 14889 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14890 | uint64_t cgen_var_1046; |
| 14891 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1046, 1); |
| 14892 | countingStream->write((uint64_t*)&cgen_var_1046, 1 * 8); |
| 14893 | uint64_t cgen_var_1047; |
| 14894 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1047, 1); |
| 14895 | countingStream->write((uint64_t*)&cgen_var_1047, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14896 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14897 | uint64_t cgen_var_1048 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14898 | countingStream->putBe64(cgen_var_1048); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14899 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14900 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14901 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14902 | } |
| 14903 | } |
| 14904 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14905 | countingStream->rewind(); |
| 14906 | uint32_t opcode_vkDestroyDescriptorUpdateTemplateKHR = OP_vkDestroyDescriptorUpdateTemplateKHR; |
| 14907 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 14908 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14909 | uint64_t cgen_var_1049; |
| 14910 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1049, 1); |
| 14911 | stream->write((uint64_t*)&cgen_var_1049, 1 * 8); |
| 14912 | uint64_t cgen_var_1050; |
| 14913 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1050, 1); |
| 14914 | stream->write((uint64_t*)&cgen_var_1050, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14915 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14916 | uint64_t cgen_var_1051 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14917 | stream->putBe64(cgen_var_1051); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14918 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14919 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14920 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14921 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14922 | mImpl->log("finish vkDestroyDescriptorUpdateTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14923 | } |
| 14924 | |
| 14925 | void VkEncoder::vkUpdateDescriptorSetWithTemplateKHR( |
| 14926 | VkDevice device, |
| 14927 | VkDescriptorSet descriptorSet, |
| 14928 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 14929 | const void* pData) |
| 14930 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14931 | mImpl->log("start vkUpdateDescriptorSetWithTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14932 | auto stream = mImpl->stream(); |
| 14933 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14934 | auto resources = mImpl->resources(); |
| 14935 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14936 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14937 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14938 | VkDescriptorSet local_descriptorSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14939 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14940 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14941 | local_device = device; |
| 14942 | local_descriptorSet = descriptorSet; |
| 14943 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14944 | local_pData = nullptr; |
| 14945 | if (pData) |
| 14946 | { |
| 14947 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 14948 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14949 | countingStream->rewind(); |
| 14950 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14951 | uint64_t cgen_var_1052; |
| 14952 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1052, 1); |
| 14953 | countingStream->write((uint64_t*)&cgen_var_1052, 1 * 8); |
| 14954 | uint64_t cgen_var_1053; |
| 14955 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1053, 1); |
| 14956 | countingStream->write((uint64_t*)&cgen_var_1053, 1 * 8); |
| 14957 | uint64_t cgen_var_1054; |
| 14958 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1054, 1); |
| 14959 | countingStream->write((uint64_t*)&cgen_var_1054, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14960 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14961 | uint64_t cgen_var_1055 = (uint64_t)(uintptr_t)local_pData; |
| 14962 | countingStream->putBe64(cgen_var_1055); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14963 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14964 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14965 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14966 | } |
| 14967 | } |
| 14968 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14969 | countingStream->rewind(); |
| 14970 | uint32_t opcode_vkUpdateDescriptorSetWithTemplateKHR = OP_vkUpdateDescriptorSetWithTemplateKHR; |
| 14971 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 14972 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14973 | uint64_t cgen_var_1056; |
| 14974 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1056, 1); |
| 14975 | stream->write((uint64_t*)&cgen_var_1056, 1 * 8); |
| 14976 | uint64_t cgen_var_1057; |
| 14977 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1057, 1); |
| 14978 | stream->write((uint64_t*)&cgen_var_1057, 1 * 8); |
| 14979 | uint64_t cgen_var_1058; |
| 14980 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1058, 1); |
| 14981 | stream->write((uint64_t*)&cgen_var_1058, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14982 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 14983 | uint64_t cgen_var_1059 = (uint64_t)(uintptr_t)local_pData; |
| 14984 | stream->putBe64(cgen_var_1059); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14985 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14986 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14987 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14988 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14989 | mImpl->log("finish vkUpdateDescriptorSetWithTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14990 | } |
| 14991 | |
| 14992 | #endif |
| 14993 | #ifdef VK_KHR_create_renderpass2 |
| 14994 | VkResult VkEncoder::vkCreateRenderPass2KHR( |
| 14995 | VkDevice device, |
| 14996 | const VkRenderPassCreateInfo2KHR* pCreateInfo, |
| 14997 | const VkAllocationCallbacks* pAllocator, |
| 14998 | VkRenderPass* pRenderPass) |
| 14999 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15000 | mImpl->log("start vkCreateRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15001 | auto stream = mImpl->stream(); |
| 15002 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15003 | auto resources = mImpl->resources(); |
| 15004 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15005 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15006 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15007 | VkRenderPassCreateInfo2KHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15008 | VkAllocationCallbacks* local_pAllocator; |
| 15009 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15010 | local_pCreateInfo = nullptr; |
| 15011 | if (pCreateInfo) |
| 15012 | { |
| 15013 | local_pCreateInfo = (VkRenderPassCreateInfo2KHR*)pool->alloc(sizeof(const VkRenderPassCreateInfo2KHR)); |
| 15014 | deepcopy_VkRenderPassCreateInfo2KHR(pool, pCreateInfo, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| 15015 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15016 | local_pAllocator = nullptr; |
| 15017 | if (pAllocator) |
| 15018 | { |
| 15019 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15020 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15021 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 15022 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15023 | if (local_pCreateInfo) |
| 15024 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15025 | transform_tohost_VkRenderPassCreateInfo2KHR(mImpl->resources(), (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15026 | } |
| 15027 | if (local_pAllocator) |
| 15028 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15029 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15030 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15031 | countingStream->rewind(); |
| 15032 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15033 | uint64_t cgen_var_1060; |
| 15034 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1060, 1); |
| 15035 | countingStream->write((uint64_t*)&cgen_var_1060, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15036 | marshal_VkRenderPassCreateInfo2KHR(countingStream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15037 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15038 | uint64_t cgen_var_1061 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15039 | countingStream->putBe64(cgen_var_1061); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15040 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15041 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15042 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15043 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15044 | uint64_t cgen_var_1062; |
| 15045 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1062, 1); |
| 15046 | countingStream->write((uint64_t*)&cgen_var_1062, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15047 | } |
| 15048 | uint32_t packetSize_vkCreateRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15049 | countingStream->rewind(); |
| 15050 | uint32_t opcode_vkCreateRenderPass2KHR = OP_vkCreateRenderPass2KHR; |
| 15051 | stream->write(&opcode_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| 15052 | stream->write(&packetSize_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15053 | uint64_t cgen_var_1063; |
| 15054 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1063, 1); |
| 15055 | stream->write((uint64_t*)&cgen_var_1063, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15056 | marshal_VkRenderPassCreateInfo2KHR(stream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15057 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15058 | uint64_t cgen_var_1064 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15059 | stream->putBe64(cgen_var_1064); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15060 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15061 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15062 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15063 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15064 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15065 | uint64_t cgen_var_1065; |
| 15066 | stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1065, 1); |
| 15067 | stream->write((uint64_t*)&cgen_var_1065, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15068 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15069 | uint64_t cgen_var_1066; |
| 15070 | stream->read((uint64_t*)&cgen_var_1066, 8); |
| 15071 | stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_1066, (VkRenderPass*)pRenderPass, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15072 | VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0; |
| 15073 | stream->read(&vkCreateRenderPass2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15074 | countingStream->clearPool(); |
| 15075 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15076 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15077 | mImpl->log("finish vkCreateRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15078 | return vkCreateRenderPass2KHR_VkResult_return; |
| 15079 | } |
| 15080 | |
| 15081 | void VkEncoder::vkCmdBeginRenderPass2KHR( |
| 15082 | VkCommandBuffer commandBuffer, |
| 15083 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 15084 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo) |
| 15085 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15086 | mImpl->log("start vkCmdBeginRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15087 | auto stream = mImpl->stream(); |
| 15088 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15089 | auto resources = mImpl->resources(); |
| 15090 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15091 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15092 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15093 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15094 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| 15095 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15096 | local_pRenderPassBegin = nullptr; |
| 15097 | if (pRenderPassBegin) |
| 15098 | { |
| 15099 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 15100 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 15101 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15102 | local_pSubpassBeginInfo = nullptr; |
| 15103 | if (pSubpassBeginInfo) |
| 15104 | { |
| 15105 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 15106 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 15107 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15108 | if (local_pRenderPassBegin) |
| 15109 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15110 | transform_tohost_VkRenderPassBeginInfo(mImpl->resources(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15111 | } |
| 15112 | if (local_pSubpassBeginInfo) |
| 15113 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15114 | transform_tohost_VkSubpassBeginInfoKHR(mImpl->resources(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15115 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15116 | countingStream->rewind(); |
| 15117 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15118 | uint64_t cgen_var_1067; |
| 15119 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1067, 1); |
| 15120 | countingStream->write((uint64_t*)&cgen_var_1067, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15121 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 15122 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15123 | } |
| 15124 | uint32_t packetSize_vkCmdBeginRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15125 | countingStream->rewind(); |
| 15126 | uint32_t opcode_vkCmdBeginRenderPass2KHR = OP_vkCmdBeginRenderPass2KHR; |
| 15127 | stream->write(&opcode_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| 15128 | stream->write(&packetSize_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15129 | uint64_t cgen_var_1068; |
| 15130 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1068, 1); |
| 15131 | stream->write((uint64_t*)&cgen_var_1068, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15132 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 15133 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15134 | mImpl->log("finish vkCmdBeginRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15135 | } |
| 15136 | |
| 15137 | void VkEncoder::vkCmdNextSubpass2KHR( |
| 15138 | VkCommandBuffer commandBuffer, |
| 15139 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo, |
| 15140 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 15141 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15142 | mImpl->log("start vkCmdNextSubpass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15143 | auto stream = mImpl->stream(); |
| 15144 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15145 | auto resources = mImpl->resources(); |
| 15146 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15147 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15148 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15149 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15150 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| 15151 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15152 | local_pSubpassBeginInfo = nullptr; |
| 15153 | if (pSubpassBeginInfo) |
| 15154 | { |
| 15155 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 15156 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 15157 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15158 | local_pSubpassEndInfo = nullptr; |
| 15159 | if (pSubpassEndInfo) |
| 15160 | { |
| 15161 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 15162 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 15163 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15164 | if (local_pSubpassBeginInfo) |
| 15165 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15166 | transform_tohost_VkSubpassBeginInfoKHR(mImpl->resources(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15167 | } |
| 15168 | if (local_pSubpassEndInfo) |
| 15169 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15170 | transform_tohost_VkSubpassEndInfoKHR(mImpl->resources(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15171 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15172 | countingStream->rewind(); |
| 15173 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15174 | uint64_t cgen_var_1069; |
| 15175 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1069, 1); |
| 15176 | countingStream->write((uint64_t*)&cgen_var_1069, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15177 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 15178 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15179 | } |
| 15180 | uint32_t packetSize_vkCmdNextSubpass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15181 | countingStream->rewind(); |
| 15182 | uint32_t opcode_vkCmdNextSubpass2KHR = OP_vkCmdNextSubpass2KHR; |
| 15183 | stream->write(&opcode_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| 15184 | stream->write(&packetSize_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15185 | uint64_t cgen_var_1070; |
| 15186 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1070, 1); |
| 15187 | stream->write((uint64_t*)&cgen_var_1070, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15188 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 15189 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15190 | mImpl->log("finish vkCmdNextSubpass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15191 | } |
| 15192 | |
| 15193 | void VkEncoder::vkCmdEndRenderPass2KHR( |
| 15194 | VkCommandBuffer commandBuffer, |
| 15195 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 15196 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15197 | mImpl->log("start vkCmdEndRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15198 | auto stream = mImpl->stream(); |
| 15199 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15200 | auto resources = mImpl->resources(); |
| 15201 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15202 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15203 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15204 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15205 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15206 | local_pSubpassEndInfo = nullptr; |
| 15207 | if (pSubpassEndInfo) |
| 15208 | { |
| 15209 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 15210 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 15211 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15212 | if (local_pSubpassEndInfo) |
| 15213 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15214 | transform_tohost_VkSubpassEndInfoKHR(mImpl->resources(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15215 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15216 | countingStream->rewind(); |
| 15217 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15218 | uint64_t cgen_var_1071; |
| 15219 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1071, 1); |
| 15220 | countingStream->write((uint64_t*)&cgen_var_1071, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15221 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15222 | } |
| 15223 | uint32_t packetSize_vkCmdEndRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15224 | countingStream->rewind(); |
| 15225 | uint32_t opcode_vkCmdEndRenderPass2KHR = OP_vkCmdEndRenderPass2KHR; |
| 15226 | stream->write(&opcode_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| 15227 | stream->write(&packetSize_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15228 | uint64_t cgen_var_1072; |
| 15229 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1072, 1); |
| 15230 | stream->write((uint64_t*)&cgen_var_1072, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15231 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15232 | mImpl->log("finish vkCmdEndRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15233 | } |
| 15234 | |
| 15235 | #endif |
| 15236 | #ifdef VK_KHR_shared_presentable_image |
| 15237 | VkResult VkEncoder::vkGetSwapchainStatusKHR( |
| 15238 | VkDevice device, |
| 15239 | VkSwapchainKHR swapchain) |
| 15240 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15241 | mImpl->log("start vkGetSwapchainStatusKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15242 | auto stream = mImpl->stream(); |
| 15243 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15244 | auto resources = mImpl->resources(); |
| 15245 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15246 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15247 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15248 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15249 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15250 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15251 | countingStream->rewind(); |
| 15252 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15253 | uint64_t cgen_var_1073; |
| 15254 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1073, 1); |
| 15255 | countingStream->write((uint64_t*)&cgen_var_1073, 1 * 8); |
| 15256 | uint64_t cgen_var_1074; |
| 15257 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1074, 1); |
| 15258 | countingStream->write((uint64_t*)&cgen_var_1074, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15259 | } |
| 15260 | uint32_t packetSize_vkGetSwapchainStatusKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15261 | countingStream->rewind(); |
| 15262 | uint32_t opcode_vkGetSwapchainStatusKHR = OP_vkGetSwapchainStatusKHR; |
| 15263 | stream->write(&opcode_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| 15264 | stream->write(&packetSize_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15265 | uint64_t cgen_var_1075; |
| 15266 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1075, 1); |
| 15267 | stream->write((uint64_t*)&cgen_var_1075, 1 * 8); |
| 15268 | uint64_t cgen_var_1076; |
| 15269 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1076, 1); |
| 15270 | stream->write((uint64_t*)&cgen_var_1076, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15271 | VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0; |
| 15272 | stream->read(&vkGetSwapchainStatusKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15273 | countingStream->clearPool(); |
| 15274 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15275 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15276 | mImpl->log("finish vkGetSwapchainStatusKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15277 | return vkGetSwapchainStatusKHR_VkResult_return; |
| 15278 | } |
| 15279 | |
| 15280 | #endif |
| 15281 | #ifdef VK_KHR_external_fence_capabilities |
| 15282 | void VkEncoder::vkGetPhysicalDeviceExternalFencePropertiesKHR( |
| 15283 | VkPhysicalDevice physicalDevice, |
| 15284 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 15285 | VkExternalFenceProperties* pExternalFenceProperties) |
| 15286 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15287 | mImpl->log("start vkGetPhysicalDeviceExternalFencePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15288 | auto stream = mImpl->stream(); |
| 15289 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15290 | auto resources = mImpl->resources(); |
| 15291 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15292 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15293 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15294 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15295 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15296 | local_pExternalFenceInfo = nullptr; |
| 15297 | if (pExternalFenceInfo) |
| 15298 | { |
| 15299 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 15300 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 15301 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15302 | if (local_pExternalFenceInfo) |
| 15303 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15304 | transform_tohost_VkPhysicalDeviceExternalFenceInfo(mImpl->resources(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15305 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15306 | countingStream->rewind(); |
| 15307 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15308 | uint64_t cgen_var_1077; |
| 15309 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1077, 1); |
| 15310 | countingStream->write((uint64_t*)&cgen_var_1077, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15311 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15312 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 15313 | } |
| 15314 | uint32_t packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15315 | countingStream->rewind(); |
| 15316 | uint32_t opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR = OP_vkGetPhysicalDeviceExternalFencePropertiesKHR; |
| 15317 | stream->write(&opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| 15318 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15319 | uint64_t cgen_var_1078; |
| 15320 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1078, 1); |
| 15321 | stream->write((uint64_t*)&cgen_var_1078, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15322 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15323 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 15324 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15325 | if (pExternalFenceProperties) |
| 15326 | { |
| 15327 | transform_fromhost_VkExternalFenceProperties(mImpl->resources(), (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 15328 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15329 | mImpl->log("finish vkGetPhysicalDeviceExternalFencePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15330 | } |
| 15331 | |
| 15332 | #endif |
| 15333 | #ifdef VK_KHR_external_fence |
| 15334 | #endif |
| 15335 | #ifdef VK_KHR_external_fence_win32 |
| 15336 | VkResult VkEncoder::vkImportFenceWin32HandleKHR( |
| 15337 | VkDevice device, |
| 15338 | const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) |
| 15339 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15340 | mImpl->log("start vkImportFenceWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15341 | auto stream = mImpl->stream(); |
| 15342 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15343 | auto resources = mImpl->resources(); |
| 15344 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15345 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15346 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15347 | VkImportFenceWin32HandleInfoKHR* local_pImportFenceWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15348 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15349 | local_pImportFenceWin32HandleInfo = nullptr; |
| 15350 | if (pImportFenceWin32HandleInfo) |
| 15351 | { |
| 15352 | local_pImportFenceWin32HandleInfo = (VkImportFenceWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportFenceWin32HandleInfoKHR)); |
| 15353 | deepcopy_VkImportFenceWin32HandleInfoKHR(pool, pImportFenceWin32HandleInfo, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| 15354 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15355 | if (local_pImportFenceWin32HandleInfo) |
| 15356 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15357 | transform_tohost_VkImportFenceWin32HandleInfoKHR(mImpl->resources(), (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15358 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15359 | countingStream->rewind(); |
| 15360 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15361 | uint64_t cgen_var_1079; |
| 15362 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1079, 1); |
| 15363 | countingStream->write((uint64_t*)&cgen_var_1079, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15364 | marshal_VkImportFenceWin32HandleInfoKHR(countingStream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15365 | } |
| 15366 | uint32_t packetSize_vkImportFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15367 | countingStream->rewind(); |
| 15368 | uint32_t opcode_vkImportFenceWin32HandleKHR = OP_vkImportFenceWin32HandleKHR; |
| 15369 | stream->write(&opcode_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| 15370 | stream->write(&packetSize_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15371 | uint64_t cgen_var_1080; |
| 15372 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1080, 1); |
| 15373 | stream->write((uint64_t*)&cgen_var_1080, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15374 | marshal_VkImportFenceWin32HandleInfoKHR(stream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15375 | VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 15376 | stream->read(&vkImportFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15377 | countingStream->clearPool(); |
| 15378 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15379 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15380 | mImpl->log("finish vkImportFenceWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15381 | return vkImportFenceWin32HandleKHR_VkResult_return; |
| 15382 | } |
| 15383 | |
| 15384 | VkResult VkEncoder::vkGetFenceWin32HandleKHR( |
| 15385 | VkDevice device, |
| 15386 | const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 15387 | HANDLE* pHandle) |
| 15388 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15389 | mImpl->log("start vkGetFenceWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15390 | auto stream = mImpl->stream(); |
| 15391 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15392 | auto resources = mImpl->resources(); |
| 15393 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15394 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15395 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15396 | VkFenceGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15397 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15398 | local_pGetWin32HandleInfo = nullptr; |
| 15399 | if (pGetWin32HandleInfo) |
| 15400 | { |
| 15401 | local_pGetWin32HandleInfo = (VkFenceGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkFenceGetWin32HandleInfoKHR)); |
| 15402 | deepcopy_VkFenceGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 15403 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15404 | if (local_pGetWin32HandleInfo) |
| 15405 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15406 | transform_tohost_VkFenceGetWin32HandleInfoKHR(mImpl->resources(), (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15407 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15408 | countingStream->rewind(); |
| 15409 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15410 | uint64_t cgen_var_1081; |
| 15411 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1081, 1); |
| 15412 | countingStream->write((uint64_t*)&cgen_var_1081, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15413 | marshal_VkFenceGetWin32HandleInfoKHR(countingStream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15414 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15415 | } |
| 15416 | uint32_t packetSize_vkGetFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15417 | countingStream->rewind(); |
| 15418 | uint32_t opcode_vkGetFenceWin32HandleKHR = OP_vkGetFenceWin32HandleKHR; |
| 15419 | stream->write(&opcode_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| 15420 | stream->write(&packetSize_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15421 | uint64_t cgen_var_1082; |
| 15422 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1082, 1); |
| 15423 | stream->write((uint64_t*)&cgen_var_1082, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15424 | marshal_VkFenceGetWin32HandleInfoKHR(stream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15425 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15426 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15427 | VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 15428 | stream->read(&vkGetFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15429 | countingStream->clearPool(); |
| 15430 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15431 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15432 | mImpl->log("finish vkGetFenceWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15433 | return vkGetFenceWin32HandleKHR_VkResult_return; |
| 15434 | } |
| 15435 | |
| 15436 | #endif |
| 15437 | #ifdef VK_KHR_external_fence_fd |
| 15438 | VkResult VkEncoder::vkImportFenceFdKHR( |
| 15439 | VkDevice device, |
| 15440 | const VkImportFenceFdInfoKHR* pImportFenceFdInfo) |
| 15441 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15442 | mImpl->log("start vkImportFenceFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15443 | auto stream = mImpl->stream(); |
| 15444 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15445 | auto resources = mImpl->resources(); |
| 15446 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15447 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15448 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15449 | VkImportFenceFdInfoKHR* local_pImportFenceFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15450 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15451 | local_pImportFenceFdInfo = nullptr; |
| 15452 | if (pImportFenceFdInfo) |
| 15453 | { |
| 15454 | local_pImportFenceFdInfo = (VkImportFenceFdInfoKHR*)pool->alloc(sizeof(const VkImportFenceFdInfoKHR)); |
| 15455 | deepcopy_VkImportFenceFdInfoKHR(pool, pImportFenceFdInfo, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| 15456 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15457 | if (local_pImportFenceFdInfo) |
| 15458 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15459 | transform_tohost_VkImportFenceFdInfoKHR(mImpl->resources(), (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15460 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15461 | countingStream->rewind(); |
| 15462 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15463 | uint64_t cgen_var_1083; |
| 15464 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1083, 1); |
| 15465 | countingStream->write((uint64_t*)&cgen_var_1083, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15466 | marshal_VkImportFenceFdInfoKHR(countingStream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15467 | } |
| 15468 | uint32_t packetSize_vkImportFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15469 | countingStream->rewind(); |
| 15470 | uint32_t opcode_vkImportFenceFdKHR = OP_vkImportFenceFdKHR; |
| 15471 | stream->write(&opcode_vkImportFenceFdKHR, sizeof(uint32_t)); |
| 15472 | stream->write(&packetSize_vkImportFenceFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15473 | uint64_t cgen_var_1084; |
| 15474 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1084, 1); |
| 15475 | stream->write((uint64_t*)&cgen_var_1084, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15476 | marshal_VkImportFenceFdInfoKHR(stream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15477 | VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0; |
| 15478 | stream->read(&vkImportFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15479 | countingStream->clearPool(); |
| 15480 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15481 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15482 | mImpl->log("finish vkImportFenceFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15483 | return vkImportFenceFdKHR_VkResult_return; |
| 15484 | } |
| 15485 | |
| 15486 | VkResult VkEncoder::vkGetFenceFdKHR( |
| 15487 | VkDevice device, |
| 15488 | const VkFenceGetFdInfoKHR* pGetFdInfo, |
| 15489 | int* pFd) |
| 15490 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15491 | mImpl->log("start vkGetFenceFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15492 | auto stream = mImpl->stream(); |
| 15493 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15494 | auto resources = mImpl->resources(); |
| 15495 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15496 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15497 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15498 | VkFenceGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15499 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15500 | local_pGetFdInfo = nullptr; |
| 15501 | if (pGetFdInfo) |
| 15502 | { |
| 15503 | local_pGetFdInfo = (VkFenceGetFdInfoKHR*)pool->alloc(sizeof(const VkFenceGetFdInfoKHR)); |
| 15504 | deepcopy_VkFenceGetFdInfoKHR(pool, pGetFdInfo, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| 15505 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15506 | if (local_pGetFdInfo) |
| 15507 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15508 | transform_tohost_VkFenceGetFdInfoKHR(mImpl->resources(), (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15509 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15510 | countingStream->rewind(); |
| 15511 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15512 | uint64_t cgen_var_1085; |
| 15513 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1085, 1); |
| 15514 | countingStream->write((uint64_t*)&cgen_var_1085, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15515 | marshal_VkFenceGetFdInfoKHR(countingStream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15516 | countingStream->write((int*)pFd, sizeof(int)); |
| 15517 | } |
| 15518 | uint32_t packetSize_vkGetFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15519 | countingStream->rewind(); |
| 15520 | uint32_t opcode_vkGetFenceFdKHR = OP_vkGetFenceFdKHR; |
| 15521 | stream->write(&opcode_vkGetFenceFdKHR, sizeof(uint32_t)); |
| 15522 | stream->write(&packetSize_vkGetFenceFdKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15523 | uint64_t cgen_var_1086; |
| 15524 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1086, 1); |
| 15525 | stream->write((uint64_t*)&cgen_var_1086, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15526 | marshal_VkFenceGetFdInfoKHR(stream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15527 | stream->write((int*)pFd, sizeof(int)); |
| 15528 | stream->read((int*)pFd, sizeof(int)); |
| 15529 | VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0; |
| 15530 | stream->read(&vkGetFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15531 | countingStream->clearPool(); |
| 15532 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15533 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15534 | mImpl->log("finish vkGetFenceFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15535 | return vkGetFenceFdKHR_VkResult_return; |
| 15536 | } |
| 15537 | |
| 15538 | #endif |
| 15539 | #ifdef VK_KHR_maintenance2 |
| 15540 | #endif |
| 15541 | #ifdef VK_KHR_get_surface_capabilities2 |
| 15542 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2KHR( |
| 15543 | VkPhysicalDevice physicalDevice, |
| 15544 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 15545 | VkSurfaceCapabilities2KHR* pSurfaceCapabilities) |
| 15546 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15547 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilities2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15548 | auto stream = mImpl->stream(); |
| 15549 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15550 | auto resources = mImpl->resources(); |
| 15551 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15552 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15553 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15554 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15555 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15556 | local_pSurfaceInfo = nullptr; |
| 15557 | if (pSurfaceInfo) |
| 15558 | { |
| 15559 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 15560 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 15561 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15562 | if (local_pSurfaceInfo) |
| 15563 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15564 | transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(mImpl->resources(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15565 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15566 | countingStream->rewind(); |
| 15567 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15568 | uint64_t cgen_var_1087; |
| 15569 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1087, 1); |
| 15570 | countingStream->write((uint64_t*)&cgen_var_1087, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15571 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15572 | marshal_VkSurfaceCapabilities2KHR(countingStream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 15573 | } |
| 15574 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15575 | countingStream->rewind(); |
| 15576 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR = OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR; |
| 15577 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| 15578 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15579 | uint64_t cgen_var_1088; |
| 15580 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1088, 1); |
| 15581 | stream->write((uint64_t*)&cgen_var_1088, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15582 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15583 | marshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 15584 | unmarshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15585 | if (pSurfaceCapabilities) |
| 15586 | { |
| 15587 | transform_fromhost_VkSurfaceCapabilities2KHR(mImpl->resources(), (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 15588 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15589 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0; |
| 15590 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15591 | countingStream->clearPool(); |
| 15592 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15593 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15594 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilities2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15595 | return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return; |
| 15596 | } |
| 15597 | |
| 15598 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormats2KHR( |
| 15599 | VkPhysicalDevice physicalDevice, |
| 15600 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 15601 | uint32_t* pSurfaceFormatCount, |
| 15602 | VkSurfaceFormat2KHR* pSurfaceFormats) |
| 15603 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15604 | mImpl->log("start vkGetPhysicalDeviceSurfaceFormats2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15605 | auto stream = mImpl->stream(); |
| 15606 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15607 | auto resources = mImpl->resources(); |
| 15608 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15609 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15610 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15611 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15612 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15613 | local_pSurfaceInfo = nullptr; |
| 15614 | if (pSurfaceInfo) |
| 15615 | { |
| 15616 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 15617 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 15618 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15619 | if (local_pSurfaceInfo) |
| 15620 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15621 | transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(mImpl->resources(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15622 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15623 | countingStream->rewind(); |
| 15624 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15625 | uint64_t cgen_var_1089; |
| 15626 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1089, 1); |
| 15627 | countingStream->write((uint64_t*)&cgen_var_1089, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15628 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15629 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15630 | uint64_t cgen_var_1090 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 15631 | countingStream->putBe64(cgen_var_1090); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15632 | if (pSurfaceFormatCount) |
| 15633 | { |
| 15634 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 15635 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15636 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15637 | uint64_t cgen_var_1091 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 15638 | countingStream->putBe64(cgen_var_1091); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15639 | if (pSurfaceFormats) |
| 15640 | { |
| 15641 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 15642 | { |
| 15643 | marshal_VkSurfaceFormat2KHR(countingStream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 15644 | } |
| 15645 | } |
| 15646 | } |
| 15647 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15648 | countingStream->rewind(); |
| 15649 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormats2KHR = OP_vkGetPhysicalDeviceSurfaceFormats2KHR; |
| 15650 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| 15651 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15652 | uint64_t cgen_var_1092; |
| 15653 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1092, 1); |
| 15654 | stream->write((uint64_t*)&cgen_var_1092, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15655 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15656 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15657 | uint64_t cgen_var_1093 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 15658 | stream->putBe64(cgen_var_1093); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15659 | if (pSurfaceFormatCount) |
| 15660 | { |
| 15661 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 15662 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15663 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15664 | uint64_t cgen_var_1094 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 15665 | stream->putBe64(cgen_var_1094); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15666 | if (pSurfaceFormats) |
| 15667 | { |
| 15668 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 15669 | { |
| 15670 | marshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 15671 | } |
| 15672 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15673 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15674 | uint32_t* check_pSurfaceFormatCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15675 | check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15676 | if (pSurfaceFormatCount) |
| 15677 | { |
| 15678 | if (!(check_pSurfaceFormatCount)) |
| 15679 | { |
| 15680 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 15681 | } |
| 15682 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 15683 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15684 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15685 | VkSurfaceFormat2KHR* check_pSurfaceFormats; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15686 | check_pSurfaceFormats = (VkSurfaceFormat2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15687 | if (pSurfaceFormats) |
| 15688 | { |
| 15689 | if (!(check_pSurfaceFormats)) |
| 15690 | { |
| 15691 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 15692 | } |
| 15693 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 15694 | { |
| 15695 | unmarshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 15696 | } |
| 15697 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15698 | if (pSurfaceFormats) |
| 15699 | { |
| 15700 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 15701 | { |
| 15702 | transform_fromhost_VkSurfaceFormat2KHR(mImpl->resources(), (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 15703 | } |
| 15704 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15705 | VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0; |
| 15706 | stream->read(&vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15707 | countingStream->clearPool(); |
| 15708 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15709 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15710 | mImpl->log("finish vkGetPhysicalDeviceSurfaceFormats2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15711 | return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return; |
| 15712 | } |
| 15713 | |
| 15714 | #endif |
| 15715 | #ifdef VK_KHR_variable_pointers |
| 15716 | #endif |
| 15717 | #ifdef VK_KHR_get_display_properties2 |
| 15718 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayProperties2KHR( |
| 15719 | VkPhysicalDevice physicalDevice, |
| 15720 | uint32_t* pPropertyCount, |
| 15721 | VkDisplayProperties2KHR* pProperties) |
| 15722 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15723 | mImpl->log("start vkGetPhysicalDeviceDisplayProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15724 | auto stream = mImpl->stream(); |
| 15725 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15726 | auto resources = mImpl->resources(); |
| 15727 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15728 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15729 | VkPhysicalDevice local_physicalDevice; |
| 15730 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15731 | countingStream->rewind(); |
| 15732 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15733 | uint64_t cgen_var_1097; |
| 15734 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1097, 1); |
| 15735 | countingStream->write((uint64_t*)&cgen_var_1097, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15736 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15737 | uint64_t cgen_var_1098 = (uint64_t)(uintptr_t)pPropertyCount; |
| 15738 | countingStream->putBe64(cgen_var_1098); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15739 | if (pPropertyCount) |
| 15740 | { |
| 15741 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 15742 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15743 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15744 | uint64_t cgen_var_1099 = (uint64_t)(uintptr_t)pProperties; |
| 15745 | countingStream->putBe64(cgen_var_1099); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15746 | if (pProperties) |
| 15747 | { |
| 15748 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 15749 | { |
| 15750 | marshal_VkDisplayProperties2KHR(countingStream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 15751 | } |
| 15752 | } |
| 15753 | } |
| 15754 | uint32_t packetSize_vkGetPhysicalDeviceDisplayProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15755 | countingStream->rewind(); |
| 15756 | uint32_t opcode_vkGetPhysicalDeviceDisplayProperties2KHR = OP_vkGetPhysicalDeviceDisplayProperties2KHR; |
| 15757 | stream->write(&opcode_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| 15758 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15759 | uint64_t cgen_var_1100; |
| 15760 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1100, 1); |
| 15761 | stream->write((uint64_t*)&cgen_var_1100, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15762 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15763 | uint64_t cgen_var_1101 = (uint64_t)(uintptr_t)pPropertyCount; |
| 15764 | stream->putBe64(cgen_var_1101); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15765 | if (pPropertyCount) |
| 15766 | { |
| 15767 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 15768 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15769 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15770 | uint64_t cgen_var_1102 = (uint64_t)(uintptr_t)pProperties; |
| 15771 | stream->putBe64(cgen_var_1102); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15772 | if (pProperties) |
| 15773 | { |
| 15774 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 15775 | { |
| 15776 | marshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 15777 | } |
| 15778 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15779 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15780 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15781 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15782 | if (pPropertyCount) |
| 15783 | { |
| 15784 | if (!(check_pPropertyCount)) |
| 15785 | { |
| 15786 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 15787 | } |
| 15788 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 15789 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15790 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15791 | VkDisplayProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15792 | check_pProperties = (VkDisplayProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15793 | if (pProperties) |
| 15794 | { |
| 15795 | if (!(check_pProperties)) |
| 15796 | { |
| 15797 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 15798 | } |
| 15799 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 15800 | { |
| 15801 | unmarshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 15802 | } |
| 15803 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15804 | if (pProperties) |
| 15805 | { |
| 15806 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 15807 | { |
| 15808 | transform_fromhost_VkDisplayProperties2KHR(mImpl->resources(), (VkDisplayProperties2KHR*)(pProperties + i)); |
| 15809 | } |
| 15810 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15811 | VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0; |
| 15812 | stream->read(&vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15813 | countingStream->clearPool(); |
| 15814 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15815 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15816 | mImpl->log("finish vkGetPhysicalDeviceDisplayProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15817 | return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return; |
| 15818 | } |
| 15819 | |
| 15820 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlaneProperties2KHR( |
| 15821 | VkPhysicalDevice physicalDevice, |
| 15822 | uint32_t* pPropertyCount, |
| 15823 | VkDisplayPlaneProperties2KHR* pProperties) |
| 15824 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15825 | mImpl->log("start vkGetPhysicalDeviceDisplayPlaneProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15826 | auto stream = mImpl->stream(); |
| 15827 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15828 | auto resources = mImpl->resources(); |
| 15829 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15830 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15831 | VkPhysicalDevice local_physicalDevice; |
| 15832 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15833 | countingStream->rewind(); |
| 15834 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15835 | uint64_t cgen_var_1105; |
| 15836 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1105, 1); |
| 15837 | countingStream->write((uint64_t*)&cgen_var_1105, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15838 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15839 | uint64_t cgen_var_1106 = (uint64_t)(uintptr_t)pPropertyCount; |
| 15840 | countingStream->putBe64(cgen_var_1106); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15841 | if (pPropertyCount) |
| 15842 | { |
| 15843 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 15844 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15845 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15846 | uint64_t cgen_var_1107 = (uint64_t)(uintptr_t)pProperties; |
| 15847 | countingStream->putBe64(cgen_var_1107); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15848 | if (pProperties) |
| 15849 | { |
| 15850 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 15851 | { |
| 15852 | marshal_VkDisplayPlaneProperties2KHR(countingStream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 15853 | } |
| 15854 | } |
| 15855 | } |
| 15856 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15857 | countingStream->rewind(); |
| 15858 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR; |
| 15859 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| 15860 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15861 | uint64_t cgen_var_1108; |
| 15862 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1108, 1); |
| 15863 | stream->write((uint64_t*)&cgen_var_1108, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15864 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15865 | uint64_t cgen_var_1109 = (uint64_t)(uintptr_t)pPropertyCount; |
| 15866 | stream->putBe64(cgen_var_1109); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15867 | if (pPropertyCount) |
| 15868 | { |
| 15869 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 15870 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15871 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15872 | uint64_t cgen_var_1110 = (uint64_t)(uintptr_t)pProperties; |
| 15873 | stream->putBe64(cgen_var_1110); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15874 | if (pProperties) |
| 15875 | { |
| 15876 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 15877 | { |
| 15878 | marshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 15879 | } |
| 15880 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15881 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15882 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15883 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15884 | if (pPropertyCount) |
| 15885 | { |
| 15886 | if (!(check_pPropertyCount)) |
| 15887 | { |
| 15888 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 15889 | } |
| 15890 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 15891 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15892 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15893 | VkDisplayPlaneProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15894 | check_pProperties = (VkDisplayPlaneProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15895 | if (pProperties) |
| 15896 | { |
| 15897 | if (!(check_pProperties)) |
| 15898 | { |
| 15899 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 15900 | } |
| 15901 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 15902 | { |
| 15903 | unmarshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 15904 | } |
| 15905 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15906 | if (pProperties) |
| 15907 | { |
| 15908 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 15909 | { |
| 15910 | transform_fromhost_VkDisplayPlaneProperties2KHR(mImpl->resources(), (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 15911 | } |
| 15912 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15913 | VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0; |
| 15914 | stream->read(&vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15915 | countingStream->clearPool(); |
| 15916 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15917 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15918 | mImpl->log("finish vkGetPhysicalDeviceDisplayPlaneProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15919 | return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return; |
| 15920 | } |
| 15921 | |
| 15922 | VkResult VkEncoder::vkGetDisplayModeProperties2KHR( |
| 15923 | VkPhysicalDevice physicalDevice, |
| 15924 | VkDisplayKHR display, |
| 15925 | uint32_t* pPropertyCount, |
| 15926 | VkDisplayModeProperties2KHR* pProperties) |
| 15927 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15928 | mImpl->log("start vkGetDisplayModeProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15929 | auto stream = mImpl->stream(); |
| 15930 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15931 | auto resources = mImpl->resources(); |
| 15932 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15933 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15934 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15935 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15936 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15937 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15938 | countingStream->rewind(); |
| 15939 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15940 | uint64_t cgen_var_1113; |
| 15941 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1113, 1); |
| 15942 | countingStream->write((uint64_t*)&cgen_var_1113, 1 * 8); |
| 15943 | uint64_t cgen_var_1114; |
| 15944 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1114, 1); |
| 15945 | countingStream->write((uint64_t*)&cgen_var_1114, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15946 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15947 | uint64_t cgen_var_1115 = (uint64_t)(uintptr_t)pPropertyCount; |
| 15948 | countingStream->putBe64(cgen_var_1115); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15949 | if (pPropertyCount) |
| 15950 | { |
| 15951 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 15952 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15953 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15954 | uint64_t cgen_var_1116 = (uint64_t)(uintptr_t)pProperties; |
| 15955 | countingStream->putBe64(cgen_var_1116); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15956 | if (pProperties) |
| 15957 | { |
| 15958 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 15959 | { |
| 15960 | marshal_VkDisplayModeProperties2KHR(countingStream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 15961 | } |
| 15962 | } |
| 15963 | } |
| 15964 | uint32_t packetSize_vkGetDisplayModeProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15965 | countingStream->rewind(); |
| 15966 | uint32_t opcode_vkGetDisplayModeProperties2KHR = OP_vkGetDisplayModeProperties2KHR; |
| 15967 | stream->write(&opcode_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| 15968 | stream->write(&packetSize_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15969 | uint64_t cgen_var_1117; |
| 15970 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1117, 1); |
| 15971 | stream->write((uint64_t*)&cgen_var_1117, 1 * 8); |
| 15972 | uint64_t cgen_var_1118; |
| 15973 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1118, 1); |
| 15974 | stream->write((uint64_t*)&cgen_var_1118, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15975 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15976 | uint64_t cgen_var_1119 = (uint64_t)(uintptr_t)pPropertyCount; |
| 15977 | stream->putBe64(cgen_var_1119); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15978 | if (pPropertyCount) |
| 15979 | { |
| 15980 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 15981 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15982 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 15983 | uint64_t cgen_var_1120 = (uint64_t)(uintptr_t)pProperties; |
| 15984 | stream->putBe64(cgen_var_1120); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15985 | if (pProperties) |
| 15986 | { |
| 15987 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 15988 | { |
| 15989 | marshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 15990 | } |
| 15991 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15992 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15993 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15994 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15995 | if (pPropertyCount) |
| 15996 | { |
| 15997 | if (!(check_pPropertyCount)) |
| 15998 | { |
| 15999 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 16000 | } |
| 16001 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16002 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16003 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16004 | VkDisplayModeProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16005 | check_pProperties = (VkDisplayModeProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16006 | if (pProperties) |
| 16007 | { |
| 16008 | if (!(check_pProperties)) |
| 16009 | { |
| 16010 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 16011 | } |
| 16012 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16013 | { |
| 16014 | unmarshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 16015 | } |
| 16016 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16017 | if (pProperties) |
| 16018 | { |
| 16019 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16020 | { |
| 16021 | transform_fromhost_VkDisplayModeProperties2KHR(mImpl->resources(), (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 16022 | } |
| 16023 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16024 | VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0; |
| 16025 | stream->read(&vkGetDisplayModeProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16026 | countingStream->clearPool(); |
| 16027 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16028 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16029 | mImpl->log("finish vkGetDisplayModeProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16030 | return vkGetDisplayModeProperties2KHR_VkResult_return; |
| 16031 | } |
| 16032 | |
| 16033 | VkResult VkEncoder::vkGetDisplayPlaneCapabilities2KHR( |
| 16034 | VkPhysicalDevice physicalDevice, |
| 16035 | const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, |
| 16036 | VkDisplayPlaneCapabilities2KHR* pCapabilities) |
| 16037 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16038 | mImpl->log("start vkGetDisplayPlaneCapabilities2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 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 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16045 | VkDisplayPlaneInfo2KHR* local_pDisplayPlaneInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16046 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16047 | local_pDisplayPlaneInfo = nullptr; |
| 16048 | if (pDisplayPlaneInfo) |
| 16049 | { |
| 16050 | local_pDisplayPlaneInfo = (VkDisplayPlaneInfo2KHR*)pool->alloc(sizeof(const VkDisplayPlaneInfo2KHR)); |
| 16051 | deepcopy_VkDisplayPlaneInfo2KHR(pool, pDisplayPlaneInfo, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| 16052 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16053 | if (local_pDisplayPlaneInfo) |
| 16054 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16055 | transform_tohost_VkDisplayPlaneInfo2KHR(mImpl->resources(), (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16056 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16057 | countingStream->rewind(); |
| 16058 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16059 | uint64_t cgen_var_1123; |
| 16060 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1123, 1); |
| 16061 | countingStream->write((uint64_t*)&cgen_var_1123, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16062 | marshal_VkDisplayPlaneInfo2KHR(countingStream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16063 | marshal_VkDisplayPlaneCapabilities2KHR(countingStream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 16064 | } |
| 16065 | uint32_t packetSize_vkGetDisplayPlaneCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16066 | countingStream->rewind(); |
| 16067 | uint32_t opcode_vkGetDisplayPlaneCapabilities2KHR = OP_vkGetDisplayPlaneCapabilities2KHR; |
| 16068 | stream->write(&opcode_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| 16069 | stream->write(&packetSize_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16070 | uint64_t cgen_var_1124; |
| 16071 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1124, 1); |
| 16072 | stream->write((uint64_t*)&cgen_var_1124, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16073 | marshal_VkDisplayPlaneInfo2KHR(stream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16074 | marshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 16075 | unmarshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16076 | if (pCapabilities) |
| 16077 | { |
| 16078 | transform_fromhost_VkDisplayPlaneCapabilities2KHR(mImpl->resources(), (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 16079 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16080 | VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0; |
| 16081 | stream->read(&vkGetDisplayPlaneCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16082 | countingStream->clearPool(); |
| 16083 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16084 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16085 | mImpl->log("finish vkGetDisplayPlaneCapabilities2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16086 | return vkGetDisplayPlaneCapabilities2KHR_VkResult_return; |
| 16087 | } |
| 16088 | |
| 16089 | #endif |
| 16090 | #ifdef VK_KHR_dedicated_allocation |
| 16091 | #endif |
| 16092 | #ifdef VK_KHR_storage_buffer_storage_class |
| 16093 | #endif |
| 16094 | #ifdef VK_KHR_relaxed_block_layout |
| 16095 | #endif |
| 16096 | #ifdef VK_KHR_get_memory_requirements2 |
| 16097 | void VkEncoder::vkGetImageMemoryRequirements2KHR( |
| 16098 | VkDevice device, |
| 16099 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 16100 | VkMemoryRequirements2* pMemoryRequirements) |
| 16101 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16102 | mImpl->log("start vkGetImageMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16103 | auto stream = mImpl->stream(); |
| 16104 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16105 | auto resources = mImpl->resources(); |
| 16106 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16107 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16108 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16109 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16110 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16111 | local_pInfo = nullptr; |
| 16112 | if (pInfo) |
| 16113 | { |
| 16114 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 16115 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 16116 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16117 | if (local_pInfo) |
| 16118 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16119 | transform_tohost_VkImageMemoryRequirementsInfo2(mImpl->resources(), (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16120 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16121 | countingStream->rewind(); |
| 16122 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16123 | uint64_t cgen_var_1125; |
| 16124 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1125, 1); |
| 16125 | countingStream->write((uint64_t*)&cgen_var_1125, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16126 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16127 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16128 | } |
| 16129 | uint32_t packetSize_vkGetImageMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16130 | countingStream->rewind(); |
| 16131 | uint32_t opcode_vkGetImageMemoryRequirements2KHR = OP_vkGetImageMemoryRequirements2KHR; |
| 16132 | stream->write(&opcode_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| 16133 | stream->write(&packetSize_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16134 | uint64_t cgen_var_1126; |
| 16135 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1126, 1); |
| 16136 | stream->write((uint64_t*)&cgen_var_1126, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16137 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16138 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16139 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16140 | if (pMemoryRequirements) |
| 16141 | { |
| 16142 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16143 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16144 | mImpl->log("finish vkGetImageMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16145 | } |
| 16146 | |
| 16147 | void VkEncoder::vkGetBufferMemoryRequirements2KHR( |
| 16148 | VkDevice device, |
| 16149 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 16150 | VkMemoryRequirements2* pMemoryRequirements) |
| 16151 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16152 | mImpl->log("start vkGetBufferMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16153 | auto stream = mImpl->stream(); |
| 16154 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16155 | auto resources = mImpl->resources(); |
| 16156 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16157 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16158 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16159 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16160 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16161 | local_pInfo = nullptr; |
| 16162 | if (pInfo) |
| 16163 | { |
| 16164 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 16165 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 16166 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16167 | if (local_pInfo) |
| 16168 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16169 | transform_tohost_VkBufferMemoryRequirementsInfo2(mImpl->resources(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16170 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16171 | countingStream->rewind(); |
| 16172 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16173 | uint64_t cgen_var_1127; |
| 16174 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1127, 1); |
| 16175 | countingStream->write((uint64_t*)&cgen_var_1127, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16176 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16177 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16178 | } |
| 16179 | uint32_t packetSize_vkGetBufferMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16180 | countingStream->rewind(); |
| 16181 | uint32_t opcode_vkGetBufferMemoryRequirements2KHR = OP_vkGetBufferMemoryRequirements2KHR; |
| 16182 | stream->write(&opcode_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| 16183 | stream->write(&packetSize_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16184 | uint64_t cgen_var_1128; |
| 16185 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1128, 1); |
| 16186 | stream->write((uint64_t*)&cgen_var_1128, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16187 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16188 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16189 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16190 | if (pMemoryRequirements) |
| 16191 | { |
| 16192 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16193 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16194 | mImpl->log("finish vkGetBufferMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16195 | } |
| 16196 | |
| 16197 | void VkEncoder::vkGetImageSparseMemoryRequirements2KHR( |
| 16198 | VkDevice device, |
| 16199 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 16200 | uint32_t* pSparseMemoryRequirementCount, |
| 16201 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 16202 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16203 | mImpl->log("start vkGetImageSparseMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16204 | auto stream = mImpl->stream(); |
| 16205 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16206 | auto resources = mImpl->resources(); |
| 16207 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16208 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16209 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16210 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16211 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16212 | local_pInfo = nullptr; |
| 16213 | if (pInfo) |
| 16214 | { |
| 16215 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 16216 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 16217 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16218 | if (local_pInfo) |
| 16219 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16220 | transform_tohost_VkImageSparseMemoryRequirementsInfo2(mImpl->resources(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16221 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16222 | countingStream->rewind(); |
| 16223 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16224 | uint64_t cgen_var_1129; |
| 16225 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1129, 1); |
| 16226 | countingStream->write((uint64_t*)&cgen_var_1129, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16227 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16228 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16229 | uint64_t cgen_var_1130 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 16230 | countingStream->putBe64(cgen_var_1130); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16231 | if (pSparseMemoryRequirementCount) |
| 16232 | { |
| 16233 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 16234 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16235 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16236 | uint64_t cgen_var_1131 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 16237 | countingStream->putBe64(cgen_var_1131); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16238 | if (pSparseMemoryRequirements) |
| 16239 | { |
| 16240 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 16241 | { |
| 16242 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 16243 | } |
| 16244 | } |
| 16245 | } |
| 16246 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16247 | countingStream->rewind(); |
| 16248 | uint32_t opcode_vkGetImageSparseMemoryRequirements2KHR = OP_vkGetImageSparseMemoryRequirements2KHR; |
| 16249 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| 16250 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16251 | uint64_t cgen_var_1132; |
| 16252 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1132, 1); |
| 16253 | stream->write((uint64_t*)&cgen_var_1132, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16254 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16255 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16256 | uint64_t cgen_var_1133 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 16257 | stream->putBe64(cgen_var_1133); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16258 | if (pSparseMemoryRequirementCount) |
| 16259 | { |
| 16260 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 16261 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16262 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16263 | uint64_t cgen_var_1134 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 16264 | stream->putBe64(cgen_var_1134); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16265 | if (pSparseMemoryRequirements) |
| 16266 | { |
| 16267 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 16268 | { |
| 16269 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 16270 | } |
| 16271 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16272 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16273 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16274 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16275 | if (pSparseMemoryRequirementCount) |
| 16276 | { |
| 16277 | if (!(check_pSparseMemoryRequirementCount)) |
| 16278 | { |
| 16279 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 16280 | } |
| 16281 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 16282 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16283 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16284 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16285 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16286 | if (pSparseMemoryRequirements) |
| 16287 | { |
| 16288 | if (!(check_pSparseMemoryRequirements)) |
| 16289 | { |
| 16290 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 16291 | } |
| 16292 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 16293 | { |
| 16294 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 16295 | } |
| 16296 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16297 | if (pSparseMemoryRequirements) |
| 16298 | { |
| 16299 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 16300 | { |
| 16301 | transform_fromhost_VkSparseImageMemoryRequirements2(mImpl->resources(), (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 16302 | } |
| 16303 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16304 | mImpl->log("finish vkGetImageSparseMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16305 | } |
| 16306 | |
| 16307 | #endif |
| 16308 | #ifdef VK_KHR_image_format_list |
| 16309 | #endif |
| 16310 | #ifdef VK_KHR_sampler_ycbcr_conversion |
| 16311 | VkResult VkEncoder::vkCreateSamplerYcbcrConversionKHR( |
| 16312 | VkDevice device, |
| 16313 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 16314 | const VkAllocationCallbacks* pAllocator, |
| 16315 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 16316 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16317 | mImpl->log("start vkCreateSamplerYcbcrConversionKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16318 | auto stream = mImpl->stream(); |
| 16319 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16320 | auto resources = mImpl->resources(); |
| 16321 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16322 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16323 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16324 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16325 | VkAllocationCallbacks* local_pAllocator; |
| 16326 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16327 | local_pCreateInfo = nullptr; |
| 16328 | if (pCreateInfo) |
| 16329 | { |
| 16330 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 16331 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 16332 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16333 | local_pAllocator = nullptr; |
| 16334 | if (pAllocator) |
| 16335 | { |
| 16336 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16337 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16338 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16339 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16340 | if (local_pCreateInfo) |
| 16341 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16342 | transform_tohost_VkSamplerYcbcrConversionCreateInfo(mImpl->resources(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16343 | } |
| 16344 | if (local_pAllocator) |
| 16345 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16346 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16347 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16348 | countingStream->rewind(); |
| 16349 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16350 | uint64_t cgen_var_1137; |
| 16351 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1137, 1); |
| 16352 | countingStream->write((uint64_t*)&cgen_var_1137, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16353 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16354 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16355 | uint64_t cgen_var_1138 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16356 | countingStream->putBe64(cgen_var_1138); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16357 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16358 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16359 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16360 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16361 | uint64_t cgen_var_1139; |
| 16362 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1139, 1); |
| 16363 | countingStream->write((uint64_t*)&cgen_var_1139, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16364 | } |
| 16365 | uint32_t packetSize_vkCreateSamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16366 | countingStream->rewind(); |
| 16367 | uint32_t opcode_vkCreateSamplerYcbcrConversionKHR = OP_vkCreateSamplerYcbcrConversionKHR; |
| 16368 | stream->write(&opcode_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 16369 | stream->write(&packetSize_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16370 | uint64_t cgen_var_1140; |
| 16371 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1140, 1); |
| 16372 | stream->write((uint64_t*)&cgen_var_1140, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16373 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16374 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16375 | uint64_t cgen_var_1141 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16376 | stream->putBe64(cgen_var_1141); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16377 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16378 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16379 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16380 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16381 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16382 | uint64_t cgen_var_1142; |
| 16383 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1142, 1); |
| 16384 | stream->write((uint64_t*)&cgen_var_1142, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16385 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16386 | uint64_t cgen_var_1143; |
| 16387 | stream->read((uint64_t*)&cgen_var_1143, 8); |
| 16388 | stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_1143, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16389 | VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0; |
| 16390 | stream->read(&vkCreateSamplerYcbcrConversionKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16391 | countingStream->clearPool(); |
| 16392 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16393 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16394 | mImpl->log("finish vkCreateSamplerYcbcrConversionKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16395 | return vkCreateSamplerYcbcrConversionKHR_VkResult_return; |
| 16396 | } |
| 16397 | |
| 16398 | void VkEncoder::vkDestroySamplerYcbcrConversionKHR( |
| 16399 | VkDevice device, |
| 16400 | VkSamplerYcbcrConversion ycbcrConversion, |
| 16401 | const VkAllocationCallbacks* pAllocator) |
| 16402 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16403 | mImpl->log("start vkDestroySamplerYcbcrConversionKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16404 | auto stream = mImpl->stream(); |
| 16405 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16406 | auto resources = mImpl->resources(); |
| 16407 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16408 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16409 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16410 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16411 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16412 | local_device = device; |
| 16413 | local_ycbcrConversion = ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16414 | local_pAllocator = nullptr; |
| 16415 | if (pAllocator) |
| 16416 | { |
| 16417 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16418 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16419 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16420 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16421 | if (local_pAllocator) |
| 16422 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16423 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16424 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16425 | countingStream->rewind(); |
| 16426 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16427 | uint64_t cgen_var_1144; |
| 16428 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1144, 1); |
| 16429 | countingStream->write((uint64_t*)&cgen_var_1144, 1 * 8); |
| 16430 | uint64_t cgen_var_1145; |
| 16431 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1145, 1); |
| 16432 | countingStream->write((uint64_t*)&cgen_var_1145, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16433 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16434 | uint64_t cgen_var_1146 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16435 | countingStream->putBe64(cgen_var_1146); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16436 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16437 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16438 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16439 | } |
| 16440 | } |
| 16441 | uint32_t packetSize_vkDestroySamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16442 | countingStream->rewind(); |
| 16443 | uint32_t opcode_vkDestroySamplerYcbcrConversionKHR = OP_vkDestroySamplerYcbcrConversionKHR; |
| 16444 | stream->write(&opcode_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 16445 | stream->write(&packetSize_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16446 | uint64_t cgen_var_1147; |
| 16447 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1147, 1); |
| 16448 | stream->write((uint64_t*)&cgen_var_1147, 1 * 8); |
| 16449 | uint64_t cgen_var_1148; |
| 16450 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1148, 1); |
| 16451 | stream->write((uint64_t*)&cgen_var_1148, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16452 | // WARNING PTR CHECK |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16453 | uint64_t cgen_var_1149 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16454 | stream->putBe64(cgen_var_1149); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16455 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16456 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16457 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16458 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16459 | mImpl->log("finish vkDestroySamplerYcbcrConversionKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16460 | } |
| 16461 | |
| 16462 | #endif |
| 16463 | #ifdef VK_KHR_bind_memory2 |
| 16464 | VkResult VkEncoder::vkBindBufferMemory2KHR( |
| 16465 | VkDevice device, |
| 16466 | uint32_t bindInfoCount, |
| 16467 | const VkBindBufferMemoryInfo* pBindInfos) |
| 16468 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16469 | mImpl->log("start vkBindBufferMemory2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16470 | auto stream = mImpl->stream(); |
| 16471 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16472 | auto resources = mImpl->resources(); |
| 16473 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16474 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16475 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16476 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16477 | VkBindBufferMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16478 | local_device = device; |
| 16479 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16480 | local_pBindInfos = nullptr; |
| 16481 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16482 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16483 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16484 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 16485 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16486 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 16487 | } |
| 16488 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16489 | if (local_pBindInfos) |
| 16490 | { |
| 16491 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 16492 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16493 | transform_tohost_VkBindBufferMemoryInfo(mImpl->resources(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16494 | } |
| 16495 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16496 | countingStream->rewind(); |
| 16497 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16498 | uint64_t cgen_var_1150; |
| 16499 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1150, 1); |
| 16500 | countingStream->write((uint64_t*)&cgen_var_1150, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16501 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 16502 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 16503 | { |
| 16504 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16505 | } |
| 16506 | } |
| 16507 | uint32_t packetSize_vkBindBufferMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16508 | countingStream->rewind(); |
| 16509 | uint32_t opcode_vkBindBufferMemory2KHR = OP_vkBindBufferMemory2KHR; |
| 16510 | stream->write(&opcode_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| 16511 | stream->write(&packetSize_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16512 | uint64_t cgen_var_1151; |
| 16513 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1151, 1); |
| 16514 | stream->write((uint64_t*)&cgen_var_1151, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16515 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16516 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 16517 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16518 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16519 | } |
| 16520 | VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0; |
| 16521 | stream->read(&vkBindBufferMemory2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16522 | countingStream->clearPool(); |
| 16523 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16524 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16525 | mImpl->log("finish vkBindBufferMemory2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16526 | return vkBindBufferMemory2KHR_VkResult_return; |
| 16527 | } |
| 16528 | |
| 16529 | VkResult VkEncoder::vkBindImageMemory2KHR( |
| 16530 | VkDevice device, |
| 16531 | uint32_t bindInfoCount, |
| 16532 | const VkBindImageMemoryInfo* pBindInfos) |
| 16533 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16534 | mImpl->log("start vkBindImageMemory2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16535 | auto stream = mImpl->stream(); |
| 16536 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16537 | auto resources = mImpl->resources(); |
| 16538 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16539 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16540 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16541 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16542 | VkBindImageMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16543 | local_device = device; |
| 16544 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16545 | local_pBindInfos = nullptr; |
| 16546 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16547 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16548 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16549 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 16550 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16551 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 16552 | } |
| 16553 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16554 | if (local_pBindInfos) |
| 16555 | { |
| 16556 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 16557 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16558 | transform_tohost_VkBindImageMemoryInfo(mImpl->resources(), (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16559 | } |
| 16560 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16561 | countingStream->rewind(); |
| 16562 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16563 | uint64_t cgen_var_1152; |
| 16564 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1152, 1); |
| 16565 | countingStream->write((uint64_t*)&cgen_var_1152, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16566 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 16567 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 16568 | { |
| 16569 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16570 | } |
| 16571 | } |
| 16572 | uint32_t packetSize_vkBindImageMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16573 | countingStream->rewind(); |
| 16574 | uint32_t opcode_vkBindImageMemory2KHR = OP_vkBindImageMemory2KHR; |
| 16575 | stream->write(&opcode_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| 16576 | stream->write(&packetSize_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16577 | uint64_t cgen_var_1153; |
| 16578 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1153, 1); |
| 16579 | stream->write((uint64_t*)&cgen_var_1153, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16580 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16581 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 16582 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16583 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16584 | } |
| 16585 | VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0; |
| 16586 | stream->read(&vkBindImageMemory2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16587 | countingStream->clearPool(); |
| 16588 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16589 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16590 | mImpl->log("finish vkBindImageMemory2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16591 | return vkBindImageMemory2KHR_VkResult_return; |
| 16592 | } |
| 16593 | |
| 16594 | #endif |
| 16595 | #ifdef VK_KHR_maintenance3 |
| 16596 | void VkEncoder::vkGetDescriptorSetLayoutSupportKHR( |
| 16597 | VkDevice device, |
| 16598 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 16599 | VkDescriptorSetLayoutSupport* pSupport) |
| 16600 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16601 | mImpl->log("start vkGetDescriptorSetLayoutSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16602 | auto stream = mImpl->stream(); |
| 16603 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16604 | auto resources = mImpl->resources(); |
| 16605 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16606 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16607 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16608 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16609 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16610 | local_pCreateInfo = nullptr; |
| 16611 | if (pCreateInfo) |
| 16612 | { |
| 16613 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 16614 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 16615 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16616 | if (local_pCreateInfo) |
| 16617 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16618 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16619 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16620 | countingStream->rewind(); |
| 16621 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16622 | uint64_t cgen_var_1154; |
| 16623 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1154, 1); |
| 16624 | countingStream->write((uint64_t*)&cgen_var_1154, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16625 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16626 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 16627 | } |
| 16628 | uint32_t packetSize_vkGetDescriptorSetLayoutSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16629 | countingStream->rewind(); |
| 16630 | uint32_t opcode_vkGetDescriptorSetLayoutSupportKHR = OP_vkGetDescriptorSetLayoutSupportKHR; |
| 16631 | stream->write(&opcode_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| 16632 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16633 | uint64_t cgen_var_1155; |
| 16634 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1155, 1); |
| 16635 | stream->write((uint64_t*)&cgen_var_1155, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16636 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16637 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 16638 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16639 | if (pSupport) |
| 16640 | { |
| 16641 | transform_fromhost_VkDescriptorSetLayoutSupport(mImpl->resources(), (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 16642 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16643 | mImpl->log("finish vkGetDescriptorSetLayoutSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16644 | } |
| 16645 | |
| 16646 | #endif |
| 16647 | #ifdef VK_KHR_draw_indirect_count |
| 16648 | void VkEncoder::vkCmdDrawIndirectCountKHR( |
| 16649 | VkCommandBuffer commandBuffer, |
| 16650 | VkBuffer buffer, |
| 16651 | VkDeviceSize offset, |
| 16652 | VkBuffer countBuffer, |
| 16653 | VkDeviceSize countBufferOffset, |
| 16654 | uint32_t maxDrawCount, |
| 16655 | uint32_t stride) |
| 16656 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16657 | mImpl->log("start vkCmdDrawIndirectCountKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16658 | auto stream = mImpl->stream(); |
| 16659 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16660 | auto resources = mImpl->resources(); |
| 16661 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16662 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16663 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16664 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16665 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16666 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16667 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16668 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16669 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16670 | local_commandBuffer = commandBuffer; |
| 16671 | local_buffer = buffer; |
| 16672 | local_offset = offset; |
| 16673 | local_countBuffer = countBuffer; |
| 16674 | local_countBufferOffset = countBufferOffset; |
| 16675 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16676 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16677 | countingStream->rewind(); |
| 16678 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16679 | uint64_t cgen_var_1156; |
| 16680 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1156, 1); |
| 16681 | countingStream->write((uint64_t*)&cgen_var_1156, 1 * 8); |
| 16682 | uint64_t cgen_var_1157; |
| 16683 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1157, 1); |
| 16684 | countingStream->write((uint64_t*)&cgen_var_1157, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 16685 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16686 | uint64_t cgen_var_1158; |
| 16687 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1158, 1); |
| 16688 | countingStream->write((uint64_t*)&cgen_var_1158, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16689 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 16690 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 16691 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16692 | } |
| 16693 | uint32_t packetSize_vkCmdDrawIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16694 | countingStream->rewind(); |
| 16695 | uint32_t opcode_vkCmdDrawIndirectCountKHR = OP_vkCmdDrawIndirectCountKHR; |
| 16696 | stream->write(&opcode_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| 16697 | stream->write(&packetSize_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16698 | uint64_t cgen_var_1159; |
| 16699 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1159, 1); |
| 16700 | stream->write((uint64_t*)&cgen_var_1159, 1 * 8); |
| 16701 | uint64_t cgen_var_1160; |
| 16702 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1160, 1); |
| 16703 | stream->write((uint64_t*)&cgen_var_1160, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 16704 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16705 | uint64_t cgen_var_1161; |
| 16706 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1161, 1); |
| 16707 | stream->write((uint64_t*)&cgen_var_1161, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16708 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 16709 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 16710 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16711 | mImpl->log("finish vkCmdDrawIndirectCountKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16712 | } |
| 16713 | |
| 16714 | void VkEncoder::vkCmdDrawIndexedIndirectCountKHR( |
| 16715 | VkCommandBuffer commandBuffer, |
| 16716 | VkBuffer buffer, |
| 16717 | VkDeviceSize offset, |
| 16718 | VkBuffer countBuffer, |
| 16719 | VkDeviceSize countBufferOffset, |
| 16720 | uint32_t maxDrawCount, |
| 16721 | uint32_t stride) |
| 16722 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16723 | mImpl->log("start vkCmdDrawIndexedIndirectCountKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16724 | auto stream = mImpl->stream(); |
| 16725 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16726 | auto resources = mImpl->resources(); |
| 16727 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16728 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16729 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16730 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16731 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16732 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16733 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16734 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16735 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16736 | local_commandBuffer = commandBuffer; |
| 16737 | local_buffer = buffer; |
| 16738 | local_offset = offset; |
| 16739 | local_countBuffer = countBuffer; |
| 16740 | local_countBufferOffset = countBufferOffset; |
| 16741 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16742 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16743 | countingStream->rewind(); |
| 16744 | { |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16745 | uint64_t cgen_var_1162; |
| 16746 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1162, 1); |
| 16747 | countingStream->write((uint64_t*)&cgen_var_1162, 1 * 8); |
| 16748 | uint64_t cgen_var_1163; |
| 16749 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1163, 1); |
| 16750 | countingStream->write((uint64_t*)&cgen_var_1163, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 16751 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16752 | uint64_t cgen_var_1164; |
| 16753 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1164, 1); |
| 16754 | countingStream->write((uint64_t*)&cgen_var_1164, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16755 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 16756 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 16757 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16758 | } |
| 16759 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16760 | countingStream->rewind(); |
| 16761 | uint32_t opcode_vkCmdDrawIndexedIndirectCountKHR = OP_vkCmdDrawIndexedIndirectCountKHR; |
| 16762 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| 16763 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16764 | uint64_t cgen_var_1165; |
| 16765 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1165, 1); |
| 16766 | stream->write((uint64_t*)&cgen_var_1165, 1 * 8); |
| 16767 | uint64_t cgen_var_1166; |
| 16768 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1166, 1); |
| 16769 | stream->write((uint64_t*)&cgen_var_1166, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 16770 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 16771 | uint64_t cgen_var_1167; |
| 16772 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1167, 1); |
| 16773 | stream->write((uint64_t*)&cgen_var_1167, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16774 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 16775 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 16776 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16777 | mImpl->log("finish vkCmdDrawIndexedIndirectCountKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16778 | } |
| 16779 | |
| 16780 | #endif |
| 16781 | #ifdef VK_KHR_8bit_storage |
| 16782 | #endif |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16783 | #ifdef VK_ANDROID_native_buffer |
| 16784 | VkResult VkEncoder::vkGetSwapchainGrallocUsageANDROID( |
| 16785 | VkDevice device, |
| 16786 | VkFormat format, |
| 16787 | VkImageUsageFlags imageUsage, |
| 16788 | int* grallocUsage) |
| 16789 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16790 | mImpl->log("start vkGetSwapchainGrallocUsageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16791 | auto stream = mImpl->stream(); |
| 16792 | auto countingStream = mImpl->countingStream(); |
| 16793 | auto resources = mImpl->resources(); |
| 16794 | auto pool = mImpl->pool(); |
| 16795 | stream->setHandleMapping(resources->unwrapMapping()); |
| 16796 | VkDevice local_device; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16797 | VkFormat local_format; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16798 | VkImageUsageFlags local_imageUsage; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16799 | local_device = device; |
| 16800 | local_format = format; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16801 | local_imageUsage = imageUsage; |
| 16802 | countingStream->rewind(); |
| 16803 | { |
| 16804 | uint64_t cgen_var_1168; |
| 16805 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1168, 1); |
| 16806 | countingStream->write((uint64_t*)&cgen_var_1168, 1 * 8); |
| 16807 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 16808 | countingStream->write((VkImageUsageFlags*)&local_imageUsage, sizeof(VkImageUsageFlags)); |
| 16809 | countingStream->write((int*)grallocUsage, sizeof(int)); |
| 16810 | } |
| 16811 | uint32_t packetSize_vkGetSwapchainGrallocUsageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16812 | countingStream->rewind(); |
| 16813 | uint32_t opcode_vkGetSwapchainGrallocUsageANDROID = OP_vkGetSwapchainGrallocUsageANDROID; |
| 16814 | stream->write(&opcode_vkGetSwapchainGrallocUsageANDROID, sizeof(uint32_t)); |
| 16815 | stream->write(&packetSize_vkGetSwapchainGrallocUsageANDROID, sizeof(uint32_t)); |
| 16816 | uint64_t cgen_var_1169; |
| 16817 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1169, 1); |
| 16818 | stream->write((uint64_t*)&cgen_var_1169, 1 * 8); |
| 16819 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 16820 | stream->write((VkImageUsageFlags*)&local_imageUsage, sizeof(VkImageUsageFlags)); |
| 16821 | stream->write((int*)grallocUsage, sizeof(int)); |
| 16822 | stream->read((int*)grallocUsage, sizeof(int)); |
| 16823 | VkResult vkGetSwapchainGrallocUsageANDROID_VkResult_return = (VkResult)0; |
| 16824 | stream->read(&vkGetSwapchainGrallocUsageANDROID_VkResult_return, sizeof(VkResult)); |
| 16825 | countingStream->clearPool(); |
| 16826 | stream->clearPool(); |
| 16827 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16828 | mImpl->log("finish vkGetSwapchainGrallocUsageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16829 | return vkGetSwapchainGrallocUsageANDROID_VkResult_return; |
| 16830 | } |
| 16831 | |
| 16832 | VkResult VkEncoder::vkAcquireImageANDROID( |
| 16833 | VkDevice device, |
| 16834 | VkImage image, |
| 16835 | int nativeFenceFd, |
| 16836 | VkSemaphore semaphore, |
| 16837 | VkFence fence) |
| 16838 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16839 | mImpl->log("start vkAcquireImageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16840 | auto stream = mImpl->stream(); |
| 16841 | auto countingStream = mImpl->countingStream(); |
| 16842 | auto resources = mImpl->resources(); |
| 16843 | auto pool = mImpl->pool(); |
| 16844 | stream->setHandleMapping(resources->unwrapMapping()); |
| 16845 | VkDevice local_device; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16846 | VkImage local_image; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16847 | int local_nativeFenceFd; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16848 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16849 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16850 | local_device = device; |
| 16851 | local_image = image; |
| 16852 | local_nativeFenceFd = nativeFenceFd; |
| 16853 | local_semaphore = semaphore; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16854 | local_fence = fence; |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 16855 | mImpl->resources()->unwrap_vkAcquireImageANDROID_nativeFenceFd(nativeFenceFd, &local_nativeFenceFd); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16856 | countingStream->rewind(); |
| 16857 | { |
| 16858 | uint64_t cgen_var_1170; |
| 16859 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1170, 1); |
| 16860 | countingStream->write((uint64_t*)&cgen_var_1170, 1 * 8); |
| 16861 | uint64_t cgen_var_1171; |
| 16862 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1171, 1); |
| 16863 | countingStream->write((uint64_t*)&cgen_var_1171, 1 * 8); |
| 16864 | countingStream->write((int*)&local_nativeFenceFd, sizeof(int)); |
| 16865 | uint64_t cgen_var_1172; |
| 16866 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_1172, 1); |
| 16867 | countingStream->write((uint64_t*)&cgen_var_1172, 1 * 8); |
| 16868 | uint64_t cgen_var_1173; |
| 16869 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1173, 1); |
| 16870 | countingStream->write((uint64_t*)&cgen_var_1173, 1 * 8); |
| 16871 | } |
| 16872 | uint32_t packetSize_vkAcquireImageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16873 | countingStream->rewind(); |
| 16874 | uint32_t opcode_vkAcquireImageANDROID = OP_vkAcquireImageANDROID; |
| 16875 | stream->write(&opcode_vkAcquireImageANDROID, sizeof(uint32_t)); |
| 16876 | stream->write(&packetSize_vkAcquireImageANDROID, sizeof(uint32_t)); |
| 16877 | uint64_t cgen_var_1174; |
| 16878 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1174, 1); |
| 16879 | stream->write((uint64_t*)&cgen_var_1174, 1 * 8); |
| 16880 | uint64_t cgen_var_1175; |
| 16881 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1175, 1); |
| 16882 | stream->write((uint64_t*)&cgen_var_1175, 1 * 8); |
| 16883 | stream->write((int*)&local_nativeFenceFd, sizeof(int)); |
| 16884 | uint64_t cgen_var_1176; |
| 16885 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_1176, 1); |
| 16886 | stream->write((uint64_t*)&cgen_var_1176, 1 * 8); |
| 16887 | uint64_t cgen_var_1177; |
| 16888 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1177, 1); |
| 16889 | stream->write((uint64_t*)&cgen_var_1177, 1 * 8); |
| 16890 | VkResult vkAcquireImageANDROID_VkResult_return = (VkResult)0; |
| 16891 | stream->read(&vkAcquireImageANDROID_VkResult_return, sizeof(VkResult)); |
| 16892 | countingStream->clearPool(); |
| 16893 | stream->clearPool(); |
| 16894 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16895 | mImpl->log("finish vkAcquireImageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16896 | return vkAcquireImageANDROID_VkResult_return; |
| 16897 | } |
| 16898 | |
| 16899 | VkResult VkEncoder::vkQueueSignalReleaseImageANDROID( |
| 16900 | VkQueue queue, |
| 16901 | uint32_t waitSemaphoreCount, |
| 16902 | const VkSemaphore* pWaitSemaphores, |
| 16903 | VkImage image, |
| 16904 | int* pNativeFenceFd) |
| 16905 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16906 | mImpl->log("start vkQueueSignalReleaseImageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16907 | auto stream = mImpl->stream(); |
| 16908 | auto countingStream = mImpl->countingStream(); |
| 16909 | auto resources = mImpl->resources(); |
| 16910 | auto pool = mImpl->pool(); |
| 16911 | stream->setHandleMapping(resources->unwrapMapping()); |
| 16912 | VkQueue local_queue; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16913 | uint32_t local_waitSemaphoreCount; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16914 | VkSemaphore* local_pWaitSemaphores; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16915 | VkImage local_image; |
| 16916 | local_queue = queue; |
| 16917 | local_waitSemaphoreCount = waitSemaphoreCount; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16918 | local_pWaitSemaphores = nullptr; |
| 16919 | if (pWaitSemaphores) |
| 16920 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 16921 | local_pWaitSemaphores = (VkSemaphore*)pool->dupArray(pWaitSemaphores, ((waitSemaphoreCount)) * sizeof(const VkSemaphore)); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16922 | } |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16923 | local_image = image; |
| 16924 | countingStream->rewind(); |
| 16925 | { |
| 16926 | uint64_t cgen_var_1178; |
| 16927 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1178, 1); |
| 16928 | countingStream->write((uint64_t*)&cgen_var_1178, 1 * 8); |
| 16929 | countingStream->write((uint32_t*)&local_waitSemaphoreCount, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 16930 | // WARNING PTR CHECK |
| 16931 | uint64_t cgen_var_1179 = (uint64_t)(uintptr_t)local_pWaitSemaphores; |
| 16932 | countingStream->putBe64(cgen_var_1179); |
| 16933 | if (local_pWaitSemaphores) |
| 16934 | { |
| 16935 | if (((waitSemaphoreCount))) |
| 16936 | { |
| 16937 | uint64_t* cgen_var_1180; |
| 16938 | countingStream->alloc((void**)&cgen_var_1180, ((waitSemaphoreCount)) * 8); |
| 16939 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(local_pWaitSemaphores, cgen_var_1180, ((waitSemaphoreCount))); |
| 16940 | countingStream->write((uint64_t*)cgen_var_1180, ((waitSemaphoreCount)) * 8); |
| 16941 | } |
| 16942 | } |
| 16943 | uint64_t cgen_var_1181; |
| 16944 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1181, 1); |
| 16945 | countingStream->write((uint64_t*)&cgen_var_1181, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16946 | countingStream->write((int*)pNativeFenceFd, sizeof(int)); |
| 16947 | } |
| 16948 | uint32_t packetSize_vkQueueSignalReleaseImageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16949 | countingStream->rewind(); |
| 16950 | uint32_t opcode_vkQueueSignalReleaseImageANDROID = OP_vkQueueSignalReleaseImageANDROID; |
| 16951 | stream->write(&opcode_vkQueueSignalReleaseImageANDROID, sizeof(uint32_t)); |
| 16952 | stream->write(&packetSize_vkQueueSignalReleaseImageANDROID, sizeof(uint32_t)); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16953 | uint64_t cgen_var_1182; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 16954 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1182, 1); |
| 16955 | stream->write((uint64_t*)&cgen_var_1182, 1 * 8); |
| 16956 | stream->write((uint32_t*)&local_waitSemaphoreCount, sizeof(uint32_t)); |
| 16957 | // WARNING PTR CHECK |
| 16958 | uint64_t cgen_var_1183 = (uint64_t)(uintptr_t)local_pWaitSemaphores; |
| 16959 | stream->putBe64(cgen_var_1183); |
| 16960 | if (local_pWaitSemaphores) |
| 16961 | { |
| 16962 | if (((waitSemaphoreCount))) |
| 16963 | { |
| 16964 | uint64_t* cgen_var_1184; |
| 16965 | stream->alloc((void**)&cgen_var_1184, ((waitSemaphoreCount)) * 8); |
| 16966 | stream->handleMapping()->mapHandles_VkSemaphore_u64(local_pWaitSemaphores, cgen_var_1184, ((waitSemaphoreCount))); |
| 16967 | stream->write((uint64_t*)cgen_var_1184, ((waitSemaphoreCount)) * 8); |
| 16968 | } |
| 16969 | } |
| 16970 | uint64_t cgen_var_1185; |
| 16971 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1185, 1); |
| 16972 | stream->write((uint64_t*)&cgen_var_1185, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16973 | stream->write((int*)pNativeFenceFd, sizeof(int)); |
| 16974 | stream->read((int*)pNativeFenceFd, sizeof(int)); |
| 16975 | VkResult vkQueueSignalReleaseImageANDROID_VkResult_return = (VkResult)0; |
| 16976 | stream->read(&vkQueueSignalReleaseImageANDROID_VkResult_return, sizeof(VkResult)); |
| 16977 | countingStream->clearPool(); |
| 16978 | stream->clearPool(); |
| 16979 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16980 | mImpl->log("finish vkQueueSignalReleaseImageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 16981 | return vkQueueSignalReleaseImageANDROID_VkResult_return; |
| 16982 | } |
| 16983 | |
| 16984 | #endif |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16985 | #ifdef VK_EXT_debug_report |
| 16986 | VkResult VkEncoder::vkCreateDebugReportCallbackEXT( |
| 16987 | VkInstance instance, |
| 16988 | const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, |
| 16989 | const VkAllocationCallbacks* pAllocator, |
| 16990 | VkDebugReportCallbackEXT* pCallback) |
| 16991 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16992 | mImpl->log("start vkCreateDebugReportCallbackEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16993 | auto stream = mImpl->stream(); |
| 16994 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16995 | auto resources = mImpl->resources(); |
| 16996 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16997 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16998 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16999 | VkDebugReportCallbackCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17000 | VkAllocationCallbacks* local_pAllocator; |
| 17001 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17002 | local_pCreateInfo = nullptr; |
| 17003 | if (pCreateInfo) |
| 17004 | { |
| 17005 | local_pCreateInfo = (VkDebugReportCallbackCreateInfoEXT*)pool->alloc(sizeof(const VkDebugReportCallbackCreateInfoEXT)); |
| 17006 | deepcopy_VkDebugReportCallbackCreateInfoEXT(pool, pCreateInfo, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| 17007 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17008 | local_pAllocator = nullptr; |
| 17009 | if (pAllocator) |
| 17010 | { |
| 17011 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17012 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17013 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17014 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17015 | if (local_pCreateInfo) |
| 17016 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17017 | transform_tohost_VkDebugReportCallbackCreateInfoEXT(mImpl->resources(), (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17018 | } |
| 17019 | if (local_pAllocator) |
| 17020 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17021 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17022 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17023 | countingStream->rewind(); |
| 17024 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17025 | uint64_t cgen_var_1186; |
| 17026 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1186, 1); |
| 17027 | countingStream->write((uint64_t*)&cgen_var_1186, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17028 | marshal_VkDebugReportCallbackCreateInfoEXT(countingStream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17029 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17030 | uint64_t cgen_var_1187 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17031 | countingStream->putBe64(cgen_var_1187); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17032 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17033 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17034 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17035 | } |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17036 | uint64_t cgen_var_1188; |
| 17037 | countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1188, 1); |
| 17038 | countingStream->write((uint64_t*)&cgen_var_1188, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17039 | } |
| 17040 | uint32_t packetSize_vkCreateDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17041 | countingStream->rewind(); |
| 17042 | uint32_t opcode_vkCreateDebugReportCallbackEXT = OP_vkCreateDebugReportCallbackEXT; |
| 17043 | stream->write(&opcode_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| 17044 | stream->write(&packetSize_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17045 | uint64_t cgen_var_1189; |
| 17046 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1189, 1); |
| 17047 | stream->write((uint64_t*)&cgen_var_1189, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17048 | marshal_VkDebugReportCallbackCreateInfoEXT(stream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17049 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17050 | uint64_t cgen_var_1190 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17051 | stream->putBe64(cgen_var_1190); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17052 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17053 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17054 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17055 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17056 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17057 | uint64_t cgen_var_1191; |
| 17058 | stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1191, 1); |
| 17059 | stream->write((uint64_t*)&cgen_var_1191, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17060 | stream->setHandleMapping(resources->unwrapMapping()); |
| 17061 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17062 | uint64_t cgen_var_1192; |
| 17063 | stream->read((uint64_t*)&cgen_var_1192, 8); |
| 17064 | stream->handleMapping()->mapHandles_u64_VkDebugReportCallbackEXT(&cgen_var_1192, (VkDebugReportCallbackEXT*)pCallback, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17065 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17066 | VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0; |
| 17067 | stream->read(&vkCreateDebugReportCallbackEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17068 | countingStream->clearPool(); |
| 17069 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17070 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17071 | mImpl->log("finish vkCreateDebugReportCallbackEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17072 | return vkCreateDebugReportCallbackEXT_VkResult_return; |
| 17073 | } |
| 17074 | |
| 17075 | void VkEncoder::vkDestroyDebugReportCallbackEXT( |
| 17076 | VkInstance instance, |
| 17077 | VkDebugReportCallbackEXT callback, |
| 17078 | const VkAllocationCallbacks* pAllocator) |
| 17079 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17080 | mImpl->log("start vkDestroyDebugReportCallbackEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17081 | auto stream = mImpl->stream(); |
| 17082 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17083 | auto resources = mImpl->resources(); |
| 17084 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17085 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17086 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17087 | VkDebugReportCallbackEXT local_callback; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17088 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17089 | local_instance = instance; |
| 17090 | local_callback = callback; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17091 | local_pAllocator = nullptr; |
| 17092 | if (pAllocator) |
| 17093 | { |
| 17094 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17095 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17096 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17097 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17098 | if (local_pAllocator) |
| 17099 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17100 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17101 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17102 | countingStream->rewind(); |
| 17103 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17104 | uint64_t cgen_var_1193; |
| 17105 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1193, 1); |
| 17106 | countingStream->write((uint64_t*)&cgen_var_1193, 1 * 8); |
| 17107 | uint64_t cgen_var_1194; |
| 17108 | countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1194, 1); |
| 17109 | countingStream->write((uint64_t*)&cgen_var_1194, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17110 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17111 | uint64_t cgen_var_1195 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17112 | countingStream->putBe64(cgen_var_1195); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17113 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17114 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17115 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17116 | } |
| 17117 | } |
| 17118 | uint32_t packetSize_vkDestroyDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17119 | countingStream->rewind(); |
| 17120 | uint32_t opcode_vkDestroyDebugReportCallbackEXT = OP_vkDestroyDebugReportCallbackEXT; |
| 17121 | stream->write(&opcode_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| 17122 | stream->write(&packetSize_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17123 | uint64_t cgen_var_1196; |
| 17124 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1196, 1); |
| 17125 | stream->write((uint64_t*)&cgen_var_1196, 1 * 8); |
| 17126 | uint64_t cgen_var_1197; |
| 17127 | stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1197, 1); |
| 17128 | stream->write((uint64_t*)&cgen_var_1197, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17129 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17130 | uint64_t cgen_var_1198 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17131 | stream->putBe64(cgen_var_1198); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17132 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17133 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17134 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17135 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17136 | resources->destroyMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)&callback); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17137 | mImpl->log("finish vkDestroyDebugReportCallbackEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17138 | } |
| 17139 | |
| 17140 | void VkEncoder::vkDebugReportMessageEXT( |
| 17141 | VkInstance instance, |
| 17142 | VkDebugReportFlagsEXT flags, |
| 17143 | VkDebugReportObjectTypeEXT objectType, |
| 17144 | uint64_t object, |
| 17145 | size_t location, |
| 17146 | int32_t messageCode, |
| 17147 | const char* pLayerPrefix, |
| 17148 | const char* pMessage) |
| 17149 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17150 | mImpl->log("start vkDebugReportMessageEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17151 | auto stream = mImpl->stream(); |
| 17152 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17153 | auto resources = mImpl->resources(); |
| 17154 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17155 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17156 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17157 | VkDebugReportFlagsEXT local_flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17158 | VkDebugReportObjectTypeEXT local_objectType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17159 | uint64_t local_object; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17160 | size_t local_location; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17161 | int32_t local_messageCode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17162 | char* local_pLayerPrefix; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17163 | char* local_pMessage; |
| 17164 | local_instance = instance; |
| 17165 | local_flags = flags; |
| 17166 | local_objectType = objectType; |
| 17167 | local_object = object; |
| 17168 | local_location = location; |
| 17169 | local_messageCode = messageCode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17170 | local_pLayerPrefix = nullptr; |
| 17171 | if (pLayerPrefix) |
| 17172 | { |
| 17173 | local_pLayerPrefix = pool->strDup(pLayerPrefix); |
| 17174 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17175 | local_pMessage = nullptr; |
| 17176 | if (pMessage) |
| 17177 | { |
| 17178 | local_pMessage = pool->strDup(pMessage); |
| 17179 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17180 | countingStream->rewind(); |
| 17181 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17182 | uint64_t cgen_var_1199; |
| 17183 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1199, 1); |
| 17184 | countingStream->write((uint64_t*)&cgen_var_1199, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17185 | countingStream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 17186 | countingStream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 17187 | countingStream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17188 | uint64_t cgen_var_1200 = (uint64_t)local_location; |
| 17189 | countingStream->putBe64(cgen_var_1200); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17190 | countingStream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 17191 | countingStream->putString(local_pLayerPrefix); |
| 17192 | countingStream->putString(local_pMessage); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17193 | } |
| 17194 | uint32_t packetSize_vkDebugReportMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17195 | countingStream->rewind(); |
| 17196 | uint32_t opcode_vkDebugReportMessageEXT = OP_vkDebugReportMessageEXT; |
| 17197 | stream->write(&opcode_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| 17198 | stream->write(&packetSize_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17199 | uint64_t cgen_var_1201; |
| 17200 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1201, 1); |
| 17201 | stream->write((uint64_t*)&cgen_var_1201, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17202 | stream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 17203 | stream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 17204 | stream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17205 | uint64_t cgen_var_1202 = (uint64_t)local_location; |
| 17206 | stream->putBe64(cgen_var_1202); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17207 | stream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 17208 | stream->putString(local_pLayerPrefix); |
| 17209 | stream->putString(local_pMessage); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17210 | mImpl->log("finish vkDebugReportMessageEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17211 | } |
| 17212 | |
| 17213 | #endif |
| 17214 | #ifdef VK_NV_glsl_shader |
| 17215 | #endif |
| 17216 | #ifdef VK_EXT_depth_range_unrestricted |
| 17217 | #endif |
| 17218 | #ifdef VK_IMG_filter_cubic |
| 17219 | #endif |
| 17220 | #ifdef VK_AMD_rasterization_order |
| 17221 | #endif |
| 17222 | #ifdef VK_AMD_shader_trinary_minmax |
| 17223 | #endif |
| 17224 | #ifdef VK_AMD_shader_explicit_vertex_parameter |
| 17225 | #endif |
| 17226 | #ifdef VK_EXT_debug_marker |
| 17227 | VkResult VkEncoder::vkDebugMarkerSetObjectTagEXT( |
| 17228 | VkDevice device, |
| 17229 | const VkDebugMarkerObjectTagInfoEXT* pTagInfo) |
| 17230 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17231 | mImpl->log("start vkDebugMarkerSetObjectTagEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17232 | auto stream = mImpl->stream(); |
| 17233 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17234 | auto resources = mImpl->resources(); |
| 17235 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17236 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17237 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17238 | VkDebugMarkerObjectTagInfoEXT* local_pTagInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17239 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17240 | local_pTagInfo = nullptr; |
| 17241 | if (pTagInfo) |
| 17242 | { |
| 17243 | local_pTagInfo = (VkDebugMarkerObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectTagInfoEXT)); |
| 17244 | deepcopy_VkDebugMarkerObjectTagInfoEXT(pool, pTagInfo, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| 17245 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17246 | if (local_pTagInfo) |
| 17247 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17248 | transform_tohost_VkDebugMarkerObjectTagInfoEXT(mImpl->resources(), (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17249 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17250 | countingStream->rewind(); |
| 17251 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17252 | uint64_t cgen_var_1203; |
| 17253 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1203, 1); |
| 17254 | countingStream->write((uint64_t*)&cgen_var_1203, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17255 | marshal_VkDebugMarkerObjectTagInfoEXT(countingStream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17256 | } |
| 17257 | uint32_t packetSize_vkDebugMarkerSetObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17258 | countingStream->rewind(); |
| 17259 | uint32_t opcode_vkDebugMarkerSetObjectTagEXT = OP_vkDebugMarkerSetObjectTagEXT; |
| 17260 | stream->write(&opcode_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| 17261 | stream->write(&packetSize_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17262 | uint64_t cgen_var_1204; |
| 17263 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1204, 1); |
| 17264 | stream->write((uint64_t*)&cgen_var_1204, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17265 | marshal_VkDebugMarkerObjectTagInfoEXT(stream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17266 | VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0; |
| 17267 | stream->read(&vkDebugMarkerSetObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17268 | countingStream->clearPool(); |
| 17269 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17270 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17271 | mImpl->log("finish vkDebugMarkerSetObjectTagEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17272 | return vkDebugMarkerSetObjectTagEXT_VkResult_return; |
| 17273 | } |
| 17274 | |
| 17275 | VkResult VkEncoder::vkDebugMarkerSetObjectNameEXT( |
| 17276 | VkDevice device, |
| 17277 | const VkDebugMarkerObjectNameInfoEXT* pNameInfo) |
| 17278 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17279 | mImpl->log("start vkDebugMarkerSetObjectNameEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17280 | auto stream = mImpl->stream(); |
| 17281 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17282 | auto resources = mImpl->resources(); |
| 17283 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17284 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17285 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17286 | VkDebugMarkerObjectNameInfoEXT* local_pNameInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17287 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17288 | local_pNameInfo = nullptr; |
| 17289 | if (pNameInfo) |
| 17290 | { |
| 17291 | local_pNameInfo = (VkDebugMarkerObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectNameInfoEXT)); |
| 17292 | deepcopy_VkDebugMarkerObjectNameInfoEXT(pool, pNameInfo, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| 17293 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17294 | if (local_pNameInfo) |
| 17295 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17296 | transform_tohost_VkDebugMarkerObjectNameInfoEXT(mImpl->resources(), (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17297 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17298 | countingStream->rewind(); |
| 17299 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17300 | uint64_t cgen_var_1205; |
| 17301 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1205, 1); |
| 17302 | countingStream->write((uint64_t*)&cgen_var_1205, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17303 | marshal_VkDebugMarkerObjectNameInfoEXT(countingStream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17304 | } |
| 17305 | uint32_t packetSize_vkDebugMarkerSetObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17306 | countingStream->rewind(); |
| 17307 | uint32_t opcode_vkDebugMarkerSetObjectNameEXT = OP_vkDebugMarkerSetObjectNameEXT; |
| 17308 | stream->write(&opcode_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| 17309 | stream->write(&packetSize_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17310 | uint64_t cgen_var_1206; |
| 17311 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1206, 1); |
| 17312 | stream->write((uint64_t*)&cgen_var_1206, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17313 | marshal_VkDebugMarkerObjectNameInfoEXT(stream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17314 | VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0; |
| 17315 | stream->read(&vkDebugMarkerSetObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17316 | countingStream->clearPool(); |
| 17317 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17318 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17319 | mImpl->log("finish vkDebugMarkerSetObjectNameEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17320 | return vkDebugMarkerSetObjectNameEXT_VkResult_return; |
| 17321 | } |
| 17322 | |
| 17323 | void VkEncoder::vkCmdDebugMarkerBeginEXT( |
| 17324 | VkCommandBuffer commandBuffer, |
| 17325 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 17326 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17327 | mImpl->log("start vkCmdDebugMarkerBeginEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17328 | auto stream = mImpl->stream(); |
| 17329 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17330 | auto resources = mImpl->resources(); |
| 17331 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17332 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17333 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17334 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17335 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17336 | local_pMarkerInfo = nullptr; |
| 17337 | if (pMarkerInfo) |
| 17338 | { |
| 17339 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 17340 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 17341 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17342 | if (local_pMarkerInfo) |
| 17343 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17344 | transform_tohost_VkDebugMarkerMarkerInfoEXT(mImpl->resources(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17345 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17346 | countingStream->rewind(); |
| 17347 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17348 | uint64_t cgen_var_1207; |
| 17349 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1207, 1); |
| 17350 | countingStream->write((uint64_t*)&cgen_var_1207, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17351 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17352 | } |
| 17353 | uint32_t packetSize_vkCmdDebugMarkerBeginEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17354 | countingStream->rewind(); |
| 17355 | uint32_t opcode_vkCmdDebugMarkerBeginEXT = OP_vkCmdDebugMarkerBeginEXT; |
| 17356 | stream->write(&opcode_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| 17357 | stream->write(&packetSize_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17358 | uint64_t cgen_var_1208; |
| 17359 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1208, 1); |
| 17360 | stream->write((uint64_t*)&cgen_var_1208, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17361 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17362 | mImpl->log("finish vkCmdDebugMarkerBeginEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17363 | } |
| 17364 | |
| 17365 | void VkEncoder::vkCmdDebugMarkerEndEXT( |
| 17366 | VkCommandBuffer commandBuffer) |
| 17367 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17368 | mImpl->log("start vkCmdDebugMarkerEndEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17369 | auto stream = mImpl->stream(); |
| 17370 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17371 | auto resources = mImpl->resources(); |
| 17372 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17373 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17374 | VkCommandBuffer local_commandBuffer; |
| 17375 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17376 | countingStream->rewind(); |
| 17377 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17378 | uint64_t cgen_var_1209; |
| 17379 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1209, 1); |
| 17380 | countingStream->write((uint64_t*)&cgen_var_1209, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17381 | } |
| 17382 | uint32_t packetSize_vkCmdDebugMarkerEndEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17383 | countingStream->rewind(); |
| 17384 | uint32_t opcode_vkCmdDebugMarkerEndEXT = OP_vkCmdDebugMarkerEndEXT; |
| 17385 | stream->write(&opcode_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| 17386 | stream->write(&packetSize_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17387 | uint64_t cgen_var_1210; |
| 17388 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1210, 1); |
| 17389 | stream->write((uint64_t*)&cgen_var_1210, 1 * 8); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17390 | mImpl->log("finish vkCmdDebugMarkerEndEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17391 | } |
| 17392 | |
| 17393 | void VkEncoder::vkCmdDebugMarkerInsertEXT( |
| 17394 | VkCommandBuffer commandBuffer, |
| 17395 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 17396 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17397 | mImpl->log("start vkCmdDebugMarkerInsertEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17398 | auto stream = mImpl->stream(); |
| 17399 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17400 | auto resources = mImpl->resources(); |
| 17401 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17402 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17403 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17404 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17405 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17406 | local_pMarkerInfo = nullptr; |
| 17407 | if (pMarkerInfo) |
| 17408 | { |
| 17409 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 17410 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 17411 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17412 | if (local_pMarkerInfo) |
| 17413 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17414 | transform_tohost_VkDebugMarkerMarkerInfoEXT(mImpl->resources(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17415 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17416 | countingStream->rewind(); |
| 17417 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17418 | uint64_t cgen_var_1211; |
| 17419 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1211, 1); |
| 17420 | countingStream->write((uint64_t*)&cgen_var_1211, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17421 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17422 | } |
| 17423 | uint32_t packetSize_vkCmdDebugMarkerInsertEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17424 | countingStream->rewind(); |
| 17425 | uint32_t opcode_vkCmdDebugMarkerInsertEXT = OP_vkCmdDebugMarkerInsertEXT; |
| 17426 | stream->write(&opcode_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| 17427 | stream->write(&packetSize_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17428 | uint64_t cgen_var_1212; |
| 17429 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1212, 1); |
| 17430 | stream->write((uint64_t*)&cgen_var_1212, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17431 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17432 | mImpl->log("finish vkCmdDebugMarkerInsertEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17433 | } |
| 17434 | |
| 17435 | #endif |
| 17436 | #ifdef VK_AMD_gcn_shader |
| 17437 | #endif |
| 17438 | #ifdef VK_NV_dedicated_allocation |
| 17439 | #endif |
| 17440 | #ifdef VK_AMD_draw_indirect_count |
| 17441 | void VkEncoder::vkCmdDrawIndirectCountAMD( |
| 17442 | VkCommandBuffer commandBuffer, |
| 17443 | VkBuffer buffer, |
| 17444 | VkDeviceSize offset, |
| 17445 | VkBuffer countBuffer, |
| 17446 | VkDeviceSize countBufferOffset, |
| 17447 | uint32_t maxDrawCount, |
| 17448 | uint32_t stride) |
| 17449 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17450 | mImpl->log("start vkCmdDrawIndirectCountAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17451 | auto stream = mImpl->stream(); |
| 17452 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17453 | auto resources = mImpl->resources(); |
| 17454 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17455 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17456 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17457 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17458 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17459 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17460 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17461 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17462 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17463 | local_commandBuffer = commandBuffer; |
| 17464 | local_buffer = buffer; |
| 17465 | local_offset = offset; |
| 17466 | local_countBuffer = countBuffer; |
| 17467 | local_countBufferOffset = countBufferOffset; |
| 17468 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17469 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17470 | countingStream->rewind(); |
| 17471 | { |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17472 | uint64_t cgen_var_1213; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17473 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1213, 1); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17474 | countingStream->write((uint64_t*)&cgen_var_1213, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17475 | uint64_t cgen_var_1214; |
| 17476 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1214, 1); |
| 17477 | countingStream->write((uint64_t*)&cgen_var_1214, 1 * 8); |
| 17478 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 17479 | uint64_t cgen_var_1215; |
| 17480 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1215, 1); |
| 17481 | countingStream->write((uint64_t*)&cgen_var_1215, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17482 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17483 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17484 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17485 | } |
| 17486 | uint32_t packetSize_vkCmdDrawIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17487 | countingStream->rewind(); |
| 17488 | uint32_t opcode_vkCmdDrawIndirectCountAMD = OP_vkCmdDrawIndirectCountAMD; |
| 17489 | stream->write(&opcode_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| 17490 | stream->write(&packetSize_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17491 | uint64_t cgen_var_1216; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17492 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1216, 1); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17493 | stream->write((uint64_t*)&cgen_var_1216, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17494 | uint64_t cgen_var_1217; |
| 17495 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1217, 1); |
| 17496 | stream->write((uint64_t*)&cgen_var_1217, 1 * 8); |
| 17497 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 17498 | uint64_t cgen_var_1218; |
| 17499 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1218, 1); |
| 17500 | stream->write((uint64_t*)&cgen_var_1218, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17501 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17502 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17503 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17504 | mImpl->log("finish vkCmdDrawIndirectCountAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17505 | } |
| 17506 | |
| 17507 | void VkEncoder::vkCmdDrawIndexedIndirectCountAMD( |
| 17508 | VkCommandBuffer commandBuffer, |
| 17509 | VkBuffer buffer, |
| 17510 | VkDeviceSize offset, |
| 17511 | VkBuffer countBuffer, |
| 17512 | VkDeviceSize countBufferOffset, |
| 17513 | uint32_t maxDrawCount, |
| 17514 | uint32_t stride) |
| 17515 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17516 | mImpl->log("start vkCmdDrawIndexedIndirectCountAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17517 | auto stream = mImpl->stream(); |
| 17518 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17519 | auto resources = mImpl->resources(); |
| 17520 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17521 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17522 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17523 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17524 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17525 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17526 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17527 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17528 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17529 | local_commandBuffer = commandBuffer; |
| 17530 | local_buffer = buffer; |
| 17531 | local_offset = offset; |
| 17532 | local_countBuffer = countBuffer; |
| 17533 | local_countBufferOffset = countBufferOffset; |
| 17534 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17535 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17536 | countingStream->rewind(); |
| 17537 | { |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17538 | uint64_t cgen_var_1219; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17539 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1219, 1); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17540 | countingStream->write((uint64_t*)&cgen_var_1219, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17541 | uint64_t cgen_var_1220; |
| 17542 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1220, 1); |
| 17543 | countingStream->write((uint64_t*)&cgen_var_1220, 1 * 8); |
| 17544 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 17545 | uint64_t cgen_var_1221; |
| 17546 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1221, 1); |
| 17547 | countingStream->write((uint64_t*)&cgen_var_1221, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17548 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17549 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17550 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17551 | } |
| 17552 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17553 | countingStream->rewind(); |
| 17554 | uint32_t opcode_vkCmdDrawIndexedIndirectCountAMD = OP_vkCmdDrawIndexedIndirectCountAMD; |
| 17555 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| 17556 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17557 | uint64_t cgen_var_1222; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17558 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1222, 1); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17559 | stream->write((uint64_t*)&cgen_var_1222, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17560 | uint64_t cgen_var_1223; |
| 17561 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1223, 1); |
| 17562 | stream->write((uint64_t*)&cgen_var_1223, 1 * 8); |
| 17563 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 17564 | uint64_t cgen_var_1224; |
| 17565 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1224, 1); |
| 17566 | stream->write((uint64_t*)&cgen_var_1224, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17567 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17568 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17569 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17570 | mImpl->log("finish vkCmdDrawIndexedIndirectCountAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17571 | } |
| 17572 | |
| 17573 | #endif |
| 17574 | #ifdef VK_AMD_negative_viewport_height |
| 17575 | #endif |
| 17576 | #ifdef VK_AMD_gpu_shader_half_float |
| 17577 | #endif |
| 17578 | #ifdef VK_AMD_shader_ballot |
| 17579 | #endif |
| 17580 | #ifdef VK_AMD_texture_gather_bias_lod |
| 17581 | #endif |
| 17582 | #ifdef VK_AMD_shader_info |
| 17583 | VkResult VkEncoder::vkGetShaderInfoAMD( |
| 17584 | VkDevice device, |
| 17585 | VkPipeline pipeline, |
| 17586 | VkShaderStageFlagBits shaderStage, |
| 17587 | VkShaderInfoTypeAMD infoType, |
| 17588 | size_t* pInfoSize, |
| 17589 | void* pInfo) |
| 17590 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17591 | mImpl->log("start vkGetShaderInfoAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17592 | auto stream = mImpl->stream(); |
| 17593 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17594 | auto resources = mImpl->resources(); |
| 17595 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17596 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17597 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17598 | VkPipeline local_pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17599 | VkShaderStageFlagBits local_shaderStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17600 | VkShaderInfoTypeAMD local_infoType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17601 | local_device = device; |
| 17602 | local_pipeline = pipeline; |
| 17603 | local_shaderStage = shaderStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17604 | local_infoType = infoType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17605 | countingStream->rewind(); |
| 17606 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17607 | uint64_t cgen_var_1225; |
| 17608 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1225, 1); |
| 17609 | countingStream->write((uint64_t*)&cgen_var_1225, 1 * 8); |
| 17610 | uint64_t cgen_var_1226; |
| 17611 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1226, 1); |
| 17612 | countingStream->write((uint64_t*)&cgen_var_1226, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17613 | countingStream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 17614 | countingStream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17615 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17616 | uint64_t cgen_var_1227 = (uint64_t)(uintptr_t)pInfoSize; |
| 17617 | countingStream->putBe64(cgen_var_1227); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17618 | if (pInfoSize) |
| 17619 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17620 | uint64_t cgen_var_1228 = (uint64_t)(*pInfoSize); |
| 17621 | countingStream->putBe64(cgen_var_1228); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17622 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17623 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17624 | uint64_t cgen_var_1229 = (uint64_t)(uintptr_t)pInfo; |
| 17625 | countingStream->putBe64(cgen_var_1229); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17626 | if (pInfo) |
| 17627 | { |
| 17628 | countingStream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 17629 | } |
| 17630 | } |
| 17631 | uint32_t packetSize_vkGetShaderInfoAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17632 | countingStream->rewind(); |
| 17633 | uint32_t opcode_vkGetShaderInfoAMD = OP_vkGetShaderInfoAMD; |
| 17634 | stream->write(&opcode_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| 17635 | stream->write(&packetSize_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17636 | uint64_t cgen_var_1230; |
| 17637 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1230, 1); |
| 17638 | stream->write((uint64_t*)&cgen_var_1230, 1 * 8); |
| 17639 | uint64_t cgen_var_1231; |
| 17640 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1231, 1); |
| 17641 | stream->write((uint64_t*)&cgen_var_1231, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17642 | stream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 17643 | stream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17644 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17645 | uint64_t cgen_var_1232 = (uint64_t)(uintptr_t)pInfoSize; |
| 17646 | stream->putBe64(cgen_var_1232); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17647 | if (pInfoSize) |
| 17648 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17649 | uint64_t cgen_var_1233 = (uint64_t)(*pInfoSize); |
| 17650 | stream->putBe64(cgen_var_1233); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17651 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17652 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17653 | uint64_t cgen_var_1234 = (uint64_t)(uintptr_t)pInfo; |
| 17654 | stream->putBe64(cgen_var_1234); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17655 | if (pInfo) |
| 17656 | { |
| 17657 | stream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 17658 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17659 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17660 | size_t* check_pInfoSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17661 | check_pInfoSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17662 | if (pInfoSize) |
| 17663 | { |
| 17664 | if (!(check_pInfoSize)) |
| 17665 | { |
| 17666 | fprintf(stderr, "fatal: pInfoSize inconsistent between guest and host\n"); |
| 17667 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 17668 | (*pInfoSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17669 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17670 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17671 | void* check_pInfo; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17672 | check_pInfo = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17673 | if (pInfo) |
| 17674 | { |
| 17675 | if (!(check_pInfo)) |
| 17676 | { |
| 17677 | fprintf(stderr, "fatal: pInfo inconsistent between guest and host\n"); |
| 17678 | } |
| 17679 | stream->read((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 17680 | } |
| 17681 | VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0; |
| 17682 | stream->read(&vkGetShaderInfoAMD_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17683 | countingStream->clearPool(); |
| 17684 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17685 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17686 | mImpl->log("finish vkGetShaderInfoAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17687 | return vkGetShaderInfoAMD_VkResult_return; |
| 17688 | } |
| 17689 | |
| 17690 | #endif |
| 17691 | #ifdef VK_AMD_shader_image_load_store_lod |
| 17692 | #endif |
| 17693 | #ifdef VK_IMG_format_pvrtc |
| 17694 | #endif |
| 17695 | #ifdef VK_NV_external_memory_capabilities |
| 17696 | VkResult VkEncoder::vkGetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 17697 | VkPhysicalDevice physicalDevice, |
| 17698 | VkFormat format, |
| 17699 | VkImageType type, |
| 17700 | VkImageTiling tiling, |
| 17701 | VkImageUsageFlags usage, |
| 17702 | VkImageCreateFlags flags, |
| 17703 | VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 17704 | VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) |
| 17705 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17706 | mImpl->log("start vkGetPhysicalDeviceExternalImageFormatPropertiesNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17707 | auto stream = mImpl->stream(); |
| 17708 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17709 | auto resources = mImpl->resources(); |
| 17710 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17711 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17712 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17713 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17714 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17715 | VkImageTiling local_tiling; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17716 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17717 | VkImageCreateFlags local_flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17718 | VkExternalMemoryHandleTypeFlagsNV local_externalHandleType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17719 | local_physicalDevice = physicalDevice; |
| 17720 | local_format = format; |
| 17721 | local_type = type; |
| 17722 | local_tiling = tiling; |
| 17723 | local_usage = usage; |
| 17724 | local_flags = flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17725 | local_externalHandleType = externalHandleType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17726 | countingStream->rewind(); |
| 17727 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17728 | uint64_t cgen_var_1238; |
| 17729 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1238, 1); |
| 17730 | countingStream->write((uint64_t*)&cgen_var_1238, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17731 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 17732 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 17733 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 17734 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 17735 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 17736 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17737 | marshal_VkExternalImageFormatPropertiesNV(countingStream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 17738 | } |
| 17739 | uint32_t packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17740 | countingStream->rewind(); |
| 17741 | uint32_t opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV; |
| 17742 | stream->write(&opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| 17743 | stream->write(&packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17744 | uint64_t cgen_var_1239; |
| 17745 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1239, 1); |
| 17746 | stream->write((uint64_t*)&cgen_var_1239, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17747 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 17748 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 17749 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 17750 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 17751 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 17752 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17753 | marshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 17754 | unmarshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17755 | if (pExternalImageFormatProperties) |
| 17756 | { |
| 17757 | transform_fromhost_VkExternalImageFormatPropertiesNV(mImpl->resources(), (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 17758 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17759 | VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0; |
| 17760 | stream->read(&vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17761 | countingStream->clearPool(); |
| 17762 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17763 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17764 | mImpl->log("finish vkGetPhysicalDeviceExternalImageFormatPropertiesNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17765 | return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return; |
| 17766 | } |
| 17767 | |
| 17768 | #endif |
| 17769 | #ifdef VK_NV_external_memory |
| 17770 | #endif |
| 17771 | #ifdef VK_NV_external_memory_win32 |
| 17772 | VkResult VkEncoder::vkGetMemoryWin32HandleNV( |
| 17773 | VkDevice device, |
| 17774 | VkDeviceMemory memory, |
| 17775 | VkExternalMemoryHandleTypeFlagsNV handleType, |
| 17776 | HANDLE* pHandle) |
| 17777 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17778 | mImpl->log("start vkGetMemoryWin32HandleNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17779 | auto stream = mImpl->stream(); |
| 17780 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17781 | auto resources = mImpl->resources(); |
| 17782 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17783 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17784 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17785 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17786 | VkExternalMemoryHandleTypeFlagsNV local_handleType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17787 | local_device = device; |
| 17788 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17789 | local_handleType = handleType; |
| Lingfeng Yang | afe29d3 | 2018-12-25 13:01:52 -0800 | [diff] [blame] | 17790 | mImpl->resources()->deviceMemoryTransform_tohost(&local_memory, 1, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 0); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17791 | countingStream->rewind(); |
| 17792 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17793 | uint64_t cgen_var_1240; |
| 17794 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1240, 1); |
| 17795 | countingStream->write((uint64_t*)&cgen_var_1240, 1 * 8); |
| 17796 | uint64_t cgen_var_1241; |
| 17797 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1241, 1); |
| 17798 | countingStream->write((uint64_t*)&cgen_var_1241, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17799 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17800 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 17801 | } |
| 17802 | uint32_t packetSize_vkGetMemoryWin32HandleNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17803 | countingStream->rewind(); |
| 17804 | uint32_t opcode_vkGetMemoryWin32HandleNV = OP_vkGetMemoryWin32HandleNV; |
| 17805 | stream->write(&opcode_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| 17806 | stream->write(&packetSize_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17807 | uint64_t cgen_var_1242; |
| 17808 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1242, 1); |
| 17809 | stream->write((uint64_t*)&cgen_var_1242, 1 * 8); |
| 17810 | uint64_t cgen_var_1243; |
| 17811 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1243, 1); |
| 17812 | stream->write((uint64_t*)&cgen_var_1243, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17813 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17814 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 17815 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 17816 | VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0; |
| 17817 | stream->read(&vkGetMemoryWin32HandleNV_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17818 | countingStream->clearPool(); |
| 17819 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17820 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17821 | mImpl->log("finish vkGetMemoryWin32HandleNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17822 | return vkGetMemoryWin32HandleNV_VkResult_return; |
| 17823 | } |
| 17824 | |
| 17825 | #endif |
| 17826 | #ifdef VK_NV_win32_keyed_mutex |
| 17827 | #endif |
| 17828 | #ifdef VK_EXT_validation_flags |
| 17829 | #endif |
| 17830 | #ifdef VK_NN_vi_surface |
| 17831 | VkResult VkEncoder::vkCreateViSurfaceNN( |
| 17832 | VkInstance instance, |
| 17833 | const VkViSurfaceCreateInfoNN* pCreateInfo, |
| 17834 | const VkAllocationCallbacks* pAllocator, |
| 17835 | VkSurfaceKHR* pSurface) |
| 17836 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17837 | mImpl->log("start vkCreateViSurfaceNN"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17838 | auto stream = mImpl->stream(); |
| 17839 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17840 | auto resources = mImpl->resources(); |
| 17841 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17842 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17843 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17844 | VkViSurfaceCreateInfoNN* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17845 | VkAllocationCallbacks* local_pAllocator; |
| 17846 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17847 | local_pCreateInfo = nullptr; |
| 17848 | if (pCreateInfo) |
| 17849 | { |
| 17850 | local_pCreateInfo = (VkViSurfaceCreateInfoNN*)pool->alloc(sizeof(const VkViSurfaceCreateInfoNN)); |
| 17851 | deepcopy_VkViSurfaceCreateInfoNN(pool, pCreateInfo, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| 17852 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17853 | local_pAllocator = nullptr; |
| 17854 | if (pAllocator) |
| 17855 | { |
| 17856 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17857 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17858 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17859 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17860 | if (local_pCreateInfo) |
| 17861 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17862 | transform_tohost_VkViSurfaceCreateInfoNN(mImpl->resources(), (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17863 | } |
| 17864 | if (local_pAllocator) |
| 17865 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17866 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17867 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17868 | countingStream->rewind(); |
| 17869 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17870 | uint64_t cgen_var_1244; |
| 17871 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1244, 1); |
| 17872 | countingStream->write((uint64_t*)&cgen_var_1244, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17873 | marshal_VkViSurfaceCreateInfoNN(countingStream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17874 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17875 | uint64_t cgen_var_1245 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17876 | countingStream->putBe64(cgen_var_1245); |
| 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(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17880 | } |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17881 | uint64_t cgen_var_1246; |
| 17882 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1246, 1); |
| 17883 | countingStream->write((uint64_t*)&cgen_var_1246, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17884 | } |
| 17885 | uint32_t packetSize_vkCreateViSurfaceNN = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17886 | countingStream->rewind(); |
| 17887 | uint32_t opcode_vkCreateViSurfaceNN = OP_vkCreateViSurfaceNN; |
| 17888 | stream->write(&opcode_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| 17889 | stream->write(&packetSize_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17890 | uint64_t cgen_var_1247; |
| 17891 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1247, 1); |
| 17892 | stream->write((uint64_t*)&cgen_var_1247, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17893 | marshal_VkViSurfaceCreateInfoNN(stream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17894 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17895 | uint64_t cgen_var_1248 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17896 | stream->putBe64(cgen_var_1248); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17897 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17898 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17899 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17900 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17901 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17902 | uint64_t cgen_var_1249; |
| 17903 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1249, 1); |
| 17904 | stream->write((uint64_t*)&cgen_var_1249, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17905 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17906 | uint64_t cgen_var_1250; |
| 17907 | stream->read((uint64_t*)&cgen_var_1250, 8); |
| 17908 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1250, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17909 | VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0; |
| 17910 | stream->read(&vkCreateViSurfaceNN_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17911 | countingStream->clearPool(); |
| 17912 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17913 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17914 | mImpl->log("finish vkCreateViSurfaceNN");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17915 | return vkCreateViSurfaceNN_VkResult_return; |
| 17916 | } |
| 17917 | |
| 17918 | #endif |
| 17919 | #ifdef VK_EXT_shader_subgroup_ballot |
| 17920 | #endif |
| 17921 | #ifdef VK_EXT_shader_subgroup_vote |
| 17922 | #endif |
| 17923 | #ifdef VK_EXT_conditional_rendering |
| 17924 | void VkEncoder::vkCmdBeginConditionalRenderingEXT( |
| 17925 | VkCommandBuffer commandBuffer, |
| 17926 | const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) |
| 17927 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17928 | mImpl->log("start vkCmdBeginConditionalRenderingEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17929 | auto stream = mImpl->stream(); |
| 17930 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17931 | auto resources = mImpl->resources(); |
| 17932 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17933 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17934 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17935 | VkConditionalRenderingBeginInfoEXT* local_pConditionalRenderingBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17936 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17937 | local_pConditionalRenderingBegin = nullptr; |
| 17938 | if (pConditionalRenderingBegin) |
| 17939 | { |
| 17940 | local_pConditionalRenderingBegin = (VkConditionalRenderingBeginInfoEXT*)pool->alloc(sizeof(const VkConditionalRenderingBeginInfoEXT)); |
| 17941 | deepcopy_VkConditionalRenderingBeginInfoEXT(pool, pConditionalRenderingBegin, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| 17942 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17943 | if (local_pConditionalRenderingBegin) |
| 17944 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17945 | transform_tohost_VkConditionalRenderingBeginInfoEXT(mImpl->resources(), (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17946 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17947 | countingStream->rewind(); |
| 17948 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17949 | uint64_t cgen_var_1251; |
| 17950 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1251, 1); |
| 17951 | countingStream->write((uint64_t*)&cgen_var_1251, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17952 | marshal_VkConditionalRenderingBeginInfoEXT(countingStream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17953 | } |
| 17954 | uint32_t packetSize_vkCmdBeginConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17955 | countingStream->rewind(); |
| 17956 | uint32_t opcode_vkCmdBeginConditionalRenderingEXT = OP_vkCmdBeginConditionalRenderingEXT; |
| 17957 | stream->write(&opcode_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| 17958 | stream->write(&packetSize_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17959 | uint64_t cgen_var_1252; |
| 17960 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1252, 1); |
| 17961 | stream->write((uint64_t*)&cgen_var_1252, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17962 | marshal_VkConditionalRenderingBeginInfoEXT(stream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17963 | mImpl->log("finish vkCmdBeginConditionalRenderingEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17964 | } |
| 17965 | |
| 17966 | void VkEncoder::vkCmdEndConditionalRenderingEXT( |
| 17967 | VkCommandBuffer commandBuffer) |
| 17968 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17969 | mImpl->log("start vkCmdEndConditionalRenderingEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17970 | auto stream = mImpl->stream(); |
| 17971 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17972 | auto resources = mImpl->resources(); |
| 17973 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17974 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17975 | VkCommandBuffer local_commandBuffer; |
| 17976 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17977 | countingStream->rewind(); |
| 17978 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17979 | uint64_t cgen_var_1253; |
| 17980 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1253, 1); |
| 17981 | countingStream->write((uint64_t*)&cgen_var_1253, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17982 | } |
| 17983 | uint32_t packetSize_vkCmdEndConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17984 | countingStream->rewind(); |
| 17985 | uint32_t opcode_vkCmdEndConditionalRenderingEXT = OP_vkCmdEndConditionalRenderingEXT; |
| 17986 | stream->write(&opcode_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| 17987 | stream->write(&packetSize_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 17988 | uint64_t cgen_var_1254; |
| 17989 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1254, 1); |
| 17990 | stream->write((uint64_t*)&cgen_var_1254, 1 * 8); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17991 | mImpl->log("finish vkCmdEndConditionalRenderingEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17992 | } |
| 17993 | |
| 17994 | #endif |
| 17995 | #ifdef VK_NVX_device_generated_commands |
| 17996 | void VkEncoder::vkCmdProcessCommandsNVX( |
| 17997 | VkCommandBuffer commandBuffer, |
| 17998 | const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) |
| 17999 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18000 | mImpl->log("start vkCmdProcessCommandsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18001 | auto stream = mImpl->stream(); |
| 18002 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18003 | auto resources = mImpl->resources(); |
| 18004 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18005 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18006 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18007 | VkCmdProcessCommandsInfoNVX* local_pProcessCommandsInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18008 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18009 | local_pProcessCommandsInfo = nullptr; |
| 18010 | if (pProcessCommandsInfo) |
| 18011 | { |
| 18012 | local_pProcessCommandsInfo = (VkCmdProcessCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdProcessCommandsInfoNVX)); |
| 18013 | deepcopy_VkCmdProcessCommandsInfoNVX(pool, pProcessCommandsInfo, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| 18014 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18015 | if (local_pProcessCommandsInfo) |
| 18016 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18017 | transform_tohost_VkCmdProcessCommandsInfoNVX(mImpl->resources(), (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18018 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18019 | countingStream->rewind(); |
| 18020 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18021 | uint64_t cgen_var_1255; |
| 18022 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1255, 1); |
| 18023 | countingStream->write((uint64_t*)&cgen_var_1255, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18024 | marshal_VkCmdProcessCommandsInfoNVX(countingStream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18025 | } |
| 18026 | uint32_t packetSize_vkCmdProcessCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18027 | countingStream->rewind(); |
| 18028 | uint32_t opcode_vkCmdProcessCommandsNVX = OP_vkCmdProcessCommandsNVX; |
| 18029 | stream->write(&opcode_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| 18030 | stream->write(&packetSize_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18031 | uint64_t cgen_var_1256; |
| 18032 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1256, 1); |
| 18033 | stream->write((uint64_t*)&cgen_var_1256, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18034 | marshal_VkCmdProcessCommandsInfoNVX(stream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18035 | mImpl->log("finish vkCmdProcessCommandsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18036 | } |
| 18037 | |
| 18038 | void VkEncoder::vkCmdReserveSpaceForCommandsNVX( |
| 18039 | VkCommandBuffer commandBuffer, |
| 18040 | const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) |
| 18041 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18042 | mImpl->log("start vkCmdReserveSpaceForCommandsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18043 | auto stream = mImpl->stream(); |
| 18044 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18045 | auto resources = mImpl->resources(); |
| 18046 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18047 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18048 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18049 | VkCmdReserveSpaceForCommandsInfoNVX* local_pReserveSpaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18050 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18051 | local_pReserveSpaceInfo = nullptr; |
| 18052 | if (pReserveSpaceInfo) |
| 18053 | { |
| 18054 | local_pReserveSpaceInfo = (VkCmdReserveSpaceForCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdReserveSpaceForCommandsInfoNVX)); |
| 18055 | deepcopy_VkCmdReserveSpaceForCommandsInfoNVX(pool, pReserveSpaceInfo, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| 18056 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18057 | if (local_pReserveSpaceInfo) |
| 18058 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18059 | transform_tohost_VkCmdReserveSpaceForCommandsInfoNVX(mImpl->resources(), (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18060 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18061 | countingStream->rewind(); |
| 18062 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18063 | uint64_t cgen_var_1257; |
| 18064 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1257, 1); |
| 18065 | countingStream->write((uint64_t*)&cgen_var_1257, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18066 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(countingStream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18067 | } |
| 18068 | uint32_t packetSize_vkCmdReserveSpaceForCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18069 | countingStream->rewind(); |
| 18070 | uint32_t opcode_vkCmdReserveSpaceForCommandsNVX = OP_vkCmdReserveSpaceForCommandsNVX; |
| 18071 | stream->write(&opcode_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| 18072 | stream->write(&packetSize_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18073 | uint64_t cgen_var_1258; |
| 18074 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1258, 1); |
| 18075 | stream->write((uint64_t*)&cgen_var_1258, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18076 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(stream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18077 | mImpl->log("finish vkCmdReserveSpaceForCommandsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18078 | } |
| 18079 | |
| 18080 | VkResult VkEncoder::vkCreateIndirectCommandsLayoutNVX( |
| 18081 | VkDevice device, |
| 18082 | const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, |
| 18083 | const VkAllocationCallbacks* pAllocator, |
| 18084 | VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) |
| 18085 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18086 | mImpl->log("start vkCreateIndirectCommandsLayoutNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18087 | auto stream = mImpl->stream(); |
| 18088 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18089 | auto resources = mImpl->resources(); |
| 18090 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18091 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18092 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18093 | VkIndirectCommandsLayoutCreateInfoNVX* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18094 | VkAllocationCallbacks* local_pAllocator; |
| 18095 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18096 | local_pCreateInfo = nullptr; |
| 18097 | if (pCreateInfo) |
| 18098 | { |
| 18099 | local_pCreateInfo = (VkIndirectCommandsLayoutCreateInfoNVX*)pool->alloc(sizeof(const VkIndirectCommandsLayoutCreateInfoNVX)); |
| 18100 | deepcopy_VkIndirectCommandsLayoutCreateInfoNVX(pool, pCreateInfo, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| 18101 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18102 | local_pAllocator = nullptr; |
| 18103 | if (pAllocator) |
| 18104 | { |
| 18105 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18106 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18107 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18108 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18109 | if (local_pCreateInfo) |
| 18110 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18111 | transform_tohost_VkIndirectCommandsLayoutCreateInfoNVX(mImpl->resources(), (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18112 | } |
| 18113 | if (local_pAllocator) |
| 18114 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18115 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18116 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18117 | countingStream->rewind(); |
| 18118 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18119 | uint64_t cgen_var_1259; |
| 18120 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1259, 1); |
| 18121 | countingStream->write((uint64_t*)&cgen_var_1259, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18122 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(countingStream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18123 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18124 | uint64_t cgen_var_1260 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18125 | countingStream->putBe64(cgen_var_1260); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18126 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18127 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18128 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18129 | } |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18130 | uint64_t cgen_var_1261; |
| 18131 | countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1261, 1); |
| 18132 | countingStream->write((uint64_t*)&cgen_var_1261, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18133 | } |
| 18134 | uint32_t packetSize_vkCreateIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18135 | countingStream->rewind(); |
| 18136 | uint32_t opcode_vkCreateIndirectCommandsLayoutNVX = OP_vkCreateIndirectCommandsLayoutNVX; |
| 18137 | stream->write(&opcode_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 18138 | stream->write(&packetSize_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18139 | uint64_t cgen_var_1262; |
| 18140 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1262, 1); |
| 18141 | stream->write((uint64_t*)&cgen_var_1262, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18142 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(stream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18143 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18144 | uint64_t cgen_var_1263 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18145 | stream->putBe64(cgen_var_1263); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18146 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18147 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18148 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18149 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18150 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18151 | uint64_t cgen_var_1264; |
| 18152 | stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1264, 1); |
| 18153 | stream->write((uint64_t*)&cgen_var_1264, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18154 | stream->setHandleMapping(resources->unwrapMapping()); |
| 18155 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18156 | uint64_t cgen_var_1265; |
| 18157 | stream->read((uint64_t*)&cgen_var_1265, 8); |
| 18158 | stream->handleMapping()->mapHandles_u64_VkIndirectCommandsLayoutNVX(&cgen_var_1265, (VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18159 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18160 | VkResult vkCreateIndirectCommandsLayoutNVX_VkResult_return = (VkResult)0; |
| 18161 | stream->read(&vkCreateIndirectCommandsLayoutNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18162 | countingStream->clearPool(); |
| 18163 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18164 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18165 | mImpl->log("finish vkCreateIndirectCommandsLayoutNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18166 | return vkCreateIndirectCommandsLayoutNVX_VkResult_return; |
| 18167 | } |
| 18168 | |
| 18169 | void VkEncoder::vkDestroyIndirectCommandsLayoutNVX( |
| 18170 | VkDevice device, |
| 18171 | VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 18172 | const VkAllocationCallbacks* pAllocator) |
| 18173 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18174 | mImpl->log("start vkDestroyIndirectCommandsLayoutNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18175 | auto stream = mImpl->stream(); |
| 18176 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18177 | auto resources = mImpl->resources(); |
| 18178 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18179 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18180 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18181 | VkIndirectCommandsLayoutNVX local_indirectCommandsLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18182 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18183 | local_device = device; |
| 18184 | local_indirectCommandsLayout = indirectCommandsLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18185 | local_pAllocator = nullptr; |
| 18186 | if (pAllocator) |
| 18187 | { |
| 18188 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18189 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18190 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18191 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18192 | if (local_pAllocator) |
| 18193 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18194 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18195 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18196 | countingStream->rewind(); |
| 18197 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18198 | uint64_t cgen_var_1266; |
| 18199 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1266, 1); |
| 18200 | countingStream->write((uint64_t*)&cgen_var_1266, 1 * 8); |
| 18201 | uint64_t cgen_var_1267; |
| 18202 | countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1267, 1); |
| 18203 | countingStream->write((uint64_t*)&cgen_var_1267, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18204 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18205 | uint64_t cgen_var_1268 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18206 | countingStream->putBe64(cgen_var_1268); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18207 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18208 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18209 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18210 | } |
| 18211 | } |
| 18212 | uint32_t packetSize_vkDestroyIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18213 | countingStream->rewind(); |
| 18214 | uint32_t opcode_vkDestroyIndirectCommandsLayoutNVX = OP_vkDestroyIndirectCommandsLayoutNVX; |
| 18215 | stream->write(&opcode_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 18216 | stream->write(&packetSize_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18217 | uint64_t cgen_var_1269; |
| 18218 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1269, 1); |
| 18219 | stream->write((uint64_t*)&cgen_var_1269, 1 * 8); |
| 18220 | uint64_t cgen_var_1270; |
| 18221 | stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1270, 1); |
| 18222 | stream->write((uint64_t*)&cgen_var_1270, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18223 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18224 | uint64_t cgen_var_1271 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18225 | stream->putBe64(cgen_var_1271); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18226 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18227 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18228 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18229 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18230 | resources->destroyMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)&indirectCommandsLayout); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18231 | mImpl->log("finish vkDestroyIndirectCommandsLayoutNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18232 | } |
| 18233 | |
| 18234 | VkResult VkEncoder::vkCreateObjectTableNVX( |
| 18235 | VkDevice device, |
| 18236 | const VkObjectTableCreateInfoNVX* pCreateInfo, |
| 18237 | const VkAllocationCallbacks* pAllocator, |
| 18238 | VkObjectTableNVX* pObjectTable) |
| 18239 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18240 | mImpl->log("start vkCreateObjectTableNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18241 | auto stream = mImpl->stream(); |
| 18242 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18243 | auto resources = mImpl->resources(); |
| 18244 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18245 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18246 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18247 | VkObjectTableCreateInfoNVX* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18248 | VkAllocationCallbacks* local_pAllocator; |
| 18249 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18250 | local_pCreateInfo = nullptr; |
| 18251 | if (pCreateInfo) |
| 18252 | { |
| 18253 | local_pCreateInfo = (VkObjectTableCreateInfoNVX*)pool->alloc(sizeof(const VkObjectTableCreateInfoNVX)); |
| 18254 | deepcopy_VkObjectTableCreateInfoNVX(pool, pCreateInfo, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| 18255 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18256 | local_pAllocator = nullptr; |
| 18257 | if (pAllocator) |
| 18258 | { |
| 18259 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18260 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18261 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18262 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18263 | if (local_pCreateInfo) |
| 18264 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18265 | transform_tohost_VkObjectTableCreateInfoNVX(mImpl->resources(), (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18266 | } |
| 18267 | if (local_pAllocator) |
| 18268 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18269 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18270 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18271 | countingStream->rewind(); |
| 18272 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18273 | uint64_t cgen_var_1272; |
| 18274 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1272, 1); |
| 18275 | countingStream->write((uint64_t*)&cgen_var_1272, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18276 | marshal_VkObjectTableCreateInfoNVX(countingStream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18277 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18278 | uint64_t cgen_var_1273 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18279 | countingStream->putBe64(cgen_var_1273); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18280 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18281 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18282 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18283 | } |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18284 | uint64_t cgen_var_1274; |
| 18285 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1274, 1); |
| 18286 | countingStream->write((uint64_t*)&cgen_var_1274, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18287 | } |
| 18288 | uint32_t packetSize_vkCreateObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18289 | countingStream->rewind(); |
| 18290 | uint32_t opcode_vkCreateObjectTableNVX = OP_vkCreateObjectTableNVX; |
| 18291 | stream->write(&opcode_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| 18292 | stream->write(&packetSize_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18293 | uint64_t cgen_var_1275; |
| 18294 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1275, 1); |
| 18295 | stream->write((uint64_t*)&cgen_var_1275, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18296 | marshal_VkObjectTableCreateInfoNVX(stream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18297 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18298 | uint64_t cgen_var_1276 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18299 | stream->putBe64(cgen_var_1276); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18300 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18301 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18302 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18303 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18304 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18305 | uint64_t cgen_var_1277; |
| 18306 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1277, 1); |
| 18307 | stream->write((uint64_t*)&cgen_var_1277, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18308 | stream->setHandleMapping(resources->unwrapMapping()); |
| 18309 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18310 | uint64_t cgen_var_1278; |
| 18311 | stream->read((uint64_t*)&cgen_var_1278, 8); |
| 18312 | stream->handleMapping()->mapHandles_u64_VkObjectTableNVX(&cgen_var_1278, (VkObjectTableNVX*)pObjectTable, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18313 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18314 | VkResult vkCreateObjectTableNVX_VkResult_return = (VkResult)0; |
| 18315 | stream->read(&vkCreateObjectTableNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18316 | countingStream->clearPool(); |
| 18317 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18318 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18319 | mImpl->log("finish vkCreateObjectTableNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18320 | return vkCreateObjectTableNVX_VkResult_return; |
| 18321 | } |
| 18322 | |
| 18323 | void VkEncoder::vkDestroyObjectTableNVX( |
| 18324 | VkDevice device, |
| 18325 | VkObjectTableNVX objectTable, |
| 18326 | const VkAllocationCallbacks* pAllocator) |
| 18327 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18328 | mImpl->log("start vkDestroyObjectTableNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18329 | auto stream = mImpl->stream(); |
| 18330 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18331 | auto resources = mImpl->resources(); |
| 18332 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18333 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18334 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18335 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18336 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18337 | local_device = device; |
| 18338 | local_objectTable = objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18339 | local_pAllocator = nullptr; |
| 18340 | if (pAllocator) |
| 18341 | { |
| 18342 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18343 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18344 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18345 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18346 | if (local_pAllocator) |
| 18347 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18348 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18349 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18350 | countingStream->rewind(); |
| 18351 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18352 | uint64_t cgen_var_1279; |
| 18353 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1279, 1); |
| 18354 | countingStream->write((uint64_t*)&cgen_var_1279, 1 * 8); |
| 18355 | uint64_t cgen_var_1280; |
| 18356 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1280, 1); |
| 18357 | countingStream->write((uint64_t*)&cgen_var_1280, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18358 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18359 | uint64_t cgen_var_1281 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18360 | countingStream->putBe64(cgen_var_1281); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18361 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18362 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18363 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18364 | } |
| 18365 | } |
| 18366 | uint32_t packetSize_vkDestroyObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18367 | countingStream->rewind(); |
| 18368 | uint32_t opcode_vkDestroyObjectTableNVX = OP_vkDestroyObjectTableNVX; |
| 18369 | stream->write(&opcode_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| 18370 | stream->write(&packetSize_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18371 | uint64_t cgen_var_1282; |
| 18372 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1282, 1); |
| 18373 | stream->write((uint64_t*)&cgen_var_1282, 1 * 8); |
| 18374 | uint64_t cgen_var_1283; |
| 18375 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1283, 1); |
| 18376 | stream->write((uint64_t*)&cgen_var_1283, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18377 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18378 | uint64_t cgen_var_1284 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18379 | stream->putBe64(cgen_var_1284); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18380 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18381 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18382 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18383 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18384 | resources->destroyMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&objectTable); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18385 | mImpl->log("finish vkDestroyObjectTableNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18386 | } |
| 18387 | |
| 18388 | VkResult VkEncoder::vkRegisterObjectsNVX( |
| 18389 | VkDevice device, |
| 18390 | VkObjectTableNVX objectTable, |
| 18391 | uint32_t objectCount, |
| 18392 | const VkObjectTableEntryNVX* const* ppObjectTableEntries, |
| 18393 | const uint32_t* pObjectIndices) |
| 18394 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18395 | mImpl->log("start vkRegisterObjectsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18396 | auto stream = mImpl->stream(); |
| 18397 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18398 | auto resources = mImpl->resources(); |
| 18399 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18400 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18401 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18402 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18403 | uint32_t local_objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18404 | VkObjectTableEntryNVX** local_ppObjectTableEntries; |
| 18405 | uint32_t* local_pObjectIndices; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18406 | local_device = device; |
| 18407 | local_objectTable = objectTable; |
| 18408 | local_objectCount = objectCount; |
| 18409 | (void)ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18410 | local_pObjectIndices = nullptr; |
| 18411 | if (pObjectIndices) |
| 18412 | { |
| 18413 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 18414 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18415 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18416 | countingStream->rewind(); |
| 18417 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18418 | uint64_t cgen_var_1285; |
| 18419 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1285, 1); |
| 18420 | countingStream->write((uint64_t*)&cgen_var_1285, 1 * 8); |
| 18421 | uint64_t cgen_var_1286; |
| 18422 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1286, 1); |
| 18423 | countingStream->write((uint64_t*)&cgen_var_1286, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18424 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 18425 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18426 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18427 | } |
| 18428 | uint32_t packetSize_vkRegisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18429 | countingStream->rewind(); |
| 18430 | uint32_t opcode_vkRegisterObjectsNVX = OP_vkRegisterObjectsNVX; |
| 18431 | stream->write(&opcode_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| 18432 | stream->write(&packetSize_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18433 | uint64_t cgen_var_1287; |
| 18434 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1287, 1); |
| 18435 | stream->write((uint64_t*)&cgen_var_1287, 1 * 8); |
| 18436 | uint64_t cgen_var_1288; |
| 18437 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1288, 1); |
| 18438 | stream->write((uint64_t*)&cgen_var_1288, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18439 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 18440 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18441 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18442 | VkResult vkRegisterObjectsNVX_VkResult_return = (VkResult)0; |
| 18443 | stream->read(&vkRegisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18444 | countingStream->clearPool(); |
| 18445 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18446 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18447 | mImpl->log("finish vkRegisterObjectsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18448 | return vkRegisterObjectsNVX_VkResult_return; |
| 18449 | } |
| 18450 | |
| 18451 | VkResult VkEncoder::vkUnregisterObjectsNVX( |
| 18452 | VkDevice device, |
| 18453 | VkObjectTableNVX objectTable, |
| 18454 | uint32_t objectCount, |
| 18455 | const VkObjectEntryTypeNVX* pObjectEntryTypes, |
| 18456 | const uint32_t* pObjectIndices) |
| 18457 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18458 | mImpl->log("start vkUnregisterObjectsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18459 | auto stream = mImpl->stream(); |
| 18460 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18461 | auto resources = mImpl->resources(); |
| 18462 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18463 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18464 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18465 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18466 | uint32_t local_objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18467 | VkObjectEntryTypeNVX* local_pObjectEntryTypes; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18468 | uint32_t* local_pObjectIndices; |
| 18469 | local_device = device; |
| 18470 | local_objectTable = objectTable; |
| 18471 | local_objectCount = objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18472 | local_pObjectEntryTypes = nullptr; |
| 18473 | if (pObjectEntryTypes) |
| 18474 | { |
| 18475 | local_pObjectEntryTypes = (VkObjectEntryTypeNVX*)pool->dupArray(pObjectEntryTypes, ((objectCount)) * sizeof(const VkObjectEntryTypeNVX)); |
| 18476 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18477 | local_pObjectIndices = nullptr; |
| 18478 | if (pObjectIndices) |
| 18479 | { |
| 18480 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 18481 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18482 | countingStream->rewind(); |
| 18483 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18484 | uint64_t cgen_var_1289; |
| 18485 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1289, 1); |
| 18486 | countingStream->write((uint64_t*)&cgen_var_1289, 1 * 8); |
| 18487 | uint64_t cgen_var_1290; |
| 18488 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1290, 1); |
| 18489 | countingStream->write((uint64_t*)&cgen_var_1290, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18490 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 18491 | countingStream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 18492 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18493 | } |
| 18494 | uint32_t packetSize_vkUnregisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18495 | countingStream->rewind(); |
| 18496 | uint32_t opcode_vkUnregisterObjectsNVX = OP_vkUnregisterObjectsNVX; |
| 18497 | stream->write(&opcode_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| 18498 | stream->write(&packetSize_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18499 | uint64_t cgen_var_1291; |
| 18500 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1291, 1); |
| 18501 | stream->write((uint64_t*)&cgen_var_1291, 1 * 8); |
| 18502 | uint64_t cgen_var_1292; |
| 18503 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1292, 1); |
| 18504 | stream->write((uint64_t*)&cgen_var_1292, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18505 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 18506 | stream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 18507 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18508 | VkResult vkUnregisterObjectsNVX_VkResult_return = (VkResult)0; |
| 18509 | stream->read(&vkUnregisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18510 | countingStream->clearPool(); |
| 18511 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18512 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18513 | mImpl->log("finish vkUnregisterObjectsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18514 | return vkUnregisterObjectsNVX_VkResult_return; |
| 18515 | } |
| 18516 | |
| 18517 | void VkEncoder::vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( |
| 18518 | VkPhysicalDevice physicalDevice, |
| 18519 | VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, |
| 18520 | VkDeviceGeneratedCommandsLimitsNVX* pLimits) |
| 18521 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18522 | mImpl->log("start vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18523 | auto stream = mImpl->stream(); |
| 18524 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18525 | auto resources = mImpl->resources(); |
| 18526 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18527 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18528 | VkPhysicalDevice local_physicalDevice; |
| 18529 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18530 | countingStream->rewind(); |
| 18531 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18532 | uint64_t cgen_var_1293; |
| 18533 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1293, 1); |
| 18534 | countingStream->write((uint64_t*)&cgen_var_1293, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18535 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(countingStream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 18536 | marshal_VkDeviceGeneratedCommandsLimitsNVX(countingStream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 18537 | } |
| 18538 | uint32_t packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18539 | countingStream->rewind(); |
| 18540 | uint32_t opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = OP_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX; |
| 18541 | stream->write(&opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| 18542 | stream->write(&packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18543 | uint64_t cgen_var_1294; |
| 18544 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1294, 1); |
| 18545 | stream->write((uint64_t*)&cgen_var_1294, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18546 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 18547 | marshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 18548 | unmarshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18549 | if (pFeatures) |
| 18550 | { |
| 18551 | transform_fromhost_VkDeviceGeneratedCommandsFeaturesNVX(mImpl->resources(), (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 18552 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18553 | unmarshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18554 | if (pLimits) |
| 18555 | { |
| 18556 | transform_fromhost_VkDeviceGeneratedCommandsLimitsNVX(mImpl->resources(), (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 18557 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18558 | mImpl->log("finish vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18559 | } |
| 18560 | |
| 18561 | #endif |
| 18562 | #ifdef VK_NV_clip_space_w_scaling |
| 18563 | void VkEncoder::vkCmdSetViewportWScalingNV( |
| 18564 | VkCommandBuffer commandBuffer, |
| 18565 | uint32_t firstViewport, |
| 18566 | uint32_t viewportCount, |
| 18567 | const VkViewportWScalingNV* pViewportWScalings) |
| 18568 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18569 | mImpl->log("start vkCmdSetViewportWScalingNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18570 | auto stream = mImpl->stream(); |
| 18571 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18572 | auto resources = mImpl->resources(); |
| 18573 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18574 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18575 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18576 | uint32_t local_firstViewport; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18577 | uint32_t local_viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18578 | VkViewportWScalingNV* local_pViewportWScalings; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18579 | local_commandBuffer = commandBuffer; |
| 18580 | local_firstViewport = firstViewport; |
| 18581 | local_viewportCount = viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18582 | local_pViewportWScalings = nullptr; |
| 18583 | if (pViewportWScalings) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18584 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18585 | local_pViewportWScalings = (VkViewportWScalingNV*)pool->alloc(((viewportCount)) * sizeof(const VkViewportWScalingNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18586 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 18587 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18588 | deepcopy_VkViewportWScalingNV(pool, pViewportWScalings + i, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| 18589 | } |
| 18590 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18591 | if (local_pViewportWScalings) |
| 18592 | { |
| 18593 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 18594 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18595 | transform_tohost_VkViewportWScalingNV(mImpl->resources(), (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18596 | } |
| 18597 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18598 | countingStream->rewind(); |
| 18599 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18600 | uint64_t cgen_var_1295; |
| 18601 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1295, 1); |
| 18602 | countingStream->write((uint64_t*)&cgen_var_1295, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18603 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 18604 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 18605 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 18606 | { |
| 18607 | marshal_VkViewportWScalingNV(countingStream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18608 | } |
| 18609 | } |
| 18610 | uint32_t packetSize_vkCmdSetViewportWScalingNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18611 | countingStream->rewind(); |
| 18612 | uint32_t opcode_vkCmdSetViewportWScalingNV = OP_vkCmdSetViewportWScalingNV; |
| 18613 | stream->write(&opcode_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| 18614 | stream->write(&packetSize_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18615 | uint64_t cgen_var_1296; |
| 18616 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1296, 1); |
| 18617 | stream->write((uint64_t*)&cgen_var_1296, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18618 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 18619 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18620 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 18621 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18622 | marshal_VkViewportWScalingNV(stream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18623 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18624 | mImpl->log("finish vkCmdSetViewportWScalingNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18625 | } |
| 18626 | |
| 18627 | #endif |
| 18628 | #ifdef VK_EXT_direct_mode_display |
| 18629 | VkResult VkEncoder::vkReleaseDisplayEXT( |
| 18630 | VkPhysicalDevice physicalDevice, |
| 18631 | VkDisplayKHR display) |
| 18632 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18633 | mImpl->log("start vkReleaseDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18634 | auto stream = mImpl->stream(); |
| 18635 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18636 | auto resources = mImpl->resources(); |
| 18637 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18638 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18639 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18640 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18641 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18642 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18643 | countingStream->rewind(); |
| 18644 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18645 | uint64_t cgen_var_1297; |
| 18646 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1297, 1); |
| 18647 | countingStream->write((uint64_t*)&cgen_var_1297, 1 * 8); |
| 18648 | uint64_t cgen_var_1298; |
| 18649 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1298, 1); |
| 18650 | countingStream->write((uint64_t*)&cgen_var_1298, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18651 | } |
| 18652 | uint32_t packetSize_vkReleaseDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18653 | countingStream->rewind(); |
| 18654 | uint32_t opcode_vkReleaseDisplayEXT = OP_vkReleaseDisplayEXT; |
| 18655 | stream->write(&opcode_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| 18656 | stream->write(&packetSize_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18657 | uint64_t cgen_var_1299; |
| 18658 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1299, 1); |
| 18659 | stream->write((uint64_t*)&cgen_var_1299, 1 * 8); |
| 18660 | uint64_t cgen_var_1300; |
| 18661 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1300, 1); |
| 18662 | stream->write((uint64_t*)&cgen_var_1300, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18663 | VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0; |
| 18664 | stream->read(&vkReleaseDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18665 | countingStream->clearPool(); |
| 18666 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18667 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18668 | mImpl->log("finish vkReleaseDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18669 | return vkReleaseDisplayEXT_VkResult_return; |
| 18670 | } |
| 18671 | |
| 18672 | #endif |
| 18673 | #ifdef VK_EXT_acquire_xlib_display |
| 18674 | VkResult VkEncoder::vkAcquireXlibDisplayEXT( |
| 18675 | VkPhysicalDevice physicalDevice, |
| 18676 | Display* dpy, |
| 18677 | VkDisplayKHR display) |
| 18678 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18679 | mImpl->log("start vkAcquireXlibDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18680 | auto stream = mImpl->stream(); |
| 18681 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18682 | auto resources = mImpl->resources(); |
| 18683 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18684 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18685 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18686 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18687 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18688 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18689 | countingStream->rewind(); |
| 18690 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18691 | uint64_t cgen_var_1301; |
| 18692 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1301, 1); |
| 18693 | countingStream->write((uint64_t*)&cgen_var_1301, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18694 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18695 | uint64_t cgen_var_1302; |
| 18696 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1302, 1); |
| 18697 | countingStream->write((uint64_t*)&cgen_var_1302, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18698 | } |
| 18699 | uint32_t packetSize_vkAcquireXlibDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18700 | countingStream->rewind(); |
| 18701 | uint32_t opcode_vkAcquireXlibDisplayEXT = OP_vkAcquireXlibDisplayEXT; |
| 18702 | stream->write(&opcode_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| 18703 | stream->write(&packetSize_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18704 | uint64_t cgen_var_1303; |
| 18705 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1303, 1); |
| 18706 | stream->write((uint64_t*)&cgen_var_1303, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18707 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18708 | uint64_t cgen_var_1304; |
| 18709 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1304, 1); |
| 18710 | stream->write((uint64_t*)&cgen_var_1304, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18711 | stream->read((Display*)dpy, sizeof(Display)); |
| 18712 | VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0; |
| 18713 | stream->read(&vkAcquireXlibDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18714 | countingStream->clearPool(); |
| 18715 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18716 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18717 | mImpl->log("finish vkAcquireXlibDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18718 | return vkAcquireXlibDisplayEXT_VkResult_return; |
| 18719 | } |
| 18720 | |
| 18721 | VkResult VkEncoder::vkGetRandROutputDisplayEXT( |
| 18722 | VkPhysicalDevice physicalDevice, |
| 18723 | Display* dpy, |
| 18724 | RROutput rrOutput, |
| 18725 | VkDisplayKHR* pDisplay) |
| 18726 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18727 | mImpl->log("start vkGetRandROutputDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18728 | auto stream = mImpl->stream(); |
| 18729 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18730 | auto resources = mImpl->resources(); |
| 18731 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18732 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18733 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18734 | RROutput local_rrOutput; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18735 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18736 | local_rrOutput = rrOutput; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18737 | countingStream->rewind(); |
| 18738 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18739 | uint64_t cgen_var_1305; |
| 18740 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1305, 1); |
| 18741 | countingStream->write((uint64_t*)&cgen_var_1305, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18742 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18743 | countingStream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18744 | uint64_t cgen_var_1306; |
| 18745 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1306, 1); |
| 18746 | countingStream->write((uint64_t*)&cgen_var_1306, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18747 | } |
| 18748 | uint32_t packetSize_vkGetRandROutputDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18749 | countingStream->rewind(); |
| 18750 | uint32_t opcode_vkGetRandROutputDisplayEXT = OP_vkGetRandROutputDisplayEXT; |
| 18751 | stream->write(&opcode_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| 18752 | stream->write(&packetSize_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18753 | uint64_t cgen_var_1307; |
| 18754 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1307, 1); |
| 18755 | stream->write((uint64_t*)&cgen_var_1307, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18756 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18757 | stream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18758 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18759 | uint64_t cgen_var_1308; |
| 18760 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1308, 1); |
| 18761 | stream->write((uint64_t*)&cgen_var_1308, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18762 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18763 | stream->read((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18764 | uint64_t cgen_var_1309; |
| 18765 | stream->read((uint64_t*)&cgen_var_1309, 8); |
| 18766 | stream->handleMapping()->mapHandles_u64_VkDisplayKHR(&cgen_var_1309, (VkDisplayKHR*)pDisplay, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18767 | VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0; |
| 18768 | stream->read(&vkGetRandROutputDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18769 | countingStream->clearPool(); |
| 18770 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18771 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18772 | mImpl->log("finish vkGetRandROutputDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18773 | return vkGetRandROutputDisplayEXT_VkResult_return; |
| 18774 | } |
| 18775 | |
| 18776 | #endif |
| 18777 | #ifdef VK_EXT_display_surface_counter |
| 18778 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2EXT( |
| 18779 | VkPhysicalDevice physicalDevice, |
| 18780 | VkSurfaceKHR surface, |
| 18781 | VkSurfaceCapabilities2EXT* pSurfaceCapabilities) |
| 18782 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18783 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilities2EXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18784 | auto stream = mImpl->stream(); |
| 18785 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18786 | auto resources = mImpl->resources(); |
| 18787 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18788 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18789 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18790 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18791 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18792 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18793 | countingStream->rewind(); |
| 18794 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18795 | uint64_t cgen_var_1310; |
| 18796 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1310, 1); |
| 18797 | countingStream->write((uint64_t*)&cgen_var_1310, 1 * 8); |
| 18798 | uint64_t cgen_var_1311; |
| 18799 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1311, 1); |
| 18800 | countingStream->write((uint64_t*)&cgen_var_1311, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18801 | marshal_VkSurfaceCapabilities2EXT(countingStream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 18802 | } |
| 18803 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18804 | countingStream->rewind(); |
| 18805 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT = OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT; |
| 18806 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| 18807 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18808 | uint64_t cgen_var_1312; |
| 18809 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1312, 1); |
| 18810 | stream->write((uint64_t*)&cgen_var_1312, 1 * 8); |
| 18811 | uint64_t cgen_var_1313; |
| 18812 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1313, 1); |
| 18813 | stream->write((uint64_t*)&cgen_var_1313, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18814 | marshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 18815 | unmarshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18816 | if (pSurfaceCapabilities) |
| 18817 | { |
| 18818 | transform_fromhost_VkSurfaceCapabilities2EXT(mImpl->resources(), (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 18819 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18820 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0; |
| 18821 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18822 | countingStream->clearPool(); |
| 18823 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18824 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18825 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilities2EXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18826 | return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return; |
| 18827 | } |
| 18828 | |
| 18829 | #endif |
| 18830 | #ifdef VK_EXT_display_control |
| 18831 | VkResult VkEncoder::vkDisplayPowerControlEXT( |
| 18832 | VkDevice device, |
| 18833 | VkDisplayKHR display, |
| 18834 | const VkDisplayPowerInfoEXT* pDisplayPowerInfo) |
| 18835 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18836 | mImpl->log("start vkDisplayPowerControlEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18837 | auto stream = mImpl->stream(); |
| 18838 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18839 | auto resources = mImpl->resources(); |
| 18840 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18841 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18842 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18843 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18844 | VkDisplayPowerInfoEXT* local_pDisplayPowerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18845 | local_device = device; |
| 18846 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18847 | local_pDisplayPowerInfo = nullptr; |
| 18848 | if (pDisplayPowerInfo) |
| 18849 | { |
| 18850 | local_pDisplayPowerInfo = (VkDisplayPowerInfoEXT*)pool->alloc(sizeof(const VkDisplayPowerInfoEXT)); |
| 18851 | deepcopy_VkDisplayPowerInfoEXT(pool, pDisplayPowerInfo, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| 18852 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18853 | if (local_pDisplayPowerInfo) |
| 18854 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18855 | transform_tohost_VkDisplayPowerInfoEXT(mImpl->resources(), (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18856 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18857 | countingStream->rewind(); |
| 18858 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18859 | uint64_t cgen_var_1314; |
| 18860 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1314, 1); |
| 18861 | countingStream->write((uint64_t*)&cgen_var_1314, 1 * 8); |
| 18862 | uint64_t cgen_var_1315; |
| 18863 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1315, 1); |
| 18864 | countingStream->write((uint64_t*)&cgen_var_1315, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18865 | marshal_VkDisplayPowerInfoEXT(countingStream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18866 | } |
| 18867 | uint32_t packetSize_vkDisplayPowerControlEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18868 | countingStream->rewind(); |
| 18869 | uint32_t opcode_vkDisplayPowerControlEXT = OP_vkDisplayPowerControlEXT; |
| 18870 | stream->write(&opcode_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| 18871 | stream->write(&packetSize_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18872 | uint64_t cgen_var_1316; |
| 18873 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1316, 1); |
| 18874 | stream->write((uint64_t*)&cgen_var_1316, 1 * 8); |
| 18875 | uint64_t cgen_var_1317; |
| 18876 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1317, 1); |
| 18877 | stream->write((uint64_t*)&cgen_var_1317, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18878 | marshal_VkDisplayPowerInfoEXT(stream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18879 | VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0; |
| 18880 | stream->read(&vkDisplayPowerControlEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18881 | countingStream->clearPool(); |
| 18882 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18883 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18884 | mImpl->log("finish vkDisplayPowerControlEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18885 | return vkDisplayPowerControlEXT_VkResult_return; |
| 18886 | } |
| 18887 | |
| 18888 | VkResult VkEncoder::vkRegisterDeviceEventEXT( |
| 18889 | VkDevice device, |
| 18890 | const VkDeviceEventInfoEXT* pDeviceEventInfo, |
| 18891 | const VkAllocationCallbacks* pAllocator, |
| 18892 | VkFence* pFence) |
| 18893 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18894 | mImpl->log("start vkRegisterDeviceEventEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18895 | auto stream = mImpl->stream(); |
| 18896 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18897 | auto resources = mImpl->resources(); |
| 18898 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18899 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18900 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18901 | VkDeviceEventInfoEXT* local_pDeviceEventInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18902 | VkAllocationCallbacks* local_pAllocator; |
| 18903 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18904 | local_pDeviceEventInfo = nullptr; |
| 18905 | if (pDeviceEventInfo) |
| 18906 | { |
| 18907 | local_pDeviceEventInfo = (VkDeviceEventInfoEXT*)pool->alloc(sizeof(const VkDeviceEventInfoEXT)); |
| 18908 | deepcopy_VkDeviceEventInfoEXT(pool, pDeviceEventInfo, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| 18909 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18910 | local_pAllocator = nullptr; |
| 18911 | if (pAllocator) |
| 18912 | { |
| 18913 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18914 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18915 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18916 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18917 | if (local_pDeviceEventInfo) |
| 18918 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18919 | transform_tohost_VkDeviceEventInfoEXT(mImpl->resources(), (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18920 | } |
| 18921 | if (local_pAllocator) |
| 18922 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18923 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18924 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18925 | countingStream->rewind(); |
| 18926 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18927 | uint64_t cgen_var_1318; |
| 18928 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1318, 1); |
| 18929 | countingStream->write((uint64_t*)&cgen_var_1318, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18930 | marshal_VkDeviceEventInfoEXT(countingStream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18931 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18932 | uint64_t cgen_var_1319 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18933 | countingStream->putBe64(cgen_var_1319); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18934 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18935 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18936 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18937 | } |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18938 | uint64_t cgen_var_1320; |
| 18939 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1320, 1); |
| 18940 | countingStream->write((uint64_t*)&cgen_var_1320, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18941 | } |
| 18942 | uint32_t packetSize_vkRegisterDeviceEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18943 | countingStream->rewind(); |
| 18944 | uint32_t opcode_vkRegisterDeviceEventEXT = OP_vkRegisterDeviceEventEXT; |
| 18945 | stream->write(&opcode_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| 18946 | stream->write(&packetSize_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18947 | uint64_t cgen_var_1321; |
| 18948 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1321, 1); |
| 18949 | stream->write((uint64_t*)&cgen_var_1321, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18950 | marshal_VkDeviceEventInfoEXT(stream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18951 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18952 | uint64_t cgen_var_1322 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18953 | stream->putBe64(cgen_var_1322); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18954 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18955 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18956 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18957 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18958 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18959 | uint64_t cgen_var_1323; |
| 18960 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1323, 1); |
| 18961 | stream->write((uint64_t*)&cgen_var_1323, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18962 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 18963 | uint64_t cgen_var_1324; |
| 18964 | stream->read((uint64_t*)&cgen_var_1324, 8); |
| 18965 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1324, (VkFence*)pFence, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18966 | VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0; |
| 18967 | stream->read(&vkRegisterDeviceEventEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18968 | countingStream->clearPool(); |
| 18969 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18970 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18971 | mImpl->log("finish vkRegisterDeviceEventEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18972 | return vkRegisterDeviceEventEXT_VkResult_return; |
| 18973 | } |
| 18974 | |
| 18975 | VkResult VkEncoder::vkRegisterDisplayEventEXT( |
| 18976 | VkDevice device, |
| 18977 | VkDisplayKHR display, |
| 18978 | const VkDisplayEventInfoEXT* pDisplayEventInfo, |
| 18979 | const VkAllocationCallbacks* pAllocator, |
| 18980 | VkFence* pFence) |
| 18981 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18982 | mImpl->log("start vkRegisterDisplayEventEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18983 | auto stream = mImpl->stream(); |
| 18984 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18985 | auto resources = mImpl->resources(); |
| 18986 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18987 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18988 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18989 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18990 | VkDisplayEventInfoEXT* local_pDisplayEventInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18991 | VkAllocationCallbacks* local_pAllocator; |
| 18992 | local_device = device; |
| 18993 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18994 | local_pDisplayEventInfo = nullptr; |
| 18995 | if (pDisplayEventInfo) |
| 18996 | { |
| 18997 | local_pDisplayEventInfo = (VkDisplayEventInfoEXT*)pool->alloc(sizeof(const VkDisplayEventInfoEXT)); |
| 18998 | deepcopy_VkDisplayEventInfoEXT(pool, pDisplayEventInfo, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| 18999 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19000 | local_pAllocator = nullptr; |
| 19001 | if (pAllocator) |
| 19002 | { |
| 19003 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19004 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19005 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19006 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19007 | if (local_pDisplayEventInfo) |
| 19008 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19009 | transform_tohost_VkDisplayEventInfoEXT(mImpl->resources(), (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19010 | } |
| 19011 | if (local_pAllocator) |
| 19012 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19013 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19014 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19015 | countingStream->rewind(); |
| 19016 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19017 | uint64_t cgen_var_1325; |
| 19018 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1325, 1); |
| 19019 | countingStream->write((uint64_t*)&cgen_var_1325, 1 * 8); |
| 19020 | uint64_t cgen_var_1326; |
| 19021 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1326, 1); |
| 19022 | countingStream->write((uint64_t*)&cgen_var_1326, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19023 | marshal_VkDisplayEventInfoEXT(countingStream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19024 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19025 | uint64_t cgen_var_1327 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19026 | countingStream->putBe64(cgen_var_1327); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19027 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19028 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19029 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19030 | } |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19031 | uint64_t cgen_var_1328; |
| 19032 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1328, 1); |
| 19033 | countingStream->write((uint64_t*)&cgen_var_1328, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19034 | } |
| 19035 | uint32_t packetSize_vkRegisterDisplayEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19036 | countingStream->rewind(); |
| 19037 | uint32_t opcode_vkRegisterDisplayEventEXT = OP_vkRegisterDisplayEventEXT; |
| 19038 | stream->write(&opcode_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| 19039 | stream->write(&packetSize_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19040 | uint64_t cgen_var_1329; |
| 19041 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1329, 1); |
| 19042 | stream->write((uint64_t*)&cgen_var_1329, 1 * 8); |
| 19043 | uint64_t cgen_var_1330; |
| 19044 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1330, 1); |
| 19045 | stream->write((uint64_t*)&cgen_var_1330, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19046 | marshal_VkDisplayEventInfoEXT(stream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19047 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19048 | uint64_t cgen_var_1331 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19049 | stream->putBe64(cgen_var_1331); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19050 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19051 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19052 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19053 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19054 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19055 | uint64_t cgen_var_1332; |
| 19056 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1332, 1); |
| 19057 | stream->write((uint64_t*)&cgen_var_1332, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19058 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19059 | uint64_t cgen_var_1333; |
| 19060 | stream->read((uint64_t*)&cgen_var_1333, 8); |
| 19061 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1333, (VkFence*)pFence, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19062 | VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0; |
| 19063 | stream->read(&vkRegisterDisplayEventEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19064 | countingStream->clearPool(); |
| 19065 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19066 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19067 | mImpl->log("finish vkRegisterDisplayEventEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19068 | return vkRegisterDisplayEventEXT_VkResult_return; |
| 19069 | } |
| 19070 | |
| 19071 | VkResult VkEncoder::vkGetSwapchainCounterEXT( |
| 19072 | VkDevice device, |
| 19073 | VkSwapchainKHR swapchain, |
| 19074 | VkSurfaceCounterFlagBitsEXT counter, |
| 19075 | uint64_t* pCounterValue) |
| 19076 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19077 | mImpl->log("start vkGetSwapchainCounterEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19078 | auto stream = mImpl->stream(); |
| 19079 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19080 | auto resources = mImpl->resources(); |
| 19081 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19082 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19083 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19084 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19085 | VkSurfaceCounterFlagBitsEXT local_counter; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19086 | local_device = device; |
| 19087 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19088 | local_counter = counter; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19089 | countingStream->rewind(); |
| 19090 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19091 | uint64_t cgen_var_1334; |
| 19092 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1334, 1); |
| 19093 | countingStream->write((uint64_t*)&cgen_var_1334, 1 * 8); |
| 19094 | uint64_t cgen_var_1335; |
| 19095 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1335, 1); |
| 19096 | countingStream->write((uint64_t*)&cgen_var_1335, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19097 | countingStream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19098 | countingStream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 19099 | } |
| 19100 | uint32_t packetSize_vkGetSwapchainCounterEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19101 | countingStream->rewind(); |
| 19102 | uint32_t opcode_vkGetSwapchainCounterEXT = OP_vkGetSwapchainCounterEXT; |
| 19103 | stream->write(&opcode_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| 19104 | stream->write(&packetSize_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19105 | uint64_t cgen_var_1336; |
| 19106 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1336, 1); |
| 19107 | stream->write((uint64_t*)&cgen_var_1336, 1 * 8); |
| 19108 | uint64_t cgen_var_1337; |
| 19109 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1337, 1); |
| 19110 | stream->write((uint64_t*)&cgen_var_1337, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19111 | stream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19112 | stream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 19113 | stream->read((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 19114 | VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0; |
| 19115 | stream->read(&vkGetSwapchainCounterEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19116 | countingStream->clearPool(); |
| 19117 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19118 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19119 | mImpl->log("finish vkGetSwapchainCounterEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19120 | return vkGetSwapchainCounterEXT_VkResult_return; |
| 19121 | } |
| 19122 | |
| 19123 | #endif |
| 19124 | #ifdef VK_GOOGLE_display_timing |
| 19125 | VkResult VkEncoder::vkGetRefreshCycleDurationGOOGLE( |
| 19126 | VkDevice device, |
| 19127 | VkSwapchainKHR swapchain, |
| 19128 | VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) |
| 19129 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19130 | mImpl->log("start vkGetRefreshCycleDurationGOOGLE"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19131 | auto stream = mImpl->stream(); |
| 19132 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19133 | auto resources = mImpl->resources(); |
| 19134 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19135 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19136 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19137 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19138 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19139 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19140 | countingStream->rewind(); |
| 19141 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19142 | uint64_t cgen_var_1338; |
| 19143 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1338, 1); |
| 19144 | countingStream->write((uint64_t*)&cgen_var_1338, 1 * 8); |
| 19145 | uint64_t cgen_var_1339; |
| 19146 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1339, 1); |
| 19147 | countingStream->write((uint64_t*)&cgen_var_1339, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19148 | marshal_VkRefreshCycleDurationGOOGLE(countingStream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 19149 | } |
| 19150 | uint32_t packetSize_vkGetRefreshCycleDurationGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19151 | countingStream->rewind(); |
| 19152 | uint32_t opcode_vkGetRefreshCycleDurationGOOGLE = OP_vkGetRefreshCycleDurationGOOGLE; |
| 19153 | stream->write(&opcode_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| 19154 | stream->write(&packetSize_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19155 | uint64_t cgen_var_1340; |
| 19156 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1340, 1); |
| 19157 | stream->write((uint64_t*)&cgen_var_1340, 1 * 8); |
| 19158 | uint64_t cgen_var_1341; |
| 19159 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1341, 1); |
| 19160 | stream->write((uint64_t*)&cgen_var_1341, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19161 | marshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 19162 | unmarshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19163 | if (pDisplayTimingProperties) |
| 19164 | { |
| 19165 | transform_fromhost_VkRefreshCycleDurationGOOGLE(mImpl->resources(), (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 19166 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19167 | VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0; |
| 19168 | stream->read(&vkGetRefreshCycleDurationGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19169 | countingStream->clearPool(); |
| 19170 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19171 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19172 | mImpl->log("finish vkGetRefreshCycleDurationGOOGLE");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19173 | return vkGetRefreshCycleDurationGOOGLE_VkResult_return; |
| 19174 | } |
| 19175 | |
| 19176 | VkResult VkEncoder::vkGetPastPresentationTimingGOOGLE( |
| 19177 | VkDevice device, |
| 19178 | VkSwapchainKHR swapchain, |
| 19179 | uint32_t* pPresentationTimingCount, |
| 19180 | VkPastPresentationTimingGOOGLE* pPresentationTimings) |
| 19181 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19182 | mImpl->log("start vkGetPastPresentationTimingGOOGLE"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19183 | auto stream = mImpl->stream(); |
| 19184 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19185 | auto resources = mImpl->resources(); |
| 19186 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19187 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19188 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19189 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19190 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19191 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19192 | countingStream->rewind(); |
| 19193 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19194 | uint64_t cgen_var_1342; |
| 19195 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1342, 1); |
| 19196 | countingStream->write((uint64_t*)&cgen_var_1342, 1 * 8); |
| 19197 | uint64_t cgen_var_1343; |
| 19198 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1343, 1); |
| 19199 | countingStream->write((uint64_t*)&cgen_var_1343, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19200 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19201 | uint64_t cgen_var_1344 = (uint64_t)(uintptr_t)pPresentationTimingCount; |
| 19202 | countingStream->putBe64(cgen_var_1344); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19203 | if (pPresentationTimingCount) |
| 19204 | { |
| 19205 | countingStream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 19206 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19207 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19208 | uint64_t cgen_var_1345 = (uint64_t)(uintptr_t)pPresentationTimings; |
| 19209 | countingStream->putBe64(cgen_var_1345); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19210 | if (pPresentationTimings) |
| 19211 | { |
| 19212 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 19213 | { |
| 19214 | marshal_VkPastPresentationTimingGOOGLE(countingStream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 19215 | } |
| 19216 | } |
| 19217 | } |
| 19218 | uint32_t packetSize_vkGetPastPresentationTimingGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19219 | countingStream->rewind(); |
| 19220 | uint32_t opcode_vkGetPastPresentationTimingGOOGLE = OP_vkGetPastPresentationTimingGOOGLE; |
| 19221 | stream->write(&opcode_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| 19222 | stream->write(&packetSize_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19223 | uint64_t cgen_var_1346; |
| 19224 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1346, 1); |
| 19225 | stream->write((uint64_t*)&cgen_var_1346, 1 * 8); |
| 19226 | uint64_t cgen_var_1347; |
| 19227 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1347, 1); |
| 19228 | stream->write((uint64_t*)&cgen_var_1347, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19229 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19230 | uint64_t cgen_var_1348 = (uint64_t)(uintptr_t)pPresentationTimingCount; |
| 19231 | stream->putBe64(cgen_var_1348); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19232 | if (pPresentationTimingCount) |
| 19233 | { |
| 19234 | stream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 19235 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19236 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19237 | uint64_t cgen_var_1349 = (uint64_t)(uintptr_t)pPresentationTimings; |
| 19238 | stream->putBe64(cgen_var_1349); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19239 | if (pPresentationTimings) |
| 19240 | { |
| 19241 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 19242 | { |
| 19243 | marshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 19244 | } |
| 19245 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19246 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19247 | uint32_t* check_pPresentationTimingCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19248 | check_pPresentationTimingCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19249 | if (pPresentationTimingCount) |
| 19250 | { |
| 19251 | if (!(check_pPresentationTimingCount)) |
| 19252 | { |
| 19253 | fprintf(stderr, "fatal: pPresentationTimingCount inconsistent between guest and host\n"); |
| 19254 | } |
| 19255 | stream->read((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 19256 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19257 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19258 | VkPastPresentationTimingGOOGLE* check_pPresentationTimings; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19259 | check_pPresentationTimings = (VkPastPresentationTimingGOOGLE*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19260 | if (pPresentationTimings) |
| 19261 | { |
| 19262 | if (!(check_pPresentationTimings)) |
| 19263 | { |
| 19264 | fprintf(stderr, "fatal: pPresentationTimings inconsistent between guest and host\n"); |
| 19265 | } |
| 19266 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 19267 | { |
| 19268 | unmarshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 19269 | } |
| 19270 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19271 | if (pPresentationTimings) |
| 19272 | { |
| 19273 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 19274 | { |
| 19275 | transform_fromhost_VkPastPresentationTimingGOOGLE(mImpl->resources(), (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 19276 | } |
| 19277 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19278 | VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0; |
| 19279 | stream->read(&vkGetPastPresentationTimingGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19280 | countingStream->clearPool(); |
| 19281 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19282 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19283 | mImpl->log("finish vkGetPastPresentationTimingGOOGLE");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19284 | return vkGetPastPresentationTimingGOOGLE_VkResult_return; |
| 19285 | } |
| 19286 | |
| 19287 | #endif |
| 19288 | #ifdef VK_NV_sample_mask_override_coverage |
| 19289 | #endif |
| 19290 | #ifdef VK_NV_geometry_shader_passthrough |
| 19291 | #endif |
| 19292 | #ifdef VK_NV_viewport_array2 |
| 19293 | #endif |
| 19294 | #ifdef VK_NVX_multiview_per_view_attributes |
| 19295 | #endif |
| 19296 | #ifdef VK_NV_viewport_swizzle |
| 19297 | #endif |
| 19298 | #ifdef VK_EXT_discard_rectangles |
| 19299 | void VkEncoder::vkCmdSetDiscardRectangleEXT( |
| 19300 | VkCommandBuffer commandBuffer, |
| 19301 | uint32_t firstDiscardRectangle, |
| 19302 | uint32_t discardRectangleCount, |
| 19303 | const VkRect2D* pDiscardRectangles) |
| 19304 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19305 | mImpl->log("start vkCmdSetDiscardRectangleEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19306 | auto stream = mImpl->stream(); |
| 19307 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19308 | auto resources = mImpl->resources(); |
| 19309 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19310 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19311 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19312 | uint32_t local_firstDiscardRectangle; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19313 | uint32_t local_discardRectangleCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19314 | VkRect2D* local_pDiscardRectangles; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19315 | local_commandBuffer = commandBuffer; |
| 19316 | local_firstDiscardRectangle = firstDiscardRectangle; |
| 19317 | local_discardRectangleCount = discardRectangleCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19318 | local_pDiscardRectangles = nullptr; |
| 19319 | if (pDiscardRectangles) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19320 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19321 | local_pDiscardRectangles = (VkRect2D*)pool->alloc(((discardRectangleCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19322 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 19323 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19324 | deepcopy_VkRect2D(pool, pDiscardRectangles + i, (VkRect2D*)(local_pDiscardRectangles + i)); |
| 19325 | } |
| 19326 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19327 | if (local_pDiscardRectangles) |
| 19328 | { |
| 19329 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 19330 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19331 | transform_tohost_VkRect2D(mImpl->resources(), (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19332 | } |
| 19333 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19334 | countingStream->rewind(); |
| 19335 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19336 | uint64_t cgen_var_1352; |
| 19337 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1352, 1); |
| 19338 | countingStream->write((uint64_t*)&cgen_var_1352, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19339 | countingStream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 19340 | countingStream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| 19341 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 19342 | { |
| 19343 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19344 | } |
| 19345 | } |
| 19346 | uint32_t packetSize_vkCmdSetDiscardRectangleEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19347 | countingStream->rewind(); |
| 19348 | uint32_t opcode_vkCmdSetDiscardRectangleEXT = OP_vkCmdSetDiscardRectangleEXT; |
| 19349 | stream->write(&opcode_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| 19350 | stream->write(&packetSize_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19351 | uint64_t cgen_var_1353; |
| 19352 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1353, 1); |
| 19353 | stream->write((uint64_t*)&cgen_var_1353, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19354 | stream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 19355 | stream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19356 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 19357 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19358 | marshal_VkRect2D(stream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19359 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19360 | mImpl->log("finish vkCmdSetDiscardRectangleEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19361 | } |
| 19362 | |
| 19363 | #endif |
| 19364 | #ifdef VK_EXT_conservative_rasterization |
| 19365 | #endif |
| 19366 | #ifdef VK_EXT_swapchain_colorspace |
| 19367 | #endif |
| 19368 | #ifdef VK_EXT_hdr_metadata |
| 19369 | void VkEncoder::vkSetHdrMetadataEXT( |
| 19370 | VkDevice device, |
| 19371 | uint32_t swapchainCount, |
| 19372 | const VkSwapchainKHR* pSwapchains, |
| 19373 | const VkHdrMetadataEXT* pMetadata) |
| 19374 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19375 | mImpl->log("start vkSetHdrMetadataEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19376 | auto stream = mImpl->stream(); |
| 19377 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19378 | auto resources = mImpl->resources(); |
| 19379 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19380 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19381 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19382 | uint32_t local_swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19383 | VkSwapchainKHR* local_pSwapchains; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19384 | VkHdrMetadataEXT* local_pMetadata; |
| 19385 | local_device = device; |
| 19386 | local_swapchainCount = swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19387 | local_pSwapchains = nullptr; |
| 19388 | if (pSwapchains) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19389 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19390 | local_pSwapchains = (VkSwapchainKHR*)pool->dupArray(pSwapchains, ((swapchainCount)) * sizeof(const VkSwapchainKHR)); |
| 19391 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19392 | local_pMetadata = nullptr; |
| 19393 | if (pMetadata) |
| 19394 | { |
| 19395 | local_pMetadata = (VkHdrMetadataEXT*)pool->alloc(((swapchainCount)) * sizeof(const VkHdrMetadataEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19396 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 19397 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19398 | deepcopy_VkHdrMetadataEXT(pool, pMetadata + i, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| 19399 | } |
| 19400 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19401 | if (local_pMetadata) |
| 19402 | { |
| 19403 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 19404 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19405 | transform_tohost_VkHdrMetadataEXT(mImpl->resources(), (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19406 | } |
| 19407 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19408 | countingStream->rewind(); |
| 19409 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19410 | uint64_t cgen_var_1354; |
| 19411 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1354, 1); |
| 19412 | countingStream->write((uint64_t*)&cgen_var_1354, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19413 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19414 | if (((swapchainCount))) |
| 19415 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19416 | uint64_t* cgen_var_1355; |
| 19417 | countingStream->alloc((void**)&cgen_var_1355, ((swapchainCount)) * 8); |
| 19418 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1355, ((swapchainCount))); |
| 19419 | countingStream->write((uint64_t*)cgen_var_1355, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19420 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19421 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 19422 | { |
| 19423 | marshal_VkHdrMetadataEXT(countingStream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19424 | } |
| 19425 | } |
| 19426 | uint32_t packetSize_vkSetHdrMetadataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19427 | countingStream->rewind(); |
| 19428 | uint32_t opcode_vkSetHdrMetadataEXT = OP_vkSetHdrMetadataEXT; |
| 19429 | stream->write(&opcode_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| 19430 | stream->write(&packetSize_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19431 | uint64_t cgen_var_1356; |
| 19432 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1356, 1); |
| 19433 | stream->write((uint64_t*)&cgen_var_1356, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19434 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19435 | if (((swapchainCount))) |
| 19436 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19437 | uint64_t* cgen_var_1357; |
| 19438 | stream->alloc((void**)&cgen_var_1357, ((swapchainCount)) * 8); |
| 19439 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1357, ((swapchainCount))); |
| 19440 | stream->write((uint64_t*)cgen_var_1357, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19441 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19442 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 19443 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19444 | marshal_VkHdrMetadataEXT(stream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19445 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19446 | mImpl->log("finish vkSetHdrMetadataEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19447 | } |
| 19448 | |
| 19449 | #endif |
| 19450 | #ifdef VK_MVK_ios_surface |
| 19451 | VkResult VkEncoder::vkCreateIOSSurfaceMVK( |
| 19452 | VkInstance instance, |
| 19453 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo, |
| 19454 | const VkAllocationCallbacks* pAllocator, |
| 19455 | VkSurfaceKHR* pSurface) |
| 19456 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19457 | mImpl->log("start vkCreateIOSSurfaceMVK"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19458 | auto stream = mImpl->stream(); |
| 19459 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19460 | auto resources = mImpl->resources(); |
| 19461 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19462 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19463 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19464 | VkIOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19465 | VkAllocationCallbacks* local_pAllocator; |
| 19466 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19467 | local_pCreateInfo = nullptr; |
| 19468 | if (pCreateInfo) |
| 19469 | { |
| 19470 | local_pCreateInfo = (VkIOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkIOSSurfaceCreateInfoMVK)); |
| 19471 | deepcopy_VkIOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 19472 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19473 | local_pAllocator = nullptr; |
| 19474 | if (pAllocator) |
| 19475 | { |
| 19476 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19477 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19478 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19479 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19480 | if (local_pCreateInfo) |
| 19481 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19482 | transform_tohost_VkIOSSurfaceCreateInfoMVK(mImpl->resources(), (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19483 | } |
| 19484 | if (local_pAllocator) |
| 19485 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19486 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19487 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19488 | countingStream->rewind(); |
| 19489 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19490 | uint64_t cgen_var_1358; |
| 19491 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1358, 1); |
| 19492 | countingStream->write((uint64_t*)&cgen_var_1358, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19493 | marshal_VkIOSSurfaceCreateInfoMVK(countingStream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19494 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19495 | uint64_t cgen_var_1359 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19496 | countingStream->putBe64(cgen_var_1359); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19497 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19498 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19499 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19500 | } |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19501 | uint64_t cgen_var_1360; |
| 19502 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1360, 1); |
| 19503 | countingStream->write((uint64_t*)&cgen_var_1360, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19504 | } |
| 19505 | uint32_t packetSize_vkCreateIOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19506 | countingStream->rewind(); |
| 19507 | uint32_t opcode_vkCreateIOSSurfaceMVK = OP_vkCreateIOSSurfaceMVK; |
| 19508 | stream->write(&opcode_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| 19509 | stream->write(&packetSize_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19510 | uint64_t cgen_var_1361; |
| 19511 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1361, 1); |
| 19512 | stream->write((uint64_t*)&cgen_var_1361, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19513 | marshal_VkIOSSurfaceCreateInfoMVK(stream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19514 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19515 | uint64_t cgen_var_1362 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19516 | stream->putBe64(cgen_var_1362); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19517 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19518 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19519 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19520 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19521 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19522 | uint64_t cgen_var_1363; |
| 19523 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1363, 1); |
| 19524 | stream->write((uint64_t*)&cgen_var_1363, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19525 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19526 | uint64_t cgen_var_1364; |
| 19527 | stream->read((uint64_t*)&cgen_var_1364, 8); |
| 19528 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1364, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19529 | VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 19530 | stream->read(&vkCreateIOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19531 | countingStream->clearPool(); |
| 19532 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19533 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19534 | mImpl->log("finish vkCreateIOSSurfaceMVK");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19535 | return vkCreateIOSSurfaceMVK_VkResult_return; |
| 19536 | } |
| 19537 | |
| 19538 | #endif |
| 19539 | #ifdef VK_MVK_macos_surface |
| 19540 | VkResult VkEncoder::vkCreateMacOSSurfaceMVK( |
| 19541 | VkInstance instance, |
| 19542 | const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, |
| 19543 | const VkAllocationCallbacks* pAllocator, |
| 19544 | VkSurfaceKHR* pSurface) |
| 19545 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19546 | mImpl->log("start vkCreateMacOSSurfaceMVK"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19547 | auto stream = mImpl->stream(); |
| 19548 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19549 | auto resources = mImpl->resources(); |
| 19550 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19551 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19552 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19553 | VkMacOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19554 | VkAllocationCallbacks* local_pAllocator; |
| 19555 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19556 | local_pCreateInfo = nullptr; |
| 19557 | if (pCreateInfo) |
| 19558 | { |
| 19559 | local_pCreateInfo = (VkMacOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkMacOSSurfaceCreateInfoMVK)); |
| 19560 | deepcopy_VkMacOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 19561 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19562 | local_pAllocator = nullptr; |
| 19563 | if (pAllocator) |
| 19564 | { |
| 19565 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19566 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19567 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19568 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19569 | if (local_pCreateInfo) |
| 19570 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19571 | transform_tohost_VkMacOSSurfaceCreateInfoMVK(mImpl->resources(), (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19572 | } |
| 19573 | if (local_pAllocator) |
| 19574 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19575 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19576 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19577 | countingStream->rewind(); |
| 19578 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19579 | uint64_t cgen_var_1365; |
| 19580 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1365, 1); |
| 19581 | countingStream->write((uint64_t*)&cgen_var_1365, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19582 | marshal_VkMacOSSurfaceCreateInfoMVK(countingStream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19583 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19584 | uint64_t cgen_var_1366 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19585 | countingStream->putBe64(cgen_var_1366); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19586 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19587 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19588 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19589 | } |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19590 | uint64_t cgen_var_1367; |
| 19591 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1367, 1); |
| 19592 | countingStream->write((uint64_t*)&cgen_var_1367, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19593 | } |
| 19594 | uint32_t packetSize_vkCreateMacOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19595 | countingStream->rewind(); |
| 19596 | uint32_t opcode_vkCreateMacOSSurfaceMVK = OP_vkCreateMacOSSurfaceMVK; |
| 19597 | stream->write(&opcode_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| 19598 | stream->write(&packetSize_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19599 | uint64_t cgen_var_1368; |
| 19600 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1368, 1); |
| 19601 | stream->write((uint64_t*)&cgen_var_1368, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19602 | marshal_VkMacOSSurfaceCreateInfoMVK(stream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19603 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19604 | uint64_t cgen_var_1369 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19605 | stream->putBe64(cgen_var_1369); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19606 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19607 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19608 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19609 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19610 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19611 | uint64_t cgen_var_1370; |
| 19612 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1370, 1); |
| 19613 | stream->write((uint64_t*)&cgen_var_1370, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19614 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19615 | uint64_t cgen_var_1371; |
| 19616 | stream->read((uint64_t*)&cgen_var_1371, 8); |
| 19617 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1371, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19618 | VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 19619 | stream->read(&vkCreateMacOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19620 | countingStream->clearPool(); |
| 19621 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19622 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19623 | mImpl->log("finish vkCreateMacOSSurfaceMVK");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19624 | return vkCreateMacOSSurfaceMVK_VkResult_return; |
| 19625 | } |
| 19626 | |
| 19627 | #endif |
| 19628 | #ifdef VK_EXT_external_memory_dma_buf |
| 19629 | #endif |
| 19630 | #ifdef VK_EXT_queue_family_foreign |
| 19631 | #endif |
| 19632 | #ifdef VK_EXT_debug_utils |
| 19633 | VkResult VkEncoder::vkSetDebugUtilsObjectNameEXT( |
| 19634 | VkDevice device, |
| 19635 | const VkDebugUtilsObjectNameInfoEXT* pNameInfo) |
| 19636 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19637 | mImpl->log("start vkSetDebugUtilsObjectNameEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19638 | auto stream = mImpl->stream(); |
| 19639 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19640 | auto resources = mImpl->resources(); |
| 19641 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19642 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19643 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19644 | VkDebugUtilsObjectNameInfoEXT* local_pNameInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19645 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19646 | local_pNameInfo = nullptr; |
| 19647 | if (pNameInfo) |
| 19648 | { |
| 19649 | local_pNameInfo = (VkDebugUtilsObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectNameInfoEXT)); |
| 19650 | deepcopy_VkDebugUtilsObjectNameInfoEXT(pool, pNameInfo, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| 19651 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19652 | if (local_pNameInfo) |
| 19653 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19654 | transform_tohost_VkDebugUtilsObjectNameInfoEXT(mImpl->resources(), (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19655 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19656 | countingStream->rewind(); |
| 19657 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19658 | uint64_t cgen_var_1372; |
| 19659 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1372, 1); |
| 19660 | countingStream->write((uint64_t*)&cgen_var_1372, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19661 | marshal_VkDebugUtilsObjectNameInfoEXT(countingStream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19662 | } |
| 19663 | uint32_t packetSize_vkSetDebugUtilsObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19664 | countingStream->rewind(); |
| 19665 | uint32_t opcode_vkSetDebugUtilsObjectNameEXT = OP_vkSetDebugUtilsObjectNameEXT; |
| 19666 | stream->write(&opcode_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| 19667 | stream->write(&packetSize_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19668 | uint64_t cgen_var_1373; |
| 19669 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1373, 1); |
| 19670 | stream->write((uint64_t*)&cgen_var_1373, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19671 | marshal_VkDebugUtilsObjectNameInfoEXT(stream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19672 | VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0; |
| 19673 | stream->read(&vkSetDebugUtilsObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19674 | countingStream->clearPool(); |
| 19675 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19676 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19677 | mImpl->log("finish vkSetDebugUtilsObjectNameEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19678 | return vkSetDebugUtilsObjectNameEXT_VkResult_return; |
| 19679 | } |
| 19680 | |
| 19681 | VkResult VkEncoder::vkSetDebugUtilsObjectTagEXT( |
| 19682 | VkDevice device, |
| 19683 | const VkDebugUtilsObjectTagInfoEXT* pTagInfo) |
| 19684 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19685 | mImpl->log("start vkSetDebugUtilsObjectTagEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19686 | auto stream = mImpl->stream(); |
| 19687 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19688 | auto resources = mImpl->resources(); |
| 19689 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19690 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19691 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19692 | VkDebugUtilsObjectTagInfoEXT* local_pTagInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19693 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19694 | local_pTagInfo = nullptr; |
| 19695 | if (pTagInfo) |
| 19696 | { |
| 19697 | local_pTagInfo = (VkDebugUtilsObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectTagInfoEXT)); |
| 19698 | deepcopy_VkDebugUtilsObjectTagInfoEXT(pool, pTagInfo, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| 19699 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19700 | if (local_pTagInfo) |
| 19701 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19702 | transform_tohost_VkDebugUtilsObjectTagInfoEXT(mImpl->resources(), (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19703 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19704 | countingStream->rewind(); |
| 19705 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19706 | uint64_t cgen_var_1374; |
| 19707 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1374, 1); |
| 19708 | countingStream->write((uint64_t*)&cgen_var_1374, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19709 | marshal_VkDebugUtilsObjectTagInfoEXT(countingStream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19710 | } |
| 19711 | uint32_t packetSize_vkSetDebugUtilsObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19712 | countingStream->rewind(); |
| 19713 | uint32_t opcode_vkSetDebugUtilsObjectTagEXT = OP_vkSetDebugUtilsObjectTagEXT; |
| 19714 | stream->write(&opcode_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| 19715 | stream->write(&packetSize_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19716 | uint64_t cgen_var_1375; |
| 19717 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1375, 1); |
| 19718 | stream->write((uint64_t*)&cgen_var_1375, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19719 | marshal_VkDebugUtilsObjectTagInfoEXT(stream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19720 | VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0; |
| 19721 | stream->read(&vkSetDebugUtilsObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19722 | countingStream->clearPool(); |
| 19723 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19724 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19725 | mImpl->log("finish vkSetDebugUtilsObjectTagEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19726 | return vkSetDebugUtilsObjectTagEXT_VkResult_return; |
| 19727 | } |
| 19728 | |
| 19729 | void VkEncoder::vkQueueBeginDebugUtilsLabelEXT( |
| 19730 | VkQueue queue, |
| 19731 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 19732 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19733 | mImpl->log("start vkQueueBeginDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19734 | auto stream = mImpl->stream(); |
| 19735 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19736 | auto resources = mImpl->resources(); |
| 19737 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19738 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19739 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19740 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19741 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19742 | local_pLabelInfo = nullptr; |
| 19743 | if (pLabelInfo) |
| 19744 | { |
| 19745 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 19746 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 19747 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19748 | if (local_pLabelInfo) |
| 19749 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19750 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19751 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19752 | countingStream->rewind(); |
| 19753 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19754 | uint64_t cgen_var_1376; |
| 19755 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1376, 1); |
| 19756 | countingStream->write((uint64_t*)&cgen_var_1376, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19757 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19758 | } |
| 19759 | uint32_t packetSize_vkQueueBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19760 | countingStream->rewind(); |
| 19761 | uint32_t opcode_vkQueueBeginDebugUtilsLabelEXT = OP_vkQueueBeginDebugUtilsLabelEXT; |
| 19762 | stream->write(&opcode_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 19763 | stream->write(&packetSize_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19764 | uint64_t cgen_var_1377; |
| 19765 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1377, 1); |
| 19766 | stream->write((uint64_t*)&cgen_var_1377, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19767 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19768 | mImpl->log("finish vkQueueBeginDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19769 | } |
| 19770 | |
| 19771 | void VkEncoder::vkQueueEndDebugUtilsLabelEXT( |
| 19772 | VkQueue queue) |
| 19773 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19774 | mImpl->log("start vkQueueEndDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19775 | auto stream = mImpl->stream(); |
| 19776 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19777 | auto resources = mImpl->resources(); |
| 19778 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19779 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19780 | VkQueue local_queue; |
| 19781 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19782 | countingStream->rewind(); |
| 19783 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19784 | uint64_t cgen_var_1378; |
| 19785 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1378, 1); |
| 19786 | countingStream->write((uint64_t*)&cgen_var_1378, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19787 | } |
| 19788 | uint32_t packetSize_vkQueueEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19789 | countingStream->rewind(); |
| 19790 | uint32_t opcode_vkQueueEndDebugUtilsLabelEXT = OP_vkQueueEndDebugUtilsLabelEXT; |
| 19791 | stream->write(&opcode_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 19792 | stream->write(&packetSize_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19793 | uint64_t cgen_var_1379; |
| 19794 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1379, 1); |
| 19795 | stream->write((uint64_t*)&cgen_var_1379, 1 * 8); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19796 | mImpl->log("finish vkQueueEndDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19797 | } |
| 19798 | |
| 19799 | void VkEncoder::vkQueueInsertDebugUtilsLabelEXT( |
| 19800 | VkQueue queue, |
| 19801 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 19802 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19803 | mImpl->log("start vkQueueInsertDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19804 | auto stream = mImpl->stream(); |
| 19805 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19806 | auto resources = mImpl->resources(); |
| 19807 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19808 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19809 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19810 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19811 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19812 | local_pLabelInfo = nullptr; |
| 19813 | if (pLabelInfo) |
| 19814 | { |
| 19815 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 19816 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 19817 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19818 | if (local_pLabelInfo) |
| 19819 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19820 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19821 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19822 | countingStream->rewind(); |
| 19823 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19824 | uint64_t cgen_var_1380; |
| 19825 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1380, 1); |
| 19826 | countingStream->write((uint64_t*)&cgen_var_1380, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19827 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19828 | } |
| 19829 | uint32_t packetSize_vkQueueInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19830 | countingStream->rewind(); |
| 19831 | uint32_t opcode_vkQueueInsertDebugUtilsLabelEXT = OP_vkQueueInsertDebugUtilsLabelEXT; |
| 19832 | stream->write(&opcode_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 19833 | stream->write(&packetSize_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19834 | uint64_t cgen_var_1381; |
| 19835 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1381, 1); |
| 19836 | stream->write((uint64_t*)&cgen_var_1381, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19837 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19838 | mImpl->log("finish vkQueueInsertDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19839 | } |
| 19840 | |
| 19841 | void VkEncoder::vkCmdBeginDebugUtilsLabelEXT( |
| 19842 | VkCommandBuffer commandBuffer, |
| 19843 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 19844 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19845 | mImpl->log("start vkCmdBeginDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19846 | auto stream = mImpl->stream(); |
| 19847 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19848 | auto resources = mImpl->resources(); |
| 19849 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19850 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19851 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19852 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19853 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19854 | local_pLabelInfo = nullptr; |
| 19855 | if (pLabelInfo) |
| 19856 | { |
| 19857 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 19858 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 19859 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19860 | if (local_pLabelInfo) |
| 19861 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19862 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19863 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19864 | countingStream->rewind(); |
| 19865 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19866 | uint64_t cgen_var_1382; |
| 19867 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1382, 1); |
| 19868 | countingStream->write((uint64_t*)&cgen_var_1382, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19869 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19870 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19871 | uint32_t packetSize_vkCmdBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19872 | countingStream->rewind(); |
| 19873 | uint32_t opcode_vkCmdBeginDebugUtilsLabelEXT = OP_vkCmdBeginDebugUtilsLabelEXT; |
| 19874 | stream->write(&opcode_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 19875 | stream->write(&packetSize_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19876 | uint64_t cgen_var_1383; |
| 19877 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1383, 1); |
| 19878 | stream->write((uint64_t*)&cgen_var_1383, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19879 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19880 | mImpl->log("finish vkCmdBeginDebugUtilsLabelEXT");; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19881 | } |
| 19882 | |
| 19883 | void VkEncoder::vkCmdEndDebugUtilsLabelEXT( |
| 19884 | VkCommandBuffer commandBuffer) |
| 19885 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19886 | mImpl->log("start vkCmdEndDebugUtilsLabelEXT"); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19887 | auto stream = mImpl->stream(); |
| 19888 | auto countingStream = mImpl->countingStream(); |
| 19889 | auto resources = mImpl->resources(); |
| 19890 | auto pool = mImpl->pool(); |
| 19891 | stream->setHandleMapping(resources->unwrapMapping()); |
| 19892 | VkCommandBuffer local_commandBuffer; |
| 19893 | local_commandBuffer = commandBuffer; |
| 19894 | countingStream->rewind(); |
| 19895 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19896 | uint64_t cgen_var_1384; |
| 19897 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1384, 1); |
| 19898 | countingStream->write((uint64_t*)&cgen_var_1384, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19899 | } |
| 19900 | uint32_t packetSize_vkCmdEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19901 | countingStream->rewind(); |
| 19902 | uint32_t opcode_vkCmdEndDebugUtilsLabelEXT = OP_vkCmdEndDebugUtilsLabelEXT; |
| 19903 | stream->write(&opcode_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 19904 | stream->write(&packetSize_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19905 | uint64_t cgen_var_1385; |
| 19906 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1385, 1); |
| 19907 | stream->write((uint64_t*)&cgen_var_1385, 1 * 8); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19908 | mImpl->log("finish vkCmdEndDebugUtilsLabelEXT");; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19909 | } |
| 19910 | |
| 19911 | void VkEncoder::vkCmdInsertDebugUtilsLabelEXT( |
| 19912 | VkCommandBuffer commandBuffer, |
| 19913 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 19914 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19915 | mImpl->log("start vkCmdInsertDebugUtilsLabelEXT"); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19916 | auto stream = mImpl->stream(); |
| 19917 | auto countingStream = mImpl->countingStream(); |
| 19918 | auto resources = mImpl->resources(); |
| 19919 | auto pool = mImpl->pool(); |
| 19920 | stream->setHandleMapping(resources->unwrapMapping()); |
| 19921 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19922 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19923 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19924 | local_pLabelInfo = nullptr; |
| 19925 | if (pLabelInfo) |
| 19926 | { |
| 19927 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 19928 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 19929 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19930 | if (local_pLabelInfo) |
| 19931 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19932 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19933 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19934 | countingStream->rewind(); |
| 19935 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19936 | uint64_t cgen_var_1386; |
| 19937 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1386, 1); |
| 19938 | countingStream->write((uint64_t*)&cgen_var_1386, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 19939 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 19940 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19941 | uint32_t packetSize_vkCmdInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19942 | countingStream->rewind(); |
| 19943 | uint32_t opcode_vkCmdInsertDebugUtilsLabelEXT = OP_vkCmdInsertDebugUtilsLabelEXT; |
| 19944 | stream->write(&opcode_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 19945 | stream->write(&packetSize_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19946 | uint64_t cgen_var_1387; |
| 19947 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1387, 1); |
| 19948 | stream->write((uint64_t*)&cgen_var_1387, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19949 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19950 | mImpl->log("finish vkCmdInsertDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19951 | } |
| 19952 | |
| 19953 | VkResult VkEncoder::vkCreateDebugUtilsMessengerEXT( |
| 19954 | VkInstance instance, |
| 19955 | const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, |
| 19956 | const VkAllocationCallbacks* pAllocator, |
| 19957 | VkDebugUtilsMessengerEXT* pMessenger) |
| 19958 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19959 | mImpl->log("start vkCreateDebugUtilsMessengerEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19960 | auto stream = mImpl->stream(); |
| 19961 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19962 | auto resources = mImpl->resources(); |
| 19963 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19964 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19965 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19966 | VkDebugUtilsMessengerCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19967 | VkAllocationCallbacks* local_pAllocator; |
| 19968 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19969 | local_pCreateInfo = nullptr; |
| 19970 | if (pCreateInfo) |
| 19971 | { |
| 19972 | local_pCreateInfo = (VkDebugUtilsMessengerCreateInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCreateInfoEXT)); |
| 19973 | deepcopy_VkDebugUtilsMessengerCreateInfoEXT(pool, pCreateInfo, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| 19974 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19975 | local_pAllocator = nullptr; |
| 19976 | if (pAllocator) |
| 19977 | { |
| 19978 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19979 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19980 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19981 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19982 | if (local_pCreateInfo) |
| 19983 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19984 | transform_tohost_VkDebugUtilsMessengerCreateInfoEXT(mImpl->resources(), (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19985 | } |
| 19986 | if (local_pAllocator) |
| 19987 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19988 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19989 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19990 | countingStream->rewind(); |
| 19991 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19992 | uint64_t cgen_var_1388; |
| 19993 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1388, 1); |
| 19994 | countingStream->write((uint64_t*)&cgen_var_1388, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19995 | marshal_VkDebugUtilsMessengerCreateInfoEXT(countingStream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19996 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 19997 | uint64_t cgen_var_1389 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19998 | countingStream->putBe64(cgen_var_1389); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19999 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20000 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20001 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20002 | } |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20003 | uint64_t cgen_var_1390; |
| 20004 | countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1390, 1); |
| 20005 | countingStream->write((uint64_t*)&cgen_var_1390, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20006 | } |
| 20007 | uint32_t packetSize_vkCreateDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20008 | countingStream->rewind(); |
| 20009 | uint32_t opcode_vkCreateDebugUtilsMessengerEXT = OP_vkCreateDebugUtilsMessengerEXT; |
| 20010 | stream->write(&opcode_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 20011 | stream->write(&packetSize_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20012 | uint64_t cgen_var_1391; |
| 20013 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1391, 1); |
| 20014 | stream->write((uint64_t*)&cgen_var_1391, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20015 | marshal_VkDebugUtilsMessengerCreateInfoEXT(stream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20016 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20017 | uint64_t cgen_var_1392 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20018 | stream->putBe64(cgen_var_1392); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20019 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20020 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20021 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20022 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20023 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20024 | uint64_t cgen_var_1393; |
| 20025 | stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1393, 1); |
| 20026 | stream->write((uint64_t*)&cgen_var_1393, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20027 | stream->setHandleMapping(resources->unwrapMapping()); |
| 20028 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20029 | uint64_t cgen_var_1394; |
| 20030 | stream->read((uint64_t*)&cgen_var_1394, 8); |
| 20031 | stream->handleMapping()->mapHandles_u64_VkDebugUtilsMessengerEXT(&cgen_var_1394, (VkDebugUtilsMessengerEXT*)pMessenger, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20032 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20033 | VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0; |
| 20034 | stream->read(&vkCreateDebugUtilsMessengerEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20035 | countingStream->clearPool(); |
| 20036 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20037 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20038 | mImpl->log("finish vkCreateDebugUtilsMessengerEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20039 | return vkCreateDebugUtilsMessengerEXT_VkResult_return; |
| 20040 | } |
| 20041 | |
| 20042 | void VkEncoder::vkDestroyDebugUtilsMessengerEXT( |
| 20043 | VkInstance instance, |
| 20044 | VkDebugUtilsMessengerEXT messenger, |
| 20045 | const VkAllocationCallbacks* pAllocator) |
| 20046 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20047 | mImpl->log("start vkDestroyDebugUtilsMessengerEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20048 | auto stream = mImpl->stream(); |
| 20049 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20050 | auto resources = mImpl->resources(); |
| 20051 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20052 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20053 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20054 | VkDebugUtilsMessengerEXT local_messenger; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20055 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20056 | local_instance = instance; |
| 20057 | local_messenger = messenger; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20058 | local_pAllocator = nullptr; |
| 20059 | if (pAllocator) |
| 20060 | { |
| 20061 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20062 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20063 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20064 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20065 | if (local_pAllocator) |
| 20066 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20067 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20068 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20069 | countingStream->rewind(); |
| 20070 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20071 | uint64_t cgen_var_1395; |
| 20072 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1395, 1); |
| 20073 | countingStream->write((uint64_t*)&cgen_var_1395, 1 * 8); |
| 20074 | uint64_t cgen_var_1396; |
| 20075 | countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1396, 1); |
| 20076 | countingStream->write((uint64_t*)&cgen_var_1396, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20077 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20078 | uint64_t cgen_var_1397 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20079 | countingStream->putBe64(cgen_var_1397); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20080 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20081 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20082 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20083 | } |
| 20084 | } |
| 20085 | uint32_t packetSize_vkDestroyDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20086 | countingStream->rewind(); |
| 20087 | uint32_t opcode_vkDestroyDebugUtilsMessengerEXT = OP_vkDestroyDebugUtilsMessengerEXT; |
| 20088 | stream->write(&opcode_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 20089 | stream->write(&packetSize_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20090 | uint64_t cgen_var_1398; |
| 20091 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1398, 1); |
| 20092 | stream->write((uint64_t*)&cgen_var_1398, 1 * 8); |
| 20093 | uint64_t cgen_var_1399; |
| 20094 | stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1399, 1); |
| 20095 | stream->write((uint64_t*)&cgen_var_1399, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20096 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20097 | uint64_t cgen_var_1400 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20098 | stream->putBe64(cgen_var_1400); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20099 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20100 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20101 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20102 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20103 | resources->destroyMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)&messenger); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20104 | mImpl->log("finish vkDestroyDebugUtilsMessengerEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20105 | } |
| 20106 | |
| 20107 | void VkEncoder::vkSubmitDebugUtilsMessageEXT( |
| 20108 | VkInstance instance, |
| 20109 | VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, |
| 20110 | VkDebugUtilsMessageTypeFlagsEXT messageTypes, |
| 20111 | const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) |
| 20112 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20113 | mImpl->log("start vkSubmitDebugUtilsMessageEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20114 | auto stream = mImpl->stream(); |
| 20115 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20116 | auto resources = mImpl->resources(); |
| 20117 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20118 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20119 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20120 | VkDebugUtilsMessageSeverityFlagBitsEXT local_messageSeverity; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20121 | VkDebugUtilsMessageTypeFlagsEXT local_messageTypes; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20122 | VkDebugUtilsMessengerCallbackDataEXT* local_pCallbackData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20123 | local_instance = instance; |
| 20124 | local_messageSeverity = messageSeverity; |
| 20125 | local_messageTypes = messageTypes; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20126 | local_pCallbackData = nullptr; |
| 20127 | if (pCallbackData) |
| 20128 | { |
| 20129 | local_pCallbackData = (VkDebugUtilsMessengerCallbackDataEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCallbackDataEXT)); |
| 20130 | deepcopy_VkDebugUtilsMessengerCallbackDataEXT(pool, pCallbackData, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| 20131 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20132 | if (local_pCallbackData) |
| 20133 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20134 | transform_tohost_VkDebugUtilsMessengerCallbackDataEXT(mImpl->resources(), (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20135 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20136 | countingStream->rewind(); |
| 20137 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20138 | uint64_t cgen_var_1401; |
| 20139 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1401, 1); |
| 20140 | countingStream->write((uint64_t*)&cgen_var_1401, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20141 | countingStream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 20142 | countingStream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 20143 | marshal_VkDebugUtilsMessengerCallbackDataEXT(countingStream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20144 | } |
| 20145 | uint32_t packetSize_vkSubmitDebugUtilsMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20146 | countingStream->rewind(); |
| 20147 | uint32_t opcode_vkSubmitDebugUtilsMessageEXT = OP_vkSubmitDebugUtilsMessageEXT; |
| 20148 | stream->write(&opcode_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| 20149 | stream->write(&packetSize_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20150 | uint64_t cgen_var_1402; |
| 20151 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1402, 1); |
| 20152 | stream->write((uint64_t*)&cgen_var_1402, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20153 | stream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 20154 | stream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 20155 | marshal_VkDebugUtilsMessengerCallbackDataEXT(stream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20156 | mImpl->log("finish vkSubmitDebugUtilsMessageEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20157 | } |
| 20158 | |
| 20159 | #endif |
| 20160 | #ifdef VK_ANDROID_external_memory_android_hardware_buffer |
| 20161 | VkResult VkEncoder::vkGetAndroidHardwareBufferPropertiesANDROID( |
| 20162 | VkDevice device, |
| 20163 | const AHardwareBuffer* buffer, |
| 20164 | VkAndroidHardwareBufferPropertiesANDROID* pProperties) |
| 20165 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20166 | mImpl->log("start vkGetAndroidHardwareBufferPropertiesANDROID"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20167 | auto stream = mImpl->stream(); |
| 20168 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20169 | auto resources = mImpl->resources(); |
| 20170 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20171 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20172 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20173 | AHardwareBuffer* local_buffer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20174 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20175 | local_buffer = nullptr; |
| 20176 | if (buffer) |
| 20177 | { |
| 20178 | local_buffer = (AHardwareBuffer*)pool->dupArray(buffer, sizeof(const AHardwareBuffer)); |
| 20179 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20180 | countingStream->rewind(); |
| 20181 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20182 | uint64_t cgen_var_1403; |
| 20183 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1403, 1); |
| 20184 | countingStream->write((uint64_t*)&cgen_var_1403, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20185 | countingStream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20186 | marshal_VkAndroidHardwareBufferPropertiesANDROID(countingStream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 20187 | } |
| 20188 | uint32_t packetSize_vkGetAndroidHardwareBufferPropertiesANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20189 | countingStream->rewind(); |
| 20190 | uint32_t opcode_vkGetAndroidHardwareBufferPropertiesANDROID = OP_vkGetAndroidHardwareBufferPropertiesANDROID; |
| 20191 | stream->write(&opcode_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| 20192 | stream->write(&packetSize_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20193 | uint64_t cgen_var_1404; |
| 20194 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1404, 1); |
| 20195 | stream->write((uint64_t*)&cgen_var_1404, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20196 | stream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20197 | marshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 20198 | unmarshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20199 | if (pProperties) |
| 20200 | { |
| 20201 | transform_fromhost_VkAndroidHardwareBufferPropertiesANDROID(mImpl->resources(), (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 20202 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20203 | VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0; |
| 20204 | stream->read(&vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20205 | countingStream->clearPool(); |
| 20206 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20207 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20208 | mImpl->log("finish vkGetAndroidHardwareBufferPropertiesANDROID");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20209 | return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return; |
| 20210 | } |
| 20211 | |
| 20212 | VkResult VkEncoder::vkGetMemoryAndroidHardwareBufferANDROID( |
| 20213 | VkDevice device, |
| 20214 | const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, |
| 20215 | AHardwareBuffer** pBuffer) |
| 20216 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20217 | mImpl->log("start vkGetMemoryAndroidHardwareBufferANDROID"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20218 | auto stream = mImpl->stream(); |
| 20219 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20220 | auto resources = mImpl->resources(); |
| 20221 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20222 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20223 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20224 | VkMemoryGetAndroidHardwareBufferInfoANDROID* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20225 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20226 | local_pInfo = nullptr; |
| 20227 | if (pInfo) |
| 20228 | { |
| 20229 | local_pInfo = (VkMemoryGetAndroidHardwareBufferInfoANDROID*)pool->alloc(sizeof(const VkMemoryGetAndroidHardwareBufferInfoANDROID)); |
| 20230 | deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(pool, pInfo, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| 20231 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20232 | if (local_pInfo) |
| 20233 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20234 | transform_tohost_VkMemoryGetAndroidHardwareBufferInfoANDROID(mImpl->resources(), (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20235 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20236 | countingStream->rewind(); |
| 20237 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20238 | uint64_t cgen_var_1405; |
| 20239 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1405, 1); |
| 20240 | countingStream->write((uint64_t*)&cgen_var_1405, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20241 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(countingStream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20242 | countingStream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 20243 | } |
| 20244 | uint32_t packetSize_vkGetMemoryAndroidHardwareBufferANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20245 | countingStream->rewind(); |
| 20246 | uint32_t opcode_vkGetMemoryAndroidHardwareBufferANDROID = OP_vkGetMemoryAndroidHardwareBufferANDROID; |
| 20247 | stream->write(&opcode_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| 20248 | stream->write(&packetSize_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20249 | uint64_t cgen_var_1406; |
| 20250 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1406, 1); |
| 20251 | stream->write((uint64_t*)&cgen_var_1406, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20252 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(stream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20253 | stream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 20254 | stream->read((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 20255 | VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0; |
| 20256 | stream->read(&vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20257 | countingStream->clearPool(); |
| 20258 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20259 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20260 | mImpl->log("finish vkGetMemoryAndroidHardwareBufferANDROID");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20261 | return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return; |
| 20262 | } |
| 20263 | |
| 20264 | #endif |
| 20265 | #ifdef VK_EXT_sampler_filter_minmax |
| 20266 | #endif |
| 20267 | #ifdef VK_AMD_gpu_shader_int16 |
| 20268 | #endif |
| 20269 | #ifdef VK_AMD_mixed_attachment_samples |
| 20270 | #endif |
| 20271 | #ifdef VK_AMD_shader_fragment_mask |
| 20272 | #endif |
| 20273 | #ifdef VK_EXT_shader_stencil_export |
| 20274 | #endif |
| 20275 | #ifdef VK_EXT_sample_locations |
| 20276 | void VkEncoder::vkCmdSetSampleLocationsEXT( |
| 20277 | VkCommandBuffer commandBuffer, |
| 20278 | const VkSampleLocationsInfoEXT* pSampleLocationsInfo) |
| 20279 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20280 | mImpl->log("start vkCmdSetSampleLocationsEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20281 | auto stream = mImpl->stream(); |
| 20282 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20283 | auto resources = mImpl->resources(); |
| 20284 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20285 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20286 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20287 | VkSampleLocationsInfoEXT* local_pSampleLocationsInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20288 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20289 | local_pSampleLocationsInfo = nullptr; |
| 20290 | if (pSampleLocationsInfo) |
| 20291 | { |
| 20292 | local_pSampleLocationsInfo = (VkSampleLocationsInfoEXT*)pool->alloc(sizeof(const VkSampleLocationsInfoEXT)); |
| 20293 | deepcopy_VkSampleLocationsInfoEXT(pool, pSampleLocationsInfo, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| 20294 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20295 | if (local_pSampleLocationsInfo) |
| 20296 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20297 | transform_tohost_VkSampleLocationsInfoEXT(mImpl->resources(), (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20298 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20299 | countingStream->rewind(); |
| 20300 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20301 | uint64_t cgen_var_1407; |
| 20302 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1407, 1); |
| 20303 | countingStream->write((uint64_t*)&cgen_var_1407, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20304 | marshal_VkSampleLocationsInfoEXT(countingStream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20305 | } |
| 20306 | uint32_t packetSize_vkCmdSetSampleLocationsEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20307 | countingStream->rewind(); |
| 20308 | uint32_t opcode_vkCmdSetSampleLocationsEXT = OP_vkCmdSetSampleLocationsEXT; |
| 20309 | stream->write(&opcode_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| 20310 | stream->write(&packetSize_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20311 | uint64_t cgen_var_1408; |
| 20312 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1408, 1); |
| 20313 | stream->write((uint64_t*)&cgen_var_1408, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20314 | marshal_VkSampleLocationsInfoEXT(stream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20315 | mImpl->log("finish vkCmdSetSampleLocationsEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20316 | } |
| 20317 | |
| 20318 | void VkEncoder::vkGetPhysicalDeviceMultisamplePropertiesEXT( |
| 20319 | VkPhysicalDevice physicalDevice, |
| 20320 | VkSampleCountFlagBits samples, |
| 20321 | VkMultisamplePropertiesEXT* pMultisampleProperties) |
| 20322 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20323 | mImpl->log("start vkGetPhysicalDeviceMultisamplePropertiesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20324 | auto stream = mImpl->stream(); |
| 20325 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20326 | auto resources = mImpl->resources(); |
| 20327 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20328 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20329 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20330 | VkSampleCountFlagBits local_samples; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20331 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20332 | local_samples = samples; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20333 | countingStream->rewind(); |
| 20334 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20335 | uint64_t cgen_var_1409; |
| 20336 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1409, 1); |
| 20337 | countingStream->write((uint64_t*)&cgen_var_1409, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20338 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20339 | marshal_VkMultisamplePropertiesEXT(countingStream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 20340 | } |
| 20341 | uint32_t packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20342 | countingStream->rewind(); |
| 20343 | uint32_t opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT = OP_vkGetPhysicalDeviceMultisamplePropertiesEXT; |
| 20344 | stream->write(&opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| 20345 | stream->write(&packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20346 | uint64_t cgen_var_1410; |
| 20347 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1410, 1); |
| 20348 | stream->write((uint64_t*)&cgen_var_1410, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20349 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20350 | marshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 20351 | unmarshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20352 | if (pMultisampleProperties) |
| 20353 | { |
| 20354 | transform_fromhost_VkMultisamplePropertiesEXT(mImpl->resources(), (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 20355 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20356 | mImpl->log("finish vkGetPhysicalDeviceMultisamplePropertiesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20357 | } |
| 20358 | |
| 20359 | #endif |
| 20360 | #ifdef VK_EXT_blend_operation_advanced |
| 20361 | #endif |
| 20362 | #ifdef VK_NV_fragment_coverage_to_color |
| 20363 | #endif |
| 20364 | #ifdef VK_NV_framebuffer_mixed_samples |
| 20365 | #endif |
| 20366 | #ifdef VK_NV_fill_rectangle |
| 20367 | #endif |
| 20368 | #ifdef VK_EXT_post_depth_coverage |
| 20369 | #endif |
| 20370 | #ifdef VK_EXT_validation_cache |
| 20371 | VkResult VkEncoder::vkCreateValidationCacheEXT( |
| 20372 | VkDevice device, |
| 20373 | const VkValidationCacheCreateInfoEXT* pCreateInfo, |
| 20374 | const VkAllocationCallbacks* pAllocator, |
| 20375 | VkValidationCacheEXT* pValidationCache) |
| 20376 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20377 | mImpl->log("start vkCreateValidationCacheEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20378 | auto stream = mImpl->stream(); |
| 20379 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20380 | auto resources = mImpl->resources(); |
| 20381 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20382 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20383 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20384 | VkValidationCacheCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20385 | VkAllocationCallbacks* local_pAllocator; |
| 20386 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20387 | local_pCreateInfo = nullptr; |
| 20388 | if (pCreateInfo) |
| 20389 | { |
| 20390 | local_pCreateInfo = (VkValidationCacheCreateInfoEXT*)pool->alloc(sizeof(const VkValidationCacheCreateInfoEXT)); |
| 20391 | deepcopy_VkValidationCacheCreateInfoEXT(pool, pCreateInfo, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| 20392 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20393 | local_pAllocator = nullptr; |
| 20394 | if (pAllocator) |
| 20395 | { |
| 20396 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20397 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20398 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20399 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20400 | if (local_pCreateInfo) |
| 20401 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20402 | transform_tohost_VkValidationCacheCreateInfoEXT(mImpl->resources(), (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20403 | } |
| 20404 | if (local_pAllocator) |
| 20405 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20406 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20407 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20408 | countingStream->rewind(); |
| 20409 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20410 | uint64_t cgen_var_1411; |
| 20411 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1411, 1); |
| 20412 | countingStream->write((uint64_t*)&cgen_var_1411, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20413 | marshal_VkValidationCacheCreateInfoEXT(countingStream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20414 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20415 | uint64_t cgen_var_1412 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20416 | countingStream->putBe64(cgen_var_1412); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20417 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20418 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20419 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20420 | } |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20421 | uint64_t cgen_var_1413; |
| 20422 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1413, 1); |
| 20423 | countingStream->write((uint64_t*)&cgen_var_1413, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20424 | } |
| 20425 | uint32_t packetSize_vkCreateValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20426 | countingStream->rewind(); |
| 20427 | uint32_t opcode_vkCreateValidationCacheEXT = OP_vkCreateValidationCacheEXT; |
| 20428 | stream->write(&opcode_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| 20429 | stream->write(&packetSize_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20430 | uint64_t cgen_var_1414; |
| 20431 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1414, 1); |
| 20432 | stream->write((uint64_t*)&cgen_var_1414, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20433 | marshal_VkValidationCacheCreateInfoEXT(stream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20434 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20435 | uint64_t cgen_var_1415 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20436 | stream->putBe64(cgen_var_1415); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20437 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20438 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20439 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20440 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20441 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20442 | uint64_t cgen_var_1416; |
| 20443 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1416, 1); |
| 20444 | stream->write((uint64_t*)&cgen_var_1416, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20445 | stream->setHandleMapping(resources->unwrapMapping()); |
| 20446 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20447 | uint64_t cgen_var_1417; |
| 20448 | stream->read((uint64_t*)&cgen_var_1417, 8); |
| 20449 | stream->handleMapping()->mapHandles_u64_VkValidationCacheEXT(&cgen_var_1417, (VkValidationCacheEXT*)pValidationCache, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20450 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20451 | VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0; |
| 20452 | stream->read(&vkCreateValidationCacheEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20453 | countingStream->clearPool(); |
| 20454 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20455 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20456 | mImpl->log("finish vkCreateValidationCacheEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20457 | return vkCreateValidationCacheEXT_VkResult_return; |
| 20458 | } |
| 20459 | |
| 20460 | void VkEncoder::vkDestroyValidationCacheEXT( |
| 20461 | VkDevice device, |
| 20462 | VkValidationCacheEXT validationCache, |
| 20463 | const VkAllocationCallbacks* pAllocator) |
| 20464 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20465 | mImpl->log("start vkDestroyValidationCacheEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20466 | auto stream = mImpl->stream(); |
| 20467 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20468 | auto resources = mImpl->resources(); |
| 20469 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20470 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20471 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20472 | VkValidationCacheEXT local_validationCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20473 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20474 | local_device = device; |
| 20475 | local_validationCache = validationCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20476 | local_pAllocator = nullptr; |
| 20477 | if (pAllocator) |
| 20478 | { |
| 20479 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20480 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20481 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20482 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20483 | if (local_pAllocator) |
| 20484 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20485 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20486 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20487 | countingStream->rewind(); |
| 20488 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20489 | uint64_t cgen_var_1418; |
| 20490 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1418, 1); |
| 20491 | countingStream->write((uint64_t*)&cgen_var_1418, 1 * 8); |
| 20492 | uint64_t cgen_var_1419; |
| 20493 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1419, 1); |
| 20494 | countingStream->write((uint64_t*)&cgen_var_1419, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20495 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20496 | uint64_t cgen_var_1420 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20497 | countingStream->putBe64(cgen_var_1420); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20498 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20499 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20500 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20501 | } |
| 20502 | } |
| 20503 | uint32_t packetSize_vkDestroyValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20504 | countingStream->rewind(); |
| 20505 | uint32_t opcode_vkDestroyValidationCacheEXT = OP_vkDestroyValidationCacheEXT; |
| 20506 | stream->write(&opcode_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| 20507 | stream->write(&packetSize_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20508 | uint64_t cgen_var_1421; |
| 20509 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1421, 1); |
| 20510 | stream->write((uint64_t*)&cgen_var_1421, 1 * 8); |
| 20511 | uint64_t cgen_var_1422; |
| 20512 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1422, 1); |
| 20513 | stream->write((uint64_t*)&cgen_var_1422, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20514 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20515 | uint64_t cgen_var_1423 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20516 | stream->putBe64(cgen_var_1423); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20517 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20518 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20519 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20520 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20521 | resources->destroyMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&validationCache); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20522 | mImpl->log("finish vkDestroyValidationCacheEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20523 | } |
| 20524 | |
| 20525 | VkResult VkEncoder::vkMergeValidationCachesEXT( |
| 20526 | VkDevice device, |
| 20527 | VkValidationCacheEXT dstCache, |
| 20528 | uint32_t srcCacheCount, |
| 20529 | const VkValidationCacheEXT* pSrcCaches) |
| 20530 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20531 | mImpl->log("start vkMergeValidationCachesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20532 | auto stream = mImpl->stream(); |
| 20533 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20534 | auto resources = mImpl->resources(); |
| 20535 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20536 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20537 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20538 | VkValidationCacheEXT local_dstCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20539 | uint32_t local_srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20540 | VkValidationCacheEXT* local_pSrcCaches; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20541 | local_device = device; |
| 20542 | local_dstCache = dstCache; |
| 20543 | local_srcCacheCount = srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20544 | local_pSrcCaches = nullptr; |
| 20545 | if (pSrcCaches) |
| 20546 | { |
| 20547 | local_pSrcCaches = (VkValidationCacheEXT*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkValidationCacheEXT)); |
| 20548 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20549 | countingStream->rewind(); |
| 20550 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20551 | uint64_t cgen_var_1424; |
| 20552 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1424, 1); |
| 20553 | countingStream->write((uint64_t*)&cgen_var_1424, 1 * 8); |
| 20554 | uint64_t cgen_var_1425; |
| 20555 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1425, 1); |
| 20556 | countingStream->write((uint64_t*)&cgen_var_1425, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20557 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20558 | if (((srcCacheCount))) |
| 20559 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20560 | uint64_t* cgen_var_1426; |
| 20561 | countingStream->alloc((void**)&cgen_var_1426, ((srcCacheCount)) * 8); |
| 20562 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1426, ((srcCacheCount))); |
| 20563 | countingStream->write((uint64_t*)cgen_var_1426, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20564 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20565 | } |
| 20566 | uint32_t packetSize_vkMergeValidationCachesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20567 | countingStream->rewind(); |
| 20568 | uint32_t opcode_vkMergeValidationCachesEXT = OP_vkMergeValidationCachesEXT; |
| 20569 | stream->write(&opcode_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| 20570 | stream->write(&packetSize_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20571 | uint64_t cgen_var_1427; |
| 20572 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1427, 1); |
| 20573 | stream->write((uint64_t*)&cgen_var_1427, 1 * 8); |
| 20574 | uint64_t cgen_var_1428; |
| 20575 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1428, 1); |
| 20576 | stream->write((uint64_t*)&cgen_var_1428, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20577 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20578 | if (((srcCacheCount))) |
| 20579 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20580 | uint64_t* cgen_var_1429; |
| 20581 | stream->alloc((void**)&cgen_var_1429, ((srcCacheCount)) * 8); |
| 20582 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1429, ((srcCacheCount))); |
| 20583 | stream->write((uint64_t*)cgen_var_1429, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20584 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20585 | VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0; |
| 20586 | stream->read(&vkMergeValidationCachesEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20587 | countingStream->clearPool(); |
| 20588 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20589 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20590 | mImpl->log("finish vkMergeValidationCachesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20591 | return vkMergeValidationCachesEXT_VkResult_return; |
| 20592 | } |
| 20593 | |
| 20594 | VkResult VkEncoder::vkGetValidationCacheDataEXT( |
| 20595 | VkDevice device, |
| 20596 | VkValidationCacheEXT validationCache, |
| 20597 | size_t* pDataSize, |
| 20598 | void* pData) |
| 20599 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20600 | mImpl->log("start vkGetValidationCacheDataEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20601 | auto stream = mImpl->stream(); |
| 20602 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20603 | auto resources = mImpl->resources(); |
| 20604 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20605 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20606 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20607 | VkValidationCacheEXT local_validationCache; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20608 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20609 | local_validationCache = validationCache; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20610 | countingStream->rewind(); |
| 20611 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20612 | uint64_t cgen_var_1430; |
| 20613 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1430, 1); |
| 20614 | countingStream->write((uint64_t*)&cgen_var_1430, 1 * 8); |
| 20615 | uint64_t cgen_var_1431; |
| 20616 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1431, 1); |
| 20617 | countingStream->write((uint64_t*)&cgen_var_1431, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20618 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20619 | uint64_t cgen_var_1432 = (uint64_t)(uintptr_t)pDataSize; |
| 20620 | countingStream->putBe64(cgen_var_1432); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20621 | if (pDataSize) |
| 20622 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20623 | uint64_t cgen_var_1433 = (uint64_t)(*pDataSize); |
| 20624 | countingStream->putBe64(cgen_var_1433); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20625 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20626 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20627 | uint64_t cgen_var_1434 = (uint64_t)(uintptr_t)pData; |
| 20628 | countingStream->putBe64(cgen_var_1434); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20629 | if (pData) |
| 20630 | { |
| 20631 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 20632 | } |
| 20633 | } |
| 20634 | uint32_t packetSize_vkGetValidationCacheDataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20635 | countingStream->rewind(); |
| 20636 | uint32_t opcode_vkGetValidationCacheDataEXT = OP_vkGetValidationCacheDataEXT; |
| 20637 | stream->write(&opcode_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| 20638 | stream->write(&packetSize_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20639 | uint64_t cgen_var_1435; |
| 20640 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1435, 1); |
| 20641 | stream->write((uint64_t*)&cgen_var_1435, 1 * 8); |
| 20642 | uint64_t cgen_var_1436; |
| 20643 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1436, 1); |
| 20644 | stream->write((uint64_t*)&cgen_var_1436, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20645 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20646 | uint64_t cgen_var_1437 = (uint64_t)(uintptr_t)pDataSize; |
| 20647 | stream->putBe64(cgen_var_1437); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20648 | if (pDataSize) |
| 20649 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20650 | uint64_t cgen_var_1438 = (uint64_t)(*pDataSize); |
| 20651 | stream->putBe64(cgen_var_1438); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20652 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20653 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20654 | uint64_t cgen_var_1439 = (uint64_t)(uintptr_t)pData; |
| 20655 | stream->putBe64(cgen_var_1439); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20656 | if (pData) |
| 20657 | { |
| 20658 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 20659 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20660 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20661 | size_t* check_pDataSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20662 | check_pDataSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20663 | if (pDataSize) |
| 20664 | { |
| 20665 | if (!(check_pDataSize)) |
| 20666 | { |
| 20667 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 20668 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 20669 | (*pDataSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20670 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20671 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20672 | void* check_pData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20673 | check_pData = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20674 | if (pData) |
| 20675 | { |
| 20676 | if (!(check_pData)) |
| 20677 | { |
| 20678 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 20679 | } |
| 20680 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 20681 | } |
| 20682 | VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0; |
| 20683 | stream->read(&vkGetValidationCacheDataEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20684 | countingStream->clearPool(); |
| 20685 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20686 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20687 | mImpl->log("finish vkGetValidationCacheDataEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20688 | return vkGetValidationCacheDataEXT_VkResult_return; |
| 20689 | } |
| 20690 | |
| 20691 | #endif |
| 20692 | #ifdef VK_EXT_descriptor_indexing |
| 20693 | #endif |
| 20694 | #ifdef VK_EXT_shader_viewport_index_layer |
| 20695 | #endif |
| 20696 | #ifdef VK_EXT_global_priority |
| 20697 | #endif |
| 20698 | #ifdef VK_EXT_external_memory_host |
| 20699 | VkResult VkEncoder::vkGetMemoryHostPointerPropertiesEXT( |
| 20700 | VkDevice device, |
| 20701 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 20702 | const void* pHostPointer, |
| 20703 | VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) |
| 20704 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20705 | mImpl->log("start vkGetMemoryHostPointerPropertiesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20706 | auto stream = mImpl->stream(); |
| 20707 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20708 | auto resources = mImpl->resources(); |
| 20709 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20710 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20711 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20712 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20713 | void* local_pHostPointer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20714 | local_device = device; |
| 20715 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20716 | local_pHostPointer = nullptr; |
| 20717 | if (pHostPointer) |
| 20718 | { |
| 20719 | local_pHostPointer = (void*)pool->dupArray(pHostPointer, sizeof(const uint8_t)); |
| 20720 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20721 | countingStream->rewind(); |
| 20722 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20723 | uint64_t cgen_var_1443; |
| 20724 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1443, 1); |
| 20725 | countingStream->write((uint64_t*)&cgen_var_1443, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20726 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20727 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20728 | uint64_t cgen_var_1444 = (uint64_t)(uintptr_t)local_pHostPointer; |
| 20729 | countingStream->putBe64(cgen_var_1444); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20730 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20731 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20732 | countingStream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20733 | } |
| 20734 | marshal_VkMemoryHostPointerPropertiesEXT(countingStream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 20735 | } |
| 20736 | uint32_t packetSize_vkGetMemoryHostPointerPropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20737 | countingStream->rewind(); |
| 20738 | uint32_t opcode_vkGetMemoryHostPointerPropertiesEXT = OP_vkGetMemoryHostPointerPropertiesEXT; |
| 20739 | stream->write(&opcode_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| 20740 | stream->write(&packetSize_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20741 | uint64_t cgen_var_1445; |
| 20742 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1445, 1); |
| 20743 | stream->write((uint64_t*)&cgen_var_1445, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20744 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20745 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20746 | uint64_t cgen_var_1446 = (uint64_t)(uintptr_t)local_pHostPointer; |
| 20747 | stream->putBe64(cgen_var_1446); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20748 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20749 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20750 | stream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20751 | } |
| 20752 | marshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 20753 | unmarshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20754 | if (pMemoryHostPointerProperties) |
| 20755 | { |
| 20756 | transform_fromhost_VkMemoryHostPointerPropertiesEXT(mImpl->resources(), (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 20757 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20758 | VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0; |
| 20759 | stream->read(&vkGetMemoryHostPointerPropertiesEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20760 | countingStream->clearPool(); |
| 20761 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20762 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20763 | mImpl->log("finish vkGetMemoryHostPointerPropertiesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20764 | return vkGetMemoryHostPointerPropertiesEXT_VkResult_return; |
| 20765 | } |
| 20766 | |
| 20767 | #endif |
| 20768 | #ifdef VK_AMD_buffer_marker |
| 20769 | void VkEncoder::vkCmdWriteBufferMarkerAMD( |
| 20770 | VkCommandBuffer commandBuffer, |
| 20771 | VkPipelineStageFlagBits pipelineStage, |
| 20772 | VkBuffer dstBuffer, |
| 20773 | VkDeviceSize dstOffset, |
| 20774 | uint32_t marker) |
| 20775 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20776 | mImpl->log("start vkCmdWriteBufferMarkerAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20777 | auto stream = mImpl->stream(); |
| 20778 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20779 | auto resources = mImpl->resources(); |
| 20780 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20781 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20782 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20783 | VkPipelineStageFlagBits local_pipelineStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20784 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20785 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20786 | uint32_t local_marker; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20787 | local_commandBuffer = commandBuffer; |
| 20788 | local_pipelineStage = pipelineStage; |
| 20789 | local_dstBuffer = dstBuffer; |
| 20790 | local_dstOffset = dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20791 | local_marker = marker; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20792 | countingStream->rewind(); |
| 20793 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20794 | uint64_t cgen_var_1447; |
| 20795 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1447, 1); |
| 20796 | countingStream->write((uint64_t*)&cgen_var_1447, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20797 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20798 | uint64_t cgen_var_1448; |
| 20799 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1448, 1); |
| 20800 | countingStream->write((uint64_t*)&cgen_var_1448, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20801 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 20802 | countingStream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20803 | } |
| 20804 | uint32_t packetSize_vkCmdWriteBufferMarkerAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20805 | countingStream->rewind(); |
| 20806 | uint32_t opcode_vkCmdWriteBufferMarkerAMD = OP_vkCmdWriteBufferMarkerAMD; |
| 20807 | stream->write(&opcode_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| 20808 | stream->write(&packetSize_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20809 | uint64_t cgen_var_1449; |
| 20810 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1449, 1); |
| 20811 | stream->write((uint64_t*)&cgen_var_1449, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20812 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20813 | uint64_t cgen_var_1450; |
| 20814 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1450, 1); |
| 20815 | stream->write((uint64_t*)&cgen_var_1450, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20816 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 20817 | stream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20818 | mImpl->log("finish vkCmdWriteBufferMarkerAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20819 | } |
| 20820 | |
| 20821 | #endif |
| 20822 | #ifdef VK_AMD_shader_core_properties |
| 20823 | #endif |
| 20824 | #ifdef VK_EXT_vertex_attribute_divisor |
| 20825 | #endif |
| 20826 | #ifdef VK_NV_shader_subgroup_partitioned |
| 20827 | #endif |
| 20828 | #ifdef VK_NV_device_diagnostic_checkpoints |
| 20829 | void VkEncoder::vkCmdSetCheckpointNV( |
| 20830 | VkCommandBuffer commandBuffer, |
| 20831 | const void* pCheckpointMarker) |
| 20832 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20833 | mImpl->log("start vkCmdSetCheckpointNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20834 | auto stream = mImpl->stream(); |
| 20835 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20836 | auto resources = mImpl->resources(); |
| 20837 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20838 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20839 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20840 | void* local_pCheckpointMarker; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20841 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20842 | local_pCheckpointMarker = nullptr; |
| 20843 | if (pCheckpointMarker) |
| 20844 | { |
| 20845 | local_pCheckpointMarker = (void*)pool->dupArray(pCheckpointMarker, sizeof(const uint8_t)); |
| 20846 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20847 | countingStream->rewind(); |
| 20848 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20849 | uint64_t cgen_var_1451; |
| 20850 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1451, 1); |
| 20851 | countingStream->write((uint64_t*)&cgen_var_1451, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20852 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20853 | uint64_t cgen_var_1452 = (uint64_t)(uintptr_t)local_pCheckpointMarker; |
| 20854 | countingStream->putBe64(cgen_var_1452); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20855 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20856 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20857 | countingStream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20858 | } |
| 20859 | } |
| 20860 | uint32_t packetSize_vkCmdSetCheckpointNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20861 | countingStream->rewind(); |
| 20862 | uint32_t opcode_vkCmdSetCheckpointNV = OP_vkCmdSetCheckpointNV; |
| 20863 | stream->write(&opcode_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| 20864 | stream->write(&packetSize_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20865 | uint64_t cgen_var_1453; |
| 20866 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1453, 1); |
| 20867 | stream->write((uint64_t*)&cgen_var_1453, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20868 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20869 | uint64_t cgen_var_1454 = (uint64_t)(uintptr_t)local_pCheckpointMarker; |
| 20870 | stream->putBe64(cgen_var_1454); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20871 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20872 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20873 | stream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20874 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20875 | mImpl->log("finish vkCmdSetCheckpointNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20876 | } |
| 20877 | |
| 20878 | void VkEncoder::vkGetQueueCheckpointDataNV( |
| 20879 | VkQueue queue, |
| 20880 | uint32_t* pCheckpointDataCount, |
| 20881 | VkCheckpointDataNV* pCheckpointData) |
| 20882 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20883 | mImpl->log("start vkGetQueueCheckpointDataNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20884 | auto stream = mImpl->stream(); |
| 20885 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20886 | auto resources = mImpl->resources(); |
| 20887 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20888 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20889 | VkQueue local_queue; |
| 20890 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20891 | countingStream->rewind(); |
| 20892 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20893 | uint64_t cgen_var_1455; |
| 20894 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1455, 1); |
| 20895 | countingStream->write((uint64_t*)&cgen_var_1455, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20896 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20897 | uint64_t cgen_var_1456 = (uint64_t)(uintptr_t)pCheckpointDataCount; |
| 20898 | countingStream->putBe64(cgen_var_1456); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20899 | if (pCheckpointDataCount) |
| 20900 | { |
| 20901 | countingStream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 20902 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20903 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20904 | uint64_t cgen_var_1457 = (uint64_t)(uintptr_t)pCheckpointData; |
| 20905 | countingStream->putBe64(cgen_var_1457); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20906 | if (pCheckpointData) |
| 20907 | { |
| 20908 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 20909 | { |
| 20910 | marshal_VkCheckpointDataNV(countingStream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 20911 | } |
| 20912 | } |
| 20913 | } |
| 20914 | uint32_t packetSize_vkGetQueueCheckpointDataNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20915 | countingStream->rewind(); |
| 20916 | uint32_t opcode_vkGetQueueCheckpointDataNV = OP_vkGetQueueCheckpointDataNV; |
| 20917 | stream->write(&opcode_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| 20918 | stream->write(&packetSize_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20919 | uint64_t cgen_var_1458; |
| 20920 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1458, 1); |
| 20921 | stream->write((uint64_t*)&cgen_var_1458, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20922 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20923 | uint64_t cgen_var_1459 = (uint64_t)(uintptr_t)pCheckpointDataCount; |
| 20924 | stream->putBe64(cgen_var_1459); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20925 | if (pCheckpointDataCount) |
| 20926 | { |
| 20927 | stream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 20928 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20929 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20930 | uint64_t cgen_var_1460 = (uint64_t)(uintptr_t)pCheckpointData; |
| 20931 | stream->putBe64(cgen_var_1460); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20932 | if (pCheckpointData) |
| 20933 | { |
| 20934 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 20935 | { |
| 20936 | marshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 20937 | } |
| 20938 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20939 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20940 | uint32_t* check_pCheckpointDataCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20941 | check_pCheckpointDataCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20942 | if (pCheckpointDataCount) |
| 20943 | { |
| 20944 | if (!(check_pCheckpointDataCount)) |
| 20945 | { |
| 20946 | fprintf(stderr, "fatal: pCheckpointDataCount inconsistent between guest and host\n"); |
| 20947 | } |
| 20948 | stream->read((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 20949 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20950 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20951 | VkCheckpointDataNV* check_pCheckpointData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20952 | check_pCheckpointData = (VkCheckpointDataNV*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20953 | if (pCheckpointData) |
| 20954 | { |
| 20955 | if (!(check_pCheckpointData)) |
| 20956 | { |
| 20957 | fprintf(stderr, "fatal: pCheckpointData inconsistent between guest and host\n"); |
| 20958 | } |
| 20959 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 20960 | { |
| 20961 | unmarshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 20962 | } |
| 20963 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20964 | if (pCheckpointData) |
| 20965 | { |
| 20966 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 20967 | { |
| 20968 | transform_fromhost_VkCheckpointDataNV(mImpl->resources(), (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 20969 | } |
| 20970 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20971 | mImpl->log("finish vkGetQueueCheckpointDataNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20972 | } |
| 20973 | |
| 20974 | #endif |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 20975 | #ifdef VK_GOOGLE_address_space |
| 20976 | VkResult VkEncoder::vkMapMemoryIntoAddressSpaceGOOGLE( |
| 20977 | VkDevice device, |
| 20978 | VkDeviceMemory memory, |
| 20979 | uint64_t* pAddress) |
| 20980 | { |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20981 | mImpl->log("start vkMapMemoryIntoAddressSpaceGOOGLE"); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 20982 | mImpl->resources()->on_vkMapMemoryIntoAddressSpaceGOOGLE_pre(this, VK_SUCCESS, device, memory, pAddress); |
| 20983 | auto stream = mImpl->stream(); |
| 20984 | auto countingStream = mImpl->countingStream(); |
| 20985 | auto resources = mImpl->resources(); |
| 20986 | auto pool = mImpl->pool(); |
| 20987 | stream->setHandleMapping(resources->unwrapMapping()); |
| 20988 | VkDevice local_device; |
| 20989 | VkDeviceMemory local_memory; |
| 20990 | local_device = device; |
| 20991 | local_memory = memory; |
| Lingfeng Yang | afe29d3 | 2018-12-25 13:01:52 -0800 | [diff] [blame] | 20992 | mImpl->resources()->deviceMemoryTransform_tohost(&local_memory, 1, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, 0); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 20993 | countingStream->rewind(); |
| 20994 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 20995 | uint64_t cgen_var_1463; |
| 20996 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1463, 1); |
| 20997 | countingStream->write((uint64_t*)&cgen_var_1463, 1 * 8); |
| 20998 | uint64_t cgen_var_1464; |
| 20999 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1464, 1); |
| 21000 | countingStream->write((uint64_t*)&cgen_var_1464, 1 * 8); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 21001 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 21002 | uint64_t cgen_var_1465 = (uint64_t)(uintptr_t)pAddress; |
| 21003 | countingStream->putBe64(cgen_var_1465); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 21004 | if (pAddress) |
| 21005 | { |
| 21006 | countingStream->write((uint64_t*)pAddress, sizeof(uint64_t)); |
| 21007 | } |
| 21008 | } |
| 21009 | uint32_t packetSize_vkMapMemoryIntoAddressSpaceGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21010 | countingStream->rewind(); |
| 21011 | uint32_t opcode_vkMapMemoryIntoAddressSpaceGOOGLE = OP_vkMapMemoryIntoAddressSpaceGOOGLE; |
| 21012 | stream->write(&opcode_vkMapMemoryIntoAddressSpaceGOOGLE, sizeof(uint32_t)); |
| 21013 | stream->write(&packetSize_vkMapMemoryIntoAddressSpaceGOOGLE, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 21014 | uint64_t cgen_var_1466; |
| 21015 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1466, 1); |
| 21016 | stream->write((uint64_t*)&cgen_var_1466, 1 * 8); |
| 21017 | uint64_t cgen_var_1467; |
| 21018 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1467, 1); |
| 21019 | stream->write((uint64_t*)&cgen_var_1467, 1 * 8); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 21020 | // WARNING PTR CHECK |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame^] | 21021 | uint64_t cgen_var_1468 = (uint64_t)(uintptr_t)pAddress; |
| 21022 | stream->putBe64(cgen_var_1468); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 21023 | if (pAddress) |
| 21024 | { |
| 21025 | stream->write((uint64_t*)pAddress, sizeof(uint64_t)); |
| 21026 | } |
| 21027 | // WARNING PTR CHECK |
| 21028 | uint64_t* check_pAddress; |
| 21029 | check_pAddress = (uint64_t*)(uintptr_t)stream->getBe64(); |
| 21030 | if (pAddress) |
| 21031 | { |
| 21032 | if (!(check_pAddress)) |
| 21033 | { |
| 21034 | fprintf(stderr, "fatal: pAddress inconsistent between guest and host\n"); |
| 21035 | } |
| 21036 | stream->read((uint64_t*)pAddress, sizeof(uint64_t)); |
| 21037 | } |
| 21038 | VkResult vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return = (VkResult)0; |
| 21039 | stream->read(&vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return, sizeof(VkResult)); |
| 21040 | countingStream->clearPool(); |
| 21041 | stream->clearPool(); |
| 21042 | pool->freeAll(); |
| 21043 | mImpl->resources()->on_vkMapMemoryIntoAddressSpaceGOOGLE(this, vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return, device, memory, pAddress); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21044 | mImpl->log("finish vkMapMemoryIntoAddressSpaceGOOGLE");; |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 21045 | return vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return; |
| 21046 | } |
| 21047 | |
| 21048 | #endif |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21049 | |
| Lingfeng Yang | b1d9010 | 2018-11-29 16:10:36 -0800 | [diff] [blame] | 21050 | } // namespace goldfish_vk |