| 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 | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 32 | #include "VulkanStreamGuest.h" |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 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 | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 36 | #include "android/base/synchronization/AndroidLock.h" |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 37 | |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 38 | #include <cutils/properties.h> |
| 39 | |
| Lingfeng Yang | e71c642 | 2018-11-01 19:29:49 -0700 | [diff] [blame] | 40 | #include "goldfish_vk_marshaling_guest.h" |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 41 | #include "goldfish_vk_deepcopy_guest.h" |
| 42 | #include "goldfish_vk_handlemap_guest.h" |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 43 | #include "goldfish_vk_private_defs.h" |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 44 | #include "goldfish_vk_transform_guest.h" |
| Lingfeng Yang | e71c642 | 2018-11-01 19:29:49 -0700 | [diff] [blame] | 45 | |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 46 | #include <unordered_map> |
| 47 | |
| 48 | |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 49 | |
| Lingfeng Yang | b1d9010 | 2018-11-29 16:10:36 -0800 | [diff] [blame] | 50 | namespace goldfish_vk { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 51 | |
| 52 | |
| 53 | |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 54 | using namespace goldfish_vk; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 55 | |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 56 | using android::aligned_buf_alloc; |
| 57 | using android::aligned_buf_free; |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 58 | using android::base::guest::AutoLock; |
| 59 | using android::base::guest::Lock; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 60 | using android::base::Pool; |
| Lingfeng Yang | 6f3b6c5 | 2018-11-05 14:22:37 -0800 | [diff] [blame] | 61 | |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 62 | class VkEncoder::Impl { |
| 63 | public: |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 64 | Impl(IOStream* stream) : m_stream(stream), m_logEncodes(false) { |
| 65 | const char* emuVkLogEncodesPropName = "qemu.vk.log"; |
| 66 | char encodeProp[PROPERTY_VALUE_MAX]; |
| 67 | if (property_get(emuVkLogEncodesPropName, encodeProp, nullptr) > 0) { |
| 68 | m_logEncodes = atoi(encodeProp) > 0; |
| 69 | } |
| 70 | } |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 71 | |
| 72 | ~Impl() { |
| 73 | for (auto it : mCleanupCallbacks) { |
| 74 | fprintf(stderr, "%s: run cleanup callback for %p\n", __func__, it.first); |
| 75 | it.second(); |
| 76 | } |
| 77 | } |
| 78 | |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 79 | VulkanCountingStream* countingStream() { return &m_countingStream; } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 80 | VulkanStreamGuest* stream() { return &m_stream; } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 81 | Pool* pool() { return &m_pool; } |
| 82 | ResourceTracker* resources() { return ResourceTracker::get(); } |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 83 | Validation* validation() { return &m_validation; } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 84 | |
| 85 | void log(const char* text) { |
| 86 | if (!m_logEncodes) return; |
| 87 | ALOGD("encoder log: %s", text); |
| 88 | } |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 89 | |
| 90 | void flush() { |
| 91 | AutoLock encoderLock(lock); |
| 92 | m_stream.flush(); |
| 93 | } |
| 94 | |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 95 | // Assume the lock for the current encoder is held. |
| 96 | void registerCleanupCallback(void* handle, VkEncoder::CleanupCallback cb) { |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 97 | if (mCleanupCallbacks.end() == mCleanupCallbacks.find(handle)) { |
| 98 | mCleanupCallbacks[handle] = cb; |
| 99 | } else { |
| 100 | return; |
| 101 | } |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | void unregisterCleanupCallback(void* handle) { |
| 105 | mCleanupCallbacks.erase(handle); |
| 106 | } |
| 107 | |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 108 | Lock lock; |
| 109 | |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 110 | private: |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 111 | VulkanCountingStream m_countingStream; |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 112 | VulkanStreamGuest m_stream; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 113 | Pool m_pool { 8, 4096, 64 }; |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 114 | |
| 115 | Validation m_validation; |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 116 | bool m_logEncodes; |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 117 | |
| 118 | std::unordered_map<void*, VkEncoder::CleanupCallback> mCleanupCallbacks; |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 119 | }; |
| 120 | |
| 121 | VkEncoder::VkEncoder(IOStream *stream) : |
| 122 | mImpl(new VkEncoder::Impl(stream)) { } |
| Lingfeng Yang | 60b411d | 2018-11-29 00:26:45 -0800 | [diff] [blame] | 123 | |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 124 | void VkEncoder::flush() { |
| 125 | mImpl->flush(); |
| 126 | } |
| 127 | |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 128 | void VkEncoder::registerCleanupCallback(void* handle, VkEncoder::CleanupCallback cb) { |
| 129 | mImpl->registerCleanupCallback(handle, cb); |
| 130 | } |
| 131 | |
| 132 | void VkEncoder::unregisterCleanupCallback(void* handle) { |
| 133 | mImpl->unregisterCleanupCallback(handle); |
| 134 | } |
| 135 | |
| Lingfeng Yang | 60b411d | 2018-11-29 00:26:45 -0800 | [diff] [blame] | 136 | #define VALIDATE_RET(retType, success, validate) \ |
| 137 | retType goldfish_vk_validateResult = validate; \ |
| 138 | if (goldfish_vk_validateResult != success) return goldfish_vk_validateResult; \ |
| 139 | |
| 140 | #define VALIDATE_VOID(validate) \ |
| 141 | VkResult goldfish_vk_validateResult = validate; \ |
| 142 | if (goldfish_vk_validateResult != VK_SUCCESS) return; \ |
| 143 | |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 144 | #ifdef VK_VERSION_1_0 |
| 145 | VkResult VkEncoder::vkCreateInstance( |
| 146 | const VkInstanceCreateInfo* pCreateInfo, |
| 147 | const VkAllocationCallbacks* pAllocator, |
| 148 | VkInstance* pInstance) |
| 149 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 150 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 151 | AEMU_SCOPED_TRACE("vkCreateInstance encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 152 | mImpl->log("start vkCreateInstance"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 153 | auto stream = mImpl->stream(); |
| 154 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 155 | auto resources = mImpl->resources(); |
| 156 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 157 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 158 | VkInstanceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 159 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 160 | local_pCreateInfo = nullptr; |
| 161 | if (pCreateInfo) |
| 162 | { |
| 163 | local_pCreateInfo = (VkInstanceCreateInfo*)pool->alloc(sizeof(const VkInstanceCreateInfo)); |
| 164 | deepcopy_VkInstanceCreateInfo(pool, pCreateInfo, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| 165 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 166 | local_pAllocator = nullptr; |
| 167 | if (pAllocator) |
| 168 | { |
| 169 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 170 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 171 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 172 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 173 | if (local_pCreateInfo) |
| 174 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 175 | transform_tohost_VkInstanceCreateInfo(mImpl->resources(), (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 176 | } |
| 177 | if (local_pAllocator) |
| 178 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 179 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 180 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 181 | countingStream->rewind(); |
| 182 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 183 | marshal_VkInstanceCreateInfo(countingStream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 184 | // WARNING PTR CHECK |
| 185 | uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pAllocator; |
| 186 | countingStream->putBe64(cgen_var_0); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 187 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 188 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 189 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 190 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 191 | uint64_t cgen_var_1; |
| 192 | countingStream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_1, 1); |
| 193 | countingStream->write((uint64_t*)&cgen_var_1, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 194 | } |
| 195 | uint32_t packetSize_vkCreateInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 196 | countingStream->rewind(); |
| 197 | uint32_t opcode_vkCreateInstance = OP_vkCreateInstance; |
| 198 | stream->write(&opcode_vkCreateInstance, sizeof(uint32_t)); |
| 199 | stream->write(&packetSize_vkCreateInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 200 | marshal_VkInstanceCreateInfo(stream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 201 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 202 | uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator; |
| 203 | stream->putBe64(cgen_var_2); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 204 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 205 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 206 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 207 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 208 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 209 | uint64_t cgen_var_3; |
| 210 | stream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_3, 1); |
| 211 | stream->write((uint64_t*)&cgen_var_3, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 212 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 213 | AEMU_SCOPED_TRACE("vkCreateInstance readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 214 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 215 | uint64_t cgen_var_4; |
| 216 | stream->read((uint64_t*)&cgen_var_4, 8); |
| 217 | stream->handleMapping()->mapHandles_u64_VkInstance(&cgen_var_4, (VkInstance*)pInstance, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 218 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 219 | AEMU_SCOPED_TRACE("vkCreateInstance returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 220 | VkResult vkCreateInstance_VkResult_return = (VkResult)0; |
| 221 | stream->read(&vkCreateInstance_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 222 | countingStream->clearPool(); |
| 223 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 224 | pool->freeAll(); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 225 | encoderLock.unlock(); |
| Lingfeng Yang | f0654ff | 2019-02-02 12:21:24 -0800 | [diff] [blame] | 226 | mImpl->resources()->on_vkCreateInstance(this, vkCreateInstance_VkResult_return, pCreateInfo, pAllocator, pInstance); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 227 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 228 | mImpl->log("finish vkCreateInstance");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 229 | return vkCreateInstance_VkResult_return; |
| 230 | } |
| 231 | |
| 232 | void VkEncoder::vkDestroyInstance( |
| 233 | VkInstance instance, |
| 234 | const VkAllocationCallbacks* pAllocator) |
| 235 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 236 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 237 | AEMU_SCOPED_TRACE("vkDestroyInstance encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 238 | mImpl->log("start vkDestroyInstance"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 239 | auto stream = mImpl->stream(); |
| 240 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 241 | auto resources = mImpl->resources(); |
| 242 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 243 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 244 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 245 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 246 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 247 | local_pAllocator = nullptr; |
| 248 | if (pAllocator) |
| 249 | { |
| 250 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 251 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 252 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 253 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 254 | if (local_pAllocator) |
| 255 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 256 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 257 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 258 | countingStream->rewind(); |
| 259 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 260 | uint64_t cgen_var_5; |
| 261 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_5, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 262 | countingStream->write((uint64_t*)&cgen_var_5, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 263 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 264 | uint64_t cgen_var_6 = (uint64_t)(uintptr_t)local_pAllocator; |
| 265 | countingStream->putBe64(cgen_var_6); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 266 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 267 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 268 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 269 | } |
| 270 | } |
| 271 | uint32_t packetSize_vkDestroyInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 272 | countingStream->rewind(); |
| 273 | uint32_t opcode_vkDestroyInstance = OP_vkDestroyInstance; |
| 274 | stream->write(&opcode_vkDestroyInstance, sizeof(uint32_t)); |
| 275 | stream->write(&packetSize_vkDestroyInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 276 | uint64_t cgen_var_7; |
| 277 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_7, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 278 | stream->write((uint64_t*)&cgen_var_7, 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_8 = (uint64_t)(uintptr_t)local_pAllocator; |
| 281 | stream->putBe64(cgen_var_8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 282 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 283 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 284 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 285 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 286 | AEMU_SCOPED_TRACE("vkDestroyInstance readParams"); |
| 287 | AEMU_SCOPED_TRACE("vkDestroyInstance returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 288 | resources->destroyMapping()->mapHandles_VkInstance((VkInstance*)&instance); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 289 | mImpl->log("finish vkDestroyInstance");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 290 | } |
| 291 | |
| 292 | VkResult VkEncoder::vkEnumeratePhysicalDevices( |
| 293 | VkInstance instance, |
| 294 | uint32_t* pPhysicalDeviceCount, |
| 295 | VkPhysicalDevice* pPhysicalDevices) |
| 296 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 297 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 298 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDevices encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 299 | mImpl->log("start vkEnumeratePhysicalDevices"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 300 | auto stream = mImpl->stream(); |
| 301 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 302 | auto resources = mImpl->resources(); |
| 303 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 304 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 305 | VkInstance local_instance; |
| 306 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 307 | countingStream->rewind(); |
| 308 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 309 | uint64_t cgen_var_9; |
| 310 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_9, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 311 | countingStream->write((uint64_t*)&cgen_var_9, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 312 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 313 | uint64_t cgen_var_10 = (uint64_t)(uintptr_t)pPhysicalDeviceCount; |
| 314 | countingStream->putBe64(cgen_var_10); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 315 | if (pPhysicalDeviceCount) |
| 316 | { |
| 317 | countingStream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 318 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 319 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 320 | uint64_t cgen_var_11 = (uint64_t)(uintptr_t)pPhysicalDevices; |
| 321 | countingStream->putBe64(cgen_var_11); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 322 | if (pPhysicalDevices) |
| 323 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 324 | if ((*(pPhysicalDeviceCount))) |
| 325 | { |
| 326 | uint64_t* cgen_var_12; |
| 327 | countingStream->alloc((void**)&cgen_var_12, (*(pPhysicalDeviceCount)) * 8); |
| 328 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_12, (*(pPhysicalDeviceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 329 | countingStream->write((uint64_t*)cgen_var_12, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 330 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 331 | } |
| 332 | } |
| 333 | uint32_t packetSize_vkEnumeratePhysicalDevices = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 334 | countingStream->rewind(); |
| 335 | uint32_t opcode_vkEnumeratePhysicalDevices = OP_vkEnumeratePhysicalDevices; |
| 336 | stream->write(&opcode_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| 337 | stream->write(&packetSize_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 338 | uint64_t cgen_var_13; |
| 339 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_13, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 340 | stream->write((uint64_t*)&cgen_var_13, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 341 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 342 | uint64_t cgen_var_14 = (uint64_t)(uintptr_t)pPhysicalDeviceCount; |
| 343 | stream->putBe64(cgen_var_14); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 344 | if (pPhysicalDeviceCount) |
| 345 | { |
| 346 | stream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 347 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 348 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 349 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 350 | uint64_t cgen_var_15 = (uint64_t)(uintptr_t)pPhysicalDevices; |
| 351 | stream->putBe64(cgen_var_15); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 352 | if (pPhysicalDevices) |
| 353 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 354 | if ((*(pPhysicalDeviceCount))) |
| 355 | { |
| 356 | uint64_t* cgen_var_16; |
| 357 | stream->alloc((void**)&cgen_var_16, (*(pPhysicalDeviceCount)) * 8); |
| 358 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_16, (*(pPhysicalDeviceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 359 | stream->write((uint64_t*)cgen_var_16, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 360 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 361 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 362 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 363 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDevices readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 364 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 365 | uint32_t* check_pPhysicalDeviceCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 366 | check_pPhysicalDeviceCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 367 | if (pPhysicalDeviceCount) |
| 368 | { |
| 369 | if (!(check_pPhysicalDeviceCount)) |
| 370 | { |
| 371 | fprintf(stderr, "fatal: pPhysicalDeviceCount inconsistent between guest and host\n"); |
| 372 | } |
| 373 | stream->read((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 374 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 375 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 376 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 377 | VkPhysicalDevice* check_pPhysicalDevices; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 378 | check_pPhysicalDevices = (VkPhysicalDevice*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 379 | if (pPhysicalDevices) |
| 380 | { |
| 381 | if (!(check_pPhysicalDevices)) |
| 382 | { |
| 383 | fprintf(stderr, "fatal: pPhysicalDevices inconsistent between guest and host\n"); |
| 384 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 385 | if ((*(pPhysicalDeviceCount))) |
| 386 | { |
| 387 | uint64_t* cgen_var_19; |
| 388 | stream->alloc((void**)&cgen_var_19, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 389 | stream->read((uint64_t*)cgen_var_19, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 390 | stream->handleMapping()->mapHandles_u64_VkPhysicalDevice(cgen_var_19, (VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount))); |
| 391 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 392 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 393 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 394 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDevices returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 395 | VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0; |
| 396 | stream->read(&vkEnumeratePhysicalDevices_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 397 | countingStream->clearPool(); |
| 398 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 399 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 400 | mImpl->log("finish vkEnumeratePhysicalDevices");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 401 | return vkEnumeratePhysicalDevices_VkResult_return; |
| 402 | } |
| 403 | |
| 404 | void VkEncoder::vkGetPhysicalDeviceFeatures( |
| 405 | VkPhysicalDevice physicalDevice, |
| 406 | VkPhysicalDeviceFeatures* pFeatures) |
| 407 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 408 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 409 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 410 | mImpl->log("start vkGetPhysicalDeviceFeatures"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 411 | auto stream = mImpl->stream(); |
| 412 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 413 | auto resources = mImpl->resources(); |
| 414 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 415 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 416 | VkPhysicalDevice local_physicalDevice; |
| 417 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 418 | countingStream->rewind(); |
| 419 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 420 | uint64_t cgen_var_20; |
| 421 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_20, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 422 | countingStream->write((uint64_t*)&cgen_var_20, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 423 | marshal_VkPhysicalDeviceFeatures(countingStream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 424 | } |
| 425 | uint32_t packetSize_vkGetPhysicalDeviceFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 426 | countingStream->rewind(); |
| 427 | uint32_t opcode_vkGetPhysicalDeviceFeatures = OP_vkGetPhysicalDeviceFeatures; |
| 428 | stream->write(&opcode_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| 429 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 430 | uint64_t cgen_var_21; |
| 431 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_21, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 432 | stream->write((uint64_t*)&cgen_var_21, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 433 | marshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 434 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 435 | unmarshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 436 | if (pFeatures) |
| 437 | { |
| 438 | transform_fromhost_VkPhysicalDeviceFeatures(mImpl->resources(), (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 439 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 440 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 441 | mImpl->log("finish vkGetPhysicalDeviceFeatures");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 442 | } |
| 443 | |
| 444 | void VkEncoder::vkGetPhysicalDeviceFormatProperties( |
| 445 | VkPhysicalDevice physicalDevice, |
| 446 | VkFormat format, |
| 447 | VkFormatProperties* pFormatProperties) |
| 448 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 449 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 450 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 451 | mImpl->log("start vkGetPhysicalDeviceFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 452 | auto stream = mImpl->stream(); |
| 453 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 454 | auto resources = mImpl->resources(); |
| 455 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 456 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 457 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 458 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 459 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 460 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 461 | countingStream->rewind(); |
| 462 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 463 | uint64_t cgen_var_22; |
| 464 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_22, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 465 | countingStream->write((uint64_t*)&cgen_var_22, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 466 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 467 | marshal_VkFormatProperties(countingStream, (VkFormatProperties*)(pFormatProperties)); |
| 468 | } |
| 469 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 470 | countingStream->rewind(); |
| 471 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties = OP_vkGetPhysicalDeviceFormatProperties; |
| 472 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| 473 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 474 | uint64_t cgen_var_23; |
| 475 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_23, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 476 | stream->write((uint64_t*)&cgen_var_23, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 477 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 478 | marshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 479 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 480 | unmarshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 481 | if (pFormatProperties) |
| 482 | { |
| 483 | transform_fromhost_VkFormatProperties(mImpl->resources(), (VkFormatProperties*)(pFormatProperties)); |
| 484 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 485 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 486 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 487 | } |
| 488 | |
| 489 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties( |
| 490 | VkPhysicalDevice physicalDevice, |
| 491 | VkFormat format, |
| 492 | VkImageType type, |
| 493 | VkImageTiling tiling, |
| 494 | VkImageUsageFlags usage, |
| 495 | VkImageCreateFlags flags, |
| 496 | VkImageFormatProperties* pImageFormatProperties) |
| 497 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 498 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 499 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 500 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 501 | auto stream = mImpl->stream(); |
| 502 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 503 | auto resources = mImpl->resources(); |
| 504 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 505 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 506 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 507 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 508 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 509 | VkImageTiling local_tiling; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 510 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 511 | VkImageCreateFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 512 | local_physicalDevice = physicalDevice; |
| 513 | local_format = format; |
| 514 | local_type = type; |
| 515 | local_tiling = tiling; |
| 516 | local_usage = usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 517 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 518 | countingStream->rewind(); |
| 519 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 520 | uint64_t cgen_var_24; |
| 521 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_24, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 522 | countingStream->write((uint64_t*)&cgen_var_24, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 523 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 524 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 525 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 526 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 527 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 528 | marshal_VkImageFormatProperties(countingStream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 529 | } |
| 530 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 531 | countingStream->rewind(); |
| 532 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties = OP_vkGetPhysicalDeviceImageFormatProperties; |
| 533 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| 534 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 535 | uint64_t cgen_var_25; |
| 536 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_25, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 537 | stream->write((uint64_t*)&cgen_var_25, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 538 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 539 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 540 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 541 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 542 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 543 | marshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 544 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 545 | unmarshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 546 | if (pImageFormatProperties) |
| 547 | { |
| 548 | transform_fromhost_VkImageFormatProperties(mImpl->resources(), (VkImageFormatProperties*)(pImageFormatProperties)); |
| 549 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 550 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 551 | VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0; |
| 552 | stream->read(&vkGetPhysicalDeviceImageFormatProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 553 | countingStream->clearPool(); |
| 554 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 555 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 556 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 557 | return vkGetPhysicalDeviceImageFormatProperties_VkResult_return; |
| 558 | } |
| 559 | |
| 560 | void VkEncoder::vkGetPhysicalDeviceProperties( |
| 561 | VkPhysicalDevice physicalDevice, |
| 562 | VkPhysicalDeviceProperties* pProperties) |
| 563 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 564 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 565 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 566 | mImpl->log("start vkGetPhysicalDeviceProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 567 | auto stream = mImpl->stream(); |
| 568 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 569 | auto resources = mImpl->resources(); |
| 570 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 571 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 572 | VkPhysicalDevice local_physicalDevice; |
| 573 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 574 | countingStream->rewind(); |
| 575 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 576 | uint64_t cgen_var_26; |
| 577 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_26, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 578 | countingStream->write((uint64_t*)&cgen_var_26, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 579 | marshal_VkPhysicalDeviceProperties(countingStream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 580 | } |
| 581 | uint32_t packetSize_vkGetPhysicalDeviceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 582 | countingStream->rewind(); |
| 583 | uint32_t opcode_vkGetPhysicalDeviceProperties = OP_vkGetPhysicalDeviceProperties; |
| 584 | stream->write(&opcode_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| 585 | stream->write(&packetSize_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 586 | uint64_t cgen_var_27; |
| 587 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_27, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 588 | stream->write((uint64_t*)&cgen_var_27, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 589 | marshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 590 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 591 | unmarshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 592 | if (pProperties) |
| 593 | { |
| 594 | transform_fromhost_VkPhysicalDeviceProperties(mImpl->resources(), (VkPhysicalDeviceProperties*)(pProperties)); |
| 595 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 596 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 597 | mImpl->log("finish vkGetPhysicalDeviceProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 598 | } |
| 599 | |
| 600 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties( |
| 601 | VkPhysicalDevice physicalDevice, |
| 602 | uint32_t* pQueueFamilyPropertyCount, |
| 603 | VkQueueFamilyProperties* pQueueFamilyProperties) |
| 604 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 605 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 606 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 607 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 608 | auto stream = mImpl->stream(); |
| 609 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 610 | auto resources = mImpl->resources(); |
| 611 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 612 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 613 | VkPhysicalDevice local_physicalDevice; |
| 614 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 615 | countingStream->rewind(); |
| 616 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 617 | uint64_t cgen_var_28; |
| 618 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_28, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 619 | countingStream->write((uint64_t*)&cgen_var_28, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 620 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 621 | uint64_t cgen_var_29 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 622 | countingStream->putBe64(cgen_var_29); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 623 | if (pQueueFamilyPropertyCount) |
| 624 | { |
| 625 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 626 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 627 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 628 | uint64_t cgen_var_30 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 629 | countingStream->putBe64(cgen_var_30); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 630 | if (pQueueFamilyProperties) |
| 631 | { |
| 632 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 633 | { |
| 634 | marshal_VkQueueFamilyProperties(countingStream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 635 | } |
| 636 | } |
| 637 | } |
| 638 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 639 | countingStream->rewind(); |
| 640 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties = OP_vkGetPhysicalDeviceQueueFamilyProperties; |
| 641 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| 642 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 643 | uint64_t cgen_var_31; |
| 644 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_31, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 645 | stream->write((uint64_t*)&cgen_var_31, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 646 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 647 | uint64_t cgen_var_32 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 648 | stream->putBe64(cgen_var_32); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 649 | if (pQueueFamilyPropertyCount) |
| 650 | { |
| 651 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 652 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 653 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 654 | uint64_t cgen_var_33 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 655 | stream->putBe64(cgen_var_33); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 656 | if (pQueueFamilyProperties) |
| 657 | { |
| 658 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 659 | { |
| 660 | marshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 661 | } |
| 662 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 663 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 664 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 665 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 666 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 667 | if (pQueueFamilyPropertyCount) |
| 668 | { |
| 669 | if (!(check_pQueueFamilyPropertyCount)) |
| 670 | { |
| 671 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 672 | } |
| 673 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 674 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 675 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 676 | VkQueueFamilyProperties* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 677 | check_pQueueFamilyProperties = (VkQueueFamilyProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 678 | if (pQueueFamilyProperties) |
| 679 | { |
| 680 | if (!(check_pQueueFamilyProperties)) |
| 681 | { |
| 682 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 683 | } |
| 684 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 685 | { |
| 686 | unmarshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 687 | } |
| 688 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 689 | if (pQueueFamilyProperties) |
| 690 | { |
| 691 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 692 | { |
| 693 | transform_fromhost_VkQueueFamilyProperties(mImpl->resources(), (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 694 | } |
| 695 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 696 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 697 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 698 | } |
| 699 | |
| 700 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties( |
| 701 | VkPhysicalDevice physicalDevice, |
| 702 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 703 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 704 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 705 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 706 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 707 | auto stream = mImpl->stream(); |
| 708 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 709 | auto resources = mImpl->resources(); |
| 710 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 711 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 712 | VkPhysicalDevice local_physicalDevice; |
| 713 | local_physicalDevice = physicalDevice; |
| 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_36; |
| 717 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_36, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 718 | countingStream->write((uint64_t*)&cgen_var_36, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 719 | marshal_VkPhysicalDeviceMemoryProperties(countingStream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 720 | } |
| 721 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 722 | countingStream->rewind(); |
| 723 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties = OP_vkGetPhysicalDeviceMemoryProperties; |
| 724 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| 725 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 726 | uint64_t cgen_var_37; |
| 727 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_37, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 728 | stream->write((uint64_t*)&cgen_var_37, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 729 | marshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 730 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 731 | unmarshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 732 | if (pMemoryProperties) |
| 733 | { |
| 734 | transform_fromhost_VkPhysicalDeviceMemoryProperties(mImpl->resources(), (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 735 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 736 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties returnUnmarshal"); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 737 | encoderLock.unlock(); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 738 | mImpl->resources()->on_vkGetPhysicalDeviceMemoryProperties(this, physicalDevice, pMemoryProperties); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 739 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 740 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 741 | } |
| 742 | |
| 743 | PFN_vkVoidFunction VkEncoder::vkGetInstanceProcAddr( |
| 744 | VkInstance instance, |
| 745 | const char* pName) |
| 746 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 747 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 748 | AEMU_SCOPED_TRACE("vkGetInstanceProcAddr encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 749 | mImpl->log("start vkGetInstanceProcAddr"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 750 | auto stream = mImpl->stream(); |
| 751 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 752 | auto resources = mImpl->resources(); |
| 753 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 754 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 755 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 756 | char* local_pName; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 757 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 758 | local_pName = nullptr; |
| 759 | if (pName) |
| 760 | { |
| 761 | local_pName = pool->strDup(pName); |
| 762 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 763 | countingStream->rewind(); |
| 764 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 765 | uint64_t cgen_var_38; |
| 766 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_38, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 767 | countingStream->write((uint64_t*)&cgen_var_38, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 768 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 769 | } |
| 770 | uint32_t packetSize_vkGetInstanceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 771 | countingStream->rewind(); |
| 772 | uint32_t opcode_vkGetInstanceProcAddr = OP_vkGetInstanceProcAddr; |
| 773 | stream->write(&opcode_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| 774 | stream->write(&packetSize_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 775 | uint64_t cgen_var_39; |
| 776 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_39, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 777 | stream->write((uint64_t*)&cgen_var_39, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 778 | stream->putString(local_pName); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 779 | AEMU_SCOPED_TRACE("vkGetInstanceProcAddr readParams"); |
| 780 | AEMU_SCOPED_TRACE("vkGetInstanceProcAddr returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 781 | PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 782 | stream->read(&vkGetInstanceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 783 | countingStream->clearPool(); |
| 784 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 785 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 786 | mImpl->log("finish vkGetInstanceProcAddr");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 787 | return vkGetInstanceProcAddr_PFN_vkVoidFunction_return; |
| 788 | } |
| 789 | |
| 790 | PFN_vkVoidFunction VkEncoder::vkGetDeviceProcAddr( |
| 791 | VkDevice device, |
| 792 | const char* pName) |
| 793 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 794 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 795 | AEMU_SCOPED_TRACE("vkGetDeviceProcAddr encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 796 | mImpl->log("start vkGetDeviceProcAddr"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 797 | auto stream = mImpl->stream(); |
| 798 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 799 | auto resources = mImpl->resources(); |
| 800 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 801 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 802 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 803 | char* local_pName; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 804 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 805 | local_pName = nullptr; |
| 806 | if (pName) |
| 807 | { |
| 808 | local_pName = pool->strDup(pName); |
| 809 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 810 | countingStream->rewind(); |
| 811 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 812 | uint64_t cgen_var_40; |
| 813 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_40, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 814 | countingStream->write((uint64_t*)&cgen_var_40, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 815 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 816 | } |
| 817 | uint32_t packetSize_vkGetDeviceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 818 | countingStream->rewind(); |
| 819 | uint32_t opcode_vkGetDeviceProcAddr = OP_vkGetDeviceProcAddr; |
| 820 | stream->write(&opcode_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| 821 | stream->write(&packetSize_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 822 | uint64_t cgen_var_41; |
| 823 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_41, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 824 | stream->write((uint64_t*)&cgen_var_41, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 825 | stream->putString(local_pName); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 826 | AEMU_SCOPED_TRACE("vkGetDeviceProcAddr readParams"); |
| 827 | AEMU_SCOPED_TRACE("vkGetDeviceProcAddr returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 828 | PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 829 | stream->read(&vkGetDeviceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 830 | countingStream->clearPool(); |
| 831 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 832 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 833 | mImpl->log("finish vkGetDeviceProcAddr");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 834 | return vkGetDeviceProcAddr_PFN_vkVoidFunction_return; |
| 835 | } |
| 836 | |
| 837 | VkResult VkEncoder::vkCreateDevice( |
| 838 | VkPhysicalDevice physicalDevice, |
| 839 | const VkDeviceCreateInfo* pCreateInfo, |
| 840 | const VkAllocationCallbacks* pAllocator, |
| 841 | VkDevice* pDevice) |
| 842 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 843 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 844 | AEMU_SCOPED_TRACE("vkCreateDevice encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 845 | mImpl->log("start vkCreateDevice"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 846 | auto stream = mImpl->stream(); |
| 847 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 848 | auto resources = mImpl->resources(); |
| 849 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 850 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 851 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 852 | VkDeviceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 853 | VkAllocationCallbacks* local_pAllocator; |
| 854 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 855 | local_pCreateInfo = nullptr; |
| 856 | if (pCreateInfo) |
| 857 | { |
| 858 | local_pCreateInfo = (VkDeviceCreateInfo*)pool->alloc(sizeof(const VkDeviceCreateInfo)); |
| 859 | deepcopy_VkDeviceCreateInfo(pool, pCreateInfo, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| 860 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 861 | local_pAllocator = nullptr; |
| 862 | if (pAllocator) |
| 863 | { |
| 864 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 865 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 866 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 867 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 868 | if (local_pCreateInfo) |
| 869 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 870 | transform_tohost_VkDeviceCreateInfo(mImpl->resources(), (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 871 | } |
| 872 | if (local_pAllocator) |
| 873 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 874 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 875 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 876 | countingStream->rewind(); |
| 877 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 878 | uint64_t cgen_var_42; |
| 879 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_42, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 880 | countingStream->write((uint64_t*)&cgen_var_42, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 881 | marshal_VkDeviceCreateInfo(countingStream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 882 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 883 | uint64_t cgen_var_43 = (uint64_t)(uintptr_t)local_pAllocator; |
| 884 | countingStream->putBe64(cgen_var_43); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 885 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 886 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 887 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 888 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 889 | uint64_t cgen_var_44; |
| 890 | countingStream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_44, 1); |
| 891 | countingStream->write((uint64_t*)&cgen_var_44, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 892 | } |
| 893 | uint32_t packetSize_vkCreateDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 894 | countingStream->rewind(); |
| 895 | uint32_t opcode_vkCreateDevice = OP_vkCreateDevice; |
| 896 | stream->write(&opcode_vkCreateDevice, sizeof(uint32_t)); |
| 897 | stream->write(&packetSize_vkCreateDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 898 | uint64_t cgen_var_45; |
| 899 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_45, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 900 | stream->write((uint64_t*)&cgen_var_45, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 901 | marshal_VkDeviceCreateInfo(stream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 902 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 903 | uint64_t cgen_var_46 = (uint64_t)(uintptr_t)local_pAllocator; |
| 904 | stream->putBe64(cgen_var_46); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 905 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 906 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 907 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 908 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 909 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 910 | uint64_t cgen_var_47; |
| 911 | stream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_47, 1); |
| 912 | stream->write((uint64_t*)&cgen_var_47, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 913 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 914 | AEMU_SCOPED_TRACE("vkCreateDevice readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 915 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 916 | uint64_t cgen_var_48; |
| 917 | stream->read((uint64_t*)&cgen_var_48, 8); |
| 918 | stream->handleMapping()->mapHandles_u64_VkDevice(&cgen_var_48, (VkDevice*)pDevice, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 919 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 920 | AEMU_SCOPED_TRACE("vkCreateDevice returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 921 | VkResult vkCreateDevice_VkResult_return = (VkResult)0; |
| 922 | stream->read(&vkCreateDevice_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 923 | countingStream->clearPool(); |
| 924 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 925 | pool->freeAll(); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 926 | encoderLock.unlock(); |
| Lingfeng Yang | 131d5a4 | 2018-11-30 12:00:33 -0800 | [diff] [blame] | 927 | mImpl->resources()->on_vkCreateDevice(this, vkCreateDevice_VkResult_return, physicalDevice, pCreateInfo, pAllocator, pDevice); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 928 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 929 | mImpl->log("finish vkCreateDevice");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 930 | return vkCreateDevice_VkResult_return; |
| 931 | } |
| 932 | |
| 933 | void VkEncoder::vkDestroyDevice( |
| 934 | VkDevice device, |
| 935 | const VkAllocationCallbacks* pAllocator) |
| 936 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 937 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 938 | AEMU_SCOPED_TRACE("vkDestroyDevice encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 939 | mImpl->log("start vkDestroyDevice"); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 940 | encoderLock.unlock(); |
| Lingfeng Yang | 35e9c6a | 2018-12-25 17:13:36 -0800 | [diff] [blame] | 941 | mImpl->resources()->on_vkDestroyDevice_pre(this, device, pAllocator); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 942 | encoderLock.lock(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 943 | auto stream = mImpl->stream(); |
| 944 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 945 | auto resources = mImpl->resources(); |
| 946 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 947 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 948 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 949 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 950 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 951 | local_pAllocator = nullptr; |
| 952 | if (pAllocator) |
| 953 | { |
| 954 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 955 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 956 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 957 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 958 | if (local_pAllocator) |
| 959 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 960 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 961 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 962 | countingStream->rewind(); |
| 963 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 964 | uint64_t cgen_var_49; |
| 965 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_49, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 966 | countingStream->write((uint64_t*)&cgen_var_49, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 967 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 968 | uint64_t cgen_var_50 = (uint64_t)(uintptr_t)local_pAllocator; |
| 969 | countingStream->putBe64(cgen_var_50); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 970 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 971 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 972 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 973 | } |
| 974 | } |
| 975 | uint32_t packetSize_vkDestroyDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 976 | countingStream->rewind(); |
| 977 | uint32_t opcode_vkDestroyDevice = OP_vkDestroyDevice; |
| 978 | stream->write(&opcode_vkDestroyDevice, sizeof(uint32_t)); |
| 979 | stream->write(&packetSize_vkDestroyDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 980 | uint64_t cgen_var_51; |
| 981 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_51, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 982 | stream->write((uint64_t*)&cgen_var_51, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 983 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 984 | uint64_t cgen_var_52 = (uint64_t)(uintptr_t)local_pAllocator; |
| 985 | stream->putBe64(cgen_var_52); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 986 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 987 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 988 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 989 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 990 | AEMU_SCOPED_TRACE("vkDestroyDevice readParams"); |
| 991 | AEMU_SCOPED_TRACE("vkDestroyDevice returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 992 | resources->destroyMapping()->mapHandles_VkDevice((VkDevice*)&device); |
| Lingfeng Yang | 35e9c6a | 2018-12-25 17:13:36 -0800 | [diff] [blame] | 993 | stream->flush(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 994 | mImpl->log("finish vkDestroyDevice");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 995 | } |
| 996 | |
| 997 | VkResult VkEncoder::vkEnumerateInstanceExtensionProperties( |
| 998 | const char* pLayerName, |
| 999 | uint32_t* pPropertyCount, |
| 1000 | VkExtensionProperties* pProperties) |
| 1001 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1002 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1003 | AEMU_SCOPED_TRACE("vkEnumerateInstanceExtensionProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1004 | mImpl->log("start vkEnumerateInstanceExtensionProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1005 | auto stream = mImpl->stream(); |
| 1006 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1007 | auto resources = mImpl->resources(); |
| 1008 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1009 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1010 | char* local_pLayerName; |
| 1011 | local_pLayerName = nullptr; |
| 1012 | if (pLayerName) |
| 1013 | { |
| 1014 | local_pLayerName = pool->strDup(pLayerName); |
| 1015 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1016 | countingStream->rewind(); |
| 1017 | { |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 1018 | if (countingStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 1019 | { |
| 1020 | // WARNING PTR CHECK |
| 1021 | uint64_t cgen_var_53 = (uint64_t)(uintptr_t)local_pLayerName; |
| 1022 | countingStream->putBe64(cgen_var_53); |
| 1023 | if (local_pLayerName) |
| 1024 | { |
| 1025 | countingStream->putString(local_pLayerName); |
| 1026 | } |
| 1027 | } |
| 1028 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1029 | { |
| 1030 | countingStream->putString(local_pLayerName); |
| 1031 | } |
| 1032 | // WARNING PTR CHECK |
| 1033 | uint64_t cgen_var_54 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1034 | countingStream->putBe64(cgen_var_54); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1035 | if (pPropertyCount) |
| 1036 | { |
| 1037 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1038 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1039 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1040 | uint64_t cgen_var_55 = (uint64_t)(uintptr_t)pProperties; |
| 1041 | countingStream->putBe64(cgen_var_55); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1042 | if (pProperties) |
| 1043 | { |
| 1044 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1045 | { |
| 1046 | marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i)); |
| 1047 | } |
| 1048 | } |
| 1049 | } |
| 1050 | uint32_t packetSize_vkEnumerateInstanceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1051 | countingStream->rewind(); |
| 1052 | uint32_t opcode_vkEnumerateInstanceExtensionProperties = OP_vkEnumerateInstanceExtensionProperties; |
| 1053 | stream->write(&opcode_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| 1054 | stream->write(&packetSize_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 1055 | if (stream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 1056 | { |
| 1057 | // WARNING PTR CHECK |
| 1058 | uint64_t cgen_var_56 = (uint64_t)(uintptr_t)local_pLayerName; |
| 1059 | stream->putBe64(cgen_var_56); |
| 1060 | if (local_pLayerName) |
| 1061 | { |
| 1062 | stream->putString(local_pLayerName); |
| 1063 | } |
| 1064 | } |
| 1065 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1066 | { |
| 1067 | stream->putString(local_pLayerName); |
| 1068 | } |
| 1069 | // WARNING PTR CHECK |
| 1070 | uint64_t cgen_var_57 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1071 | stream->putBe64(cgen_var_57); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1072 | if (pPropertyCount) |
| 1073 | { |
| 1074 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1075 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1076 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1077 | uint64_t cgen_var_58 = (uint64_t)(uintptr_t)pProperties; |
| 1078 | stream->putBe64(cgen_var_58); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1079 | if (pProperties) |
| 1080 | { |
| 1081 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1082 | { |
| 1083 | marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1084 | } |
| 1085 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1086 | AEMU_SCOPED_TRACE("vkEnumerateInstanceExtensionProperties readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1087 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1088 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1089 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1090 | if (pPropertyCount) |
| 1091 | { |
| 1092 | if (!(check_pPropertyCount)) |
| 1093 | { |
| 1094 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1095 | } |
| 1096 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1097 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1098 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1099 | VkExtensionProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1100 | check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1101 | if (pProperties) |
| 1102 | { |
| 1103 | if (!(check_pProperties)) |
| 1104 | { |
| 1105 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1106 | } |
| 1107 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1108 | { |
| 1109 | unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1110 | } |
| 1111 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1112 | if (pProperties) |
| 1113 | { |
| 1114 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1115 | { |
| 1116 | transform_fromhost_VkExtensionProperties(mImpl->resources(), (VkExtensionProperties*)(pProperties + i)); |
| 1117 | } |
| 1118 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1119 | AEMU_SCOPED_TRACE("vkEnumerateInstanceExtensionProperties returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1120 | VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0; |
| 1121 | stream->read(&vkEnumerateInstanceExtensionProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1122 | countingStream->clearPool(); |
| 1123 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1124 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1125 | mImpl->log("finish vkEnumerateInstanceExtensionProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1126 | return vkEnumerateInstanceExtensionProperties_VkResult_return; |
| 1127 | } |
| 1128 | |
| 1129 | VkResult VkEncoder::vkEnumerateDeviceExtensionProperties( |
| 1130 | VkPhysicalDevice physicalDevice, |
| 1131 | const char* pLayerName, |
| 1132 | uint32_t* pPropertyCount, |
| 1133 | VkExtensionProperties* pProperties) |
| 1134 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1135 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1136 | AEMU_SCOPED_TRACE("vkEnumerateDeviceExtensionProperties encode"); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1137 | mImpl->log("start vkEnumerateDeviceExtensionProperties"); |
| 1138 | auto stream = mImpl->stream(); |
| 1139 | auto countingStream = mImpl->countingStream(); |
| 1140 | auto resources = mImpl->resources(); |
| 1141 | auto pool = mImpl->pool(); |
| 1142 | stream->setHandleMapping(resources->unwrapMapping()); |
| 1143 | VkPhysicalDevice local_physicalDevice; |
| 1144 | char* local_pLayerName; |
| 1145 | local_physicalDevice = physicalDevice; |
| 1146 | local_pLayerName = nullptr; |
| 1147 | if (pLayerName) |
| 1148 | { |
| 1149 | local_pLayerName = pool->strDup(pLayerName); |
| 1150 | } |
| 1151 | countingStream->rewind(); |
| 1152 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1153 | uint64_t cgen_var_61; |
| 1154 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_61, 1); |
| 1155 | countingStream->write((uint64_t*)&cgen_var_61, 1 * 8); |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 1156 | if (countingStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 1157 | { |
| 1158 | // WARNING PTR CHECK |
| 1159 | uint64_t cgen_var_62 = (uint64_t)(uintptr_t)local_pLayerName; |
| 1160 | countingStream->putBe64(cgen_var_62); |
| 1161 | if (local_pLayerName) |
| 1162 | { |
| 1163 | countingStream->putString(local_pLayerName); |
| 1164 | } |
| 1165 | } |
| 1166 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1167 | { |
| 1168 | countingStream->putString(local_pLayerName); |
| 1169 | } |
| 1170 | // WARNING PTR CHECK |
| 1171 | uint64_t cgen_var_63 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1172 | countingStream->putBe64(cgen_var_63); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1173 | if (pPropertyCount) |
| 1174 | { |
| 1175 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1176 | } |
| 1177 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1178 | uint64_t cgen_var_64 = (uint64_t)(uintptr_t)pProperties; |
| 1179 | countingStream->putBe64(cgen_var_64); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1180 | if (pProperties) |
| 1181 | { |
| 1182 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1183 | { |
| 1184 | marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i)); |
| 1185 | } |
| 1186 | } |
| 1187 | } |
| 1188 | uint32_t packetSize_vkEnumerateDeviceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1189 | countingStream->rewind(); |
| 1190 | uint32_t opcode_vkEnumerateDeviceExtensionProperties = OP_vkEnumerateDeviceExtensionProperties; |
| 1191 | stream->write(&opcode_vkEnumerateDeviceExtensionProperties, sizeof(uint32_t)); |
| 1192 | stream->write(&packetSize_vkEnumerateDeviceExtensionProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1193 | uint64_t cgen_var_65; |
| 1194 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_65, 1); |
| 1195 | stream->write((uint64_t*)&cgen_var_65, 1 * 8); |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 1196 | if (stream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 1197 | { |
| 1198 | // WARNING PTR CHECK |
| 1199 | uint64_t cgen_var_66 = (uint64_t)(uintptr_t)local_pLayerName; |
| 1200 | stream->putBe64(cgen_var_66); |
| 1201 | if (local_pLayerName) |
| 1202 | { |
| 1203 | stream->putString(local_pLayerName); |
| 1204 | } |
| 1205 | } |
| 1206 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1207 | { |
| 1208 | stream->putString(local_pLayerName); |
| 1209 | } |
| 1210 | // WARNING PTR CHECK |
| 1211 | uint64_t cgen_var_67 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1212 | stream->putBe64(cgen_var_67); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1213 | if (pPropertyCount) |
| 1214 | { |
| 1215 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1216 | } |
| 1217 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1218 | uint64_t cgen_var_68 = (uint64_t)(uintptr_t)pProperties; |
| 1219 | stream->putBe64(cgen_var_68); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1220 | if (pProperties) |
| 1221 | { |
| 1222 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1223 | { |
| 1224 | marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1225 | } |
| 1226 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1227 | AEMU_SCOPED_TRACE("vkEnumerateDeviceExtensionProperties readParams"); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1228 | // WARNING PTR CHECK |
| 1229 | uint32_t* check_pPropertyCount; |
| 1230 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| 1231 | if (pPropertyCount) |
| 1232 | { |
| 1233 | if (!(check_pPropertyCount)) |
| 1234 | { |
| 1235 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1236 | } |
| 1237 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1238 | } |
| 1239 | // WARNING PTR CHECK |
| 1240 | VkExtensionProperties* check_pProperties; |
| 1241 | check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64(); |
| 1242 | if (pProperties) |
| 1243 | { |
| 1244 | if (!(check_pProperties)) |
| 1245 | { |
| 1246 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1247 | } |
| 1248 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1249 | { |
| 1250 | unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1251 | } |
| 1252 | } |
| 1253 | if (pProperties) |
| 1254 | { |
| 1255 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1256 | { |
| 1257 | transform_fromhost_VkExtensionProperties(mImpl->resources(), (VkExtensionProperties*)(pProperties + i)); |
| 1258 | } |
| 1259 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1260 | AEMU_SCOPED_TRACE("vkEnumerateDeviceExtensionProperties returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1261 | VkResult vkEnumerateDeviceExtensionProperties_VkResult_return = (VkResult)0; |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1262 | stream->read(&vkEnumerateDeviceExtensionProperties_VkResult_return, sizeof(VkResult)); |
| 1263 | countingStream->clearPool(); |
| 1264 | stream->clearPool(); |
| 1265 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1266 | mImpl->log("finish vkEnumerateDeviceExtensionProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1267 | return vkEnumerateDeviceExtensionProperties_VkResult_return; |
| 1268 | } |
| 1269 | |
| 1270 | VkResult VkEncoder::vkEnumerateInstanceLayerProperties( |
| 1271 | uint32_t* pPropertyCount, |
| 1272 | VkLayerProperties* pProperties) |
| 1273 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1274 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1275 | AEMU_SCOPED_TRACE("vkEnumerateInstanceLayerProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1276 | mImpl->log("start vkEnumerateInstanceLayerProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1277 | auto stream = mImpl->stream(); |
| 1278 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1279 | auto resources = mImpl->resources(); |
| 1280 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1281 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1282 | countingStream->rewind(); |
| 1283 | { |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1284 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1285 | uint64_t cgen_var_71 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1286 | countingStream->putBe64(cgen_var_71); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1287 | if (pPropertyCount) |
| 1288 | { |
| 1289 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1290 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1291 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1292 | uint64_t cgen_var_72 = (uint64_t)(uintptr_t)pProperties; |
| 1293 | countingStream->putBe64(cgen_var_72); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1294 | if (pProperties) |
| 1295 | { |
| 1296 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1297 | { |
| 1298 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 1299 | } |
| 1300 | } |
| 1301 | } |
| 1302 | uint32_t packetSize_vkEnumerateInstanceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1303 | countingStream->rewind(); |
| 1304 | uint32_t opcode_vkEnumerateInstanceLayerProperties = OP_vkEnumerateInstanceLayerProperties; |
| 1305 | stream->write(&opcode_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| 1306 | stream->write(&packetSize_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1307 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1308 | uint64_t cgen_var_73 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1309 | stream->putBe64(cgen_var_73); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1310 | if (pPropertyCount) |
| 1311 | { |
| 1312 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1313 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1314 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1315 | uint64_t cgen_var_74 = (uint64_t)(uintptr_t)pProperties; |
| 1316 | stream->putBe64(cgen_var_74); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1317 | if (pProperties) |
| 1318 | { |
| 1319 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1320 | { |
| 1321 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1322 | } |
| 1323 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1324 | AEMU_SCOPED_TRACE("vkEnumerateInstanceLayerProperties readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1325 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1326 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1327 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1328 | if (pPropertyCount) |
| 1329 | { |
| 1330 | if (!(check_pPropertyCount)) |
| 1331 | { |
| 1332 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1333 | } |
| 1334 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1335 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1336 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1337 | VkLayerProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1338 | check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1339 | if (pProperties) |
| 1340 | { |
| 1341 | if (!(check_pProperties)) |
| 1342 | { |
| 1343 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1344 | } |
| 1345 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1346 | { |
| 1347 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1348 | } |
| 1349 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1350 | if (pProperties) |
| 1351 | { |
| 1352 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1353 | { |
| 1354 | transform_fromhost_VkLayerProperties(mImpl->resources(), (VkLayerProperties*)(pProperties + i)); |
| 1355 | } |
| 1356 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1357 | AEMU_SCOPED_TRACE("vkEnumerateInstanceLayerProperties returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1358 | VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0; |
| 1359 | stream->read(&vkEnumerateInstanceLayerProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1360 | countingStream->clearPool(); |
| 1361 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1362 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1363 | mImpl->log("finish vkEnumerateInstanceLayerProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1364 | return vkEnumerateInstanceLayerProperties_VkResult_return; |
| 1365 | } |
| 1366 | |
| 1367 | VkResult VkEncoder::vkEnumerateDeviceLayerProperties( |
| 1368 | VkPhysicalDevice physicalDevice, |
| 1369 | uint32_t* pPropertyCount, |
| 1370 | VkLayerProperties* pProperties) |
| 1371 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1372 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1373 | AEMU_SCOPED_TRACE("vkEnumerateDeviceLayerProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1374 | mImpl->log("start vkEnumerateDeviceLayerProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1375 | auto stream = mImpl->stream(); |
| 1376 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1377 | auto resources = mImpl->resources(); |
| 1378 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1379 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1380 | VkPhysicalDevice local_physicalDevice; |
| 1381 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1382 | countingStream->rewind(); |
| 1383 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1384 | uint64_t cgen_var_77; |
| 1385 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_77, 1); |
| 1386 | countingStream->write((uint64_t*)&cgen_var_77, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1387 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1388 | uint64_t cgen_var_78 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1389 | countingStream->putBe64(cgen_var_78); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1390 | if (pPropertyCount) |
| 1391 | { |
| 1392 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1393 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1394 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1395 | uint64_t cgen_var_79 = (uint64_t)(uintptr_t)pProperties; |
| 1396 | countingStream->putBe64(cgen_var_79); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1397 | if (pProperties) |
| 1398 | { |
| 1399 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1400 | { |
| 1401 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 1402 | } |
| 1403 | } |
| 1404 | } |
| 1405 | uint32_t packetSize_vkEnumerateDeviceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1406 | countingStream->rewind(); |
| 1407 | uint32_t opcode_vkEnumerateDeviceLayerProperties = OP_vkEnumerateDeviceLayerProperties; |
| 1408 | stream->write(&opcode_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| 1409 | stream->write(&packetSize_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1410 | uint64_t cgen_var_80; |
| 1411 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_80, 1); |
| 1412 | stream->write((uint64_t*)&cgen_var_80, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1413 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1414 | uint64_t cgen_var_81 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1415 | stream->putBe64(cgen_var_81); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1416 | if (pPropertyCount) |
| 1417 | { |
| 1418 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1419 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1420 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1421 | uint64_t cgen_var_82 = (uint64_t)(uintptr_t)pProperties; |
| 1422 | stream->putBe64(cgen_var_82); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1423 | if (pProperties) |
| 1424 | { |
| 1425 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1426 | { |
| 1427 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1428 | } |
| 1429 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1430 | AEMU_SCOPED_TRACE("vkEnumerateDeviceLayerProperties readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1431 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1432 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1433 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1434 | if (pPropertyCount) |
| 1435 | { |
| 1436 | if (!(check_pPropertyCount)) |
| 1437 | { |
| 1438 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1439 | } |
| 1440 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1441 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1442 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1443 | VkLayerProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1444 | check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1445 | if (pProperties) |
| 1446 | { |
| 1447 | if (!(check_pProperties)) |
| 1448 | { |
| 1449 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1450 | } |
| 1451 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1452 | { |
| 1453 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1454 | } |
| 1455 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1456 | if (pProperties) |
| 1457 | { |
| 1458 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1459 | { |
| 1460 | transform_fromhost_VkLayerProperties(mImpl->resources(), (VkLayerProperties*)(pProperties + i)); |
| 1461 | } |
| 1462 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1463 | AEMU_SCOPED_TRACE("vkEnumerateDeviceLayerProperties returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1464 | VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0; |
| 1465 | stream->read(&vkEnumerateDeviceLayerProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1466 | countingStream->clearPool(); |
| 1467 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1468 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1469 | mImpl->log("finish vkEnumerateDeviceLayerProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1470 | return vkEnumerateDeviceLayerProperties_VkResult_return; |
| 1471 | } |
| 1472 | |
| 1473 | void VkEncoder::vkGetDeviceQueue( |
| 1474 | VkDevice device, |
| 1475 | uint32_t queueFamilyIndex, |
| 1476 | uint32_t queueIndex, |
| 1477 | VkQueue* pQueue) |
| 1478 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1479 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1480 | AEMU_SCOPED_TRACE("vkGetDeviceQueue encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1481 | mImpl->log("start vkGetDeviceQueue"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1482 | auto stream = mImpl->stream(); |
| 1483 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1484 | auto resources = mImpl->resources(); |
| 1485 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1486 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1487 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1488 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1489 | uint32_t local_queueIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1490 | local_device = device; |
| 1491 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1492 | local_queueIndex = queueIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1493 | countingStream->rewind(); |
| 1494 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1495 | uint64_t cgen_var_85; |
| 1496 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_85, 1); |
| 1497 | countingStream->write((uint64_t*)&cgen_var_85, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1498 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 1499 | countingStream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1500 | uint64_t cgen_var_86; |
| 1501 | countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_86, 1); |
| 1502 | countingStream->write((uint64_t*)&cgen_var_86, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1503 | } |
| 1504 | uint32_t packetSize_vkGetDeviceQueue = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1505 | countingStream->rewind(); |
| 1506 | uint32_t opcode_vkGetDeviceQueue = OP_vkGetDeviceQueue; |
| 1507 | stream->write(&opcode_vkGetDeviceQueue, sizeof(uint32_t)); |
| 1508 | stream->write(&packetSize_vkGetDeviceQueue, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1509 | uint64_t cgen_var_87; |
| 1510 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_87, 1); |
| 1511 | stream->write((uint64_t*)&cgen_var_87, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1512 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 1513 | stream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1514 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1515 | uint64_t cgen_var_88; |
| 1516 | stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_88, 1); |
| 1517 | stream->write((uint64_t*)&cgen_var_88, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1518 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1519 | AEMU_SCOPED_TRACE("vkGetDeviceQueue readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1520 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1521 | uint64_t cgen_var_89; |
| 1522 | stream->read((uint64_t*)&cgen_var_89, 8); |
| 1523 | stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_89, (VkQueue*)pQueue, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1524 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1525 | AEMU_SCOPED_TRACE("vkGetDeviceQueue returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1526 | mImpl->log("finish vkGetDeviceQueue");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1527 | } |
| 1528 | |
| 1529 | VkResult VkEncoder::vkQueueSubmit( |
| 1530 | VkQueue queue, |
| 1531 | uint32_t submitCount, |
| 1532 | const VkSubmitInfo* pSubmits, |
| 1533 | VkFence fence) |
| 1534 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1535 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1536 | AEMU_SCOPED_TRACE("vkQueueSubmit encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1537 | mImpl->log("start vkQueueSubmit"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1538 | auto stream = mImpl->stream(); |
| 1539 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1540 | auto resources = mImpl->resources(); |
| 1541 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1542 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1543 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1544 | uint32_t local_submitCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1545 | VkSubmitInfo* local_pSubmits; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1546 | VkFence local_fence; |
| 1547 | local_queue = queue; |
| 1548 | local_submitCount = submitCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1549 | local_pSubmits = nullptr; |
| 1550 | if (pSubmits) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1551 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1552 | local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1553 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1554 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1555 | deepcopy_VkSubmitInfo(pool, pSubmits + i, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1556 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1557 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1558 | local_fence = fence; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1559 | if (local_pSubmits) |
| 1560 | { |
| 1561 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1562 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1563 | transform_tohost_VkSubmitInfo(mImpl->resources(), (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1564 | } |
| 1565 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1566 | countingStream->rewind(); |
| 1567 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1568 | uint64_t cgen_var_90; |
| 1569 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_90, 1); |
| 1570 | countingStream->write((uint64_t*)&cgen_var_90, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1571 | countingStream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| 1572 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1573 | { |
| 1574 | marshal_VkSubmitInfo(countingStream, (VkSubmitInfo*)(local_pSubmits + i)); |
| 1575 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1576 | uint64_t cgen_var_91; |
| 1577 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_91, 1); |
| 1578 | countingStream->write((uint64_t*)&cgen_var_91, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1579 | } |
| 1580 | uint32_t packetSize_vkQueueSubmit = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1581 | countingStream->rewind(); |
| 1582 | uint32_t opcode_vkQueueSubmit = OP_vkQueueSubmit; |
| 1583 | stream->write(&opcode_vkQueueSubmit, sizeof(uint32_t)); |
| 1584 | stream->write(&packetSize_vkQueueSubmit, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1585 | uint64_t cgen_var_92; |
| 1586 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_92, 1); |
| 1587 | stream->write((uint64_t*)&cgen_var_92, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1588 | stream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1589 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1590 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1591 | marshal_VkSubmitInfo(stream, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1592 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1593 | uint64_t cgen_var_93; |
| 1594 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_93, 1); |
| 1595 | stream->write((uint64_t*)&cgen_var_93, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1596 | AEMU_SCOPED_TRACE("vkQueueSubmit readParams"); |
| 1597 | AEMU_SCOPED_TRACE("vkQueueSubmit returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1598 | VkResult vkQueueSubmit_VkResult_return = (VkResult)0; |
| 1599 | stream->read(&vkQueueSubmit_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1600 | countingStream->clearPool(); |
| 1601 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1602 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1603 | mImpl->log("finish vkQueueSubmit");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1604 | return vkQueueSubmit_VkResult_return; |
| 1605 | } |
| 1606 | |
| 1607 | VkResult VkEncoder::vkQueueWaitIdle( |
| 1608 | VkQueue queue) |
| 1609 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1610 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1611 | AEMU_SCOPED_TRACE("vkQueueWaitIdle encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1612 | mImpl->log("start vkQueueWaitIdle"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1613 | auto stream = mImpl->stream(); |
| 1614 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1615 | auto resources = mImpl->resources(); |
| 1616 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1617 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1618 | VkQueue local_queue; |
| 1619 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1620 | countingStream->rewind(); |
| 1621 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1622 | uint64_t cgen_var_94; |
| 1623 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_94, 1); |
| 1624 | countingStream->write((uint64_t*)&cgen_var_94, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1625 | } |
| 1626 | uint32_t packetSize_vkQueueWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1627 | countingStream->rewind(); |
| 1628 | uint32_t opcode_vkQueueWaitIdle = OP_vkQueueWaitIdle; |
| 1629 | stream->write(&opcode_vkQueueWaitIdle, sizeof(uint32_t)); |
| 1630 | stream->write(&packetSize_vkQueueWaitIdle, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1631 | uint64_t cgen_var_95; |
| 1632 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_95, 1); |
| 1633 | stream->write((uint64_t*)&cgen_var_95, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1634 | AEMU_SCOPED_TRACE("vkQueueWaitIdle readParams"); |
| 1635 | AEMU_SCOPED_TRACE("vkQueueWaitIdle returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1636 | VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0; |
| 1637 | stream->read(&vkQueueWaitIdle_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1638 | countingStream->clearPool(); |
| 1639 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1640 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1641 | mImpl->log("finish vkQueueWaitIdle");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1642 | return vkQueueWaitIdle_VkResult_return; |
| 1643 | } |
| 1644 | |
| 1645 | VkResult VkEncoder::vkDeviceWaitIdle( |
| 1646 | VkDevice device) |
| 1647 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1648 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1649 | AEMU_SCOPED_TRACE("vkDeviceWaitIdle encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1650 | mImpl->log("start vkDeviceWaitIdle"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1651 | auto stream = mImpl->stream(); |
| 1652 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1653 | auto resources = mImpl->resources(); |
| 1654 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1655 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1656 | VkDevice local_device; |
| 1657 | local_device = device; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1658 | countingStream->rewind(); |
| 1659 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1660 | uint64_t cgen_var_96; |
| 1661 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_96, 1); |
| 1662 | countingStream->write((uint64_t*)&cgen_var_96, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1663 | } |
| 1664 | uint32_t packetSize_vkDeviceWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1665 | countingStream->rewind(); |
| 1666 | uint32_t opcode_vkDeviceWaitIdle = OP_vkDeviceWaitIdle; |
| 1667 | stream->write(&opcode_vkDeviceWaitIdle, sizeof(uint32_t)); |
| 1668 | stream->write(&packetSize_vkDeviceWaitIdle, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1669 | uint64_t cgen_var_97; |
| 1670 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_97, 1); |
| 1671 | stream->write((uint64_t*)&cgen_var_97, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1672 | AEMU_SCOPED_TRACE("vkDeviceWaitIdle readParams"); |
| 1673 | AEMU_SCOPED_TRACE("vkDeviceWaitIdle returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1674 | VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0; |
| 1675 | stream->read(&vkDeviceWaitIdle_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1676 | countingStream->clearPool(); |
| 1677 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1678 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1679 | mImpl->log("finish vkDeviceWaitIdle");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1680 | return vkDeviceWaitIdle_VkResult_return; |
| 1681 | } |
| 1682 | |
| 1683 | VkResult VkEncoder::vkAllocateMemory( |
| 1684 | VkDevice device, |
| 1685 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 1686 | const VkAllocationCallbacks* pAllocator, |
| 1687 | VkDeviceMemory* pMemory) |
| 1688 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1689 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1690 | AEMU_SCOPED_TRACE("vkAllocateMemory encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1691 | mImpl->log("start vkAllocateMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1692 | auto stream = mImpl->stream(); |
| 1693 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1694 | auto resources = mImpl->resources(); |
| 1695 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1696 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1697 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1698 | VkMemoryAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1699 | VkAllocationCallbacks* local_pAllocator; |
| 1700 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1701 | local_pAllocateInfo = nullptr; |
| 1702 | if (pAllocateInfo) |
| 1703 | { |
| 1704 | local_pAllocateInfo = (VkMemoryAllocateInfo*)pool->alloc(sizeof(const VkMemoryAllocateInfo)); |
| 1705 | deepcopy_VkMemoryAllocateInfo(pool, pAllocateInfo, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| 1706 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1707 | local_pAllocator = nullptr; |
| 1708 | if (pAllocator) |
| 1709 | { |
| 1710 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1711 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1712 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1713 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1714 | if (local_pAllocateInfo) |
| 1715 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1716 | transform_tohost_VkMemoryAllocateInfo(mImpl->resources(), (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1717 | } |
| 1718 | if (local_pAllocator) |
| 1719 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1720 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1721 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1722 | countingStream->rewind(); |
| 1723 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1724 | uint64_t cgen_var_98; |
| 1725 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_98, 1); |
| 1726 | countingStream->write((uint64_t*)&cgen_var_98, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1727 | marshal_VkMemoryAllocateInfo(countingStream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1728 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1729 | uint64_t cgen_var_99 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1730 | countingStream->putBe64(cgen_var_99); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1731 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1732 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1733 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1734 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1735 | uint64_t cgen_var_100; |
| 1736 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_100, 1); |
| 1737 | countingStream->write((uint64_t*)&cgen_var_100, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1738 | } |
| 1739 | uint32_t packetSize_vkAllocateMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1740 | countingStream->rewind(); |
| 1741 | uint32_t opcode_vkAllocateMemory = OP_vkAllocateMemory; |
| 1742 | stream->write(&opcode_vkAllocateMemory, sizeof(uint32_t)); |
| 1743 | stream->write(&packetSize_vkAllocateMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1744 | uint64_t cgen_var_101; |
| 1745 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_101, 1); |
| 1746 | stream->write((uint64_t*)&cgen_var_101, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1747 | marshal_VkMemoryAllocateInfo(stream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1748 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1749 | uint64_t cgen_var_102 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1750 | stream->putBe64(cgen_var_102); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1751 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1752 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1753 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1754 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1755 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1756 | uint64_t cgen_var_103; |
| 1757 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_103, 1); |
| 1758 | stream->write((uint64_t*)&cgen_var_103, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1759 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1760 | AEMU_SCOPED_TRACE("vkAllocateMemory readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1761 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1762 | uint64_t cgen_var_104; |
| 1763 | stream->read((uint64_t*)&cgen_var_104, 8); |
| 1764 | stream->handleMapping()->mapHandles_u64_VkDeviceMemory(&cgen_var_104, (VkDeviceMemory*)pMemory, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1765 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1766 | AEMU_SCOPED_TRACE("vkAllocateMemory returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1767 | VkResult vkAllocateMemory_VkResult_return = (VkResult)0; |
| 1768 | stream->read(&vkAllocateMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1769 | countingStream->clearPool(); |
| 1770 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1771 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1772 | mImpl->log("finish vkAllocateMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1773 | return vkAllocateMemory_VkResult_return; |
| 1774 | } |
| 1775 | |
| 1776 | void VkEncoder::vkFreeMemory( |
| 1777 | VkDevice device, |
| 1778 | VkDeviceMemory memory, |
| 1779 | const VkAllocationCallbacks* pAllocator) |
| 1780 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1781 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1782 | AEMU_SCOPED_TRACE("vkFreeMemory encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1783 | mImpl->log("start vkFreeMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1784 | auto stream = mImpl->stream(); |
| 1785 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1786 | auto resources = mImpl->resources(); |
| 1787 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1788 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1789 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1790 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1791 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1792 | local_device = device; |
| 1793 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1794 | local_pAllocator = nullptr; |
| 1795 | if (pAllocator) |
| 1796 | { |
| 1797 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1798 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1799 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1800 | local_pAllocator = nullptr; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 1801 | mImpl->resources()->deviceMemoryTransform_tohost((VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1802 | countingStream->rewind(); |
| 1803 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1804 | uint64_t cgen_var_105; |
| 1805 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_105, 1); |
| 1806 | countingStream->write((uint64_t*)&cgen_var_105, 1 * 8); |
| 1807 | uint64_t cgen_var_106; |
| 1808 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_106, 1); |
| 1809 | countingStream->write((uint64_t*)&cgen_var_106, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1810 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1811 | uint64_t cgen_var_107 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1812 | countingStream->putBe64(cgen_var_107); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1813 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1814 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1815 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1816 | } |
| 1817 | } |
| 1818 | uint32_t packetSize_vkFreeMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1819 | countingStream->rewind(); |
| 1820 | uint32_t opcode_vkFreeMemory = OP_vkFreeMemory; |
| 1821 | stream->write(&opcode_vkFreeMemory, sizeof(uint32_t)); |
| 1822 | stream->write(&packetSize_vkFreeMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1823 | uint64_t cgen_var_108; |
| 1824 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_108, 1); |
| 1825 | stream->write((uint64_t*)&cgen_var_108, 1 * 8); |
| 1826 | uint64_t cgen_var_109; |
| 1827 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_109, 1); |
| 1828 | stream->write((uint64_t*)&cgen_var_109, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1829 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1830 | uint64_t cgen_var_110 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1831 | stream->putBe64(cgen_var_110); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1832 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1833 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1834 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1835 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1836 | AEMU_SCOPED_TRACE("vkFreeMemory readParams"); |
| 1837 | AEMU_SCOPED_TRACE("vkFreeMemory returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1838 | resources->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1839 | mImpl->log("finish vkFreeMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1840 | } |
| 1841 | |
| 1842 | VkResult VkEncoder::vkMapMemory( |
| 1843 | VkDevice device, |
| 1844 | VkDeviceMemory memory, |
| 1845 | VkDeviceSize offset, |
| 1846 | VkDeviceSize size, |
| 1847 | VkMemoryMapFlags flags, |
| 1848 | void** ppData) |
| 1849 | { |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1850 | AEMU_SCOPED_TRACE("vkMapMemory resourceEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1851 | VkResult vkMapMemory_VkResult_return = (VkResult)0; |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 1852 | 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] | 1853 | mImpl->log("finish vkMapMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1854 | return vkMapMemory_VkResult_return; |
| 1855 | } |
| 1856 | |
| 1857 | void VkEncoder::vkUnmapMemory( |
| 1858 | VkDevice device, |
| 1859 | VkDeviceMemory memory) |
| 1860 | { |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1861 | AEMU_SCOPED_TRACE("vkUnmapMemory resourceEvent"); |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 1862 | mImpl->resources()->on_vkUnmapMemory(this, device, memory); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1863 | } |
| 1864 | |
| 1865 | VkResult VkEncoder::vkFlushMappedMemoryRanges( |
| 1866 | VkDevice device, |
| 1867 | uint32_t memoryRangeCount, |
| 1868 | const VkMappedMemoryRange* pMemoryRanges) |
| 1869 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1870 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1871 | AEMU_SCOPED_TRACE("vkFlushMappedMemoryRanges encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1872 | mImpl->log("start vkFlushMappedMemoryRanges"); |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 1873 | 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] | 1874 | auto stream = mImpl->stream(); |
| 1875 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1876 | auto resources = mImpl->resources(); |
| 1877 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1878 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1879 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1880 | uint32_t local_memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1881 | VkMappedMemoryRange* local_pMemoryRanges; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1882 | local_device = device; |
| 1883 | local_memoryRangeCount = memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1884 | local_pMemoryRanges = nullptr; |
| 1885 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1886 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1887 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1888 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1889 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1890 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1891 | } |
| 1892 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1893 | if (local_pMemoryRanges) |
| 1894 | { |
| 1895 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1896 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1897 | transform_tohost_VkMappedMemoryRange(mImpl->resources(), (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1898 | } |
| 1899 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1900 | countingStream->rewind(); |
| 1901 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1902 | uint64_t cgen_var_111; |
| 1903 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_111, 1); |
| 1904 | countingStream->write((uint64_t*)&cgen_var_111, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1905 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 1906 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1907 | { |
| 1908 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1909 | } |
| 1910 | } |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1911 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1912 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1913 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1914 | { |
| 1915 | auto range = pMemoryRanges[i]; |
| 1916 | auto memory = pMemoryRanges[i].memory; |
| 1917 | auto size = pMemoryRanges[i].size; |
| 1918 | auto offset = pMemoryRanges[i].offset; |
| 1919 | uint64_t streamSize = 0; |
| 1920 | if (!memory) { countingStream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1921 | auto hostPtr = resources->getMappedPointer(memory); |
| 1922 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 1923 | if (!hostPtr) { countingStream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1924 | streamSize = actualSize; |
| 1925 | countingStream->write(&streamSize, sizeof(uint64_t)); |
| 1926 | uint8_t* targetRange = hostPtr + offset; |
| 1927 | countingStream->write(targetRange, actualSize); |
| 1928 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1929 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1930 | uint32_t packetSize_vkFlushMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1931 | countingStream->rewind(); |
| 1932 | uint32_t opcode_vkFlushMappedMemoryRanges = OP_vkFlushMappedMemoryRanges; |
| 1933 | stream->write(&opcode_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| 1934 | stream->write(&packetSize_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1935 | uint64_t cgen_var_112; |
| 1936 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_112, 1); |
| 1937 | stream->write((uint64_t*)&cgen_var_112, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1938 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1939 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1940 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1941 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1942 | } |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1943 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1944 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1945 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1946 | { |
| 1947 | auto range = pMemoryRanges[i]; |
| 1948 | auto memory = pMemoryRanges[i].memory; |
| 1949 | auto size = pMemoryRanges[i].size; |
| 1950 | auto offset = pMemoryRanges[i].offset; |
| 1951 | uint64_t streamSize = 0; |
| 1952 | if (!memory) { stream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1953 | auto hostPtr = resources->getMappedPointer(memory); |
| 1954 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 1955 | if (!hostPtr) { stream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1956 | streamSize = actualSize; |
| 1957 | stream->write(&streamSize, sizeof(uint64_t)); |
| 1958 | uint8_t* targetRange = hostPtr + offset; |
| 1959 | stream->write(targetRange, actualSize); |
| 1960 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1961 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1962 | AEMU_SCOPED_TRACE("vkFlushMappedMemoryRanges readParams"); |
| 1963 | AEMU_SCOPED_TRACE("vkFlushMappedMemoryRanges returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1964 | VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 1965 | stream->read(&vkFlushMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1966 | countingStream->clearPool(); |
| 1967 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1968 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1969 | mImpl->log("finish vkFlushMappedMemoryRanges");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1970 | return vkFlushMappedMemoryRanges_VkResult_return; |
| 1971 | } |
| 1972 | |
| 1973 | VkResult VkEncoder::vkInvalidateMappedMemoryRanges( |
| 1974 | VkDevice device, |
| 1975 | uint32_t memoryRangeCount, |
| 1976 | const VkMappedMemoryRange* pMemoryRanges) |
| 1977 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1978 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1979 | AEMU_SCOPED_TRACE("vkInvalidateMappedMemoryRanges encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1980 | mImpl->log("start vkInvalidateMappedMemoryRanges"); |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 1981 | 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] | 1982 | auto stream = mImpl->stream(); |
| 1983 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1984 | auto resources = mImpl->resources(); |
| 1985 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1986 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1987 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1988 | uint32_t local_memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1989 | VkMappedMemoryRange* local_pMemoryRanges; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1990 | local_device = device; |
| 1991 | local_memoryRangeCount = memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1992 | local_pMemoryRanges = nullptr; |
| 1993 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1994 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1995 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1996 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1997 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1998 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1999 | } |
| 2000 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2001 | if (local_pMemoryRanges) |
| 2002 | { |
| 2003 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 2004 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2005 | transform_tohost_VkMappedMemoryRange(mImpl->resources(), (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2006 | } |
| 2007 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2008 | countingStream->rewind(); |
| 2009 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2010 | uint64_t cgen_var_113; |
| 2011 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_113, 1); |
| 2012 | countingStream->write((uint64_t*)&cgen_var_113, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2013 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 2014 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 2015 | { |
| 2016 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2017 | } |
| 2018 | } |
| 2019 | uint32_t packetSize_vkInvalidateMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2020 | countingStream->rewind(); |
| 2021 | uint32_t opcode_vkInvalidateMappedMemoryRanges = OP_vkInvalidateMappedMemoryRanges; |
| 2022 | stream->write(&opcode_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| 2023 | stream->write(&packetSize_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2024 | uint64_t cgen_var_114; |
| 2025 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_114, 1); |
| 2026 | stream->write((uint64_t*)&cgen_var_114, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2027 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2028 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 2029 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2030 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2031 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2032 | AEMU_SCOPED_TRACE("vkInvalidateMappedMemoryRanges readParams"); |
| 2033 | AEMU_SCOPED_TRACE("vkInvalidateMappedMemoryRanges returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2034 | VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 2035 | stream->read(&vkInvalidateMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2036 | countingStream->clearPool(); |
| 2037 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2038 | pool->freeAll(); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 2039 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2040 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 2041 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 2042 | { |
| 2043 | auto range = pMemoryRanges[i]; |
| 2044 | auto memory = pMemoryRanges[i].memory; |
| 2045 | auto size = pMemoryRanges[i].size; |
| 2046 | auto offset = pMemoryRanges[i].offset; |
| 2047 | uint64_t streamSize = 0; |
| 2048 | if (!memory) { stream->read(&streamSize, sizeof(uint64_t)); continue; }; |
| 2049 | auto hostPtr = resources->getMappedPointer(memory); |
| 2050 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 2051 | if (!hostPtr) { stream->read(&streamSize, sizeof(uint64_t)); continue; }; |
| 2052 | streamSize = actualSize; |
| 2053 | stream->read(&streamSize, sizeof(uint64_t)); |
| 2054 | uint8_t* targetRange = hostPtr + offset; |
| 2055 | stream->read(targetRange, actualSize); |
| 2056 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2057 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2058 | mImpl->log("finish vkInvalidateMappedMemoryRanges");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2059 | return vkInvalidateMappedMemoryRanges_VkResult_return; |
| 2060 | } |
| 2061 | |
| 2062 | void VkEncoder::vkGetDeviceMemoryCommitment( |
| 2063 | VkDevice device, |
| 2064 | VkDeviceMemory memory, |
| 2065 | VkDeviceSize* pCommittedMemoryInBytes) |
| 2066 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2067 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2068 | AEMU_SCOPED_TRACE("vkGetDeviceMemoryCommitment encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2069 | mImpl->log("start vkGetDeviceMemoryCommitment"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2070 | auto stream = mImpl->stream(); |
| 2071 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2072 | auto resources = mImpl->resources(); |
| 2073 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2074 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2075 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2076 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2077 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2078 | local_memory = memory; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 2079 | mImpl->resources()->deviceMemoryTransform_tohost((VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2080 | countingStream->rewind(); |
| 2081 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2082 | uint64_t cgen_var_115; |
| 2083 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_115, 1); |
| 2084 | countingStream->write((uint64_t*)&cgen_var_115, 1 * 8); |
| 2085 | uint64_t cgen_var_116; |
| 2086 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_116, 1); |
| 2087 | countingStream->write((uint64_t*)&cgen_var_116, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2088 | countingStream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 2089 | } |
| 2090 | uint32_t packetSize_vkGetDeviceMemoryCommitment = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2091 | countingStream->rewind(); |
| 2092 | uint32_t opcode_vkGetDeviceMemoryCommitment = OP_vkGetDeviceMemoryCommitment; |
| 2093 | stream->write(&opcode_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| 2094 | stream->write(&packetSize_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2095 | uint64_t cgen_var_117; |
| 2096 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_117, 1); |
| 2097 | stream->write((uint64_t*)&cgen_var_117, 1 * 8); |
| 2098 | uint64_t cgen_var_118; |
| 2099 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_118, 1); |
| 2100 | stream->write((uint64_t*)&cgen_var_118, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2101 | stream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2102 | AEMU_SCOPED_TRACE("vkGetDeviceMemoryCommitment readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2103 | stream->read((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2104 | AEMU_SCOPED_TRACE("vkGetDeviceMemoryCommitment returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2105 | mImpl->log("finish vkGetDeviceMemoryCommitment");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2106 | } |
| 2107 | |
| 2108 | VkResult VkEncoder::vkBindBufferMemory( |
| 2109 | VkDevice device, |
| 2110 | VkBuffer buffer, |
| 2111 | VkDeviceMemory memory, |
| 2112 | VkDeviceSize memoryOffset) |
| 2113 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2114 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2115 | AEMU_SCOPED_TRACE("vkBindBufferMemory encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2116 | mImpl->log("start vkBindBufferMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2117 | auto stream = mImpl->stream(); |
| 2118 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2119 | auto resources = mImpl->resources(); |
| 2120 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2121 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2122 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2123 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2124 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2125 | VkDeviceSize local_memoryOffset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2126 | local_device = device; |
| 2127 | local_buffer = buffer; |
| 2128 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2129 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 2130 | mImpl->resources()->deviceMemoryTransform_tohost((VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)&local_memoryOffset, 1, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2131 | countingStream->rewind(); |
| 2132 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2133 | uint64_t cgen_var_119; |
| 2134 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_119, 1); |
| 2135 | countingStream->write((uint64_t*)&cgen_var_119, 1 * 8); |
| 2136 | uint64_t cgen_var_120; |
| 2137 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_120, 1); |
| 2138 | countingStream->write((uint64_t*)&cgen_var_120, 1 * 8); |
| 2139 | uint64_t cgen_var_121; |
| 2140 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_121, 1); |
| 2141 | countingStream->write((uint64_t*)&cgen_var_121, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2142 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2143 | } |
| 2144 | uint32_t packetSize_vkBindBufferMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2145 | countingStream->rewind(); |
| 2146 | uint32_t opcode_vkBindBufferMemory = OP_vkBindBufferMemory; |
| 2147 | stream->write(&opcode_vkBindBufferMemory, sizeof(uint32_t)); |
| 2148 | stream->write(&packetSize_vkBindBufferMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2149 | uint64_t cgen_var_122; |
| 2150 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_122, 1); |
| 2151 | stream->write((uint64_t*)&cgen_var_122, 1 * 8); |
| 2152 | uint64_t cgen_var_123; |
| 2153 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_123, 1); |
| 2154 | stream->write((uint64_t*)&cgen_var_123, 1 * 8); |
| 2155 | uint64_t cgen_var_124; |
| 2156 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_124, 1); |
| 2157 | stream->write((uint64_t*)&cgen_var_124, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2158 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2159 | AEMU_SCOPED_TRACE("vkBindBufferMemory readParams"); |
| 2160 | AEMU_SCOPED_TRACE("vkBindBufferMemory returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2161 | VkResult vkBindBufferMemory_VkResult_return = (VkResult)0; |
| 2162 | stream->read(&vkBindBufferMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2163 | countingStream->clearPool(); |
| 2164 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2165 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2166 | mImpl->log("finish vkBindBufferMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2167 | return vkBindBufferMemory_VkResult_return; |
| 2168 | } |
| 2169 | |
| 2170 | VkResult VkEncoder::vkBindImageMemory( |
| 2171 | VkDevice device, |
| 2172 | VkImage image, |
| 2173 | VkDeviceMemory memory, |
| 2174 | VkDeviceSize memoryOffset) |
| 2175 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2176 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2177 | AEMU_SCOPED_TRACE("vkBindImageMemory encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2178 | mImpl->log("start vkBindImageMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2179 | auto stream = mImpl->stream(); |
| 2180 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2181 | auto resources = mImpl->resources(); |
| 2182 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2183 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2184 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2185 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2186 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2187 | VkDeviceSize local_memoryOffset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2188 | local_device = device; |
| 2189 | local_image = image; |
| 2190 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2191 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 2192 | mImpl->resources()->deviceMemoryTransform_tohost((VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)&local_memoryOffset, 1, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2193 | countingStream->rewind(); |
| 2194 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2195 | uint64_t cgen_var_125; |
| 2196 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_125, 1); |
| 2197 | countingStream->write((uint64_t*)&cgen_var_125, 1 * 8); |
| 2198 | uint64_t cgen_var_126; |
| 2199 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_126, 1); |
| 2200 | countingStream->write((uint64_t*)&cgen_var_126, 1 * 8); |
| 2201 | uint64_t cgen_var_127; |
| 2202 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_127, 1); |
| 2203 | countingStream->write((uint64_t*)&cgen_var_127, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2204 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2205 | } |
| 2206 | uint32_t packetSize_vkBindImageMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2207 | countingStream->rewind(); |
| 2208 | uint32_t opcode_vkBindImageMemory = OP_vkBindImageMemory; |
| 2209 | stream->write(&opcode_vkBindImageMemory, sizeof(uint32_t)); |
| 2210 | stream->write(&packetSize_vkBindImageMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2211 | uint64_t cgen_var_128; |
| 2212 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_128, 1); |
| 2213 | stream->write((uint64_t*)&cgen_var_128, 1 * 8); |
| 2214 | uint64_t cgen_var_129; |
| 2215 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_129, 1); |
| 2216 | stream->write((uint64_t*)&cgen_var_129, 1 * 8); |
| 2217 | uint64_t cgen_var_130; |
| 2218 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_130, 1); |
| 2219 | stream->write((uint64_t*)&cgen_var_130, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2220 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2221 | AEMU_SCOPED_TRACE("vkBindImageMemory readParams"); |
| 2222 | AEMU_SCOPED_TRACE("vkBindImageMemory returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2223 | VkResult vkBindImageMemory_VkResult_return = (VkResult)0; |
| 2224 | stream->read(&vkBindImageMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2225 | countingStream->clearPool(); |
| 2226 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2227 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2228 | mImpl->log("finish vkBindImageMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2229 | return vkBindImageMemory_VkResult_return; |
| 2230 | } |
| 2231 | |
| 2232 | void VkEncoder::vkGetBufferMemoryRequirements( |
| 2233 | VkDevice device, |
| 2234 | VkBuffer buffer, |
| 2235 | VkMemoryRequirements* pMemoryRequirements) |
| 2236 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2237 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2238 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2239 | mImpl->log("start vkGetBufferMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2240 | auto stream = mImpl->stream(); |
| 2241 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2242 | auto resources = mImpl->resources(); |
| 2243 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2244 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2245 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2246 | VkBuffer local_buffer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2247 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2248 | local_buffer = buffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2249 | countingStream->rewind(); |
| 2250 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2251 | uint64_t cgen_var_131; |
| 2252 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_131, 1); |
| 2253 | countingStream->write((uint64_t*)&cgen_var_131, 1 * 8); |
| 2254 | uint64_t cgen_var_132; |
| 2255 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_132, 1); |
| 2256 | countingStream->write((uint64_t*)&cgen_var_132, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2257 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2258 | } |
| 2259 | uint32_t packetSize_vkGetBufferMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2260 | countingStream->rewind(); |
| 2261 | uint32_t opcode_vkGetBufferMemoryRequirements = OP_vkGetBufferMemoryRequirements; |
| 2262 | stream->write(&opcode_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| 2263 | stream->write(&packetSize_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2264 | uint64_t cgen_var_133; |
| 2265 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_133, 1); |
| 2266 | stream->write((uint64_t*)&cgen_var_133, 1 * 8); |
| 2267 | uint64_t cgen_var_134; |
| 2268 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_134, 1); |
| 2269 | stream->write((uint64_t*)&cgen_var_134, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2270 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2271 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2272 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2273 | if (pMemoryRequirements) |
| 2274 | { |
| 2275 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2276 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2277 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2278 | mImpl->log("finish vkGetBufferMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2279 | } |
| 2280 | |
| 2281 | void VkEncoder::vkGetImageMemoryRequirements( |
| 2282 | VkDevice device, |
| 2283 | VkImage image, |
| 2284 | VkMemoryRequirements* pMemoryRequirements) |
| 2285 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2286 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2287 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2288 | mImpl->log("start vkGetImageMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2289 | auto stream = mImpl->stream(); |
| 2290 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2291 | auto resources = mImpl->resources(); |
| 2292 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2293 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2294 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2295 | VkImage local_image; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2296 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2297 | local_image = image; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2298 | countingStream->rewind(); |
| 2299 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2300 | uint64_t cgen_var_135; |
| 2301 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_135, 1); |
| 2302 | countingStream->write((uint64_t*)&cgen_var_135, 1 * 8); |
| 2303 | uint64_t cgen_var_136; |
| 2304 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_136, 1); |
| 2305 | countingStream->write((uint64_t*)&cgen_var_136, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2306 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2307 | } |
| 2308 | uint32_t packetSize_vkGetImageMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2309 | countingStream->rewind(); |
| 2310 | uint32_t opcode_vkGetImageMemoryRequirements = OP_vkGetImageMemoryRequirements; |
| 2311 | stream->write(&opcode_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| 2312 | stream->write(&packetSize_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2313 | uint64_t cgen_var_137; |
| 2314 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_137, 1); |
| 2315 | stream->write((uint64_t*)&cgen_var_137, 1 * 8); |
| 2316 | uint64_t cgen_var_138; |
| 2317 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_138, 1); |
| 2318 | stream->write((uint64_t*)&cgen_var_138, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2319 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2320 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2321 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2322 | if (pMemoryRequirements) |
| 2323 | { |
| 2324 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2325 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2326 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2327 | mImpl->log("finish vkGetImageMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2328 | } |
| 2329 | |
| 2330 | void VkEncoder::vkGetImageSparseMemoryRequirements( |
| 2331 | VkDevice device, |
| 2332 | VkImage image, |
| 2333 | uint32_t* pSparseMemoryRequirementCount, |
| 2334 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 2335 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2336 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2337 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2338 | mImpl->log("start vkGetImageSparseMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2339 | auto stream = mImpl->stream(); |
| 2340 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2341 | auto resources = mImpl->resources(); |
| 2342 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2343 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2344 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2345 | VkImage local_image; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2346 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2347 | local_image = image; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2348 | countingStream->rewind(); |
| 2349 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2350 | uint64_t cgen_var_139; |
| 2351 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_139, 1); |
| 2352 | countingStream->write((uint64_t*)&cgen_var_139, 1 * 8); |
| 2353 | uint64_t cgen_var_140; |
| 2354 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_140, 1); |
| 2355 | countingStream->write((uint64_t*)&cgen_var_140, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2356 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2357 | uint64_t cgen_var_141 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 2358 | countingStream->putBe64(cgen_var_141); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2359 | if (pSparseMemoryRequirementCount) |
| 2360 | { |
| 2361 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2362 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2363 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2364 | uint64_t cgen_var_142 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 2365 | countingStream->putBe64(cgen_var_142); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2366 | if (pSparseMemoryRequirements) |
| 2367 | { |
| 2368 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2369 | { |
| 2370 | marshal_VkSparseImageMemoryRequirements(countingStream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2371 | } |
| 2372 | } |
| 2373 | } |
| 2374 | uint32_t packetSize_vkGetImageSparseMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2375 | countingStream->rewind(); |
| 2376 | uint32_t opcode_vkGetImageSparseMemoryRequirements = OP_vkGetImageSparseMemoryRequirements; |
| 2377 | stream->write(&opcode_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| 2378 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2379 | uint64_t cgen_var_143; |
| 2380 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_143, 1); |
| 2381 | stream->write((uint64_t*)&cgen_var_143, 1 * 8); |
| 2382 | uint64_t cgen_var_144; |
| 2383 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_144, 1); |
| 2384 | stream->write((uint64_t*)&cgen_var_144, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2385 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2386 | uint64_t cgen_var_145 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 2387 | stream->putBe64(cgen_var_145); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2388 | if (pSparseMemoryRequirementCount) |
| 2389 | { |
| 2390 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2391 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2392 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2393 | uint64_t cgen_var_146 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 2394 | stream->putBe64(cgen_var_146); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2395 | if (pSparseMemoryRequirements) |
| 2396 | { |
| 2397 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2398 | { |
| 2399 | marshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2400 | } |
| 2401 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2402 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2403 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2404 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2405 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2406 | if (pSparseMemoryRequirementCount) |
| 2407 | { |
| 2408 | if (!(check_pSparseMemoryRequirementCount)) |
| 2409 | { |
| 2410 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 2411 | } |
| 2412 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2413 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2414 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2415 | VkSparseImageMemoryRequirements* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2416 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2417 | if (pSparseMemoryRequirements) |
| 2418 | { |
| 2419 | if (!(check_pSparseMemoryRequirements)) |
| 2420 | { |
| 2421 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 2422 | } |
| 2423 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2424 | { |
| 2425 | unmarshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2426 | } |
| 2427 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2428 | if (pSparseMemoryRequirements) |
| 2429 | { |
| 2430 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2431 | { |
| 2432 | transform_fromhost_VkSparseImageMemoryRequirements(mImpl->resources(), (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2433 | } |
| 2434 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2435 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2436 | mImpl->log("finish vkGetImageSparseMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2437 | } |
| 2438 | |
| 2439 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties( |
| 2440 | VkPhysicalDevice physicalDevice, |
| 2441 | VkFormat format, |
| 2442 | VkImageType type, |
| 2443 | VkSampleCountFlagBits samples, |
| 2444 | VkImageUsageFlags usage, |
| 2445 | VkImageTiling tiling, |
| 2446 | uint32_t* pPropertyCount, |
| 2447 | VkSparseImageFormatProperties* pProperties) |
| 2448 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2449 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2450 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2451 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2452 | auto stream = mImpl->stream(); |
| 2453 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2454 | auto resources = mImpl->resources(); |
| 2455 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2456 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2457 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2458 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2459 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2460 | VkSampleCountFlagBits local_samples; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2461 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2462 | VkImageTiling local_tiling; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2463 | local_physicalDevice = physicalDevice; |
| 2464 | local_format = format; |
| 2465 | local_type = type; |
| 2466 | local_samples = samples; |
| 2467 | local_usage = usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2468 | local_tiling = tiling; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2469 | countingStream->rewind(); |
| 2470 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2471 | uint64_t cgen_var_149; |
| 2472 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_149, 1); |
| 2473 | countingStream->write((uint64_t*)&cgen_var_149, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2474 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 2475 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 2476 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 2477 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 2478 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2479 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2480 | uint64_t cgen_var_150 = (uint64_t)(uintptr_t)pPropertyCount; |
| 2481 | countingStream->putBe64(cgen_var_150); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2482 | if (pPropertyCount) |
| 2483 | { |
| 2484 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2485 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2486 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2487 | uint64_t cgen_var_151 = (uint64_t)(uintptr_t)pProperties; |
| 2488 | countingStream->putBe64(cgen_var_151); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2489 | if (pProperties) |
| 2490 | { |
| 2491 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2492 | { |
| 2493 | marshal_VkSparseImageFormatProperties(countingStream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2494 | } |
| 2495 | } |
| 2496 | } |
| 2497 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2498 | countingStream->rewind(); |
| 2499 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties = OP_vkGetPhysicalDeviceSparseImageFormatProperties; |
| 2500 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| 2501 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2502 | uint64_t cgen_var_152; |
| 2503 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_152, 1); |
| 2504 | stream->write((uint64_t*)&cgen_var_152, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2505 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 2506 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 2507 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 2508 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 2509 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2510 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2511 | uint64_t cgen_var_153 = (uint64_t)(uintptr_t)pPropertyCount; |
| 2512 | stream->putBe64(cgen_var_153); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2513 | if (pPropertyCount) |
| 2514 | { |
| 2515 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2516 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2517 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2518 | uint64_t cgen_var_154 = (uint64_t)(uintptr_t)pProperties; |
| 2519 | stream->putBe64(cgen_var_154); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2520 | if (pProperties) |
| 2521 | { |
| 2522 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2523 | { |
| 2524 | marshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2525 | } |
| 2526 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2527 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2528 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2529 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2530 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2531 | if (pPropertyCount) |
| 2532 | { |
| 2533 | if (!(check_pPropertyCount)) |
| 2534 | { |
| 2535 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 2536 | } |
| 2537 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2538 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2539 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2540 | VkSparseImageFormatProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2541 | check_pProperties = (VkSparseImageFormatProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2542 | if (pProperties) |
| 2543 | { |
| 2544 | if (!(check_pProperties)) |
| 2545 | { |
| 2546 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 2547 | } |
| 2548 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2549 | { |
| 2550 | unmarshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2551 | } |
| 2552 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2553 | if (pProperties) |
| 2554 | { |
| 2555 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2556 | { |
| 2557 | transform_fromhost_VkSparseImageFormatProperties(mImpl->resources(), (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2558 | } |
| 2559 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2560 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2561 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2562 | } |
| 2563 | |
| 2564 | VkResult VkEncoder::vkQueueBindSparse( |
| 2565 | VkQueue queue, |
| 2566 | uint32_t bindInfoCount, |
| 2567 | const VkBindSparseInfo* pBindInfo, |
| 2568 | VkFence fence) |
| 2569 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2570 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2571 | AEMU_SCOPED_TRACE("vkQueueBindSparse encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2572 | mImpl->log("start vkQueueBindSparse"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2573 | auto stream = mImpl->stream(); |
| 2574 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2575 | auto resources = mImpl->resources(); |
| 2576 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2577 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2578 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2579 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2580 | VkBindSparseInfo* local_pBindInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2581 | VkFence local_fence; |
| 2582 | local_queue = queue; |
| 2583 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2584 | local_pBindInfo = nullptr; |
| 2585 | if (pBindInfo) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2586 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2587 | local_pBindInfo = (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2588 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2589 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2590 | deepcopy_VkBindSparseInfo(pool, pBindInfo + i, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2591 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2592 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2593 | local_fence = fence; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2594 | if (local_pBindInfo) |
| 2595 | { |
| 2596 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2597 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2598 | transform_tohost_VkBindSparseInfo(mImpl->resources(), (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2599 | } |
| 2600 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2601 | countingStream->rewind(); |
| 2602 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2603 | uint64_t cgen_var_157; |
| 2604 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_157, 1); |
| 2605 | countingStream->write((uint64_t*)&cgen_var_157, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2606 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 2607 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2608 | { |
| 2609 | marshal_VkBindSparseInfo(countingStream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 2610 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2611 | uint64_t cgen_var_158; |
| 2612 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_158, 1); |
| 2613 | countingStream->write((uint64_t*)&cgen_var_158, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2614 | } |
| 2615 | uint32_t packetSize_vkQueueBindSparse = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2616 | countingStream->rewind(); |
| 2617 | uint32_t opcode_vkQueueBindSparse = OP_vkQueueBindSparse; |
| 2618 | stream->write(&opcode_vkQueueBindSparse, sizeof(uint32_t)); |
| 2619 | stream->write(&packetSize_vkQueueBindSparse, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2620 | uint64_t cgen_var_159; |
| 2621 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_159, 1); |
| 2622 | stream->write((uint64_t*)&cgen_var_159, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2623 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2624 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2625 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2626 | marshal_VkBindSparseInfo(stream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2627 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2628 | uint64_t cgen_var_160; |
| 2629 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_160, 1); |
| 2630 | stream->write((uint64_t*)&cgen_var_160, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2631 | AEMU_SCOPED_TRACE("vkQueueBindSparse readParams"); |
| 2632 | AEMU_SCOPED_TRACE("vkQueueBindSparse returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2633 | VkResult vkQueueBindSparse_VkResult_return = (VkResult)0; |
| 2634 | stream->read(&vkQueueBindSparse_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2635 | countingStream->clearPool(); |
| 2636 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2637 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2638 | mImpl->log("finish vkQueueBindSparse");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2639 | return vkQueueBindSparse_VkResult_return; |
| 2640 | } |
| 2641 | |
| 2642 | VkResult VkEncoder::vkCreateFence( |
| 2643 | VkDevice device, |
| 2644 | const VkFenceCreateInfo* pCreateInfo, |
| 2645 | const VkAllocationCallbacks* pAllocator, |
| 2646 | VkFence* pFence) |
| 2647 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2648 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2649 | AEMU_SCOPED_TRACE("vkCreateFence encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2650 | mImpl->log("start vkCreateFence"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2651 | auto stream = mImpl->stream(); |
| 2652 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2653 | auto resources = mImpl->resources(); |
| 2654 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2655 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2656 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2657 | VkFenceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2658 | VkAllocationCallbacks* local_pAllocator; |
| 2659 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2660 | local_pCreateInfo = nullptr; |
| 2661 | if (pCreateInfo) |
| 2662 | { |
| 2663 | local_pCreateInfo = (VkFenceCreateInfo*)pool->alloc(sizeof(const VkFenceCreateInfo)); |
| 2664 | deepcopy_VkFenceCreateInfo(pool, pCreateInfo, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| 2665 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2666 | local_pAllocator = nullptr; |
| 2667 | if (pAllocator) |
| 2668 | { |
| 2669 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2670 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2671 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2672 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2673 | if (local_pCreateInfo) |
| 2674 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2675 | transform_tohost_VkFenceCreateInfo(mImpl->resources(), (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2676 | } |
| 2677 | if (local_pAllocator) |
| 2678 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2679 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2680 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2681 | countingStream->rewind(); |
| 2682 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2683 | uint64_t cgen_var_161; |
| 2684 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_161, 1); |
| 2685 | countingStream->write((uint64_t*)&cgen_var_161, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2686 | marshal_VkFenceCreateInfo(countingStream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2687 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2688 | uint64_t cgen_var_162 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2689 | countingStream->putBe64(cgen_var_162); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2690 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2691 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2692 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2693 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2694 | uint64_t cgen_var_163; |
| 2695 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_163, 1); |
| 2696 | countingStream->write((uint64_t*)&cgen_var_163, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2697 | } |
| 2698 | uint32_t packetSize_vkCreateFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2699 | countingStream->rewind(); |
| 2700 | uint32_t opcode_vkCreateFence = OP_vkCreateFence; |
| 2701 | stream->write(&opcode_vkCreateFence, sizeof(uint32_t)); |
| 2702 | stream->write(&packetSize_vkCreateFence, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2703 | uint64_t cgen_var_164; |
| 2704 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_164, 1); |
| 2705 | stream->write((uint64_t*)&cgen_var_164, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2706 | marshal_VkFenceCreateInfo(stream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2707 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2708 | uint64_t cgen_var_165 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2709 | stream->putBe64(cgen_var_165); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2710 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2711 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2712 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2713 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2714 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2715 | uint64_t cgen_var_166; |
| 2716 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_166, 1); |
| 2717 | stream->write((uint64_t*)&cgen_var_166, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2718 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2719 | AEMU_SCOPED_TRACE("vkCreateFence readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2720 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2721 | uint64_t cgen_var_167; |
| 2722 | stream->read((uint64_t*)&cgen_var_167, 8); |
| 2723 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_167, (VkFence*)pFence, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2724 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2725 | AEMU_SCOPED_TRACE("vkCreateFence returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2726 | VkResult vkCreateFence_VkResult_return = (VkResult)0; |
| 2727 | stream->read(&vkCreateFence_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2728 | countingStream->clearPool(); |
| 2729 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2730 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2731 | mImpl->log("finish vkCreateFence");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2732 | return vkCreateFence_VkResult_return; |
| 2733 | } |
| 2734 | |
| 2735 | void VkEncoder::vkDestroyFence( |
| 2736 | VkDevice device, |
| 2737 | VkFence fence, |
| 2738 | const VkAllocationCallbacks* pAllocator) |
| 2739 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2740 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2741 | AEMU_SCOPED_TRACE("vkDestroyFence encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2742 | mImpl->log("start vkDestroyFence"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2743 | auto stream = mImpl->stream(); |
| 2744 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2745 | auto resources = mImpl->resources(); |
| 2746 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2747 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2748 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2749 | VkFence local_fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2750 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2751 | local_device = device; |
| 2752 | local_fence = fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2753 | local_pAllocator = nullptr; |
| 2754 | if (pAllocator) |
| 2755 | { |
| 2756 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2757 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2758 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2759 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2760 | if (local_pAllocator) |
| 2761 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2762 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2763 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2764 | countingStream->rewind(); |
| 2765 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2766 | uint64_t cgen_var_168; |
| 2767 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_168, 1); |
| 2768 | countingStream->write((uint64_t*)&cgen_var_168, 1 * 8); |
| 2769 | uint64_t cgen_var_169; |
| 2770 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_169, 1); |
| 2771 | countingStream->write((uint64_t*)&cgen_var_169, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2772 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2773 | uint64_t cgen_var_170 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2774 | countingStream->putBe64(cgen_var_170); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2775 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2776 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2777 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2778 | } |
| 2779 | } |
| 2780 | uint32_t packetSize_vkDestroyFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2781 | countingStream->rewind(); |
| 2782 | uint32_t opcode_vkDestroyFence = OP_vkDestroyFence; |
| 2783 | stream->write(&opcode_vkDestroyFence, sizeof(uint32_t)); |
| 2784 | stream->write(&packetSize_vkDestroyFence, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2785 | uint64_t cgen_var_171; |
| 2786 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_171, 1); |
| 2787 | stream->write((uint64_t*)&cgen_var_171, 1 * 8); |
| 2788 | uint64_t cgen_var_172; |
| 2789 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_172, 1); |
| 2790 | stream->write((uint64_t*)&cgen_var_172, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2791 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2792 | uint64_t cgen_var_173 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2793 | stream->putBe64(cgen_var_173); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2794 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2795 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2796 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2797 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2798 | AEMU_SCOPED_TRACE("vkDestroyFence readParams"); |
| 2799 | AEMU_SCOPED_TRACE("vkDestroyFence returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2800 | resources->destroyMapping()->mapHandles_VkFence((VkFence*)&fence); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2801 | mImpl->log("finish vkDestroyFence");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2802 | } |
| 2803 | |
| 2804 | VkResult VkEncoder::vkResetFences( |
| 2805 | VkDevice device, |
| 2806 | uint32_t fenceCount, |
| 2807 | const VkFence* pFences) |
| 2808 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2809 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2810 | AEMU_SCOPED_TRACE("vkResetFences encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2811 | mImpl->log("start vkResetFences"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2812 | auto stream = mImpl->stream(); |
| 2813 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2814 | auto resources = mImpl->resources(); |
| 2815 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2816 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2817 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2818 | uint32_t local_fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2819 | VkFence* local_pFences; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2820 | local_device = device; |
| 2821 | local_fenceCount = fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2822 | local_pFences = nullptr; |
| 2823 | if (pFences) |
| 2824 | { |
| 2825 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2826 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2827 | countingStream->rewind(); |
| 2828 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2829 | uint64_t cgen_var_174; |
| 2830 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_174, 1); |
| 2831 | countingStream->write((uint64_t*)&cgen_var_174, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2832 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2833 | if (((fenceCount))) |
| 2834 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2835 | uint64_t* cgen_var_175; |
| 2836 | countingStream->alloc((void**)&cgen_var_175, ((fenceCount)) * 8); |
| 2837 | countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_175, ((fenceCount))); |
| 2838 | countingStream->write((uint64_t*)cgen_var_175, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2839 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2840 | } |
| 2841 | uint32_t packetSize_vkResetFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2842 | countingStream->rewind(); |
| 2843 | uint32_t opcode_vkResetFences = OP_vkResetFences; |
| 2844 | stream->write(&opcode_vkResetFences, sizeof(uint32_t)); |
| 2845 | stream->write(&packetSize_vkResetFences, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2846 | uint64_t cgen_var_176; |
| 2847 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_176, 1); |
| 2848 | stream->write((uint64_t*)&cgen_var_176, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2849 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2850 | if (((fenceCount))) |
| 2851 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2852 | uint64_t* cgen_var_177; |
| 2853 | stream->alloc((void**)&cgen_var_177, ((fenceCount)) * 8); |
| 2854 | stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_177, ((fenceCount))); |
| 2855 | stream->write((uint64_t*)cgen_var_177, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2856 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2857 | AEMU_SCOPED_TRACE("vkResetFences readParams"); |
| 2858 | AEMU_SCOPED_TRACE("vkResetFences returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2859 | VkResult vkResetFences_VkResult_return = (VkResult)0; |
| 2860 | stream->read(&vkResetFences_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2861 | countingStream->clearPool(); |
| 2862 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2863 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2864 | mImpl->log("finish vkResetFences");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2865 | return vkResetFences_VkResult_return; |
| 2866 | } |
| 2867 | |
| 2868 | VkResult VkEncoder::vkGetFenceStatus( |
| 2869 | VkDevice device, |
| 2870 | VkFence fence) |
| 2871 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2872 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2873 | AEMU_SCOPED_TRACE("vkGetFenceStatus encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2874 | mImpl->log("start vkGetFenceStatus"); |
| 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 | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2881 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2882 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2883 | local_fence = fence; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2884 | countingStream->rewind(); |
| 2885 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2886 | uint64_t cgen_var_178; |
| 2887 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_178, 1); |
| 2888 | countingStream->write((uint64_t*)&cgen_var_178, 1 * 8); |
| 2889 | uint64_t cgen_var_179; |
| 2890 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_179, 1); |
| 2891 | countingStream->write((uint64_t*)&cgen_var_179, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2892 | } |
| 2893 | uint32_t packetSize_vkGetFenceStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2894 | countingStream->rewind(); |
| 2895 | uint32_t opcode_vkGetFenceStatus = OP_vkGetFenceStatus; |
| 2896 | stream->write(&opcode_vkGetFenceStatus, sizeof(uint32_t)); |
| 2897 | stream->write(&packetSize_vkGetFenceStatus, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2898 | uint64_t cgen_var_180; |
| 2899 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_180, 1); |
| 2900 | stream->write((uint64_t*)&cgen_var_180, 1 * 8); |
| 2901 | uint64_t cgen_var_181; |
| 2902 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_181, 1); |
| 2903 | stream->write((uint64_t*)&cgen_var_181, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2904 | AEMU_SCOPED_TRACE("vkGetFenceStatus readParams"); |
| 2905 | AEMU_SCOPED_TRACE("vkGetFenceStatus returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2906 | VkResult vkGetFenceStatus_VkResult_return = (VkResult)0; |
| 2907 | stream->read(&vkGetFenceStatus_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2908 | countingStream->clearPool(); |
| 2909 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2910 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2911 | mImpl->log("finish vkGetFenceStatus");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2912 | return vkGetFenceStatus_VkResult_return; |
| 2913 | } |
| 2914 | |
| 2915 | VkResult VkEncoder::vkWaitForFences( |
| 2916 | VkDevice device, |
| 2917 | uint32_t fenceCount, |
| 2918 | const VkFence* pFences, |
| 2919 | VkBool32 waitAll, |
| 2920 | uint64_t timeout) |
| 2921 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2922 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2923 | AEMU_SCOPED_TRACE("vkWaitForFences encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2924 | mImpl->log("start vkWaitForFences"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2925 | auto stream = mImpl->stream(); |
| 2926 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2927 | auto resources = mImpl->resources(); |
| 2928 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2929 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2930 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2931 | uint32_t local_fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2932 | VkFence* local_pFences; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2933 | VkBool32 local_waitAll; |
| 2934 | uint64_t local_timeout; |
| 2935 | local_device = device; |
| 2936 | local_fenceCount = fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2937 | local_pFences = nullptr; |
| 2938 | if (pFences) |
| 2939 | { |
| 2940 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2941 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2942 | local_waitAll = waitAll; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2943 | local_timeout = timeout; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2944 | countingStream->rewind(); |
| 2945 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2946 | uint64_t cgen_var_182; |
| 2947 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_182, 1); |
| 2948 | countingStream->write((uint64_t*)&cgen_var_182, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2949 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2950 | if (((fenceCount))) |
| 2951 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2952 | uint64_t* cgen_var_183; |
| 2953 | countingStream->alloc((void**)&cgen_var_183, ((fenceCount)) * 8); |
| 2954 | countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_183, ((fenceCount))); |
| 2955 | countingStream->write((uint64_t*)cgen_var_183, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2956 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2957 | countingStream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2958 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2959 | } |
| 2960 | uint32_t packetSize_vkWaitForFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2961 | countingStream->rewind(); |
| 2962 | uint32_t opcode_vkWaitForFences = OP_vkWaitForFences; |
| 2963 | stream->write(&opcode_vkWaitForFences, sizeof(uint32_t)); |
| 2964 | stream->write(&packetSize_vkWaitForFences, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2965 | uint64_t cgen_var_184; |
| 2966 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_184, 1); |
| 2967 | stream->write((uint64_t*)&cgen_var_184, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2968 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2969 | if (((fenceCount))) |
| 2970 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2971 | uint64_t* cgen_var_185; |
| 2972 | stream->alloc((void**)&cgen_var_185, ((fenceCount)) * 8); |
| 2973 | stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_185, ((fenceCount))); |
| 2974 | stream->write((uint64_t*)cgen_var_185, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2975 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2976 | stream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2977 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2978 | AEMU_SCOPED_TRACE("vkWaitForFences readParams"); |
| 2979 | AEMU_SCOPED_TRACE("vkWaitForFences returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2980 | VkResult vkWaitForFences_VkResult_return = (VkResult)0; |
| 2981 | stream->read(&vkWaitForFences_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2982 | countingStream->clearPool(); |
| 2983 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2984 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2985 | mImpl->log("finish vkWaitForFences");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2986 | return vkWaitForFences_VkResult_return; |
| 2987 | } |
| 2988 | |
| 2989 | VkResult VkEncoder::vkCreateSemaphore( |
| 2990 | VkDevice device, |
| 2991 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 2992 | const VkAllocationCallbacks* pAllocator, |
| 2993 | VkSemaphore* pSemaphore) |
| 2994 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2995 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2996 | AEMU_SCOPED_TRACE("vkCreateSemaphore encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2997 | mImpl->log("start vkCreateSemaphore"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2998 | auto stream = mImpl->stream(); |
| 2999 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3000 | auto resources = mImpl->resources(); |
| 3001 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3002 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3003 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3004 | VkSemaphoreCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3005 | VkAllocationCallbacks* local_pAllocator; |
| 3006 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3007 | local_pCreateInfo = nullptr; |
| 3008 | if (pCreateInfo) |
| 3009 | { |
| 3010 | local_pCreateInfo = (VkSemaphoreCreateInfo*)pool->alloc(sizeof(const VkSemaphoreCreateInfo)); |
| 3011 | deepcopy_VkSemaphoreCreateInfo(pool, pCreateInfo, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| 3012 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3013 | local_pAllocator = nullptr; |
| 3014 | if (pAllocator) |
| 3015 | { |
| 3016 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3017 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3018 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3019 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3020 | if (local_pCreateInfo) |
| 3021 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3022 | transform_tohost_VkSemaphoreCreateInfo(mImpl->resources(), (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3023 | } |
| 3024 | if (local_pAllocator) |
| 3025 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3026 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3027 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3028 | countingStream->rewind(); |
| 3029 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3030 | uint64_t cgen_var_186; |
| 3031 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_186, 1); |
| 3032 | countingStream->write((uint64_t*)&cgen_var_186, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3033 | marshal_VkSemaphoreCreateInfo(countingStream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3034 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3035 | uint64_t cgen_var_187 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3036 | countingStream->putBe64(cgen_var_187); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3037 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3038 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3039 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3040 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3041 | uint64_t cgen_var_188; |
| 3042 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_188, 1); |
| 3043 | countingStream->write((uint64_t*)&cgen_var_188, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3044 | } |
| 3045 | uint32_t packetSize_vkCreateSemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3046 | countingStream->rewind(); |
| 3047 | uint32_t opcode_vkCreateSemaphore = OP_vkCreateSemaphore; |
| 3048 | stream->write(&opcode_vkCreateSemaphore, sizeof(uint32_t)); |
| 3049 | stream->write(&packetSize_vkCreateSemaphore, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3050 | uint64_t cgen_var_189; |
| 3051 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_189, 1); |
| 3052 | stream->write((uint64_t*)&cgen_var_189, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3053 | marshal_VkSemaphoreCreateInfo(stream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3054 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3055 | uint64_t cgen_var_190 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3056 | stream->putBe64(cgen_var_190); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3057 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3058 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3059 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3060 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3061 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3062 | uint64_t cgen_var_191; |
| 3063 | stream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_191, 1); |
| 3064 | stream->write((uint64_t*)&cgen_var_191, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3065 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3066 | AEMU_SCOPED_TRACE("vkCreateSemaphore readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3067 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3068 | uint64_t cgen_var_192; |
| 3069 | stream->read((uint64_t*)&cgen_var_192, 8); |
| 3070 | stream->handleMapping()->mapHandles_u64_VkSemaphore(&cgen_var_192, (VkSemaphore*)pSemaphore, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3071 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3072 | AEMU_SCOPED_TRACE("vkCreateSemaphore returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3073 | VkResult vkCreateSemaphore_VkResult_return = (VkResult)0; |
| 3074 | stream->read(&vkCreateSemaphore_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3075 | countingStream->clearPool(); |
| 3076 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3077 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3078 | mImpl->log("finish vkCreateSemaphore");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3079 | return vkCreateSemaphore_VkResult_return; |
| 3080 | } |
| 3081 | |
| 3082 | void VkEncoder::vkDestroySemaphore( |
| 3083 | VkDevice device, |
| 3084 | VkSemaphore semaphore, |
| 3085 | const VkAllocationCallbacks* pAllocator) |
| 3086 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3087 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3088 | AEMU_SCOPED_TRACE("vkDestroySemaphore encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3089 | mImpl->log("start vkDestroySemaphore"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3090 | auto stream = mImpl->stream(); |
| 3091 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3092 | auto resources = mImpl->resources(); |
| 3093 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3094 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3095 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3096 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3097 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3098 | local_device = device; |
| 3099 | local_semaphore = semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3100 | local_pAllocator = nullptr; |
| 3101 | if (pAllocator) |
| 3102 | { |
| 3103 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3104 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3105 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3106 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3107 | if (local_pAllocator) |
| 3108 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3109 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3110 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3111 | countingStream->rewind(); |
| 3112 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3113 | uint64_t cgen_var_193; |
| 3114 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_193, 1); |
| 3115 | countingStream->write((uint64_t*)&cgen_var_193, 1 * 8); |
| 3116 | uint64_t cgen_var_194; |
| 3117 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_194, 1); |
| 3118 | countingStream->write((uint64_t*)&cgen_var_194, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3119 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3120 | uint64_t cgen_var_195 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3121 | countingStream->putBe64(cgen_var_195); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3122 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3123 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3124 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3125 | } |
| 3126 | } |
| 3127 | uint32_t packetSize_vkDestroySemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3128 | countingStream->rewind(); |
| 3129 | uint32_t opcode_vkDestroySemaphore = OP_vkDestroySemaphore; |
| 3130 | stream->write(&opcode_vkDestroySemaphore, sizeof(uint32_t)); |
| 3131 | stream->write(&packetSize_vkDestroySemaphore, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3132 | uint64_t cgen_var_196; |
| 3133 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_196, 1); |
| 3134 | stream->write((uint64_t*)&cgen_var_196, 1 * 8); |
| 3135 | uint64_t cgen_var_197; |
| 3136 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_197, 1); |
| 3137 | stream->write((uint64_t*)&cgen_var_197, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3138 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3139 | uint64_t cgen_var_198 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3140 | stream->putBe64(cgen_var_198); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3141 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3142 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3143 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3144 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3145 | AEMU_SCOPED_TRACE("vkDestroySemaphore readParams"); |
| 3146 | AEMU_SCOPED_TRACE("vkDestroySemaphore returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3147 | resources->destroyMapping()->mapHandles_VkSemaphore((VkSemaphore*)&semaphore); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3148 | mImpl->log("finish vkDestroySemaphore");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3149 | } |
| 3150 | |
| 3151 | VkResult VkEncoder::vkCreateEvent( |
| 3152 | VkDevice device, |
| 3153 | const VkEventCreateInfo* pCreateInfo, |
| 3154 | const VkAllocationCallbacks* pAllocator, |
| 3155 | VkEvent* pEvent) |
| 3156 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3157 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3158 | AEMU_SCOPED_TRACE("vkCreateEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3159 | mImpl->log("start vkCreateEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3160 | auto stream = mImpl->stream(); |
| 3161 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3162 | auto resources = mImpl->resources(); |
| 3163 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3164 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3165 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3166 | VkEventCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3167 | VkAllocationCallbacks* local_pAllocator; |
| 3168 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3169 | local_pCreateInfo = nullptr; |
| 3170 | if (pCreateInfo) |
| 3171 | { |
| 3172 | local_pCreateInfo = (VkEventCreateInfo*)pool->alloc(sizeof(const VkEventCreateInfo)); |
| 3173 | deepcopy_VkEventCreateInfo(pool, pCreateInfo, (VkEventCreateInfo*)(local_pCreateInfo)); |
| 3174 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3175 | local_pAllocator = nullptr; |
| 3176 | if (pAllocator) |
| 3177 | { |
| 3178 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3179 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3180 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3181 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3182 | if (local_pCreateInfo) |
| 3183 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3184 | transform_tohost_VkEventCreateInfo(mImpl->resources(), (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3185 | } |
| 3186 | if (local_pAllocator) |
| 3187 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3188 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3189 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3190 | countingStream->rewind(); |
| 3191 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3192 | uint64_t cgen_var_199; |
| 3193 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_199, 1); |
| 3194 | countingStream->write((uint64_t*)&cgen_var_199, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3195 | marshal_VkEventCreateInfo(countingStream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3196 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3197 | uint64_t cgen_var_200 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3198 | countingStream->putBe64(cgen_var_200); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3199 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3200 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3201 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3202 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3203 | uint64_t cgen_var_201; |
| 3204 | countingStream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_201, 1); |
| 3205 | countingStream->write((uint64_t*)&cgen_var_201, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3206 | } |
| 3207 | uint32_t packetSize_vkCreateEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3208 | countingStream->rewind(); |
| 3209 | uint32_t opcode_vkCreateEvent = OP_vkCreateEvent; |
| 3210 | stream->write(&opcode_vkCreateEvent, sizeof(uint32_t)); |
| 3211 | stream->write(&packetSize_vkCreateEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3212 | uint64_t cgen_var_202; |
| 3213 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_202, 1); |
| 3214 | stream->write((uint64_t*)&cgen_var_202, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3215 | marshal_VkEventCreateInfo(stream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3216 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3217 | uint64_t cgen_var_203 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3218 | stream->putBe64(cgen_var_203); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3219 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3220 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3221 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3222 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3223 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3224 | uint64_t cgen_var_204; |
| 3225 | stream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_204, 1); |
| 3226 | stream->write((uint64_t*)&cgen_var_204, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3227 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3228 | AEMU_SCOPED_TRACE("vkCreateEvent readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3229 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3230 | uint64_t cgen_var_205; |
| 3231 | stream->read((uint64_t*)&cgen_var_205, 8); |
| 3232 | stream->handleMapping()->mapHandles_u64_VkEvent(&cgen_var_205, (VkEvent*)pEvent, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3233 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3234 | AEMU_SCOPED_TRACE("vkCreateEvent returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3235 | VkResult vkCreateEvent_VkResult_return = (VkResult)0; |
| 3236 | stream->read(&vkCreateEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3237 | countingStream->clearPool(); |
| 3238 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3239 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3240 | mImpl->log("finish vkCreateEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3241 | return vkCreateEvent_VkResult_return; |
| 3242 | } |
| 3243 | |
| 3244 | void VkEncoder::vkDestroyEvent( |
| 3245 | VkDevice device, |
| 3246 | VkEvent event, |
| 3247 | const VkAllocationCallbacks* pAllocator) |
| 3248 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3249 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3250 | AEMU_SCOPED_TRACE("vkDestroyEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3251 | mImpl->log("start vkDestroyEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3252 | auto stream = mImpl->stream(); |
| 3253 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3254 | auto resources = mImpl->resources(); |
| 3255 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3256 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3257 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3258 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3259 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3260 | local_device = device; |
| 3261 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3262 | local_pAllocator = nullptr; |
| 3263 | if (pAllocator) |
| 3264 | { |
| 3265 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3266 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3267 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3268 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3269 | if (local_pAllocator) |
| 3270 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3271 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3272 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3273 | countingStream->rewind(); |
| 3274 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3275 | uint64_t cgen_var_206; |
| 3276 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_206, 1); |
| 3277 | countingStream->write((uint64_t*)&cgen_var_206, 1 * 8); |
| 3278 | uint64_t cgen_var_207; |
| 3279 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_207, 1); |
| 3280 | countingStream->write((uint64_t*)&cgen_var_207, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3281 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3282 | uint64_t cgen_var_208 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3283 | countingStream->putBe64(cgen_var_208); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3284 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3285 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3286 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3287 | } |
| 3288 | } |
| 3289 | uint32_t packetSize_vkDestroyEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3290 | countingStream->rewind(); |
| 3291 | uint32_t opcode_vkDestroyEvent = OP_vkDestroyEvent; |
| 3292 | stream->write(&opcode_vkDestroyEvent, sizeof(uint32_t)); |
| 3293 | stream->write(&packetSize_vkDestroyEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3294 | uint64_t cgen_var_209; |
| 3295 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_209, 1); |
| 3296 | stream->write((uint64_t*)&cgen_var_209, 1 * 8); |
| 3297 | uint64_t cgen_var_210; |
| 3298 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_210, 1); |
| 3299 | stream->write((uint64_t*)&cgen_var_210, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3300 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3301 | uint64_t cgen_var_211 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3302 | stream->putBe64(cgen_var_211); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3303 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3304 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3305 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3306 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3307 | AEMU_SCOPED_TRACE("vkDestroyEvent readParams"); |
| 3308 | AEMU_SCOPED_TRACE("vkDestroyEvent returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3309 | resources->destroyMapping()->mapHandles_VkEvent((VkEvent*)&event); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3310 | mImpl->log("finish vkDestroyEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3311 | } |
| 3312 | |
| 3313 | VkResult VkEncoder::vkGetEventStatus( |
| 3314 | VkDevice device, |
| 3315 | VkEvent event) |
| 3316 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3317 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3318 | AEMU_SCOPED_TRACE("vkGetEventStatus encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3319 | mImpl->log("start vkGetEventStatus"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3320 | auto stream = mImpl->stream(); |
| 3321 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3322 | auto resources = mImpl->resources(); |
| 3323 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3324 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3325 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3326 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3327 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3328 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3329 | countingStream->rewind(); |
| 3330 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3331 | uint64_t cgen_var_212; |
| 3332 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_212, 1); |
| 3333 | countingStream->write((uint64_t*)&cgen_var_212, 1 * 8); |
| 3334 | uint64_t cgen_var_213; |
| 3335 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_213, 1); |
| 3336 | countingStream->write((uint64_t*)&cgen_var_213, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3337 | } |
| 3338 | uint32_t packetSize_vkGetEventStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3339 | countingStream->rewind(); |
| 3340 | uint32_t opcode_vkGetEventStatus = OP_vkGetEventStatus; |
| 3341 | stream->write(&opcode_vkGetEventStatus, sizeof(uint32_t)); |
| 3342 | stream->write(&packetSize_vkGetEventStatus, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3343 | uint64_t cgen_var_214; |
| 3344 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_214, 1); |
| 3345 | stream->write((uint64_t*)&cgen_var_214, 1 * 8); |
| 3346 | uint64_t cgen_var_215; |
| 3347 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_215, 1); |
| 3348 | stream->write((uint64_t*)&cgen_var_215, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3349 | AEMU_SCOPED_TRACE("vkGetEventStatus readParams"); |
| 3350 | AEMU_SCOPED_TRACE("vkGetEventStatus returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3351 | VkResult vkGetEventStatus_VkResult_return = (VkResult)0; |
| 3352 | stream->read(&vkGetEventStatus_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3353 | countingStream->clearPool(); |
| 3354 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3355 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3356 | mImpl->log("finish vkGetEventStatus");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3357 | return vkGetEventStatus_VkResult_return; |
| 3358 | } |
| 3359 | |
| 3360 | VkResult VkEncoder::vkSetEvent( |
| 3361 | VkDevice device, |
| 3362 | VkEvent event) |
| 3363 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3364 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3365 | AEMU_SCOPED_TRACE("vkSetEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3366 | mImpl->log("start vkSetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3367 | auto stream = mImpl->stream(); |
| 3368 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3369 | auto resources = mImpl->resources(); |
| 3370 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3371 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3372 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3373 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3374 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3375 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3376 | countingStream->rewind(); |
| 3377 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3378 | uint64_t cgen_var_216; |
| 3379 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_216, 1); |
| 3380 | countingStream->write((uint64_t*)&cgen_var_216, 1 * 8); |
| 3381 | uint64_t cgen_var_217; |
| 3382 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_217, 1); |
| 3383 | countingStream->write((uint64_t*)&cgen_var_217, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3384 | } |
| 3385 | uint32_t packetSize_vkSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3386 | countingStream->rewind(); |
| 3387 | uint32_t opcode_vkSetEvent = OP_vkSetEvent; |
| 3388 | stream->write(&opcode_vkSetEvent, sizeof(uint32_t)); |
| 3389 | stream->write(&packetSize_vkSetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3390 | uint64_t cgen_var_218; |
| 3391 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_218, 1); |
| 3392 | stream->write((uint64_t*)&cgen_var_218, 1 * 8); |
| 3393 | uint64_t cgen_var_219; |
| 3394 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_219, 1); |
| 3395 | stream->write((uint64_t*)&cgen_var_219, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3396 | AEMU_SCOPED_TRACE("vkSetEvent readParams"); |
| 3397 | AEMU_SCOPED_TRACE("vkSetEvent returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3398 | VkResult vkSetEvent_VkResult_return = (VkResult)0; |
| 3399 | stream->read(&vkSetEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3400 | countingStream->clearPool(); |
| 3401 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3402 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3403 | mImpl->log("finish vkSetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3404 | return vkSetEvent_VkResult_return; |
| 3405 | } |
| 3406 | |
| 3407 | VkResult VkEncoder::vkResetEvent( |
| 3408 | VkDevice device, |
| 3409 | VkEvent event) |
| 3410 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3411 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3412 | AEMU_SCOPED_TRACE("vkResetEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3413 | mImpl->log("start vkResetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3414 | auto stream = mImpl->stream(); |
| 3415 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3416 | auto resources = mImpl->resources(); |
| 3417 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3418 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3419 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3420 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3421 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3422 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3423 | countingStream->rewind(); |
| 3424 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3425 | uint64_t cgen_var_220; |
| 3426 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_220, 1); |
| 3427 | countingStream->write((uint64_t*)&cgen_var_220, 1 * 8); |
| 3428 | uint64_t cgen_var_221; |
| 3429 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_221, 1); |
| 3430 | countingStream->write((uint64_t*)&cgen_var_221, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3431 | } |
| 3432 | uint32_t packetSize_vkResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3433 | countingStream->rewind(); |
| 3434 | uint32_t opcode_vkResetEvent = OP_vkResetEvent; |
| 3435 | stream->write(&opcode_vkResetEvent, sizeof(uint32_t)); |
| 3436 | stream->write(&packetSize_vkResetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3437 | uint64_t cgen_var_222; |
| 3438 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_222, 1); |
| 3439 | stream->write((uint64_t*)&cgen_var_222, 1 * 8); |
| 3440 | uint64_t cgen_var_223; |
| 3441 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_223, 1); |
| 3442 | stream->write((uint64_t*)&cgen_var_223, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3443 | AEMU_SCOPED_TRACE("vkResetEvent readParams"); |
| 3444 | AEMU_SCOPED_TRACE("vkResetEvent returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3445 | VkResult vkResetEvent_VkResult_return = (VkResult)0; |
| 3446 | stream->read(&vkResetEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3447 | countingStream->clearPool(); |
| 3448 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3449 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3450 | mImpl->log("finish vkResetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3451 | return vkResetEvent_VkResult_return; |
| 3452 | } |
| 3453 | |
| 3454 | VkResult VkEncoder::vkCreateQueryPool( |
| 3455 | VkDevice device, |
| 3456 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3457 | const VkAllocationCallbacks* pAllocator, |
| 3458 | VkQueryPool* pQueryPool) |
| 3459 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3460 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3461 | AEMU_SCOPED_TRACE("vkCreateQueryPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3462 | mImpl->log("start vkCreateQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3463 | auto stream = mImpl->stream(); |
| 3464 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3465 | auto resources = mImpl->resources(); |
| 3466 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3467 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3468 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3469 | VkQueryPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3470 | VkAllocationCallbacks* local_pAllocator; |
| 3471 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3472 | local_pCreateInfo = nullptr; |
| 3473 | if (pCreateInfo) |
| 3474 | { |
| 3475 | local_pCreateInfo = (VkQueryPoolCreateInfo*)pool->alloc(sizeof(const VkQueryPoolCreateInfo)); |
| 3476 | deepcopy_VkQueryPoolCreateInfo(pool, pCreateInfo, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| 3477 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3478 | local_pAllocator = nullptr; |
| 3479 | if (pAllocator) |
| 3480 | { |
| 3481 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3482 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3483 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3484 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3485 | if (local_pCreateInfo) |
| 3486 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3487 | transform_tohost_VkQueryPoolCreateInfo(mImpl->resources(), (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3488 | } |
| 3489 | if (local_pAllocator) |
| 3490 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3491 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3492 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3493 | countingStream->rewind(); |
| 3494 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3495 | uint64_t cgen_var_224; |
| 3496 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_224, 1); |
| 3497 | countingStream->write((uint64_t*)&cgen_var_224, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3498 | marshal_VkQueryPoolCreateInfo(countingStream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3499 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3500 | uint64_t cgen_var_225 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3501 | countingStream->putBe64(cgen_var_225); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3502 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3503 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3504 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3505 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3506 | uint64_t cgen_var_226; |
| 3507 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_226, 1); |
| 3508 | countingStream->write((uint64_t*)&cgen_var_226, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3509 | } |
| 3510 | uint32_t packetSize_vkCreateQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3511 | countingStream->rewind(); |
| 3512 | uint32_t opcode_vkCreateQueryPool = OP_vkCreateQueryPool; |
| 3513 | stream->write(&opcode_vkCreateQueryPool, sizeof(uint32_t)); |
| 3514 | stream->write(&packetSize_vkCreateQueryPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3515 | uint64_t cgen_var_227; |
| 3516 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_227, 1); |
| 3517 | stream->write((uint64_t*)&cgen_var_227, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3518 | marshal_VkQueryPoolCreateInfo(stream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3519 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3520 | uint64_t cgen_var_228 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3521 | stream->putBe64(cgen_var_228); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3522 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3523 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3524 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3525 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3526 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3527 | uint64_t cgen_var_229; |
| 3528 | stream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_229, 1); |
| 3529 | stream->write((uint64_t*)&cgen_var_229, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3530 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3531 | AEMU_SCOPED_TRACE("vkCreateQueryPool readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3532 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3533 | uint64_t cgen_var_230; |
| 3534 | stream->read((uint64_t*)&cgen_var_230, 8); |
| 3535 | stream->handleMapping()->mapHandles_u64_VkQueryPool(&cgen_var_230, (VkQueryPool*)pQueryPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3536 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3537 | AEMU_SCOPED_TRACE("vkCreateQueryPool returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3538 | VkResult vkCreateQueryPool_VkResult_return = (VkResult)0; |
| 3539 | stream->read(&vkCreateQueryPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3540 | countingStream->clearPool(); |
| 3541 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3542 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3543 | mImpl->log("finish vkCreateQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3544 | return vkCreateQueryPool_VkResult_return; |
| 3545 | } |
| 3546 | |
| 3547 | void VkEncoder::vkDestroyQueryPool( |
| 3548 | VkDevice device, |
| 3549 | VkQueryPool queryPool, |
| 3550 | const VkAllocationCallbacks* pAllocator) |
| 3551 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3552 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3553 | AEMU_SCOPED_TRACE("vkDestroyQueryPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3554 | mImpl->log("start vkDestroyQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3555 | auto stream = mImpl->stream(); |
| 3556 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3557 | auto resources = mImpl->resources(); |
| 3558 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3559 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3560 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3561 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3562 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3563 | local_device = device; |
| 3564 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3565 | local_pAllocator = nullptr; |
| 3566 | if (pAllocator) |
| 3567 | { |
| 3568 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3569 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3570 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3571 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3572 | if (local_pAllocator) |
| 3573 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3574 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3575 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3576 | countingStream->rewind(); |
| 3577 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3578 | uint64_t cgen_var_231; |
| 3579 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_231, 1); |
| 3580 | countingStream->write((uint64_t*)&cgen_var_231, 1 * 8); |
| 3581 | uint64_t cgen_var_232; |
| 3582 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_232, 1); |
| 3583 | countingStream->write((uint64_t*)&cgen_var_232, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3584 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3585 | uint64_t cgen_var_233 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3586 | countingStream->putBe64(cgen_var_233); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3587 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3588 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3589 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3590 | } |
| 3591 | } |
| 3592 | uint32_t packetSize_vkDestroyQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3593 | countingStream->rewind(); |
| 3594 | uint32_t opcode_vkDestroyQueryPool = OP_vkDestroyQueryPool; |
| 3595 | stream->write(&opcode_vkDestroyQueryPool, sizeof(uint32_t)); |
| 3596 | stream->write(&packetSize_vkDestroyQueryPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3597 | uint64_t cgen_var_234; |
| 3598 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_234, 1); |
| 3599 | stream->write((uint64_t*)&cgen_var_234, 1 * 8); |
| 3600 | uint64_t cgen_var_235; |
| 3601 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_235, 1); |
| 3602 | stream->write((uint64_t*)&cgen_var_235, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3603 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3604 | uint64_t cgen_var_236 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3605 | stream->putBe64(cgen_var_236); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3606 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3607 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3608 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3609 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3610 | AEMU_SCOPED_TRACE("vkDestroyQueryPool readParams"); |
| 3611 | AEMU_SCOPED_TRACE("vkDestroyQueryPool returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3612 | resources->destroyMapping()->mapHandles_VkQueryPool((VkQueryPool*)&queryPool); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3613 | mImpl->log("finish vkDestroyQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3614 | } |
| 3615 | |
| 3616 | VkResult VkEncoder::vkGetQueryPoolResults( |
| 3617 | VkDevice device, |
| 3618 | VkQueryPool queryPool, |
| 3619 | uint32_t firstQuery, |
| 3620 | uint32_t queryCount, |
| 3621 | size_t dataSize, |
| 3622 | void* pData, |
| 3623 | VkDeviceSize stride, |
| 3624 | VkQueryResultFlags flags) |
| 3625 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3626 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3627 | AEMU_SCOPED_TRACE("vkGetQueryPoolResults encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3628 | mImpl->log("start vkGetQueryPoolResults"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3629 | auto stream = mImpl->stream(); |
| 3630 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3631 | auto resources = mImpl->resources(); |
| 3632 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3633 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3634 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3635 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3636 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3637 | uint32_t local_queryCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3638 | size_t local_dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3639 | VkDeviceSize local_stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3640 | VkQueryResultFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3641 | local_device = device; |
| 3642 | local_queryPool = queryPool; |
| 3643 | local_firstQuery = firstQuery; |
| 3644 | local_queryCount = queryCount; |
| 3645 | local_dataSize = dataSize; |
| 3646 | local_stride = stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3647 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3648 | countingStream->rewind(); |
| 3649 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3650 | uint64_t cgen_var_237; |
| 3651 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_237, 1); |
| 3652 | countingStream->write((uint64_t*)&cgen_var_237, 1 * 8); |
| 3653 | uint64_t cgen_var_238; |
| 3654 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_238, 1); |
| 3655 | countingStream->write((uint64_t*)&cgen_var_238, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3656 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 3657 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3658 | uint64_t cgen_var_239 = (uint64_t)local_dataSize; |
| 3659 | countingStream->putBe64(cgen_var_239); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3660 | countingStream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3661 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 3662 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3663 | } |
| 3664 | uint32_t packetSize_vkGetQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3665 | countingStream->rewind(); |
| 3666 | uint32_t opcode_vkGetQueryPoolResults = OP_vkGetQueryPoolResults; |
| 3667 | stream->write(&opcode_vkGetQueryPoolResults, sizeof(uint32_t)); |
| 3668 | stream->write(&packetSize_vkGetQueryPoolResults, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3669 | uint64_t cgen_var_240; |
| 3670 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_240, 1); |
| 3671 | stream->write((uint64_t*)&cgen_var_240, 1 * 8); |
| 3672 | uint64_t cgen_var_241; |
| 3673 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_241, 1); |
| 3674 | stream->write((uint64_t*)&cgen_var_241, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3675 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 3676 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3677 | uint64_t cgen_var_242 = (uint64_t)local_dataSize; |
| 3678 | stream->putBe64(cgen_var_242); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3679 | stream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3680 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 3681 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3682 | AEMU_SCOPED_TRACE("vkGetQueryPoolResults readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3683 | stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3684 | AEMU_SCOPED_TRACE("vkGetQueryPoolResults returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3685 | VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0; |
| 3686 | stream->read(&vkGetQueryPoolResults_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3687 | countingStream->clearPool(); |
| 3688 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3689 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3690 | mImpl->log("finish vkGetQueryPoolResults");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3691 | return vkGetQueryPoolResults_VkResult_return; |
| 3692 | } |
| 3693 | |
| 3694 | VkResult VkEncoder::vkCreateBuffer( |
| 3695 | VkDevice device, |
| 3696 | const VkBufferCreateInfo* pCreateInfo, |
| 3697 | const VkAllocationCallbacks* pAllocator, |
| 3698 | VkBuffer* pBuffer) |
| 3699 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3700 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3701 | AEMU_SCOPED_TRACE("vkCreateBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3702 | mImpl->log("start vkCreateBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3703 | auto stream = mImpl->stream(); |
| 3704 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3705 | auto resources = mImpl->resources(); |
| 3706 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3707 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3708 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3709 | VkBufferCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3710 | VkAllocationCallbacks* local_pAllocator; |
| 3711 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3712 | local_pCreateInfo = nullptr; |
| 3713 | if (pCreateInfo) |
| 3714 | { |
| 3715 | local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo)); |
| 3716 | deepcopy_VkBufferCreateInfo(pool, pCreateInfo, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 3717 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3718 | local_pAllocator = nullptr; |
| 3719 | if (pAllocator) |
| 3720 | { |
| 3721 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3722 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3723 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3724 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3725 | if (local_pCreateInfo) |
| 3726 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3727 | transform_tohost_VkBufferCreateInfo(mImpl->resources(), (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3728 | } |
| 3729 | if (local_pAllocator) |
| 3730 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3731 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3732 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3733 | countingStream->rewind(); |
| 3734 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3735 | uint64_t cgen_var_243; |
| 3736 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_243, 1); |
| 3737 | countingStream->write((uint64_t*)&cgen_var_243, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3738 | marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3739 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3740 | uint64_t cgen_var_244 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3741 | countingStream->putBe64(cgen_var_244); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3742 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3743 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3744 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3745 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3746 | uint64_t cgen_var_245; |
| 3747 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_245, 1); |
| 3748 | countingStream->write((uint64_t*)&cgen_var_245, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3749 | } |
| 3750 | uint32_t packetSize_vkCreateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3751 | countingStream->rewind(); |
| 3752 | uint32_t opcode_vkCreateBuffer = OP_vkCreateBuffer; |
| 3753 | stream->write(&opcode_vkCreateBuffer, sizeof(uint32_t)); |
| 3754 | stream->write(&packetSize_vkCreateBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3755 | uint64_t cgen_var_246; |
| 3756 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_246, 1); |
| 3757 | stream->write((uint64_t*)&cgen_var_246, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3758 | marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3759 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3760 | uint64_t cgen_var_247 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3761 | stream->putBe64(cgen_var_247); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3762 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3763 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3764 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3765 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3766 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3767 | uint64_t cgen_var_248; |
| 3768 | stream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_248, 1); |
| 3769 | stream->write((uint64_t*)&cgen_var_248, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3770 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3771 | AEMU_SCOPED_TRACE("vkCreateBuffer readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3772 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3773 | uint64_t cgen_var_249; |
| 3774 | stream->read((uint64_t*)&cgen_var_249, 8); |
| 3775 | stream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_249, (VkBuffer*)pBuffer, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3776 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3777 | AEMU_SCOPED_TRACE("vkCreateBuffer returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3778 | VkResult vkCreateBuffer_VkResult_return = (VkResult)0; |
| 3779 | stream->read(&vkCreateBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3780 | countingStream->clearPool(); |
| 3781 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3782 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3783 | mImpl->log("finish vkCreateBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3784 | return vkCreateBuffer_VkResult_return; |
| 3785 | } |
| 3786 | |
| 3787 | void VkEncoder::vkDestroyBuffer( |
| 3788 | VkDevice device, |
| 3789 | VkBuffer buffer, |
| 3790 | const VkAllocationCallbacks* pAllocator) |
| 3791 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3792 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3793 | AEMU_SCOPED_TRACE("vkDestroyBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3794 | mImpl->log("start vkDestroyBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3795 | auto stream = mImpl->stream(); |
| 3796 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3797 | auto resources = mImpl->resources(); |
| 3798 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3799 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3800 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3801 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3802 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3803 | local_device = device; |
| 3804 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3805 | local_pAllocator = nullptr; |
| 3806 | if (pAllocator) |
| 3807 | { |
| 3808 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3809 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3810 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3811 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3812 | if (local_pAllocator) |
| 3813 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3814 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3815 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3816 | countingStream->rewind(); |
| 3817 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3818 | uint64_t cgen_var_250; |
| 3819 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_250, 1); |
| 3820 | countingStream->write((uint64_t*)&cgen_var_250, 1 * 8); |
| 3821 | uint64_t cgen_var_251; |
| 3822 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_251, 1); |
| 3823 | countingStream->write((uint64_t*)&cgen_var_251, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3824 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3825 | uint64_t cgen_var_252 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3826 | countingStream->putBe64(cgen_var_252); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3827 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3828 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3829 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3830 | } |
| 3831 | } |
| 3832 | uint32_t packetSize_vkDestroyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3833 | countingStream->rewind(); |
| 3834 | uint32_t opcode_vkDestroyBuffer = OP_vkDestroyBuffer; |
| 3835 | stream->write(&opcode_vkDestroyBuffer, sizeof(uint32_t)); |
| 3836 | stream->write(&packetSize_vkDestroyBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3837 | uint64_t cgen_var_253; |
| 3838 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_253, 1); |
| 3839 | stream->write((uint64_t*)&cgen_var_253, 1 * 8); |
| 3840 | uint64_t cgen_var_254; |
| 3841 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_254, 1); |
| 3842 | stream->write((uint64_t*)&cgen_var_254, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3843 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3844 | uint64_t cgen_var_255 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3845 | stream->putBe64(cgen_var_255); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3846 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3847 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3848 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3849 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3850 | AEMU_SCOPED_TRACE("vkDestroyBuffer readParams"); |
| 3851 | AEMU_SCOPED_TRACE("vkDestroyBuffer returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3852 | resources->destroyMapping()->mapHandles_VkBuffer((VkBuffer*)&buffer); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3853 | mImpl->log("finish vkDestroyBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3854 | } |
| 3855 | |
| 3856 | VkResult VkEncoder::vkCreateBufferView( |
| 3857 | VkDevice device, |
| 3858 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3859 | const VkAllocationCallbacks* pAllocator, |
| 3860 | VkBufferView* pView) |
| 3861 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3862 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3863 | AEMU_SCOPED_TRACE("vkCreateBufferView encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3864 | mImpl->log("start vkCreateBufferView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3865 | auto stream = mImpl->stream(); |
| 3866 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3867 | auto resources = mImpl->resources(); |
| 3868 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3869 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3870 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3871 | VkBufferViewCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3872 | VkAllocationCallbacks* local_pAllocator; |
| 3873 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3874 | local_pCreateInfo = nullptr; |
| 3875 | if (pCreateInfo) |
| 3876 | { |
| 3877 | local_pCreateInfo = (VkBufferViewCreateInfo*)pool->alloc(sizeof(const VkBufferViewCreateInfo)); |
| 3878 | deepcopy_VkBufferViewCreateInfo(pool, pCreateInfo, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| 3879 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3880 | local_pAllocator = nullptr; |
| 3881 | if (pAllocator) |
| 3882 | { |
| 3883 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3884 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3885 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3886 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3887 | if (local_pCreateInfo) |
| 3888 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3889 | transform_tohost_VkBufferViewCreateInfo(mImpl->resources(), (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3890 | } |
| 3891 | if (local_pAllocator) |
| 3892 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3893 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3894 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3895 | countingStream->rewind(); |
| 3896 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3897 | uint64_t cgen_var_256; |
| 3898 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_256, 1); |
| 3899 | countingStream->write((uint64_t*)&cgen_var_256, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3900 | marshal_VkBufferViewCreateInfo(countingStream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3901 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3902 | uint64_t cgen_var_257 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3903 | countingStream->putBe64(cgen_var_257); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3904 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3905 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3906 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3907 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3908 | uint64_t cgen_var_258; |
| 3909 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_258, 1); |
| 3910 | countingStream->write((uint64_t*)&cgen_var_258, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3911 | } |
| 3912 | uint32_t packetSize_vkCreateBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3913 | countingStream->rewind(); |
| 3914 | uint32_t opcode_vkCreateBufferView = OP_vkCreateBufferView; |
| 3915 | stream->write(&opcode_vkCreateBufferView, sizeof(uint32_t)); |
| 3916 | stream->write(&packetSize_vkCreateBufferView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3917 | uint64_t cgen_var_259; |
| 3918 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_259, 1); |
| 3919 | stream->write((uint64_t*)&cgen_var_259, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3920 | marshal_VkBufferViewCreateInfo(stream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3921 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3922 | uint64_t cgen_var_260 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3923 | stream->putBe64(cgen_var_260); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3924 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3925 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3926 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3927 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3928 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3929 | uint64_t cgen_var_261; |
| 3930 | stream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_261, 1); |
| 3931 | stream->write((uint64_t*)&cgen_var_261, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3932 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3933 | AEMU_SCOPED_TRACE("vkCreateBufferView readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3934 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3935 | uint64_t cgen_var_262; |
| 3936 | stream->read((uint64_t*)&cgen_var_262, 8); |
| 3937 | stream->handleMapping()->mapHandles_u64_VkBufferView(&cgen_var_262, (VkBufferView*)pView, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3938 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3939 | AEMU_SCOPED_TRACE("vkCreateBufferView returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3940 | VkResult vkCreateBufferView_VkResult_return = (VkResult)0; |
| 3941 | stream->read(&vkCreateBufferView_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3942 | countingStream->clearPool(); |
| 3943 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3944 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3945 | mImpl->log("finish vkCreateBufferView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3946 | return vkCreateBufferView_VkResult_return; |
| 3947 | } |
| 3948 | |
| 3949 | void VkEncoder::vkDestroyBufferView( |
| 3950 | VkDevice device, |
| 3951 | VkBufferView bufferView, |
| 3952 | const VkAllocationCallbacks* pAllocator) |
| 3953 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3954 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3955 | AEMU_SCOPED_TRACE("vkDestroyBufferView encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3956 | mImpl->log("start vkDestroyBufferView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3957 | auto stream = mImpl->stream(); |
| 3958 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3959 | auto resources = mImpl->resources(); |
| 3960 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3961 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3962 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3963 | VkBufferView local_bufferView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3964 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3965 | local_device = device; |
| 3966 | local_bufferView = bufferView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3967 | local_pAllocator = nullptr; |
| 3968 | if (pAllocator) |
| 3969 | { |
| 3970 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3971 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3972 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3973 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3974 | if (local_pAllocator) |
| 3975 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3976 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3977 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3978 | countingStream->rewind(); |
| 3979 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3980 | uint64_t cgen_var_263; |
| 3981 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_263, 1); |
| 3982 | countingStream->write((uint64_t*)&cgen_var_263, 1 * 8); |
| 3983 | uint64_t cgen_var_264; |
| 3984 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_264, 1); |
| 3985 | countingStream->write((uint64_t*)&cgen_var_264, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3986 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3987 | uint64_t cgen_var_265 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3988 | countingStream->putBe64(cgen_var_265); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3989 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3990 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3991 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3992 | } |
| 3993 | } |
| 3994 | uint32_t packetSize_vkDestroyBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3995 | countingStream->rewind(); |
| 3996 | uint32_t opcode_vkDestroyBufferView = OP_vkDestroyBufferView; |
| 3997 | stream->write(&opcode_vkDestroyBufferView, sizeof(uint32_t)); |
| 3998 | stream->write(&packetSize_vkDestroyBufferView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3999 | uint64_t cgen_var_266; |
| 4000 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_266, 1); |
| 4001 | stream->write((uint64_t*)&cgen_var_266, 1 * 8); |
| 4002 | uint64_t cgen_var_267; |
| 4003 | stream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_267, 1); |
| 4004 | stream->write((uint64_t*)&cgen_var_267, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4005 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4006 | uint64_t cgen_var_268 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4007 | stream->putBe64(cgen_var_268); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4008 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4009 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4010 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4011 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4012 | AEMU_SCOPED_TRACE("vkDestroyBufferView readParams"); |
| 4013 | AEMU_SCOPED_TRACE("vkDestroyBufferView returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4014 | resources->destroyMapping()->mapHandles_VkBufferView((VkBufferView*)&bufferView); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4015 | mImpl->log("finish vkDestroyBufferView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4016 | } |
| 4017 | |
| 4018 | VkResult VkEncoder::vkCreateImage( |
| 4019 | VkDevice device, |
| 4020 | const VkImageCreateInfo* pCreateInfo, |
| 4021 | const VkAllocationCallbacks* pAllocator, |
| 4022 | VkImage* pImage) |
| 4023 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4024 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4025 | AEMU_SCOPED_TRACE("vkCreateImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4026 | mImpl->log("start vkCreateImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4027 | auto stream = mImpl->stream(); |
| 4028 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4029 | auto resources = mImpl->resources(); |
| 4030 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4031 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4032 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4033 | VkImageCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4034 | VkAllocationCallbacks* local_pAllocator; |
| 4035 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4036 | local_pCreateInfo = nullptr; |
| 4037 | if (pCreateInfo) |
| 4038 | { |
| 4039 | local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo)); |
| 4040 | deepcopy_VkImageCreateInfo(pool, pCreateInfo, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 4041 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4042 | local_pAllocator = nullptr; |
| 4043 | if (pAllocator) |
| 4044 | { |
| 4045 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4046 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4047 | } |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 4048 | mImpl->resources()->unwrap_VkNativeBufferANDROID(pCreateInfo, local_pCreateInfo); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4049 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4050 | if (local_pCreateInfo) |
| 4051 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4052 | transform_tohost_VkImageCreateInfo(mImpl->resources(), (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4053 | } |
| 4054 | if (local_pAllocator) |
| 4055 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4056 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4057 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4058 | countingStream->rewind(); |
| 4059 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4060 | uint64_t cgen_var_269; |
| 4061 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_269, 1); |
| 4062 | countingStream->write((uint64_t*)&cgen_var_269, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4063 | marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4064 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4065 | uint64_t cgen_var_270 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4066 | countingStream->putBe64(cgen_var_270); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4067 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4068 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4069 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4070 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4071 | uint64_t cgen_var_271; |
| 4072 | countingStream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_271, 1); |
| 4073 | countingStream->write((uint64_t*)&cgen_var_271, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4074 | } |
| 4075 | uint32_t packetSize_vkCreateImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4076 | countingStream->rewind(); |
| 4077 | uint32_t opcode_vkCreateImage = OP_vkCreateImage; |
| 4078 | stream->write(&opcode_vkCreateImage, sizeof(uint32_t)); |
| 4079 | stream->write(&packetSize_vkCreateImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4080 | uint64_t cgen_var_272; |
| 4081 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_272, 1); |
| 4082 | stream->write((uint64_t*)&cgen_var_272, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4083 | marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4084 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4085 | uint64_t cgen_var_273 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4086 | stream->putBe64(cgen_var_273); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4087 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4088 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4089 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4090 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4091 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4092 | uint64_t cgen_var_274; |
| 4093 | stream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_274, 1); |
| 4094 | stream->write((uint64_t*)&cgen_var_274, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4095 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4096 | AEMU_SCOPED_TRACE("vkCreateImage readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4097 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4098 | uint64_t cgen_var_275; |
| 4099 | stream->read((uint64_t*)&cgen_var_275, 8); |
| 4100 | stream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_275, (VkImage*)pImage, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4101 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4102 | AEMU_SCOPED_TRACE("vkCreateImage returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4103 | VkResult vkCreateImage_VkResult_return = (VkResult)0; |
| 4104 | stream->read(&vkCreateImage_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4105 | countingStream->clearPool(); |
| 4106 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4107 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4108 | mImpl->log("finish vkCreateImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4109 | return vkCreateImage_VkResult_return; |
| 4110 | } |
| 4111 | |
| 4112 | void VkEncoder::vkDestroyImage( |
| 4113 | VkDevice device, |
| 4114 | VkImage image, |
| 4115 | const VkAllocationCallbacks* pAllocator) |
| 4116 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4117 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4118 | AEMU_SCOPED_TRACE("vkDestroyImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4119 | mImpl->log("start vkDestroyImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4120 | auto stream = mImpl->stream(); |
| 4121 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4122 | auto resources = mImpl->resources(); |
| 4123 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4124 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4125 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4126 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4127 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4128 | local_device = device; |
| 4129 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4130 | local_pAllocator = nullptr; |
| 4131 | if (pAllocator) |
| 4132 | { |
| 4133 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4134 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4135 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4136 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4137 | if (local_pAllocator) |
| 4138 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4139 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4140 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4141 | countingStream->rewind(); |
| 4142 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4143 | uint64_t cgen_var_276; |
| 4144 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_276, 1); |
| 4145 | countingStream->write((uint64_t*)&cgen_var_276, 1 * 8); |
| 4146 | uint64_t cgen_var_277; |
| 4147 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_277, 1); |
| 4148 | countingStream->write((uint64_t*)&cgen_var_277, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4149 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4150 | uint64_t cgen_var_278 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4151 | countingStream->putBe64(cgen_var_278); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4152 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4153 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4154 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4155 | } |
| 4156 | } |
| 4157 | uint32_t packetSize_vkDestroyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4158 | countingStream->rewind(); |
| 4159 | uint32_t opcode_vkDestroyImage = OP_vkDestroyImage; |
| 4160 | stream->write(&opcode_vkDestroyImage, sizeof(uint32_t)); |
| 4161 | stream->write(&packetSize_vkDestroyImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4162 | uint64_t cgen_var_279; |
| 4163 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_279, 1); |
| 4164 | stream->write((uint64_t*)&cgen_var_279, 1 * 8); |
| 4165 | uint64_t cgen_var_280; |
| 4166 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_280, 1); |
| 4167 | stream->write((uint64_t*)&cgen_var_280, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4168 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4169 | uint64_t cgen_var_281 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4170 | stream->putBe64(cgen_var_281); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4171 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4172 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4173 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4174 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4175 | AEMU_SCOPED_TRACE("vkDestroyImage readParams"); |
| 4176 | AEMU_SCOPED_TRACE("vkDestroyImage returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4177 | resources->destroyMapping()->mapHandles_VkImage((VkImage*)&image); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4178 | mImpl->log("finish vkDestroyImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4179 | } |
| 4180 | |
| 4181 | void VkEncoder::vkGetImageSubresourceLayout( |
| 4182 | VkDevice device, |
| 4183 | VkImage image, |
| 4184 | const VkImageSubresource* pSubresource, |
| 4185 | VkSubresourceLayout* pLayout) |
| 4186 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4187 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4188 | AEMU_SCOPED_TRACE("vkGetImageSubresourceLayout encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4189 | mImpl->log("start vkGetImageSubresourceLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4190 | auto stream = mImpl->stream(); |
| 4191 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4192 | auto resources = mImpl->resources(); |
| 4193 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4194 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4195 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4196 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4197 | VkImageSubresource* local_pSubresource; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4198 | local_device = device; |
| 4199 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4200 | local_pSubresource = nullptr; |
| 4201 | if (pSubresource) |
| 4202 | { |
| 4203 | local_pSubresource = (VkImageSubresource*)pool->alloc(sizeof(const VkImageSubresource)); |
| 4204 | deepcopy_VkImageSubresource(pool, pSubresource, (VkImageSubresource*)(local_pSubresource)); |
| 4205 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4206 | if (local_pSubresource) |
| 4207 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4208 | transform_tohost_VkImageSubresource(mImpl->resources(), (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4209 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4210 | countingStream->rewind(); |
| 4211 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4212 | uint64_t cgen_var_282; |
| 4213 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_282, 1); |
| 4214 | countingStream->write((uint64_t*)&cgen_var_282, 1 * 8); |
| 4215 | uint64_t cgen_var_283; |
| 4216 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_283, 1); |
| 4217 | countingStream->write((uint64_t*)&cgen_var_283, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4218 | marshal_VkImageSubresource(countingStream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4219 | marshal_VkSubresourceLayout(countingStream, (VkSubresourceLayout*)(pLayout)); |
| 4220 | } |
| 4221 | uint32_t packetSize_vkGetImageSubresourceLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4222 | countingStream->rewind(); |
| 4223 | uint32_t opcode_vkGetImageSubresourceLayout = OP_vkGetImageSubresourceLayout; |
| 4224 | stream->write(&opcode_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| 4225 | stream->write(&packetSize_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4226 | uint64_t cgen_var_284; |
| 4227 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_284, 1); |
| 4228 | stream->write((uint64_t*)&cgen_var_284, 1 * 8); |
| 4229 | uint64_t cgen_var_285; |
| 4230 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_285, 1); |
| 4231 | stream->write((uint64_t*)&cgen_var_285, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4232 | marshal_VkImageSubresource(stream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4233 | marshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4234 | AEMU_SCOPED_TRACE("vkGetImageSubresourceLayout readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4235 | unmarshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4236 | if (pLayout) |
| 4237 | { |
| 4238 | transform_fromhost_VkSubresourceLayout(mImpl->resources(), (VkSubresourceLayout*)(pLayout)); |
| 4239 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4240 | AEMU_SCOPED_TRACE("vkGetImageSubresourceLayout returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4241 | mImpl->log("finish vkGetImageSubresourceLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4242 | } |
| 4243 | |
| 4244 | VkResult VkEncoder::vkCreateImageView( |
| 4245 | VkDevice device, |
| 4246 | const VkImageViewCreateInfo* pCreateInfo, |
| 4247 | const VkAllocationCallbacks* pAllocator, |
| 4248 | VkImageView* pView) |
| 4249 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4250 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4251 | AEMU_SCOPED_TRACE("vkCreateImageView encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4252 | mImpl->log("start vkCreateImageView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4253 | auto stream = mImpl->stream(); |
| 4254 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4255 | auto resources = mImpl->resources(); |
| 4256 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4257 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4258 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4259 | VkImageViewCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4260 | VkAllocationCallbacks* local_pAllocator; |
| 4261 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4262 | local_pCreateInfo = nullptr; |
| 4263 | if (pCreateInfo) |
| 4264 | { |
| 4265 | local_pCreateInfo = (VkImageViewCreateInfo*)pool->alloc(sizeof(const VkImageViewCreateInfo)); |
| 4266 | deepcopy_VkImageViewCreateInfo(pool, pCreateInfo, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| 4267 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4268 | local_pAllocator = nullptr; |
| 4269 | if (pAllocator) |
| 4270 | { |
| 4271 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4272 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4273 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4274 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4275 | if (local_pCreateInfo) |
| 4276 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4277 | transform_tohost_VkImageViewCreateInfo(mImpl->resources(), (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4278 | } |
| 4279 | if (local_pAllocator) |
| 4280 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4281 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4282 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4283 | countingStream->rewind(); |
| 4284 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4285 | uint64_t cgen_var_286; |
| 4286 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_286, 1); |
| 4287 | countingStream->write((uint64_t*)&cgen_var_286, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4288 | marshal_VkImageViewCreateInfo(countingStream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4289 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4290 | uint64_t cgen_var_287 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4291 | countingStream->putBe64(cgen_var_287); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4292 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4293 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4294 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4295 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4296 | uint64_t cgen_var_288; |
| 4297 | countingStream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_288, 1); |
| 4298 | countingStream->write((uint64_t*)&cgen_var_288, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4299 | } |
| 4300 | uint32_t packetSize_vkCreateImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4301 | countingStream->rewind(); |
| 4302 | uint32_t opcode_vkCreateImageView = OP_vkCreateImageView; |
| 4303 | stream->write(&opcode_vkCreateImageView, sizeof(uint32_t)); |
| 4304 | stream->write(&packetSize_vkCreateImageView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4305 | uint64_t cgen_var_289; |
| 4306 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_289, 1); |
| 4307 | stream->write((uint64_t*)&cgen_var_289, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4308 | marshal_VkImageViewCreateInfo(stream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4309 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4310 | uint64_t cgen_var_290 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4311 | stream->putBe64(cgen_var_290); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4312 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4313 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4314 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4315 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4316 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4317 | uint64_t cgen_var_291; |
| 4318 | stream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_291, 1); |
| 4319 | stream->write((uint64_t*)&cgen_var_291, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4320 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4321 | AEMU_SCOPED_TRACE("vkCreateImageView readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4322 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4323 | uint64_t cgen_var_292; |
| 4324 | stream->read((uint64_t*)&cgen_var_292, 8); |
| 4325 | stream->handleMapping()->mapHandles_u64_VkImageView(&cgen_var_292, (VkImageView*)pView, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4326 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4327 | AEMU_SCOPED_TRACE("vkCreateImageView returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4328 | VkResult vkCreateImageView_VkResult_return = (VkResult)0; |
| 4329 | stream->read(&vkCreateImageView_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4330 | countingStream->clearPool(); |
| 4331 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4332 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4333 | mImpl->log("finish vkCreateImageView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4334 | return vkCreateImageView_VkResult_return; |
| 4335 | } |
| 4336 | |
| 4337 | void VkEncoder::vkDestroyImageView( |
| 4338 | VkDevice device, |
| 4339 | VkImageView imageView, |
| 4340 | const VkAllocationCallbacks* pAllocator) |
| 4341 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4342 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4343 | AEMU_SCOPED_TRACE("vkDestroyImageView encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4344 | mImpl->log("start vkDestroyImageView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4345 | auto stream = mImpl->stream(); |
| 4346 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4347 | auto resources = mImpl->resources(); |
| 4348 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4349 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4350 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4351 | VkImageView local_imageView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4352 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4353 | local_device = device; |
| 4354 | local_imageView = imageView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4355 | local_pAllocator = nullptr; |
| 4356 | if (pAllocator) |
| 4357 | { |
| 4358 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4359 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4360 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4361 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4362 | if (local_pAllocator) |
| 4363 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4364 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4365 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4366 | countingStream->rewind(); |
| 4367 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4368 | uint64_t cgen_var_293; |
| 4369 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_293, 1); |
| 4370 | countingStream->write((uint64_t*)&cgen_var_293, 1 * 8); |
| 4371 | uint64_t cgen_var_294; |
| 4372 | countingStream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_294, 1); |
| 4373 | countingStream->write((uint64_t*)&cgen_var_294, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4374 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4375 | uint64_t cgen_var_295 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4376 | countingStream->putBe64(cgen_var_295); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4377 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4378 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4379 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4380 | } |
| 4381 | } |
| 4382 | uint32_t packetSize_vkDestroyImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4383 | countingStream->rewind(); |
| 4384 | uint32_t opcode_vkDestroyImageView = OP_vkDestroyImageView; |
| 4385 | stream->write(&opcode_vkDestroyImageView, sizeof(uint32_t)); |
| 4386 | stream->write(&packetSize_vkDestroyImageView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4387 | uint64_t cgen_var_296; |
| 4388 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_296, 1); |
| 4389 | stream->write((uint64_t*)&cgen_var_296, 1 * 8); |
| 4390 | uint64_t cgen_var_297; |
| 4391 | stream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_297, 1); |
| 4392 | stream->write((uint64_t*)&cgen_var_297, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4393 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4394 | uint64_t cgen_var_298 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4395 | stream->putBe64(cgen_var_298); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4396 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4397 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4398 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4399 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4400 | AEMU_SCOPED_TRACE("vkDestroyImageView readParams"); |
| 4401 | AEMU_SCOPED_TRACE("vkDestroyImageView returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4402 | resources->destroyMapping()->mapHandles_VkImageView((VkImageView*)&imageView); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4403 | mImpl->log("finish vkDestroyImageView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4404 | } |
| 4405 | |
| 4406 | VkResult VkEncoder::vkCreateShaderModule( |
| 4407 | VkDevice device, |
| 4408 | const VkShaderModuleCreateInfo* pCreateInfo, |
| 4409 | const VkAllocationCallbacks* pAllocator, |
| 4410 | VkShaderModule* pShaderModule) |
| 4411 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4412 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4413 | AEMU_SCOPED_TRACE("vkCreateShaderModule encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4414 | mImpl->log("start vkCreateShaderModule"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4415 | auto stream = mImpl->stream(); |
| 4416 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4417 | auto resources = mImpl->resources(); |
| 4418 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4419 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4420 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4421 | VkShaderModuleCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4422 | VkAllocationCallbacks* local_pAllocator; |
| 4423 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4424 | local_pCreateInfo = nullptr; |
| 4425 | if (pCreateInfo) |
| 4426 | { |
| 4427 | local_pCreateInfo = (VkShaderModuleCreateInfo*)pool->alloc(sizeof(const VkShaderModuleCreateInfo)); |
| 4428 | deepcopy_VkShaderModuleCreateInfo(pool, pCreateInfo, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| 4429 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4430 | local_pAllocator = nullptr; |
| 4431 | if (pAllocator) |
| 4432 | { |
| 4433 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4434 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4435 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4436 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4437 | if (local_pCreateInfo) |
| 4438 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4439 | transform_tohost_VkShaderModuleCreateInfo(mImpl->resources(), (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4440 | } |
| 4441 | if (local_pAllocator) |
| 4442 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4443 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4444 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4445 | countingStream->rewind(); |
| 4446 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4447 | uint64_t cgen_var_299; |
| 4448 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_299, 1); |
| 4449 | countingStream->write((uint64_t*)&cgen_var_299, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4450 | marshal_VkShaderModuleCreateInfo(countingStream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4451 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4452 | uint64_t cgen_var_300 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4453 | countingStream->putBe64(cgen_var_300); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4454 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4455 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4456 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4457 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4458 | uint64_t cgen_var_301; |
| 4459 | countingStream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_301, 1); |
| 4460 | countingStream->write((uint64_t*)&cgen_var_301, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4461 | } |
| 4462 | uint32_t packetSize_vkCreateShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4463 | countingStream->rewind(); |
| 4464 | uint32_t opcode_vkCreateShaderModule = OP_vkCreateShaderModule; |
| 4465 | stream->write(&opcode_vkCreateShaderModule, sizeof(uint32_t)); |
| 4466 | stream->write(&packetSize_vkCreateShaderModule, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4467 | uint64_t cgen_var_302; |
| 4468 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_302, 1); |
| 4469 | stream->write((uint64_t*)&cgen_var_302, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4470 | marshal_VkShaderModuleCreateInfo(stream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4471 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4472 | uint64_t cgen_var_303 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4473 | stream->putBe64(cgen_var_303); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4474 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4475 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4476 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4477 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4478 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4479 | uint64_t cgen_var_304; |
| 4480 | stream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_304, 1); |
| 4481 | stream->write((uint64_t*)&cgen_var_304, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4482 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4483 | AEMU_SCOPED_TRACE("vkCreateShaderModule readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4484 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4485 | uint64_t cgen_var_305; |
| 4486 | stream->read((uint64_t*)&cgen_var_305, 8); |
| 4487 | stream->handleMapping()->mapHandles_u64_VkShaderModule(&cgen_var_305, (VkShaderModule*)pShaderModule, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4488 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4489 | AEMU_SCOPED_TRACE("vkCreateShaderModule returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4490 | VkResult vkCreateShaderModule_VkResult_return = (VkResult)0; |
| 4491 | stream->read(&vkCreateShaderModule_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4492 | countingStream->clearPool(); |
| 4493 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4494 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4495 | mImpl->log("finish vkCreateShaderModule");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4496 | return vkCreateShaderModule_VkResult_return; |
| 4497 | } |
| 4498 | |
| 4499 | void VkEncoder::vkDestroyShaderModule( |
| 4500 | VkDevice device, |
| 4501 | VkShaderModule shaderModule, |
| 4502 | const VkAllocationCallbacks* pAllocator) |
| 4503 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4504 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4505 | AEMU_SCOPED_TRACE("vkDestroyShaderModule encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4506 | mImpl->log("start vkDestroyShaderModule"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4507 | auto stream = mImpl->stream(); |
| 4508 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4509 | auto resources = mImpl->resources(); |
| 4510 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4511 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4512 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4513 | VkShaderModule local_shaderModule; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4514 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4515 | local_device = device; |
| 4516 | local_shaderModule = shaderModule; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4517 | local_pAllocator = nullptr; |
| 4518 | if (pAllocator) |
| 4519 | { |
| 4520 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4521 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4522 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4523 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4524 | if (local_pAllocator) |
| 4525 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4526 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4527 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4528 | countingStream->rewind(); |
| 4529 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4530 | uint64_t cgen_var_306; |
| 4531 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_306, 1); |
| 4532 | countingStream->write((uint64_t*)&cgen_var_306, 1 * 8); |
| 4533 | uint64_t cgen_var_307; |
| 4534 | countingStream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_307, 1); |
| 4535 | countingStream->write((uint64_t*)&cgen_var_307, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4536 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4537 | uint64_t cgen_var_308 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4538 | countingStream->putBe64(cgen_var_308); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4539 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4540 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4541 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4542 | } |
| 4543 | } |
| 4544 | uint32_t packetSize_vkDestroyShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4545 | countingStream->rewind(); |
| 4546 | uint32_t opcode_vkDestroyShaderModule = OP_vkDestroyShaderModule; |
| 4547 | stream->write(&opcode_vkDestroyShaderModule, sizeof(uint32_t)); |
| 4548 | stream->write(&packetSize_vkDestroyShaderModule, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4549 | uint64_t cgen_var_309; |
| 4550 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_309, 1); |
| 4551 | stream->write((uint64_t*)&cgen_var_309, 1 * 8); |
| 4552 | uint64_t cgen_var_310; |
| 4553 | stream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_310, 1); |
| 4554 | stream->write((uint64_t*)&cgen_var_310, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4555 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4556 | uint64_t cgen_var_311 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4557 | stream->putBe64(cgen_var_311); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4558 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4559 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4560 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4561 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4562 | AEMU_SCOPED_TRACE("vkDestroyShaderModule readParams"); |
| 4563 | AEMU_SCOPED_TRACE("vkDestroyShaderModule returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4564 | resources->destroyMapping()->mapHandles_VkShaderModule((VkShaderModule*)&shaderModule); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4565 | mImpl->log("finish vkDestroyShaderModule");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4566 | } |
| 4567 | |
| 4568 | VkResult VkEncoder::vkCreatePipelineCache( |
| 4569 | VkDevice device, |
| 4570 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 4571 | const VkAllocationCallbacks* pAllocator, |
| 4572 | VkPipelineCache* pPipelineCache) |
| 4573 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4574 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4575 | AEMU_SCOPED_TRACE("vkCreatePipelineCache encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4576 | mImpl->log("start vkCreatePipelineCache"); |
| 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 | VkPipelineCacheCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4584 | VkAllocationCallbacks* local_pAllocator; |
| 4585 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4586 | local_pCreateInfo = nullptr; |
| 4587 | if (pCreateInfo) |
| 4588 | { |
| 4589 | local_pCreateInfo = (VkPipelineCacheCreateInfo*)pool->alloc(sizeof(const VkPipelineCacheCreateInfo)); |
| 4590 | deepcopy_VkPipelineCacheCreateInfo(pool, pCreateInfo, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| 4591 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4592 | local_pAllocator = nullptr; |
| 4593 | if (pAllocator) |
| 4594 | { |
| 4595 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4596 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4597 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4598 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4599 | if (local_pCreateInfo) |
| 4600 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4601 | transform_tohost_VkPipelineCacheCreateInfo(mImpl->resources(), (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4602 | } |
| 4603 | if (local_pAllocator) |
| 4604 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4605 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4606 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4607 | countingStream->rewind(); |
| 4608 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4609 | uint64_t cgen_var_312; |
| 4610 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_312, 1); |
| 4611 | countingStream->write((uint64_t*)&cgen_var_312, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4612 | marshal_VkPipelineCacheCreateInfo(countingStream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4613 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4614 | uint64_t cgen_var_313 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4615 | countingStream->putBe64(cgen_var_313); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4616 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4617 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4618 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4619 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4620 | uint64_t cgen_var_314; |
| 4621 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_314, 1); |
| 4622 | countingStream->write((uint64_t*)&cgen_var_314, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4623 | } |
| 4624 | uint32_t packetSize_vkCreatePipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4625 | countingStream->rewind(); |
| 4626 | uint32_t opcode_vkCreatePipelineCache = OP_vkCreatePipelineCache; |
| 4627 | stream->write(&opcode_vkCreatePipelineCache, sizeof(uint32_t)); |
| 4628 | stream->write(&packetSize_vkCreatePipelineCache, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4629 | uint64_t cgen_var_315; |
| 4630 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_315, 1); |
| 4631 | stream->write((uint64_t*)&cgen_var_315, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4632 | marshal_VkPipelineCacheCreateInfo(stream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4633 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4634 | uint64_t cgen_var_316 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4635 | stream->putBe64(cgen_var_316); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4636 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4637 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4638 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4639 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4640 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4641 | uint64_t cgen_var_317; |
| 4642 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_317, 1); |
| 4643 | stream->write((uint64_t*)&cgen_var_317, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4644 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4645 | AEMU_SCOPED_TRACE("vkCreatePipelineCache readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4646 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4647 | uint64_t cgen_var_318; |
| 4648 | stream->read((uint64_t*)&cgen_var_318, 8); |
| 4649 | stream->handleMapping()->mapHandles_u64_VkPipelineCache(&cgen_var_318, (VkPipelineCache*)pPipelineCache, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4650 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4651 | AEMU_SCOPED_TRACE("vkCreatePipelineCache returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4652 | VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0; |
| 4653 | stream->read(&vkCreatePipelineCache_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4654 | countingStream->clearPool(); |
| 4655 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4656 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4657 | mImpl->log("finish vkCreatePipelineCache");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4658 | return vkCreatePipelineCache_VkResult_return; |
| 4659 | } |
| 4660 | |
| 4661 | void VkEncoder::vkDestroyPipelineCache( |
| 4662 | VkDevice device, |
| 4663 | VkPipelineCache pipelineCache, |
| 4664 | const VkAllocationCallbacks* pAllocator) |
| 4665 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4666 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4667 | AEMU_SCOPED_TRACE("vkDestroyPipelineCache encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4668 | mImpl->log("start vkDestroyPipelineCache"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4669 | auto stream = mImpl->stream(); |
| 4670 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4671 | auto resources = mImpl->resources(); |
| 4672 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4673 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4674 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4675 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4676 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4677 | local_device = device; |
| 4678 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4679 | local_pAllocator = nullptr; |
| 4680 | if (pAllocator) |
| 4681 | { |
| 4682 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4683 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4684 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4685 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4686 | if (local_pAllocator) |
| 4687 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4688 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4689 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4690 | countingStream->rewind(); |
| 4691 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4692 | uint64_t cgen_var_319; |
| 4693 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_319, 1); |
| 4694 | countingStream->write((uint64_t*)&cgen_var_319, 1 * 8); |
| 4695 | uint64_t cgen_var_320; |
| 4696 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_320, 1); |
| 4697 | countingStream->write((uint64_t*)&cgen_var_320, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4698 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4699 | uint64_t cgen_var_321 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4700 | countingStream->putBe64(cgen_var_321); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4701 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4702 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4703 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4704 | } |
| 4705 | } |
| 4706 | uint32_t packetSize_vkDestroyPipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4707 | countingStream->rewind(); |
| 4708 | uint32_t opcode_vkDestroyPipelineCache = OP_vkDestroyPipelineCache; |
| 4709 | stream->write(&opcode_vkDestroyPipelineCache, sizeof(uint32_t)); |
| 4710 | stream->write(&packetSize_vkDestroyPipelineCache, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4711 | uint64_t cgen_var_322; |
| 4712 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_322, 1); |
| 4713 | stream->write((uint64_t*)&cgen_var_322, 1 * 8); |
| 4714 | uint64_t cgen_var_323; |
| 4715 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_323, 1); |
| 4716 | stream->write((uint64_t*)&cgen_var_323, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4717 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4718 | uint64_t cgen_var_324 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4719 | stream->putBe64(cgen_var_324); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4720 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4721 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4722 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4723 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4724 | AEMU_SCOPED_TRACE("vkDestroyPipelineCache readParams"); |
| 4725 | AEMU_SCOPED_TRACE("vkDestroyPipelineCache returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4726 | resources->destroyMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&pipelineCache); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4727 | mImpl->log("finish vkDestroyPipelineCache");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4728 | } |
| 4729 | |
| 4730 | VkResult VkEncoder::vkGetPipelineCacheData( |
| 4731 | VkDevice device, |
| 4732 | VkPipelineCache pipelineCache, |
| 4733 | size_t* pDataSize, |
| 4734 | void* pData) |
| 4735 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4736 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4737 | AEMU_SCOPED_TRACE("vkGetPipelineCacheData encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4738 | mImpl->log("start vkGetPipelineCacheData"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4739 | auto stream = mImpl->stream(); |
| 4740 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4741 | auto resources = mImpl->resources(); |
| 4742 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4743 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4744 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4745 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4746 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4747 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4748 | countingStream->rewind(); |
| 4749 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4750 | uint64_t cgen_var_325; |
| 4751 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_325, 1); |
| 4752 | countingStream->write((uint64_t*)&cgen_var_325, 1 * 8); |
| 4753 | uint64_t cgen_var_326; |
| 4754 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_326, 1); |
| 4755 | countingStream->write((uint64_t*)&cgen_var_326, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4756 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4757 | uint64_t cgen_var_327 = (uint64_t)(uintptr_t)pDataSize; |
| 4758 | countingStream->putBe64(cgen_var_327); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4759 | if (pDataSize) |
| 4760 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4761 | uint64_t cgen_var_328 = (uint64_t)(*pDataSize); |
| 4762 | countingStream->putBe64(cgen_var_328); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4763 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4764 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4765 | uint64_t cgen_var_329 = (uint64_t)(uintptr_t)pData; |
| 4766 | countingStream->putBe64(cgen_var_329); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4767 | if (pData) |
| 4768 | { |
| 4769 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4770 | } |
| 4771 | } |
| 4772 | uint32_t packetSize_vkGetPipelineCacheData = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4773 | countingStream->rewind(); |
| 4774 | uint32_t opcode_vkGetPipelineCacheData = OP_vkGetPipelineCacheData; |
| 4775 | stream->write(&opcode_vkGetPipelineCacheData, sizeof(uint32_t)); |
| 4776 | stream->write(&packetSize_vkGetPipelineCacheData, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4777 | uint64_t cgen_var_330; |
| 4778 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_330, 1); |
| 4779 | stream->write((uint64_t*)&cgen_var_330, 1 * 8); |
| 4780 | uint64_t cgen_var_331; |
| 4781 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_331, 1); |
| 4782 | stream->write((uint64_t*)&cgen_var_331, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4783 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4784 | uint64_t cgen_var_332 = (uint64_t)(uintptr_t)pDataSize; |
| 4785 | stream->putBe64(cgen_var_332); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4786 | if (pDataSize) |
| 4787 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4788 | uint64_t cgen_var_333 = (uint64_t)(*pDataSize); |
| 4789 | stream->putBe64(cgen_var_333); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4790 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4791 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4792 | uint64_t cgen_var_334 = (uint64_t)(uintptr_t)pData; |
| 4793 | stream->putBe64(cgen_var_334); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4794 | if (pData) |
| 4795 | { |
| 4796 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4797 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4798 | AEMU_SCOPED_TRACE("vkGetPipelineCacheData readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4799 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4800 | size_t* check_pDataSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4801 | check_pDataSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4802 | if (pDataSize) |
| 4803 | { |
| 4804 | if (!(check_pDataSize)) |
| 4805 | { |
| 4806 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 4807 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4808 | (*pDataSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4809 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4810 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4811 | void* check_pData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4812 | check_pData = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4813 | if (pData) |
| 4814 | { |
| 4815 | if (!(check_pData)) |
| 4816 | { |
| 4817 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 4818 | } |
| 4819 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4820 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4821 | AEMU_SCOPED_TRACE("vkGetPipelineCacheData returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4822 | VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0; |
| 4823 | stream->read(&vkGetPipelineCacheData_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4824 | countingStream->clearPool(); |
| 4825 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4826 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4827 | mImpl->log("finish vkGetPipelineCacheData");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4828 | return vkGetPipelineCacheData_VkResult_return; |
| 4829 | } |
| 4830 | |
| 4831 | VkResult VkEncoder::vkMergePipelineCaches( |
| 4832 | VkDevice device, |
| 4833 | VkPipelineCache dstCache, |
| 4834 | uint32_t srcCacheCount, |
| 4835 | const VkPipelineCache* pSrcCaches) |
| 4836 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4837 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4838 | AEMU_SCOPED_TRACE("vkMergePipelineCaches encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4839 | mImpl->log("start vkMergePipelineCaches"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4840 | auto stream = mImpl->stream(); |
| 4841 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4842 | auto resources = mImpl->resources(); |
| 4843 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4844 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4845 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4846 | VkPipelineCache local_dstCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4847 | uint32_t local_srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4848 | VkPipelineCache* local_pSrcCaches; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4849 | local_device = device; |
| 4850 | local_dstCache = dstCache; |
| 4851 | local_srcCacheCount = srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4852 | local_pSrcCaches = nullptr; |
| 4853 | if (pSrcCaches) |
| 4854 | { |
| 4855 | local_pSrcCaches = (VkPipelineCache*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkPipelineCache)); |
| 4856 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4857 | countingStream->rewind(); |
| 4858 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4859 | uint64_t cgen_var_338; |
| 4860 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_338, 1); |
| 4861 | countingStream->write((uint64_t*)&cgen_var_338, 1 * 8); |
| 4862 | uint64_t cgen_var_339; |
| 4863 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_339, 1); |
| 4864 | countingStream->write((uint64_t*)&cgen_var_339, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4865 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4866 | if (((srcCacheCount))) |
| 4867 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4868 | uint64_t* cgen_var_340; |
| 4869 | countingStream->alloc((void**)&cgen_var_340, ((srcCacheCount)) * 8); |
| 4870 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_340, ((srcCacheCount))); |
| 4871 | countingStream->write((uint64_t*)cgen_var_340, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4872 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4873 | } |
| 4874 | uint32_t packetSize_vkMergePipelineCaches = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4875 | countingStream->rewind(); |
| 4876 | uint32_t opcode_vkMergePipelineCaches = OP_vkMergePipelineCaches; |
| 4877 | stream->write(&opcode_vkMergePipelineCaches, sizeof(uint32_t)); |
| 4878 | stream->write(&packetSize_vkMergePipelineCaches, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4879 | uint64_t cgen_var_341; |
| 4880 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_341, 1); |
| 4881 | stream->write((uint64_t*)&cgen_var_341, 1 * 8); |
| 4882 | uint64_t cgen_var_342; |
| 4883 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_342, 1); |
| 4884 | stream->write((uint64_t*)&cgen_var_342, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4885 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4886 | if (((srcCacheCount))) |
| 4887 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4888 | uint64_t* cgen_var_343; |
| 4889 | stream->alloc((void**)&cgen_var_343, ((srcCacheCount)) * 8); |
| 4890 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_343, ((srcCacheCount))); |
| 4891 | stream->write((uint64_t*)cgen_var_343, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4892 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4893 | AEMU_SCOPED_TRACE("vkMergePipelineCaches readParams"); |
| 4894 | AEMU_SCOPED_TRACE("vkMergePipelineCaches returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4895 | VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0; |
| 4896 | stream->read(&vkMergePipelineCaches_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4897 | countingStream->clearPool(); |
| 4898 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4899 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4900 | mImpl->log("finish vkMergePipelineCaches");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4901 | return vkMergePipelineCaches_VkResult_return; |
| 4902 | } |
| 4903 | |
| 4904 | VkResult VkEncoder::vkCreateGraphicsPipelines( |
| 4905 | VkDevice device, |
| 4906 | VkPipelineCache pipelineCache, |
| 4907 | uint32_t createInfoCount, |
| 4908 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 4909 | const VkAllocationCallbacks* pAllocator, |
| 4910 | VkPipeline* pPipelines) |
| 4911 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4912 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4913 | AEMU_SCOPED_TRACE("vkCreateGraphicsPipelines encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4914 | mImpl->log("start vkCreateGraphicsPipelines"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4915 | auto stream = mImpl->stream(); |
| 4916 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4917 | auto resources = mImpl->resources(); |
| 4918 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4919 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4920 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4921 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4922 | uint32_t local_createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4923 | VkGraphicsPipelineCreateInfo* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4924 | VkAllocationCallbacks* local_pAllocator; |
| 4925 | local_device = device; |
| 4926 | local_pipelineCache = pipelineCache; |
| 4927 | local_createInfoCount = createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4928 | local_pCreateInfos = nullptr; |
| 4929 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4930 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4931 | local_pCreateInfos = (VkGraphicsPipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkGraphicsPipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4932 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4933 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4934 | deepcopy_VkGraphicsPipelineCreateInfo(pool, pCreateInfos + i, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4935 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4936 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4937 | local_pAllocator = nullptr; |
| 4938 | if (pAllocator) |
| 4939 | { |
| 4940 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4941 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4942 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4943 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4944 | if (local_pCreateInfos) |
| 4945 | { |
| 4946 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4947 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4948 | transform_tohost_VkGraphicsPipelineCreateInfo(mImpl->resources(), (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4949 | } |
| 4950 | } |
| 4951 | if (local_pAllocator) |
| 4952 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4953 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4954 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4955 | countingStream->rewind(); |
| 4956 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4957 | uint64_t cgen_var_344; |
| 4958 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_344, 1); |
| 4959 | countingStream->write((uint64_t*)&cgen_var_344, 1 * 8); |
| 4960 | uint64_t cgen_var_345; |
| 4961 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_345, 1); |
| 4962 | countingStream->write((uint64_t*)&cgen_var_345, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4963 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 4964 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4965 | { |
| 4966 | marshal_VkGraphicsPipelineCreateInfo(countingStream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| 4967 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4968 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4969 | uint64_t cgen_var_346 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4970 | countingStream->putBe64(cgen_var_346); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4971 | if (local_pAllocator) |
| 4972 | { |
| 4973 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4974 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4975 | if (((createInfoCount))) |
| 4976 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4977 | uint64_t* cgen_var_347; |
| 4978 | countingStream->alloc((void**)&cgen_var_347, ((createInfoCount)) * 8); |
| 4979 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_347, ((createInfoCount))); |
| 4980 | countingStream->write((uint64_t*)cgen_var_347, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4981 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4982 | } |
| 4983 | uint32_t packetSize_vkCreateGraphicsPipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4984 | countingStream->rewind(); |
| 4985 | uint32_t opcode_vkCreateGraphicsPipelines = OP_vkCreateGraphicsPipelines; |
| 4986 | stream->write(&opcode_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| 4987 | stream->write(&packetSize_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4988 | uint64_t cgen_var_348; |
| 4989 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_348, 1); |
| 4990 | stream->write((uint64_t*)&cgen_var_348, 1 * 8); |
| 4991 | uint64_t cgen_var_349; |
| 4992 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_349, 1); |
| 4993 | stream->write((uint64_t*)&cgen_var_349, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4994 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4995 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4996 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4997 | marshal_VkGraphicsPipelineCreateInfo(stream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4998 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4999 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5000 | uint64_t cgen_var_350 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5001 | stream->putBe64(cgen_var_350); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5002 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5003 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5004 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5005 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5006 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5007 | if (((createInfoCount))) |
| 5008 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5009 | uint64_t* cgen_var_351; |
| 5010 | stream->alloc((void**)&cgen_var_351, ((createInfoCount)) * 8); |
| 5011 | stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_351, ((createInfoCount))); |
| 5012 | stream->write((uint64_t*)cgen_var_351, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5013 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5014 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5015 | AEMU_SCOPED_TRACE("vkCreateGraphicsPipelines readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5016 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5017 | if (((createInfoCount))) |
| 5018 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5019 | uint64_t* cgen_var_352; |
| 5020 | stream->alloc((void**)&cgen_var_352, ((createInfoCount)) * 8); |
| 5021 | stream->read((uint64_t*)cgen_var_352, ((createInfoCount)) * 8); |
| 5022 | stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_352, (VkPipeline*)pPipelines, ((createInfoCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5023 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5024 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5025 | AEMU_SCOPED_TRACE("vkCreateGraphicsPipelines returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5026 | VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0; |
| 5027 | stream->read(&vkCreateGraphicsPipelines_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5028 | countingStream->clearPool(); |
| 5029 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5030 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5031 | mImpl->log("finish vkCreateGraphicsPipelines");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5032 | return vkCreateGraphicsPipelines_VkResult_return; |
| 5033 | } |
| 5034 | |
| 5035 | VkResult VkEncoder::vkCreateComputePipelines( |
| 5036 | VkDevice device, |
| 5037 | VkPipelineCache pipelineCache, |
| 5038 | uint32_t createInfoCount, |
| 5039 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 5040 | const VkAllocationCallbacks* pAllocator, |
| 5041 | VkPipeline* pPipelines) |
| 5042 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5043 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5044 | AEMU_SCOPED_TRACE("vkCreateComputePipelines encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5045 | mImpl->log("start vkCreateComputePipelines"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5046 | auto stream = mImpl->stream(); |
| 5047 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5048 | auto resources = mImpl->resources(); |
| 5049 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5050 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5051 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5052 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5053 | uint32_t local_createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5054 | VkComputePipelineCreateInfo* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5055 | VkAllocationCallbacks* local_pAllocator; |
| 5056 | local_device = device; |
| 5057 | local_pipelineCache = pipelineCache; |
| 5058 | local_createInfoCount = createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5059 | local_pCreateInfos = nullptr; |
| 5060 | if (pCreateInfos) |
| 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 | local_pCreateInfos = (VkComputePipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkComputePipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5063 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 5064 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5065 | deepcopy_VkComputePipelineCreateInfo(pool, pCreateInfos + i, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5066 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5067 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5068 | local_pAllocator = nullptr; |
| 5069 | if (pAllocator) |
| 5070 | { |
| 5071 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5072 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5073 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5074 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5075 | if (local_pCreateInfos) |
| 5076 | { |
| 5077 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 5078 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5079 | transform_tohost_VkComputePipelineCreateInfo(mImpl->resources(), (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5080 | } |
| 5081 | } |
| 5082 | if (local_pAllocator) |
| 5083 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5084 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5085 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5086 | countingStream->rewind(); |
| 5087 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5088 | uint64_t cgen_var_353; |
| 5089 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_353, 1); |
| 5090 | countingStream->write((uint64_t*)&cgen_var_353, 1 * 8); |
| 5091 | uint64_t cgen_var_354; |
| 5092 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_354, 1); |
| 5093 | countingStream->write((uint64_t*)&cgen_var_354, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5094 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 5095 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 5096 | { |
| 5097 | marshal_VkComputePipelineCreateInfo(countingStream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| 5098 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5099 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5100 | uint64_t cgen_var_355 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5101 | countingStream->putBe64(cgen_var_355); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5102 | if (local_pAllocator) |
| 5103 | { |
| 5104 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5105 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5106 | if (((createInfoCount))) |
| 5107 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5108 | uint64_t* cgen_var_356; |
| 5109 | countingStream->alloc((void**)&cgen_var_356, ((createInfoCount)) * 8); |
| 5110 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_356, ((createInfoCount))); |
| 5111 | countingStream->write((uint64_t*)cgen_var_356, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5112 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5113 | } |
| 5114 | uint32_t packetSize_vkCreateComputePipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5115 | countingStream->rewind(); |
| 5116 | uint32_t opcode_vkCreateComputePipelines = OP_vkCreateComputePipelines; |
| 5117 | stream->write(&opcode_vkCreateComputePipelines, sizeof(uint32_t)); |
| 5118 | stream->write(&packetSize_vkCreateComputePipelines, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5119 | uint64_t cgen_var_357; |
| 5120 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_357, 1); |
| 5121 | stream->write((uint64_t*)&cgen_var_357, 1 * 8); |
| 5122 | uint64_t cgen_var_358; |
| 5123 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_358, 1); |
| 5124 | stream->write((uint64_t*)&cgen_var_358, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5125 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5126 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 5127 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5128 | marshal_VkComputePipelineCreateInfo(stream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5129 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5130 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5131 | uint64_t cgen_var_359 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5132 | stream->putBe64(cgen_var_359); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5133 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5134 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5135 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5136 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5137 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5138 | if (((createInfoCount))) |
| 5139 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5140 | uint64_t* cgen_var_360; |
| 5141 | stream->alloc((void**)&cgen_var_360, ((createInfoCount)) * 8); |
| 5142 | stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_360, ((createInfoCount))); |
| 5143 | stream->write((uint64_t*)cgen_var_360, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5144 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5145 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5146 | AEMU_SCOPED_TRACE("vkCreateComputePipelines readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5147 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5148 | if (((createInfoCount))) |
| 5149 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5150 | uint64_t* cgen_var_361; |
| 5151 | stream->alloc((void**)&cgen_var_361, ((createInfoCount)) * 8); |
| 5152 | stream->read((uint64_t*)cgen_var_361, ((createInfoCount)) * 8); |
| 5153 | stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_361, (VkPipeline*)pPipelines, ((createInfoCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5154 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5155 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5156 | AEMU_SCOPED_TRACE("vkCreateComputePipelines returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5157 | VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0; |
| 5158 | stream->read(&vkCreateComputePipelines_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5159 | countingStream->clearPool(); |
| 5160 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5161 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5162 | mImpl->log("finish vkCreateComputePipelines");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5163 | return vkCreateComputePipelines_VkResult_return; |
| 5164 | } |
| 5165 | |
| 5166 | void VkEncoder::vkDestroyPipeline( |
| 5167 | VkDevice device, |
| 5168 | VkPipeline pipeline, |
| 5169 | const VkAllocationCallbacks* pAllocator) |
| 5170 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5171 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5172 | AEMU_SCOPED_TRACE("vkDestroyPipeline encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5173 | mImpl->log("start vkDestroyPipeline"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5174 | auto stream = mImpl->stream(); |
| 5175 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5176 | auto resources = mImpl->resources(); |
| 5177 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5178 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5179 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5180 | VkPipeline local_pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5181 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5182 | local_device = device; |
| 5183 | local_pipeline = pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5184 | local_pAllocator = nullptr; |
| 5185 | if (pAllocator) |
| 5186 | { |
| 5187 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5188 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5189 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5190 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5191 | if (local_pAllocator) |
| 5192 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5193 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5194 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5195 | countingStream->rewind(); |
| 5196 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5197 | uint64_t cgen_var_362; |
| 5198 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_362, 1); |
| 5199 | countingStream->write((uint64_t*)&cgen_var_362, 1 * 8); |
| 5200 | uint64_t cgen_var_363; |
| 5201 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_363, 1); |
| 5202 | countingStream->write((uint64_t*)&cgen_var_363, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5203 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5204 | uint64_t cgen_var_364 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5205 | countingStream->putBe64(cgen_var_364); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5206 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5207 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5208 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5209 | } |
| 5210 | } |
| 5211 | uint32_t packetSize_vkDestroyPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5212 | countingStream->rewind(); |
| 5213 | uint32_t opcode_vkDestroyPipeline = OP_vkDestroyPipeline; |
| 5214 | stream->write(&opcode_vkDestroyPipeline, sizeof(uint32_t)); |
| 5215 | stream->write(&packetSize_vkDestroyPipeline, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5216 | uint64_t cgen_var_365; |
| 5217 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_365, 1); |
| 5218 | stream->write((uint64_t*)&cgen_var_365, 1 * 8); |
| 5219 | uint64_t cgen_var_366; |
| 5220 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_366, 1); |
| 5221 | stream->write((uint64_t*)&cgen_var_366, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5222 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5223 | uint64_t cgen_var_367 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5224 | stream->putBe64(cgen_var_367); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5225 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5226 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5227 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5228 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5229 | AEMU_SCOPED_TRACE("vkDestroyPipeline readParams"); |
| 5230 | AEMU_SCOPED_TRACE("vkDestroyPipeline returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5231 | resources->destroyMapping()->mapHandles_VkPipeline((VkPipeline*)&pipeline); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5232 | mImpl->log("finish vkDestroyPipeline");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5233 | } |
| 5234 | |
| 5235 | VkResult VkEncoder::vkCreatePipelineLayout( |
| 5236 | VkDevice device, |
| 5237 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 5238 | const VkAllocationCallbacks* pAllocator, |
| 5239 | VkPipelineLayout* pPipelineLayout) |
| 5240 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5241 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5242 | AEMU_SCOPED_TRACE("vkCreatePipelineLayout encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5243 | mImpl->log("start vkCreatePipelineLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5244 | auto stream = mImpl->stream(); |
| 5245 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5246 | auto resources = mImpl->resources(); |
| 5247 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5248 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5249 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5250 | VkPipelineLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5251 | VkAllocationCallbacks* local_pAllocator; |
| 5252 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5253 | local_pCreateInfo = nullptr; |
| 5254 | if (pCreateInfo) |
| 5255 | { |
| 5256 | local_pCreateInfo = (VkPipelineLayoutCreateInfo*)pool->alloc(sizeof(const VkPipelineLayoutCreateInfo)); |
| 5257 | deepcopy_VkPipelineLayoutCreateInfo(pool, pCreateInfo, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| 5258 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5259 | local_pAllocator = nullptr; |
| 5260 | if (pAllocator) |
| 5261 | { |
| 5262 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5263 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5264 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5265 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5266 | if (local_pCreateInfo) |
| 5267 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5268 | transform_tohost_VkPipelineLayoutCreateInfo(mImpl->resources(), (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5269 | } |
| 5270 | if (local_pAllocator) |
| 5271 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5272 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5273 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5274 | countingStream->rewind(); |
| 5275 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5276 | uint64_t cgen_var_368; |
| 5277 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_368, 1); |
| 5278 | countingStream->write((uint64_t*)&cgen_var_368, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5279 | marshal_VkPipelineLayoutCreateInfo(countingStream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5280 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5281 | uint64_t cgen_var_369 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5282 | countingStream->putBe64(cgen_var_369); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5283 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5284 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5285 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5286 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5287 | uint64_t cgen_var_370; |
| 5288 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_370, 1); |
| 5289 | countingStream->write((uint64_t*)&cgen_var_370, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5290 | } |
| 5291 | uint32_t packetSize_vkCreatePipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5292 | countingStream->rewind(); |
| 5293 | uint32_t opcode_vkCreatePipelineLayout = OP_vkCreatePipelineLayout; |
| 5294 | stream->write(&opcode_vkCreatePipelineLayout, sizeof(uint32_t)); |
| 5295 | stream->write(&packetSize_vkCreatePipelineLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5296 | uint64_t cgen_var_371; |
| 5297 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_371, 1); |
| 5298 | stream->write((uint64_t*)&cgen_var_371, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5299 | marshal_VkPipelineLayoutCreateInfo(stream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5300 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5301 | uint64_t cgen_var_372 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5302 | stream->putBe64(cgen_var_372); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5303 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5304 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5305 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5306 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5307 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5308 | uint64_t cgen_var_373; |
| 5309 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_373, 1); |
| 5310 | stream->write((uint64_t*)&cgen_var_373, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5311 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5312 | AEMU_SCOPED_TRACE("vkCreatePipelineLayout readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5313 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5314 | uint64_t cgen_var_374; |
| 5315 | stream->read((uint64_t*)&cgen_var_374, 8); |
| 5316 | stream->handleMapping()->mapHandles_u64_VkPipelineLayout(&cgen_var_374, (VkPipelineLayout*)pPipelineLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5317 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5318 | AEMU_SCOPED_TRACE("vkCreatePipelineLayout returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5319 | VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0; |
| 5320 | stream->read(&vkCreatePipelineLayout_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5321 | countingStream->clearPool(); |
| 5322 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5323 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5324 | mImpl->log("finish vkCreatePipelineLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5325 | return vkCreatePipelineLayout_VkResult_return; |
| 5326 | } |
| 5327 | |
| 5328 | void VkEncoder::vkDestroyPipelineLayout( |
| 5329 | VkDevice device, |
| 5330 | VkPipelineLayout pipelineLayout, |
| 5331 | const VkAllocationCallbacks* pAllocator) |
| 5332 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5333 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5334 | AEMU_SCOPED_TRACE("vkDestroyPipelineLayout encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5335 | mImpl->log("start vkDestroyPipelineLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5336 | auto stream = mImpl->stream(); |
| 5337 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5338 | auto resources = mImpl->resources(); |
| 5339 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5340 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5341 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5342 | VkPipelineLayout local_pipelineLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5343 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5344 | local_device = device; |
| 5345 | local_pipelineLayout = pipelineLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5346 | local_pAllocator = nullptr; |
| 5347 | if (pAllocator) |
| 5348 | { |
| 5349 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5350 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5351 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5352 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5353 | if (local_pAllocator) |
| 5354 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5355 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5356 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5357 | countingStream->rewind(); |
| 5358 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5359 | uint64_t cgen_var_375; |
| 5360 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_375, 1); |
| 5361 | countingStream->write((uint64_t*)&cgen_var_375, 1 * 8); |
| 5362 | uint64_t cgen_var_376; |
| 5363 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_376, 1); |
| 5364 | countingStream->write((uint64_t*)&cgen_var_376, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5365 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5366 | uint64_t cgen_var_377 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5367 | countingStream->putBe64(cgen_var_377); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5368 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5369 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5370 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5371 | } |
| 5372 | } |
| 5373 | uint32_t packetSize_vkDestroyPipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5374 | countingStream->rewind(); |
| 5375 | uint32_t opcode_vkDestroyPipelineLayout = OP_vkDestroyPipelineLayout; |
| 5376 | stream->write(&opcode_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| 5377 | stream->write(&packetSize_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5378 | uint64_t cgen_var_378; |
| 5379 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_378, 1); |
| 5380 | stream->write((uint64_t*)&cgen_var_378, 1 * 8); |
| 5381 | uint64_t cgen_var_379; |
| 5382 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_379, 1); |
| 5383 | stream->write((uint64_t*)&cgen_var_379, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5384 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5385 | uint64_t cgen_var_380 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5386 | stream->putBe64(cgen_var_380); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5387 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5388 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5389 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5390 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5391 | AEMU_SCOPED_TRACE("vkDestroyPipelineLayout readParams"); |
| 5392 | AEMU_SCOPED_TRACE("vkDestroyPipelineLayout returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5393 | resources->destroyMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&pipelineLayout); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5394 | mImpl->log("finish vkDestroyPipelineLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5395 | } |
| 5396 | |
| 5397 | VkResult VkEncoder::vkCreateSampler( |
| 5398 | VkDevice device, |
| 5399 | const VkSamplerCreateInfo* pCreateInfo, |
| 5400 | const VkAllocationCallbacks* pAllocator, |
| 5401 | VkSampler* pSampler) |
| 5402 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5403 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5404 | AEMU_SCOPED_TRACE("vkCreateSampler encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5405 | mImpl->log("start vkCreateSampler"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5406 | auto stream = mImpl->stream(); |
| 5407 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5408 | auto resources = mImpl->resources(); |
| 5409 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5410 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5411 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5412 | VkSamplerCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5413 | VkAllocationCallbacks* local_pAllocator; |
| 5414 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5415 | local_pCreateInfo = nullptr; |
| 5416 | if (pCreateInfo) |
| 5417 | { |
| 5418 | local_pCreateInfo = (VkSamplerCreateInfo*)pool->alloc(sizeof(const VkSamplerCreateInfo)); |
| 5419 | deepcopy_VkSamplerCreateInfo(pool, pCreateInfo, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| 5420 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5421 | local_pAllocator = nullptr; |
| 5422 | if (pAllocator) |
| 5423 | { |
| 5424 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5425 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5426 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5427 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5428 | if (local_pCreateInfo) |
| 5429 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5430 | transform_tohost_VkSamplerCreateInfo(mImpl->resources(), (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5431 | } |
| 5432 | if (local_pAllocator) |
| 5433 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5434 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5435 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5436 | countingStream->rewind(); |
| 5437 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5438 | uint64_t cgen_var_381; |
| 5439 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_381, 1); |
| 5440 | countingStream->write((uint64_t*)&cgen_var_381, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5441 | marshal_VkSamplerCreateInfo(countingStream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5442 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5443 | uint64_t cgen_var_382 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5444 | countingStream->putBe64(cgen_var_382); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5445 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5446 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5447 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5448 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5449 | uint64_t cgen_var_383; |
| 5450 | countingStream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_383, 1); |
| 5451 | countingStream->write((uint64_t*)&cgen_var_383, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5452 | } |
| 5453 | uint32_t packetSize_vkCreateSampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5454 | countingStream->rewind(); |
| 5455 | uint32_t opcode_vkCreateSampler = OP_vkCreateSampler; |
| 5456 | stream->write(&opcode_vkCreateSampler, sizeof(uint32_t)); |
| 5457 | stream->write(&packetSize_vkCreateSampler, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5458 | uint64_t cgen_var_384; |
| 5459 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_384, 1); |
| 5460 | stream->write((uint64_t*)&cgen_var_384, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5461 | marshal_VkSamplerCreateInfo(stream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5462 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5463 | uint64_t cgen_var_385 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5464 | stream->putBe64(cgen_var_385); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5465 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5466 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5467 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5468 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5469 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5470 | uint64_t cgen_var_386; |
| 5471 | stream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_386, 1); |
| 5472 | stream->write((uint64_t*)&cgen_var_386, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5473 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5474 | AEMU_SCOPED_TRACE("vkCreateSampler readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5475 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5476 | uint64_t cgen_var_387; |
| 5477 | stream->read((uint64_t*)&cgen_var_387, 8); |
| 5478 | stream->handleMapping()->mapHandles_u64_VkSampler(&cgen_var_387, (VkSampler*)pSampler, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5479 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5480 | AEMU_SCOPED_TRACE("vkCreateSampler returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5481 | VkResult vkCreateSampler_VkResult_return = (VkResult)0; |
| 5482 | stream->read(&vkCreateSampler_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5483 | countingStream->clearPool(); |
| 5484 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5485 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5486 | mImpl->log("finish vkCreateSampler");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5487 | return vkCreateSampler_VkResult_return; |
| 5488 | } |
| 5489 | |
| 5490 | void VkEncoder::vkDestroySampler( |
| 5491 | VkDevice device, |
| 5492 | VkSampler sampler, |
| 5493 | const VkAllocationCallbacks* pAllocator) |
| 5494 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5495 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5496 | AEMU_SCOPED_TRACE("vkDestroySampler encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5497 | mImpl->log("start vkDestroySampler"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5498 | auto stream = mImpl->stream(); |
| 5499 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5500 | auto resources = mImpl->resources(); |
| 5501 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5502 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5503 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5504 | VkSampler local_sampler; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5505 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5506 | local_device = device; |
| 5507 | local_sampler = sampler; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5508 | local_pAllocator = nullptr; |
| 5509 | if (pAllocator) |
| 5510 | { |
| 5511 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5512 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5513 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5514 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5515 | if (local_pAllocator) |
| 5516 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5517 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5518 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5519 | countingStream->rewind(); |
| 5520 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5521 | uint64_t cgen_var_388; |
| 5522 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_388, 1); |
| 5523 | countingStream->write((uint64_t*)&cgen_var_388, 1 * 8); |
| 5524 | uint64_t cgen_var_389; |
| 5525 | countingStream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_389, 1); |
| 5526 | countingStream->write((uint64_t*)&cgen_var_389, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5527 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5528 | uint64_t cgen_var_390 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5529 | countingStream->putBe64(cgen_var_390); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5530 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5531 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5532 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5533 | } |
| 5534 | } |
| 5535 | uint32_t packetSize_vkDestroySampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5536 | countingStream->rewind(); |
| 5537 | uint32_t opcode_vkDestroySampler = OP_vkDestroySampler; |
| 5538 | stream->write(&opcode_vkDestroySampler, sizeof(uint32_t)); |
| 5539 | stream->write(&packetSize_vkDestroySampler, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5540 | uint64_t cgen_var_391; |
| 5541 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_391, 1); |
| 5542 | stream->write((uint64_t*)&cgen_var_391, 1 * 8); |
| 5543 | uint64_t cgen_var_392; |
| 5544 | stream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_392, 1); |
| 5545 | stream->write((uint64_t*)&cgen_var_392, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5546 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5547 | uint64_t cgen_var_393 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5548 | stream->putBe64(cgen_var_393); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5549 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5550 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5551 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5552 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5553 | AEMU_SCOPED_TRACE("vkDestroySampler readParams"); |
| 5554 | AEMU_SCOPED_TRACE("vkDestroySampler returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5555 | resources->destroyMapping()->mapHandles_VkSampler((VkSampler*)&sampler); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5556 | mImpl->log("finish vkDestroySampler");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5557 | } |
| 5558 | |
| 5559 | VkResult VkEncoder::vkCreateDescriptorSetLayout( |
| 5560 | VkDevice device, |
| 5561 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 5562 | const VkAllocationCallbacks* pAllocator, |
| 5563 | VkDescriptorSetLayout* pSetLayout) |
| 5564 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5565 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5566 | AEMU_SCOPED_TRACE("vkCreateDescriptorSetLayout encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5567 | mImpl->log("start vkCreateDescriptorSetLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5568 | auto stream = mImpl->stream(); |
| 5569 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5570 | auto resources = mImpl->resources(); |
| 5571 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5572 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5573 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5574 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5575 | VkAllocationCallbacks* local_pAllocator; |
| 5576 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5577 | local_pCreateInfo = nullptr; |
| 5578 | if (pCreateInfo) |
| 5579 | { |
| 5580 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 5581 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 5582 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5583 | local_pAllocator = nullptr; |
| 5584 | if (pAllocator) |
| 5585 | { |
| 5586 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5587 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5588 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5589 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5590 | if (local_pCreateInfo) |
| 5591 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5592 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5593 | } |
| 5594 | if (local_pAllocator) |
| 5595 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5596 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5597 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5598 | countingStream->rewind(); |
| 5599 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5600 | uint64_t cgen_var_394; |
| 5601 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_394, 1); |
| 5602 | countingStream->write((uint64_t*)&cgen_var_394, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5603 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5604 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5605 | uint64_t cgen_var_395 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5606 | countingStream->putBe64(cgen_var_395); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5607 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5608 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5609 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5610 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5611 | uint64_t cgen_var_396; |
| 5612 | countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_396, 1); |
| 5613 | countingStream->write((uint64_t*)&cgen_var_396, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5614 | } |
| 5615 | uint32_t packetSize_vkCreateDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5616 | countingStream->rewind(); |
| 5617 | uint32_t opcode_vkCreateDescriptorSetLayout = OP_vkCreateDescriptorSetLayout; |
| 5618 | stream->write(&opcode_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| 5619 | stream->write(&packetSize_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5620 | uint64_t cgen_var_397; |
| 5621 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_397, 1); |
| 5622 | stream->write((uint64_t*)&cgen_var_397, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5623 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5624 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5625 | uint64_t cgen_var_398 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5626 | stream->putBe64(cgen_var_398); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5627 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5628 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5629 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5630 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5631 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5632 | uint64_t cgen_var_399; |
| 5633 | stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_399, 1); |
| 5634 | stream->write((uint64_t*)&cgen_var_399, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5635 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5636 | AEMU_SCOPED_TRACE("vkCreateDescriptorSetLayout readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5637 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5638 | uint64_t cgen_var_400; |
| 5639 | stream->read((uint64_t*)&cgen_var_400, 8); |
| 5640 | stream->handleMapping()->mapHandles_u64_VkDescriptorSetLayout(&cgen_var_400, (VkDescriptorSetLayout*)pSetLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5641 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5642 | AEMU_SCOPED_TRACE("vkCreateDescriptorSetLayout returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5643 | VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0; |
| 5644 | stream->read(&vkCreateDescriptorSetLayout_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5645 | countingStream->clearPool(); |
| 5646 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5647 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5648 | mImpl->log("finish vkCreateDescriptorSetLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5649 | return vkCreateDescriptorSetLayout_VkResult_return; |
| 5650 | } |
| 5651 | |
| 5652 | void VkEncoder::vkDestroyDescriptorSetLayout( |
| 5653 | VkDevice device, |
| 5654 | VkDescriptorSetLayout descriptorSetLayout, |
| 5655 | const VkAllocationCallbacks* pAllocator) |
| 5656 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5657 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5658 | AEMU_SCOPED_TRACE("vkDestroyDescriptorSetLayout encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5659 | mImpl->log("start vkDestroyDescriptorSetLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5660 | auto stream = mImpl->stream(); |
| 5661 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5662 | auto resources = mImpl->resources(); |
| 5663 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5664 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5665 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5666 | VkDescriptorSetLayout local_descriptorSetLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5667 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5668 | local_device = device; |
| 5669 | local_descriptorSetLayout = descriptorSetLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5670 | local_pAllocator = nullptr; |
| 5671 | if (pAllocator) |
| 5672 | { |
| 5673 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5674 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5675 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5676 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5677 | if (local_pAllocator) |
| 5678 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5679 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5680 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5681 | countingStream->rewind(); |
| 5682 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5683 | uint64_t cgen_var_401; |
| 5684 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_401, 1); |
| 5685 | countingStream->write((uint64_t*)&cgen_var_401, 1 * 8); |
| 5686 | uint64_t cgen_var_402; |
| 5687 | countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_402, 1); |
| 5688 | countingStream->write((uint64_t*)&cgen_var_402, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5689 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5690 | uint64_t cgen_var_403 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5691 | countingStream->putBe64(cgen_var_403); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5692 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5693 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5694 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5695 | } |
| 5696 | } |
| 5697 | uint32_t packetSize_vkDestroyDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5698 | countingStream->rewind(); |
| 5699 | uint32_t opcode_vkDestroyDescriptorSetLayout = OP_vkDestroyDescriptorSetLayout; |
| 5700 | stream->write(&opcode_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| 5701 | stream->write(&packetSize_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5702 | uint64_t cgen_var_404; |
| 5703 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_404, 1); |
| 5704 | stream->write((uint64_t*)&cgen_var_404, 1 * 8); |
| 5705 | uint64_t cgen_var_405; |
| 5706 | stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_405, 1); |
| 5707 | stream->write((uint64_t*)&cgen_var_405, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5708 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5709 | uint64_t cgen_var_406 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5710 | stream->putBe64(cgen_var_406); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5711 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5712 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5713 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5714 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5715 | AEMU_SCOPED_TRACE("vkDestroyDescriptorSetLayout readParams"); |
| 5716 | AEMU_SCOPED_TRACE("vkDestroyDescriptorSetLayout returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5717 | resources->destroyMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)&descriptorSetLayout); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5718 | mImpl->log("finish vkDestroyDescriptorSetLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5719 | } |
| 5720 | |
| 5721 | VkResult VkEncoder::vkCreateDescriptorPool( |
| 5722 | VkDevice device, |
| 5723 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 5724 | const VkAllocationCallbacks* pAllocator, |
| 5725 | VkDescriptorPool* pDescriptorPool) |
| 5726 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5727 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5728 | AEMU_SCOPED_TRACE("vkCreateDescriptorPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5729 | mImpl->log("start vkCreateDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5730 | auto stream = mImpl->stream(); |
| 5731 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5732 | auto resources = mImpl->resources(); |
| 5733 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5734 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5735 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5736 | VkDescriptorPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5737 | VkAllocationCallbacks* local_pAllocator; |
| 5738 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5739 | local_pCreateInfo = nullptr; |
| 5740 | if (pCreateInfo) |
| 5741 | { |
| 5742 | local_pCreateInfo = (VkDescriptorPoolCreateInfo*)pool->alloc(sizeof(const VkDescriptorPoolCreateInfo)); |
| 5743 | deepcopy_VkDescriptorPoolCreateInfo(pool, pCreateInfo, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| 5744 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5745 | local_pAllocator = nullptr; |
| 5746 | if (pAllocator) |
| 5747 | { |
| 5748 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5749 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5750 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5751 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5752 | if (local_pCreateInfo) |
| 5753 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5754 | transform_tohost_VkDescriptorPoolCreateInfo(mImpl->resources(), (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5755 | } |
| 5756 | if (local_pAllocator) |
| 5757 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5758 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5759 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5760 | countingStream->rewind(); |
| 5761 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5762 | uint64_t cgen_var_407; |
| 5763 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_407, 1); |
| 5764 | countingStream->write((uint64_t*)&cgen_var_407, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5765 | marshal_VkDescriptorPoolCreateInfo(countingStream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5766 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5767 | uint64_t cgen_var_408 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5768 | countingStream->putBe64(cgen_var_408); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5769 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5770 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5771 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5772 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5773 | uint64_t cgen_var_409; |
| 5774 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_409, 1); |
| 5775 | countingStream->write((uint64_t*)&cgen_var_409, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5776 | } |
| 5777 | uint32_t packetSize_vkCreateDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5778 | countingStream->rewind(); |
| 5779 | uint32_t opcode_vkCreateDescriptorPool = OP_vkCreateDescriptorPool; |
| 5780 | stream->write(&opcode_vkCreateDescriptorPool, sizeof(uint32_t)); |
| 5781 | stream->write(&packetSize_vkCreateDescriptorPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5782 | uint64_t cgen_var_410; |
| 5783 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_410, 1); |
| 5784 | stream->write((uint64_t*)&cgen_var_410, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5785 | marshal_VkDescriptorPoolCreateInfo(stream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5786 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5787 | uint64_t cgen_var_411 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5788 | stream->putBe64(cgen_var_411); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5789 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5790 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5791 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5792 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5793 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5794 | uint64_t cgen_var_412; |
| 5795 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_412, 1); |
| 5796 | stream->write((uint64_t*)&cgen_var_412, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5797 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5798 | AEMU_SCOPED_TRACE("vkCreateDescriptorPool readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5799 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5800 | uint64_t cgen_var_413; |
| 5801 | stream->read((uint64_t*)&cgen_var_413, 8); |
| 5802 | stream->handleMapping()->mapHandles_u64_VkDescriptorPool(&cgen_var_413, (VkDescriptorPool*)pDescriptorPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5803 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5804 | AEMU_SCOPED_TRACE("vkCreateDescriptorPool returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5805 | VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0; |
| 5806 | stream->read(&vkCreateDescriptorPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5807 | countingStream->clearPool(); |
| 5808 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5809 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5810 | mImpl->log("finish vkCreateDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5811 | return vkCreateDescriptorPool_VkResult_return; |
| 5812 | } |
| 5813 | |
| 5814 | void VkEncoder::vkDestroyDescriptorPool( |
| 5815 | VkDevice device, |
| 5816 | VkDescriptorPool descriptorPool, |
| 5817 | const VkAllocationCallbacks* pAllocator) |
| 5818 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5819 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5820 | AEMU_SCOPED_TRACE("vkDestroyDescriptorPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5821 | mImpl->log("start vkDestroyDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5822 | auto stream = mImpl->stream(); |
| 5823 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5824 | auto resources = mImpl->resources(); |
| 5825 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5826 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5827 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5828 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5829 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5830 | local_device = device; |
| 5831 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5832 | local_pAllocator = nullptr; |
| 5833 | if (pAllocator) |
| 5834 | { |
| 5835 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5836 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5837 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5838 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5839 | if (local_pAllocator) |
| 5840 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5841 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5842 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5843 | countingStream->rewind(); |
| 5844 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5845 | uint64_t cgen_var_414; |
| 5846 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_414, 1); |
| 5847 | countingStream->write((uint64_t*)&cgen_var_414, 1 * 8); |
| 5848 | uint64_t cgen_var_415; |
| 5849 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_415, 1); |
| 5850 | countingStream->write((uint64_t*)&cgen_var_415, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5851 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5852 | uint64_t cgen_var_416 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5853 | countingStream->putBe64(cgen_var_416); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5854 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5855 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5856 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5857 | } |
| 5858 | } |
| 5859 | uint32_t packetSize_vkDestroyDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5860 | countingStream->rewind(); |
| 5861 | uint32_t opcode_vkDestroyDescriptorPool = OP_vkDestroyDescriptorPool; |
| 5862 | stream->write(&opcode_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| 5863 | stream->write(&packetSize_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5864 | uint64_t cgen_var_417; |
| 5865 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_417, 1); |
| 5866 | stream->write((uint64_t*)&cgen_var_417, 1 * 8); |
| 5867 | uint64_t cgen_var_418; |
| 5868 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_418, 1); |
| 5869 | stream->write((uint64_t*)&cgen_var_418, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5870 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5871 | uint64_t cgen_var_419 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5872 | stream->putBe64(cgen_var_419); |
| 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(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5876 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5877 | AEMU_SCOPED_TRACE("vkDestroyDescriptorPool readParams"); |
| 5878 | AEMU_SCOPED_TRACE("vkDestroyDescriptorPool returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5879 | resources->destroyMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&descriptorPool); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5880 | mImpl->log("finish vkDestroyDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5881 | } |
| 5882 | |
| 5883 | VkResult VkEncoder::vkResetDescriptorPool( |
| 5884 | VkDevice device, |
| 5885 | VkDescriptorPool descriptorPool, |
| 5886 | VkDescriptorPoolResetFlags flags) |
| 5887 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5888 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5889 | AEMU_SCOPED_TRACE("vkResetDescriptorPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5890 | mImpl->log("start vkResetDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5891 | auto stream = mImpl->stream(); |
| 5892 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5893 | auto resources = mImpl->resources(); |
| 5894 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5895 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5896 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5897 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5898 | VkDescriptorPoolResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5899 | local_device = device; |
| 5900 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5901 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5902 | countingStream->rewind(); |
| 5903 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5904 | uint64_t cgen_var_420; |
| 5905 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_420, 1); |
| 5906 | countingStream->write((uint64_t*)&cgen_var_420, 1 * 8); |
| 5907 | uint64_t cgen_var_421; |
| 5908 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_421, 1); |
| 5909 | countingStream->write((uint64_t*)&cgen_var_421, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5910 | countingStream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5911 | } |
| 5912 | uint32_t packetSize_vkResetDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5913 | countingStream->rewind(); |
| 5914 | uint32_t opcode_vkResetDescriptorPool = OP_vkResetDescriptorPool; |
| 5915 | stream->write(&opcode_vkResetDescriptorPool, sizeof(uint32_t)); |
| 5916 | stream->write(&packetSize_vkResetDescriptorPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5917 | uint64_t cgen_var_422; |
| 5918 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_422, 1); |
| 5919 | stream->write((uint64_t*)&cgen_var_422, 1 * 8); |
| 5920 | uint64_t cgen_var_423; |
| 5921 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_423, 1); |
| 5922 | stream->write((uint64_t*)&cgen_var_423, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5923 | stream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5924 | AEMU_SCOPED_TRACE("vkResetDescriptorPool readParams"); |
| 5925 | AEMU_SCOPED_TRACE("vkResetDescriptorPool returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5926 | VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0; |
| 5927 | stream->read(&vkResetDescriptorPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5928 | countingStream->clearPool(); |
| 5929 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5930 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5931 | mImpl->log("finish vkResetDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5932 | return vkResetDescriptorPool_VkResult_return; |
| 5933 | } |
| 5934 | |
| 5935 | VkResult VkEncoder::vkAllocateDescriptorSets( |
| 5936 | VkDevice device, |
| 5937 | const VkDescriptorSetAllocateInfo* pAllocateInfo, |
| 5938 | VkDescriptorSet* pDescriptorSets) |
| 5939 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5940 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5941 | AEMU_SCOPED_TRACE("vkAllocateDescriptorSets encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5942 | mImpl->log("start vkAllocateDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5943 | auto stream = mImpl->stream(); |
| 5944 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5945 | auto resources = mImpl->resources(); |
| 5946 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5947 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5948 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5949 | VkDescriptorSetAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5950 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5951 | local_pAllocateInfo = nullptr; |
| 5952 | if (pAllocateInfo) |
| 5953 | { |
| 5954 | local_pAllocateInfo = (VkDescriptorSetAllocateInfo*)pool->alloc(sizeof(const VkDescriptorSetAllocateInfo)); |
| 5955 | deepcopy_VkDescriptorSetAllocateInfo(pool, pAllocateInfo, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| 5956 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5957 | if (local_pAllocateInfo) |
| 5958 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5959 | transform_tohost_VkDescriptorSetAllocateInfo(mImpl->resources(), (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5960 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5961 | countingStream->rewind(); |
| 5962 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5963 | uint64_t cgen_var_424; |
| 5964 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_424, 1); |
| 5965 | countingStream->write((uint64_t*)&cgen_var_424, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5966 | marshal_VkDescriptorSetAllocateInfo(countingStream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5967 | if (pAllocateInfo->descriptorSetCount) |
| 5968 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5969 | uint64_t* cgen_var_425; |
| 5970 | countingStream->alloc((void**)&cgen_var_425, pAllocateInfo->descriptorSetCount * 8); |
| 5971 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_425, pAllocateInfo->descriptorSetCount); |
| 5972 | countingStream->write((uint64_t*)cgen_var_425, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5973 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5974 | } |
| 5975 | uint32_t packetSize_vkAllocateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5976 | countingStream->rewind(); |
| 5977 | uint32_t opcode_vkAllocateDescriptorSets = OP_vkAllocateDescriptorSets; |
| 5978 | stream->write(&opcode_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| 5979 | stream->write(&packetSize_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5980 | uint64_t cgen_var_426; |
| 5981 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_426, 1); |
| 5982 | stream->write((uint64_t*)&cgen_var_426, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5983 | marshal_VkDescriptorSetAllocateInfo(stream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5984 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5985 | if (pAllocateInfo->descriptorSetCount) |
| 5986 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5987 | uint64_t* cgen_var_427; |
| 5988 | stream->alloc((void**)&cgen_var_427, pAllocateInfo->descriptorSetCount * 8); |
| 5989 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_427, pAllocateInfo->descriptorSetCount); |
| 5990 | stream->write((uint64_t*)cgen_var_427, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5991 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5992 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5993 | AEMU_SCOPED_TRACE("vkAllocateDescriptorSets readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5994 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5995 | if (pAllocateInfo->descriptorSetCount) |
| 5996 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5997 | uint64_t* cgen_var_428; |
| 5998 | stream->alloc((void**)&cgen_var_428, pAllocateInfo->descriptorSetCount * 8); |
| 5999 | stream->read((uint64_t*)cgen_var_428, pAllocateInfo->descriptorSetCount * 8); |
| 6000 | stream->handleMapping()->mapHandles_u64_VkDescriptorSet(cgen_var_428, (VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6001 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6002 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6003 | AEMU_SCOPED_TRACE("vkAllocateDescriptorSets returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6004 | VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0; |
| 6005 | stream->read(&vkAllocateDescriptorSets_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6006 | countingStream->clearPool(); |
| 6007 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6008 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6009 | mImpl->log("finish vkAllocateDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6010 | return vkAllocateDescriptorSets_VkResult_return; |
| 6011 | } |
| 6012 | |
| 6013 | VkResult VkEncoder::vkFreeDescriptorSets( |
| 6014 | VkDevice device, |
| 6015 | VkDescriptorPool descriptorPool, |
| 6016 | uint32_t descriptorSetCount, |
| 6017 | const VkDescriptorSet* pDescriptorSets) |
| 6018 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6019 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6020 | AEMU_SCOPED_TRACE("vkFreeDescriptorSets encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6021 | mImpl->log("start vkFreeDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6022 | auto stream = mImpl->stream(); |
| 6023 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6024 | auto resources = mImpl->resources(); |
| 6025 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6026 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6027 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6028 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6029 | uint32_t local_descriptorSetCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6030 | VkDescriptorSet* local_pDescriptorSets; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6031 | local_device = device; |
| 6032 | local_descriptorPool = descriptorPool; |
| 6033 | local_descriptorSetCount = descriptorSetCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6034 | local_pDescriptorSets = nullptr; |
| 6035 | if (pDescriptorSets) |
| 6036 | { |
| 6037 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 6038 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6039 | countingStream->rewind(); |
| 6040 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6041 | uint64_t cgen_var_429; |
| 6042 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_429, 1); |
| 6043 | countingStream->write((uint64_t*)&cgen_var_429, 1 * 8); |
| 6044 | uint64_t cgen_var_430; |
| 6045 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_430, 1); |
| 6046 | countingStream->write((uint64_t*)&cgen_var_430, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6047 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6048 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6049 | uint64_t cgen_var_431 = (uint64_t)(uintptr_t)local_pDescriptorSets; |
| 6050 | countingStream->putBe64(cgen_var_431); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6051 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6052 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6053 | if (((descriptorSetCount))) |
| 6054 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6055 | uint64_t* cgen_var_432; |
| 6056 | countingStream->alloc((void**)&cgen_var_432, ((descriptorSetCount)) * 8); |
| 6057 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_432, ((descriptorSetCount))); |
| 6058 | countingStream->write((uint64_t*)cgen_var_432, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6059 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6060 | } |
| 6061 | } |
| 6062 | uint32_t packetSize_vkFreeDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6063 | countingStream->rewind(); |
| 6064 | uint32_t opcode_vkFreeDescriptorSets = OP_vkFreeDescriptorSets; |
| 6065 | stream->write(&opcode_vkFreeDescriptorSets, sizeof(uint32_t)); |
| 6066 | stream->write(&packetSize_vkFreeDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6067 | uint64_t cgen_var_433; |
| 6068 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_433, 1); |
| 6069 | stream->write((uint64_t*)&cgen_var_433, 1 * 8); |
| 6070 | uint64_t cgen_var_434; |
| 6071 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_434, 1); |
| 6072 | stream->write((uint64_t*)&cgen_var_434, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6073 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6074 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6075 | uint64_t cgen_var_435 = (uint64_t)(uintptr_t)local_pDescriptorSets; |
| 6076 | stream->putBe64(cgen_var_435); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6077 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6078 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6079 | if (((descriptorSetCount))) |
| 6080 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6081 | uint64_t* cgen_var_436; |
| 6082 | stream->alloc((void**)&cgen_var_436, ((descriptorSetCount)) * 8); |
| 6083 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_436, ((descriptorSetCount))); |
| 6084 | stream->write((uint64_t*)cgen_var_436, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6085 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6086 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6087 | AEMU_SCOPED_TRACE("vkFreeDescriptorSets readParams"); |
| 6088 | AEMU_SCOPED_TRACE("vkFreeDescriptorSets returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6089 | VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0; |
| 6090 | stream->read(&vkFreeDescriptorSets_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6091 | countingStream->clearPool(); |
| 6092 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6093 | pool->freeAll(); |
| Lingfeng Yang | 6ab1b0d | 2018-11-27 23:36:03 -0800 | [diff] [blame] | 6094 | if (pDescriptorSets) |
| 6095 | { |
| 6096 | resources->destroyMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount))); |
| 6097 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6098 | mImpl->log("finish vkFreeDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6099 | return vkFreeDescriptorSets_VkResult_return; |
| 6100 | } |
| 6101 | |
| 6102 | void VkEncoder::vkUpdateDescriptorSets( |
| 6103 | VkDevice device, |
| 6104 | uint32_t descriptorWriteCount, |
| 6105 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 6106 | uint32_t descriptorCopyCount, |
| 6107 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 6108 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6109 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6110 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSets encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6111 | mImpl->log("start vkUpdateDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6112 | auto stream = mImpl->stream(); |
| 6113 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6114 | auto resources = mImpl->resources(); |
| 6115 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6116 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6117 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6118 | uint32_t local_descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6119 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6120 | uint32_t local_descriptorCopyCount; |
| 6121 | VkCopyDescriptorSet* local_pDescriptorCopies; |
| 6122 | local_device = device; |
| 6123 | local_descriptorWriteCount = descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6124 | local_pDescriptorWrites = nullptr; |
| 6125 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6126 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6127 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6128 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 6129 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6130 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6131 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6132 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6133 | local_descriptorCopyCount = descriptorCopyCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6134 | local_pDescriptorCopies = nullptr; |
| 6135 | if (pDescriptorCopies) |
| 6136 | { |
| 6137 | local_pDescriptorCopies = (VkCopyDescriptorSet*)pool->alloc(((descriptorCopyCount)) * sizeof(const VkCopyDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6138 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 6139 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6140 | deepcopy_VkCopyDescriptorSet(pool, pDescriptorCopies + i, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| 6141 | } |
| 6142 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6143 | if (local_pDescriptorWrites) |
| 6144 | { |
| 6145 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 6146 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6147 | transform_tohost_VkWriteDescriptorSet(mImpl->resources(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6148 | } |
| 6149 | } |
| 6150 | if (local_pDescriptorCopies) |
| 6151 | { |
| 6152 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 6153 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6154 | transform_tohost_VkCopyDescriptorSet(mImpl->resources(), (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6155 | } |
| 6156 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6157 | countingStream->rewind(); |
| 6158 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6159 | uint64_t cgen_var_437; |
| 6160 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_437, 1); |
| 6161 | countingStream->write((uint64_t*)&cgen_var_437, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6162 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 6163 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 6164 | { |
| 6165 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 6166 | } |
| 6167 | countingStream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| 6168 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 6169 | { |
| 6170 | marshal_VkCopyDescriptorSet(countingStream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6171 | } |
| 6172 | } |
| 6173 | uint32_t packetSize_vkUpdateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6174 | countingStream->rewind(); |
| 6175 | uint32_t opcode_vkUpdateDescriptorSets = OP_vkUpdateDescriptorSets; |
| 6176 | stream->write(&opcode_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| 6177 | stream->write(&packetSize_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6178 | uint64_t cgen_var_438; |
| 6179 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_438, 1); |
| 6180 | stream->write((uint64_t*)&cgen_var_438, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6181 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6182 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 6183 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6184 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6185 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6186 | stream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6187 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 6188 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6189 | marshal_VkCopyDescriptorSet(stream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6190 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6191 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSets readParams"); |
| 6192 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSets returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6193 | mImpl->log("finish vkUpdateDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6194 | } |
| 6195 | |
| 6196 | VkResult VkEncoder::vkCreateFramebuffer( |
| 6197 | VkDevice device, |
| 6198 | const VkFramebufferCreateInfo* pCreateInfo, |
| 6199 | const VkAllocationCallbacks* pAllocator, |
| 6200 | VkFramebuffer* pFramebuffer) |
| 6201 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6202 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6203 | AEMU_SCOPED_TRACE("vkCreateFramebuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6204 | mImpl->log("start vkCreateFramebuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6205 | auto stream = mImpl->stream(); |
| 6206 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6207 | auto resources = mImpl->resources(); |
| 6208 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6209 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6210 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6211 | VkFramebufferCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6212 | VkAllocationCallbacks* local_pAllocator; |
| 6213 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6214 | local_pCreateInfo = nullptr; |
| 6215 | if (pCreateInfo) |
| 6216 | { |
| 6217 | local_pCreateInfo = (VkFramebufferCreateInfo*)pool->alloc(sizeof(const VkFramebufferCreateInfo)); |
| 6218 | deepcopy_VkFramebufferCreateInfo(pool, pCreateInfo, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| 6219 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6220 | local_pAllocator = nullptr; |
| 6221 | if (pAllocator) |
| 6222 | { |
| 6223 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6224 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6225 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6226 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6227 | if (local_pCreateInfo) |
| 6228 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6229 | transform_tohost_VkFramebufferCreateInfo(mImpl->resources(), (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6230 | } |
| 6231 | if (local_pAllocator) |
| 6232 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6233 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6234 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6235 | countingStream->rewind(); |
| 6236 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6237 | uint64_t cgen_var_439; |
| 6238 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_439, 1); |
| 6239 | countingStream->write((uint64_t*)&cgen_var_439, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6240 | marshal_VkFramebufferCreateInfo(countingStream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6241 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6242 | uint64_t cgen_var_440 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6243 | countingStream->putBe64(cgen_var_440); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6244 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6245 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6246 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6247 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6248 | uint64_t cgen_var_441; |
| 6249 | countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_441, 1); |
| 6250 | countingStream->write((uint64_t*)&cgen_var_441, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6251 | } |
| 6252 | uint32_t packetSize_vkCreateFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6253 | countingStream->rewind(); |
| 6254 | uint32_t opcode_vkCreateFramebuffer = OP_vkCreateFramebuffer; |
| 6255 | stream->write(&opcode_vkCreateFramebuffer, sizeof(uint32_t)); |
| 6256 | stream->write(&packetSize_vkCreateFramebuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6257 | uint64_t cgen_var_442; |
| 6258 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_442, 1); |
| 6259 | stream->write((uint64_t*)&cgen_var_442, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6260 | marshal_VkFramebufferCreateInfo(stream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6261 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6262 | uint64_t cgen_var_443 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6263 | stream->putBe64(cgen_var_443); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6264 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6265 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6266 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6267 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6268 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6269 | uint64_t cgen_var_444; |
| 6270 | stream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_444, 1); |
| 6271 | stream->write((uint64_t*)&cgen_var_444, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6272 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6273 | AEMU_SCOPED_TRACE("vkCreateFramebuffer readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6274 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6275 | uint64_t cgen_var_445; |
| 6276 | stream->read((uint64_t*)&cgen_var_445, 8); |
| 6277 | stream->handleMapping()->mapHandles_u64_VkFramebuffer(&cgen_var_445, (VkFramebuffer*)pFramebuffer, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6278 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6279 | AEMU_SCOPED_TRACE("vkCreateFramebuffer returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6280 | VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0; |
| 6281 | stream->read(&vkCreateFramebuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6282 | countingStream->clearPool(); |
| 6283 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6284 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6285 | mImpl->log("finish vkCreateFramebuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6286 | return vkCreateFramebuffer_VkResult_return; |
| 6287 | } |
| 6288 | |
| 6289 | void VkEncoder::vkDestroyFramebuffer( |
| 6290 | VkDevice device, |
| 6291 | VkFramebuffer framebuffer, |
| 6292 | const VkAllocationCallbacks* pAllocator) |
| 6293 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6294 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6295 | AEMU_SCOPED_TRACE("vkDestroyFramebuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6296 | mImpl->log("start vkDestroyFramebuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6297 | auto stream = mImpl->stream(); |
| 6298 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6299 | auto resources = mImpl->resources(); |
| 6300 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6301 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6302 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6303 | VkFramebuffer local_framebuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6304 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6305 | local_device = device; |
| 6306 | local_framebuffer = framebuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6307 | local_pAllocator = nullptr; |
| 6308 | if (pAllocator) |
| 6309 | { |
| 6310 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6311 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6312 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6313 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6314 | if (local_pAllocator) |
| 6315 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6316 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6317 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6318 | countingStream->rewind(); |
| 6319 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6320 | uint64_t cgen_var_446; |
| 6321 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_446, 1); |
| 6322 | countingStream->write((uint64_t*)&cgen_var_446, 1 * 8); |
| 6323 | uint64_t cgen_var_447; |
| 6324 | countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_447, 1); |
| 6325 | countingStream->write((uint64_t*)&cgen_var_447, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6326 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6327 | uint64_t cgen_var_448 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6328 | countingStream->putBe64(cgen_var_448); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6329 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6330 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6331 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6332 | } |
| 6333 | } |
| 6334 | uint32_t packetSize_vkDestroyFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6335 | countingStream->rewind(); |
| 6336 | uint32_t opcode_vkDestroyFramebuffer = OP_vkDestroyFramebuffer; |
| 6337 | stream->write(&opcode_vkDestroyFramebuffer, sizeof(uint32_t)); |
| 6338 | stream->write(&packetSize_vkDestroyFramebuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6339 | uint64_t cgen_var_449; |
| 6340 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_449, 1); |
| 6341 | stream->write((uint64_t*)&cgen_var_449, 1 * 8); |
| 6342 | uint64_t cgen_var_450; |
| 6343 | stream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_450, 1); |
| 6344 | stream->write((uint64_t*)&cgen_var_450, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6345 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6346 | uint64_t cgen_var_451 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6347 | stream->putBe64(cgen_var_451); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6348 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6349 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6350 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6351 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6352 | AEMU_SCOPED_TRACE("vkDestroyFramebuffer readParams"); |
| 6353 | AEMU_SCOPED_TRACE("vkDestroyFramebuffer returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6354 | resources->destroyMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&framebuffer); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6355 | mImpl->log("finish vkDestroyFramebuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6356 | } |
| 6357 | |
| 6358 | VkResult VkEncoder::vkCreateRenderPass( |
| 6359 | VkDevice device, |
| 6360 | const VkRenderPassCreateInfo* pCreateInfo, |
| 6361 | const VkAllocationCallbacks* pAllocator, |
| 6362 | VkRenderPass* pRenderPass) |
| 6363 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6364 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6365 | AEMU_SCOPED_TRACE("vkCreateRenderPass encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6366 | mImpl->log("start vkCreateRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6367 | auto stream = mImpl->stream(); |
| 6368 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6369 | auto resources = mImpl->resources(); |
| 6370 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6371 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6372 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6373 | VkRenderPassCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6374 | VkAllocationCallbacks* local_pAllocator; |
| 6375 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6376 | local_pCreateInfo = nullptr; |
| 6377 | if (pCreateInfo) |
| 6378 | { |
| 6379 | local_pCreateInfo = (VkRenderPassCreateInfo*)pool->alloc(sizeof(const VkRenderPassCreateInfo)); |
| 6380 | deepcopy_VkRenderPassCreateInfo(pool, pCreateInfo, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| 6381 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6382 | local_pAllocator = nullptr; |
| 6383 | if (pAllocator) |
| 6384 | { |
| 6385 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6386 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6387 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6388 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6389 | if (local_pCreateInfo) |
| 6390 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6391 | transform_tohost_VkRenderPassCreateInfo(mImpl->resources(), (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6392 | } |
| 6393 | if (local_pAllocator) |
| 6394 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6395 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6396 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6397 | countingStream->rewind(); |
| 6398 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6399 | uint64_t cgen_var_452; |
| 6400 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_452, 1); |
| 6401 | countingStream->write((uint64_t*)&cgen_var_452, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6402 | marshal_VkRenderPassCreateInfo(countingStream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6403 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6404 | uint64_t cgen_var_453 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6405 | countingStream->putBe64(cgen_var_453); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6406 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6407 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6408 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6409 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6410 | uint64_t cgen_var_454; |
| 6411 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_454, 1); |
| 6412 | countingStream->write((uint64_t*)&cgen_var_454, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6413 | } |
| 6414 | uint32_t packetSize_vkCreateRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6415 | countingStream->rewind(); |
| 6416 | uint32_t opcode_vkCreateRenderPass = OP_vkCreateRenderPass; |
| 6417 | stream->write(&opcode_vkCreateRenderPass, sizeof(uint32_t)); |
| 6418 | stream->write(&packetSize_vkCreateRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6419 | uint64_t cgen_var_455; |
| 6420 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_455, 1); |
| 6421 | stream->write((uint64_t*)&cgen_var_455, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6422 | marshal_VkRenderPassCreateInfo(stream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6423 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6424 | uint64_t cgen_var_456 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6425 | stream->putBe64(cgen_var_456); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6426 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6427 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6428 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6429 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6430 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6431 | uint64_t cgen_var_457; |
| 6432 | stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_457, 1); |
| 6433 | stream->write((uint64_t*)&cgen_var_457, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6434 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6435 | AEMU_SCOPED_TRACE("vkCreateRenderPass readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6436 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6437 | uint64_t cgen_var_458; |
| 6438 | stream->read((uint64_t*)&cgen_var_458, 8); |
| 6439 | stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_458, (VkRenderPass*)pRenderPass, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6440 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6441 | AEMU_SCOPED_TRACE("vkCreateRenderPass returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6442 | VkResult vkCreateRenderPass_VkResult_return = (VkResult)0; |
| 6443 | stream->read(&vkCreateRenderPass_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6444 | countingStream->clearPool(); |
| 6445 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6446 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6447 | mImpl->log("finish vkCreateRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6448 | return vkCreateRenderPass_VkResult_return; |
| 6449 | } |
| 6450 | |
| 6451 | void VkEncoder::vkDestroyRenderPass( |
| 6452 | VkDevice device, |
| 6453 | VkRenderPass renderPass, |
| 6454 | const VkAllocationCallbacks* pAllocator) |
| 6455 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6456 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6457 | AEMU_SCOPED_TRACE("vkDestroyRenderPass encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6458 | mImpl->log("start vkDestroyRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6459 | auto stream = mImpl->stream(); |
| 6460 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6461 | auto resources = mImpl->resources(); |
| 6462 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6463 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6464 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6465 | VkRenderPass local_renderPass; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6466 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6467 | local_device = device; |
| 6468 | local_renderPass = renderPass; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6469 | local_pAllocator = nullptr; |
| 6470 | if (pAllocator) |
| 6471 | { |
| 6472 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6473 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6474 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6475 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6476 | if (local_pAllocator) |
| 6477 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6478 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6479 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6480 | countingStream->rewind(); |
| 6481 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6482 | uint64_t cgen_var_459; |
| 6483 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_459, 1); |
| 6484 | countingStream->write((uint64_t*)&cgen_var_459, 1 * 8); |
| 6485 | uint64_t cgen_var_460; |
| 6486 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_460, 1); |
| 6487 | countingStream->write((uint64_t*)&cgen_var_460, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6488 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6489 | uint64_t cgen_var_461 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6490 | countingStream->putBe64(cgen_var_461); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6491 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6492 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6493 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6494 | } |
| 6495 | } |
| 6496 | uint32_t packetSize_vkDestroyRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6497 | countingStream->rewind(); |
| 6498 | uint32_t opcode_vkDestroyRenderPass = OP_vkDestroyRenderPass; |
| 6499 | stream->write(&opcode_vkDestroyRenderPass, sizeof(uint32_t)); |
| 6500 | stream->write(&packetSize_vkDestroyRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6501 | uint64_t cgen_var_462; |
| 6502 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_462, 1); |
| 6503 | stream->write((uint64_t*)&cgen_var_462, 1 * 8); |
| 6504 | uint64_t cgen_var_463; |
| 6505 | stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_463, 1); |
| 6506 | stream->write((uint64_t*)&cgen_var_463, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6507 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6508 | uint64_t cgen_var_464 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6509 | stream->putBe64(cgen_var_464); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6510 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6511 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6512 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6513 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6514 | AEMU_SCOPED_TRACE("vkDestroyRenderPass readParams"); |
| 6515 | AEMU_SCOPED_TRACE("vkDestroyRenderPass returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6516 | resources->destroyMapping()->mapHandles_VkRenderPass((VkRenderPass*)&renderPass); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6517 | mImpl->log("finish vkDestroyRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6518 | } |
| 6519 | |
| 6520 | void VkEncoder::vkGetRenderAreaGranularity( |
| 6521 | VkDevice device, |
| 6522 | VkRenderPass renderPass, |
| 6523 | VkExtent2D* pGranularity) |
| 6524 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6525 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6526 | AEMU_SCOPED_TRACE("vkGetRenderAreaGranularity encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6527 | mImpl->log("start vkGetRenderAreaGranularity"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6528 | auto stream = mImpl->stream(); |
| 6529 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6530 | auto resources = mImpl->resources(); |
| 6531 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6532 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6533 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6534 | VkRenderPass local_renderPass; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6535 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6536 | local_renderPass = renderPass; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6537 | countingStream->rewind(); |
| 6538 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6539 | uint64_t cgen_var_465; |
| 6540 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_465, 1); |
| 6541 | countingStream->write((uint64_t*)&cgen_var_465, 1 * 8); |
| 6542 | uint64_t cgen_var_466; |
| 6543 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_466, 1); |
| 6544 | countingStream->write((uint64_t*)&cgen_var_466, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6545 | marshal_VkExtent2D(countingStream, (VkExtent2D*)(pGranularity)); |
| 6546 | } |
| 6547 | uint32_t packetSize_vkGetRenderAreaGranularity = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6548 | countingStream->rewind(); |
| 6549 | uint32_t opcode_vkGetRenderAreaGranularity = OP_vkGetRenderAreaGranularity; |
| 6550 | stream->write(&opcode_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| 6551 | stream->write(&packetSize_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6552 | uint64_t cgen_var_467; |
| 6553 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_467, 1); |
| 6554 | stream->write((uint64_t*)&cgen_var_467, 1 * 8); |
| 6555 | uint64_t cgen_var_468; |
| 6556 | stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_468, 1); |
| 6557 | stream->write((uint64_t*)&cgen_var_468, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6558 | marshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6559 | AEMU_SCOPED_TRACE("vkGetRenderAreaGranularity readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6560 | unmarshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6561 | if (pGranularity) |
| 6562 | { |
| 6563 | transform_fromhost_VkExtent2D(mImpl->resources(), (VkExtent2D*)(pGranularity)); |
| 6564 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6565 | AEMU_SCOPED_TRACE("vkGetRenderAreaGranularity returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6566 | mImpl->log("finish vkGetRenderAreaGranularity");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6567 | } |
| 6568 | |
| 6569 | VkResult VkEncoder::vkCreateCommandPool( |
| 6570 | VkDevice device, |
| 6571 | const VkCommandPoolCreateInfo* pCreateInfo, |
| 6572 | const VkAllocationCallbacks* pAllocator, |
| 6573 | VkCommandPool* pCommandPool) |
| 6574 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6575 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6576 | AEMU_SCOPED_TRACE("vkCreateCommandPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6577 | mImpl->log("start vkCreateCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6578 | auto stream = mImpl->stream(); |
| 6579 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6580 | auto resources = mImpl->resources(); |
| 6581 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6582 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6583 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6584 | VkCommandPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6585 | VkAllocationCallbacks* local_pAllocator; |
| 6586 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6587 | local_pCreateInfo = nullptr; |
| 6588 | if (pCreateInfo) |
| 6589 | { |
| 6590 | local_pCreateInfo = (VkCommandPoolCreateInfo*)pool->alloc(sizeof(const VkCommandPoolCreateInfo)); |
| 6591 | deepcopy_VkCommandPoolCreateInfo(pool, pCreateInfo, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| 6592 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6593 | local_pAllocator = nullptr; |
| 6594 | if (pAllocator) |
| 6595 | { |
| 6596 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6597 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6598 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6599 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6600 | if (local_pCreateInfo) |
| 6601 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6602 | transform_tohost_VkCommandPoolCreateInfo(mImpl->resources(), (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6603 | } |
| 6604 | if (local_pAllocator) |
| 6605 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6606 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6607 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6608 | countingStream->rewind(); |
| 6609 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6610 | uint64_t cgen_var_469; |
| 6611 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_469, 1); |
| 6612 | countingStream->write((uint64_t*)&cgen_var_469, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6613 | marshal_VkCommandPoolCreateInfo(countingStream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6614 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6615 | uint64_t cgen_var_470 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6616 | countingStream->putBe64(cgen_var_470); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6617 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6618 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6619 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6620 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6621 | uint64_t cgen_var_471; |
| 6622 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_471, 1); |
| 6623 | countingStream->write((uint64_t*)&cgen_var_471, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6624 | } |
| 6625 | uint32_t packetSize_vkCreateCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6626 | countingStream->rewind(); |
| 6627 | uint32_t opcode_vkCreateCommandPool = OP_vkCreateCommandPool; |
| 6628 | stream->write(&opcode_vkCreateCommandPool, sizeof(uint32_t)); |
| 6629 | stream->write(&packetSize_vkCreateCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6630 | uint64_t cgen_var_472; |
| 6631 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_472, 1); |
| 6632 | stream->write((uint64_t*)&cgen_var_472, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6633 | marshal_VkCommandPoolCreateInfo(stream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6634 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6635 | uint64_t cgen_var_473 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6636 | stream->putBe64(cgen_var_473); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6637 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6638 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6639 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6640 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6641 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6642 | uint64_t cgen_var_474; |
| 6643 | stream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_474, 1); |
| 6644 | stream->write((uint64_t*)&cgen_var_474, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6645 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6646 | AEMU_SCOPED_TRACE("vkCreateCommandPool readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6647 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6648 | uint64_t cgen_var_475; |
| 6649 | stream->read((uint64_t*)&cgen_var_475, 8); |
| 6650 | stream->handleMapping()->mapHandles_u64_VkCommandPool(&cgen_var_475, (VkCommandPool*)pCommandPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6651 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6652 | AEMU_SCOPED_TRACE("vkCreateCommandPool returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6653 | VkResult vkCreateCommandPool_VkResult_return = (VkResult)0; |
| 6654 | stream->read(&vkCreateCommandPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6655 | countingStream->clearPool(); |
| 6656 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6657 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6658 | mImpl->log("finish vkCreateCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6659 | return vkCreateCommandPool_VkResult_return; |
| 6660 | } |
| 6661 | |
| 6662 | void VkEncoder::vkDestroyCommandPool( |
| 6663 | VkDevice device, |
| 6664 | VkCommandPool commandPool, |
| 6665 | const VkAllocationCallbacks* pAllocator) |
| 6666 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6667 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6668 | AEMU_SCOPED_TRACE("vkDestroyCommandPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6669 | mImpl->log("start vkDestroyCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6670 | auto stream = mImpl->stream(); |
| 6671 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6672 | auto resources = mImpl->resources(); |
| 6673 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6674 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6675 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6676 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6677 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6678 | local_device = device; |
| 6679 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6680 | local_pAllocator = nullptr; |
| 6681 | if (pAllocator) |
| 6682 | { |
| 6683 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6684 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6685 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6686 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6687 | if (local_pAllocator) |
| 6688 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6689 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6690 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6691 | countingStream->rewind(); |
| 6692 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6693 | uint64_t cgen_var_476; |
| 6694 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_476, 1); |
| 6695 | countingStream->write((uint64_t*)&cgen_var_476, 1 * 8); |
| 6696 | uint64_t cgen_var_477; |
| 6697 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_477, 1); |
| 6698 | countingStream->write((uint64_t*)&cgen_var_477, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6699 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6700 | uint64_t cgen_var_478 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6701 | countingStream->putBe64(cgen_var_478); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6702 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6703 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6704 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6705 | } |
| 6706 | } |
| 6707 | uint32_t packetSize_vkDestroyCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6708 | countingStream->rewind(); |
| 6709 | uint32_t opcode_vkDestroyCommandPool = OP_vkDestroyCommandPool; |
| 6710 | stream->write(&opcode_vkDestroyCommandPool, sizeof(uint32_t)); |
| 6711 | stream->write(&packetSize_vkDestroyCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6712 | uint64_t cgen_var_479; |
| 6713 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_479, 1); |
| 6714 | stream->write((uint64_t*)&cgen_var_479, 1 * 8); |
| 6715 | uint64_t cgen_var_480; |
| 6716 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_480, 1); |
| 6717 | stream->write((uint64_t*)&cgen_var_480, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6718 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6719 | uint64_t cgen_var_481 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6720 | stream->putBe64(cgen_var_481); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6721 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6722 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6723 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6724 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6725 | AEMU_SCOPED_TRACE("vkDestroyCommandPool readParams"); |
| 6726 | AEMU_SCOPED_TRACE("vkDestroyCommandPool returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6727 | resources->destroyMapping()->mapHandles_VkCommandPool((VkCommandPool*)&commandPool); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6728 | mImpl->log("finish vkDestroyCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6729 | } |
| 6730 | |
| 6731 | VkResult VkEncoder::vkResetCommandPool( |
| 6732 | VkDevice device, |
| 6733 | VkCommandPool commandPool, |
| 6734 | VkCommandPoolResetFlags flags) |
| 6735 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6736 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6737 | AEMU_SCOPED_TRACE("vkResetCommandPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6738 | mImpl->log("start vkResetCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6739 | auto stream = mImpl->stream(); |
| 6740 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6741 | auto resources = mImpl->resources(); |
| 6742 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6743 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6744 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6745 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6746 | VkCommandPoolResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6747 | local_device = device; |
| 6748 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6749 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6750 | countingStream->rewind(); |
| 6751 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6752 | uint64_t cgen_var_482; |
| 6753 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_482, 1); |
| 6754 | countingStream->write((uint64_t*)&cgen_var_482, 1 * 8); |
| 6755 | uint64_t cgen_var_483; |
| 6756 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_483, 1); |
| 6757 | countingStream->write((uint64_t*)&cgen_var_483, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6758 | countingStream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6759 | } |
| 6760 | uint32_t packetSize_vkResetCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6761 | countingStream->rewind(); |
| 6762 | uint32_t opcode_vkResetCommandPool = OP_vkResetCommandPool; |
| 6763 | stream->write(&opcode_vkResetCommandPool, sizeof(uint32_t)); |
| 6764 | stream->write(&packetSize_vkResetCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6765 | uint64_t cgen_var_484; |
| 6766 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_484, 1); |
| 6767 | stream->write((uint64_t*)&cgen_var_484, 1 * 8); |
| 6768 | uint64_t cgen_var_485; |
| 6769 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_485, 1); |
| 6770 | stream->write((uint64_t*)&cgen_var_485, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6771 | stream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6772 | AEMU_SCOPED_TRACE("vkResetCommandPool readParams"); |
| 6773 | AEMU_SCOPED_TRACE("vkResetCommandPool returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6774 | VkResult vkResetCommandPool_VkResult_return = (VkResult)0; |
| 6775 | stream->read(&vkResetCommandPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6776 | countingStream->clearPool(); |
| 6777 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6778 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6779 | mImpl->log("finish vkResetCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6780 | return vkResetCommandPool_VkResult_return; |
| 6781 | } |
| 6782 | |
| 6783 | VkResult VkEncoder::vkAllocateCommandBuffers( |
| 6784 | VkDevice device, |
| 6785 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 6786 | VkCommandBuffer* pCommandBuffers) |
| 6787 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6788 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6789 | AEMU_SCOPED_TRACE("vkAllocateCommandBuffers encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6790 | mImpl->log("start vkAllocateCommandBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6791 | auto stream = mImpl->stream(); |
| 6792 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6793 | auto resources = mImpl->resources(); |
| 6794 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6795 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6796 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6797 | VkCommandBufferAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6798 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6799 | local_pAllocateInfo = nullptr; |
| 6800 | if (pAllocateInfo) |
| 6801 | { |
| 6802 | local_pAllocateInfo = (VkCommandBufferAllocateInfo*)pool->alloc(sizeof(const VkCommandBufferAllocateInfo)); |
| 6803 | deepcopy_VkCommandBufferAllocateInfo(pool, pAllocateInfo, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| 6804 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6805 | if (local_pAllocateInfo) |
| 6806 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6807 | transform_tohost_VkCommandBufferAllocateInfo(mImpl->resources(), (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6808 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6809 | countingStream->rewind(); |
| 6810 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6811 | uint64_t cgen_var_486; |
| 6812 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_486, 1); |
| 6813 | countingStream->write((uint64_t*)&cgen_var_486, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6814 | marshal_VkCommandBufferAllocateInfo(countingStream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6815 | if (pAllocateInfo->commandBufferCount) |
| 6816 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6817 | uint64_t* cgen_var_487; |
| 6818 | countingStream->alloc((void**)&cgen_var_487, pAllocateInfo->commandBufferCount * 8); |
| 6819 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_487, pAllocateInfo->commandBufferCount); |
| 6820 | countingStream->write((uint64_t*)cgen_var_487, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6821 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6822 | } |
| 6823 | uint32_t packetSize_vkAllocateCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6824 | countingStream->rewind(); |
| 6825 | uint32_t opcode_vkAllocateCommandBuffers = OP_vkAllocateCommandBuffers; |
| 6826 | stream->write(&opcode_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| 6827 | stream->write(&packetSize_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6828 | uint64_t cgen_var_488; |
| 6829 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_488, 1); |
| 6830 | stream->write((uint64_t*)&cgen_var_488, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6831 | marshal_VkCommandBufferAllocateInfo(stream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6832 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6833 | if (pAllocateInfo->commandBufferCount) |
| 6834 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6835 | uint64_t* cgen_var_489; |
| 6836 | stream->alloc((void**)&cgen_var_489, pAllocateInfo->commandBufferCount * 8); |
| 6837 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_489, pAllocateInfo->commandBufferCount); |
| 6838 | stream->write((uint64_t*)cgen_var_489, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6839 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6840 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6841 | AEMU_SCOPED_TRACE("vkAllocateCommandBuffers readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6842 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6843 | if (pAllocateInfo->commandBufferCount) |
| 6844 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6845 | uint64_t* cgen_var_490; |
| 6846 | stream->alloc((void**)&cgen_var_490, pAllocateInfo->commandBufferCount * 8); |
| 6847 | stream->read((uint64_t*)cgen_var_490, pAllocateInfo->commandBufferCount * 8); |
| 6848 | stream->handleMapping()->mapHandles_u64_VkCommandBuffer(cgen_var_490, (VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6849 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6850 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6851 | AEMU_SCOPED_TRACE("vkAllocateCommandBuffers returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6852 | VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0; |
| 6853 | stream->read(&vkAllocateCommandBuffers_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6854 | countingStream->clearPool(); |
| 6855 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6856 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6857 | mImpl->log("finish vkAllocateCommandBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6858 | return vkAllocateCommandBuffers_VkResult_return; |
| 6859 | } |
| 6860 | |
| 6861 | void VkEncoder::vkFreeCommandBuffers( |
| 6862 | VkDevice device, |
| 6863 | VkCommandPool commandPool, |
| 6864 | uint32_t commandBufferCount, |
| 6865 | const VkCommandBuffer* pCommandBuffers) |
| 6866 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6867 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6868 | AEMU_SCOPED_TRACE("vkFreeCommandBuffers encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6869 | mImpl->log("start vkFreeCommandBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6870 | auto stream = mImpl->stream(); |
| 6871 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6872 | auto resources = mImpl->resources(); |
| 6873 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6874 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6875 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6876 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6877 | uint32_t local_commandBufferCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6878 | VkCommandBuffer* local_pCommandBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6879 | local_device = device; |
| 6880 | local_commandPool = commandPool; |
| 6881 | local_commandBufferCount = commandBufferCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6882 | local_pCommandBuffers = nullptr; |
| 6883 | if (pCommandBuffers) |
| 6884 | { |
| 6885 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 6886 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6887 | countingStream->rewind(); |
| 6888 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6889 | uint64_t cgen_var_491; |
| 6890 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_491, 1); |
| 6891 | countingStream->write((uint64_t*)&cgen_var_491, 1 * 8); |
| 6892 | uint64_t cgen_var_492; |
| 6893 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_492, 1); |
| 6894 | countingStream->write((uint64_t*)&cgen_var_492, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6895 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6896 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6897 | uint64_t cgen_var_493 = (uint64_t)(uintptr_t)local_pCommandBuffers; |
| 6898 | countingStream->putBe64(cgen_var_493); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6899 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6900 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6901 | if (((commandBufferCount))) |
| 6902 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6903 | uint64_t* cgen_var_494; |
| 6904 | countingStream->alloc((void**)&cgen_var_494, ((commandBufferCount)) * 8); |
| 6905 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_494, ((commandBufferCount))); |
| 6906 | countingStream->write((uint64_t*)cgen_var_494, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6907 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6908 | } |
| 6909 | } |
| 6910 | uint32_t packetSize_vkFreeCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6911 | countingStream->rewind(); |
| 6912 | uint32_t opcode_vkFreeCommandBuffers = OP_vkFreeCommandBuffers; |
| 6913 | stream->write(&opcode_vkFreeCommandBuffers, sizeof(uint32_t)); |
| 6914 | stream->write(&packetSize_vkFreeCommandBuffers, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6915 | uint64_t cgen_var_495; |
| 6916 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_495, 1); |
| 6917 | stream->write((uint64_t*)&cgen_var_495, 1 * 8); |
| 6918 | uint64_t cgen_var_496; |
| 6919 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_496, 1); |
| 6920 | stream->write((uint64_t*)&cgen_var_496, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6921 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6922 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6923 | uint64_t cgen_var_497 = (uint64_t)(uintptr_t)local_pCommandBuffers; |
| 6924 | stream->putBe64(cgen_var_497); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6925 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6926 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6927 | if (((commandBufferCount))) |
| 6928 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6929 | uint64_t* cgen_var_498; |
| 6930 | stream->alloc((void**)&cgen_var_498, ((commandBufferCount)) * 8); |
| 6931 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_498, ((commandBufferCount))); |
| 6932 | stream->write((uint64_t*)cgen_var_498, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6933 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6934 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6935 | AEMU_SCOPED_TRACE("vkFreeCommandBuffers readParams"); |
| 6936 | AEMU_SCOPED_TRACE("vkFreeCommandBuffers returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6937 | if (pCommandBuffers) |
| 6938 | { |
| 6939 | resources->destroyMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, ((commandBufferCount))); |
| 6940 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6941 | mImpl->log("finish vkFreeCommandBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6942 | } |
| 6943 | |
| 6944 | VkResult VkEncoder::vkBeginCommandBuffer( |
| 6945 | VkCommandBuffer commandBuffer, |
| 6946 | const VkCommandBufferBeginInfo* pBeginInfo) |
| 6947 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6948 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6949 | AEMU_SCOPED_TRACE("vkBeginCommandBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6950 | mImpl->log("start vkBeginCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6951 | auto stream = mImpl->stream(); |
| 6952 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6953 | auto resources = mImpl->resources(); |
| 6954 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6955 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6956 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6957 | VkCommandBufferBeginInfo* local_pBeginInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6958 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6959 | local_pBeginInfo = nullptr; |
| 6960 | if (pBeginInfo) |
| 6961 | { |
| 6962 | local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo)); |
| 6963 | deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 6964 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6965 | if (local_pBeginInfo) |
| 6966 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6967 | transform_tohost_VkCommandBufferBeginInfo(mImpl->resources(), (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6968 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6969 | countingStream->rewind(); |
| 6970 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6971 | uint64_t cgen_var_499; |
| 6972 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_499, 1); |
| 6973 | countingStream->write((uint64_t*)&cgen_var_499, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6974 | marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6975 | } |
| 6976 | uint32_t packetSize_vkBeginCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6977 | countingStream->rewind(); |
| 6978 | uint32_t opcode_vkBeginCommandBuffer = OP_vkBeginCommandBuffer; |
| 6979 | stream->write(&opcode_vkBeginCommandBuffer, sizeof(uint32_t)); |
| 6980 | stream->write(&packetSize_vkBeginCommandBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6981 | uint64_t cgen_var_500; |
| 6982 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_500, 1); |
| 6983 | stream->write((uint64_t*)&cgen_var_500, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6984 | marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6985 | AEMU_SCOPED_TRACE("vkBeginCommandBuffer readParams"); |
| 6986 | AEMU_SCOPED_TRACE("vkBeginCommandBuffer returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6987 | VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0; |
| 6988 | stream->read(&vkBeginCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6989 | countingStream->clearPool(); |
| 6990 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6991 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6992 | mImpl->log("finish vkBeginCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6993 | return vkBeginCommandBuffer_VkResult_return; |
| 6994 | } |
| 6995 | |
| 6996 | VkResult VkEncoder::vkEndCommandBuffer( |
| 6997 | VkCommandBuffer commandBuffer) |
| 6998 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6999 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7000 | AEMU_SCOPED_TRACE("vkEndCommandBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7001 | mImpl->log("start vkEndCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7002 | auto stream = mImpl->stream(); |
| 7003 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7004 | auto resources = mImpl->resources(); |
| 7005 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7006 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7007 | VkCommandBuffer local_commandBuffer; |
| 7008 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7009 | countingStream->rewind(); |
| 7010 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7011 | uint64_t cgen_var_501; |
| 7012 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_501, 1); |
| 7013 | countingStream->write((uint64_t*)&cgen_var_501, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7014 | } |
| 7015 | uint32_t packetSize_vkEndCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7016 | countingStream->rewind(); |
| 7017 | uint32_t opcode_vkEndCommandBuffer = OP_vkEndCommandBuffer; |
| 7018 | stream->write(&opcode_vkEndCommandBuffer, sizeof(uint32_t)); |
| 7019 | stream->write(&packetSize_vkEndCommandBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7020 | uint64_t cgen_var_502; |
| 7021 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_502, 1); |
| 7022 | stream->write((uint64_t*)&cgen_var_502, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7023 | AEMU_SCOPED_TRACE("vkEndCommandBuffer readParams"); |
| 7024 | AEMU_SCOPED_TRACE("vkEndCommandBuffer returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7025 | VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0; |
| 7026 | stream->read(&vkEndCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7027 | countingStream->clearPool(); |
| 7028 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7029 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7030 | mImpl->log("finish vkEndCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7031 | return vkEndCommandBuffer_VkResult_return; |
| 7032 | } |
| 7033 | |
| 7034 | VkResult VkEncoder::vkResetCommandBuffer( |
| 7035 | VkCommandBuffer commandBuffer, |
| 7036 | VkCommandBufferResetFlags flags) |
| 7037 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7038 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7039 | AEMU_SCOPED_TRACE("vkResetCommandBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7040 | mImpl->log("start vkResetCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7041 | auto stream = mImpl->stream(); |
| 7042 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7043 | auto resources = mImpl->resources(); |
| 7044 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7045 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7046 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7047 | VkCommandBufferResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7048 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7049 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7050 | countingStream->rewind(); |
| 7051 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7052 | uint64_t cgen_var_503; |
| 7053 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_503, 1); |
| 7054 | countingStream->write((uint64_t*)&cgen_var_503, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7055 | countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7056 | } |
| 7057 | uint32_t packetSize_vkResetCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7058 | countingStream->rewind(); |
| 7059 | uint32_t opcode_vkResetCommandBuffer = OP_vkResetCommandBuffer; |
| 7060 | stream->write(&opcode_vkResetCommandBuffer, sizeof(uint32_t)); |
| 7061 | stream->write(&packetSize_vkResetCommandBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7062 | uint64_t cgen_var_504; |
| 7063 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_504, 1); |
| 7064 | stream->write((uint64_t*)&cgen_var_504, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7065 | stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7066 | AEMU_SCOPED_TRACE("vkResetCommandBuffer readParams"); |
| 7067 | AEMU_SCOPED_TRACE("vkResetCommandBuffer returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7068 | VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0; |
| 7069 | stream->read(&vkResetCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7070 | countingStream->clearPool(); |
| 7071 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7072 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7073 | mImpl->log("finish vkResetCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7074 | return vkResetCommandBuffer_VkResult_return; |
| 7075 | } |
| 7076 | |
| 7077 | void VkEncoder::vkCmdBindPipeline( |
| 7078 | VkCommandBuffer commandBuffer, |
| 7079 | VkPipelineBindPoint pipelineBindPoint, |
| 7080 | VkPipeline pipeline) |
| 7081 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7082 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7083 | AEMU_SCOPED_TRACE("vkCmdBindPipeline encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7084 | mImpl->log("start vkCmdBindPipeline"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7085 | auto stream = mImpl->stream(); |
| 7086 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7087 | auto resources = mImpl->resources(); |
| 7088 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7089 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7090 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7091 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7092 | VkPipeline local_pipeline; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7093 | local_commandBuffer = commandBuffer; |
| 7094 | local_pipelineBindPoint = pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7095 | local_pipeline = pipeline; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7096 | countingStream->rewind(); |
| 7097 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7098 | uint64_t cgen_var_505; |
| 7099 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_505, 1); |
| 7100 | countingStream->write((uint64_t*)&cgen_var_505, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7101 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7102 | uint64_t cgen_var_506; |
| 7103 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_506, 1); |
| 7104 | countingStream->write((uint64_t*)&cgen_var_506, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7105 | } |
| 7106 | uint32_t packetSize_vkCmdBindPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7107 | countingStream->rewind(); |
| 7108 | uint32_t opcode_vkCmdBindPipeline = OP_vkCmdBindPipeline; |
| 7109 | stream->write(&opcode_vkCmdBindPipeline, sizeof(uint32_t)); |
| 7110 | stream->write(&packetSize_vkCmdBindPipeline, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7111 | uint64_t cgen_var_507; |
| 7112 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_507, 1); |
| 7113 | stream->write((uint64_t*)&cgen_var_507, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7114 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7115 | uint64_t cgen_var_508; |
| 7116 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_508, 1); |
| 7117 | stream->write((uint64_t*)&cgen_var_508, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7118 | AEMU_SCOPED_TRACE("vkCmdBindPipeline readParams"); |
| 7119 | AEMU_SCOPED_TRACE("vkCmdBindPipeline returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7120 | mImpl->log("finish vkCmdBindPipeline");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7121 | } |
| 7122 | |
| 7123 | void VkEncoder::vkCmdSetViewport( |
| 7124 | VkCommandBuffer commandBuffer, |
| 7125 | uint32_t firstViewport, |
| 7126 | uint32_t viewportCount, |
| 7127 | const VkViewport* pViewports) |
| 7128 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7129 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7130 | AEMU_SCOPED_TRACE("vkCmdSetViewport encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7131 | mImpl->log("start vkCmdSetViewport"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7132 | auto stream = mImpl->stream(); |
| 7133 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7134 | auto resources = mImpl->resources(); |
| 7135 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7136 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7137 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7138 | uint32_t local_firstViewport; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7139 | uint32_t local_viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7140 | VkViewport* local_pViewports; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7141 | local_commandBuffer = commandBuffer; |
| 7142 | local_firstViewport = firstViewport; |
| 7143 | local_viewportCount = viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7144 | local_pViewports = nullptr; |
| 7145 | if (pViewports) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7146 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7147 | local_pViewports = (VkViewport*)pool->alloc(((viewportCount)) * sizeof(const VkViewport)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7148 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 7149 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7150 | deepcopy_VkViewport(pool, pViewports + i, (VkViewport*)(local_pViewports + i)); |
| 7151 | } |
| 7152 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7153 | if (local_pViewports) |
| 7154 | { |
| 7155 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 7156 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7157 | transform_tohost_VkViewport(mImpl->resources(), (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7158 | } |
| 7159 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7160 | countingStream->rewind(); |
| 7161 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7162 | uint64_t cgen_var_509; |
| 7163 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_509, 1); |
| 7164 | countingStream->write((uint64_t*)&cgen_var_509, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7165 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 7166 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 7167 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 7168 | { |
| 7169 | marshal_VkViewport(countingStream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7170 | } |
| 7171 | } |
| 7172 | uint32_t packetSize_vkCmdSetViewport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7173 | countingStream->rewind(); |
| 7174 | uint32_t opcode_vkCmdSetViewport = OP_vkCmdSetViewport; |
| 7175 | stream->write(&opcode_vkCmdSetViewport, sizeof(uint32_t)); |
| 7176 | stream->write(&packetSize_vkCmdSetViewport, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7177 | uint64_t cgen_var_510; |
| 7178 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_510, 1); |
| 7179 | stream->write((uint64_t*)&cgen_var_510, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7180 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 7181 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7182 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 7183 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7184 | marshal_VkViewport(stream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7185 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7186 | AEMU_SCOPED_TRACE("vkCmdSetViewport readParams"); |
| 7187 | AEMU_SCOPED_TRACE("vkCmdSetViewport returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7188 | mImpl->log("finish vkCmdSetViewport");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7189 | } |
| 7190 | |
| 7191 | void VkEncoder::vkCmdSetScissor( |
| 7192 | VkCommandBuffer commandBuffer, |
| 7193 | uint32_t firstScissor, |
| 7194 | uint32_t scissorCount, |
| 7195 | const VkRect2D* pScissors) |
| 7196 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7197 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7198 | AEMU_SCOPED_TRACE("vkCmdSetScissor encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7199 | mImpl->log("start vkCmdSetScissor"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7200 | auto stream = mImpl->stream(); |
| 7201 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7202 | auto resources = mImpl->resources(); |
| 7203 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7204 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7205 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7206 | uint32_t local_firstScissor; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7207 | uint32_t local_scissorCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7208 | VkRect2D* local_pScissors; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7209 | local_commandBuffer = commandBuffer; |
| 7210 | local_firstScissor = firstScissor; |
| 7211 | local_scissorCount = scissorCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7212 | local_pScissors = nullptr; |
| 7213 | if (pScissors) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7214 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7215 | local_pScissors = (VkRect2D*)pool->alloc(((scissorCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7216 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 7217 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7218 | deepcopy_VkRect2D(pool, pScissors + i, (VkRect2D*)(local_pScissors + i)); |
| 7219 | } |
| 7220 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7221 | if (local_pScissors) |
| 7222 | { |
| 7223 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 7224 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7225 | transform_tohost_VkRect2D(mImpl->resources(), (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7226 | } |
| 7227 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7228 | countingStream->rewind(); |
| 7229 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7230 | uint64_t cgen_var_511; |
| 7231 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_511, 1); |
| 7232 | countingStream->write((uint64_t*)&cgen_var_511, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7233 | countingStream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 7234 | countingStream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| 7235 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 7236 | { |
| 7237 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7238 | } |
| 7239 | } |
| 7240 | uint32_t packetSize_vkCmdSetScissor = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7241 | countingStream->rewind(); |
| 7242 | uint32_t opcode_vkCmdSetScissor = OP_vkCmdSetScissor; |
| 7243 | stream->write(&opcode_vkCmdSetScissor, sizeof(uint32_t)); |
| 7244 | stream->write(&packetSize_vkCmdSetScissor, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7245 | uint64_t cgen_var_512; |
| 7246 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_512, 1); |
| 7247 | stream->write((uint64_t*)&cgen_var_512, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7248 | stream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 7249 | stream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7250 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 7251 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7252 | marshal_VkRect2D(stream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7253 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7254 | AEMU_SCOPED_TRACE("vkCmdSetScissor readParams"); |
| 7255 | AEMU_SCOPED_TRACE("vkCmdSetScissor returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7256 | mImpl->log("finish vkCmdSetScissor");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7257 | } |
| 7258 | |
| 7259 | void VkEncoder::vkCmdSetLineWidth( |
| 7260 | VkCommandBuffer commandBuffer, |
| 7261 | float lineWidth) |
| 7262 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7263 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7264 | AEMU_SCOPED_TRACE("vkCmdSetLineWidth encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7265 | mImpl->log("start vkCmdSetLineWidth"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7266 | auto stream = mImpl->stream(); |
| 7267 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7268 | auto resources = mImpl->resources(); |
| 7269 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7270 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7271 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7272 | float local_lineWidth; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7273 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7274 | local_lineWidth = lineWidth; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7275 | countingStream->rewind(); |
| 7276 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7277 | uint64_t cgen_var_513; |
| 7278 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_513, 1); |
| 7279 | countingStream->write((uint64_t*)&cgen_var_513, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7280 | countingStream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7281 | } |
| 7282 | uint32_t packetSize_vkCmdSetLineWidth = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7283 | countingStream->rewind(); |
| 7284 | uint32_t opcode_vkCmdSetLineWidth = OP_vkCmdSetLineWidth; |
| 7285 | stream->write(&opcode_vkCmdSetLineWidth, sizeof(uint32_t)); |
| 7286 | stream->write(&packetSize_vkCmdSetLineWidth, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7287 | uint64_t cgen_var_514; |
| 7288 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_514, 1); |
| 7289 | stream->write((uint64_t*)&cgen_var_514, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7290 | stream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7291 | AEMU_SCOPED_TRACE("vkCmdSetLineWidth readParams"); |
| 7292 | AEMU_SCOPED_TRACE("vkCmdSetLineWidth returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7293 | mImpl->log("finish vkCmdSetLineWidth");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7294 | } |
| 7295 | |
| 7296 | void VkEncoder::vkCmdSetDepthBias( |
| 7297 | VkCommandBuffer commandBuffer, |
| 7298 | float depthBiasConstantFactor, |
| 7299 | float depthBiasClamp, |
| 7300 | float depthBiasSlopeFactor) |
| 7301 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7302 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7303 | AEMU_SCOPED_TRACE("vkCmdSetDepthBias encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7304 | mImpl->log("start vkCmdSetDepthBias"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7305 | auto stream = mImpl->stream(); |
| 7306 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7307 | auto resources = mImpl->resources(); |
| 7308 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7309 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7310 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7311 | float local_depthBiasConstantFactor; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7312 | float local_depthBiasClamp; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7313 | float local_depthBiasSlopeFactor; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7314 | local_commandBuffer = commandBuffer; |
| 7315 | local_depthBiasConstantFactor = depthBiasConstantFactor; |
| 7316 | local_depthBiasClamp = depthBiasClamp; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7317 | local_depthBiasSlopeFactor = depthBiasSlopeFactor; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7318 | countingStream->rewind(); |
| 7319 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7320 | uint64_t cgen_var_515; |
| 7321 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_515, 1); |
| 7322 | countingStream->write((uint64_t*)&cgen_var_515, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7323 | countingStream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 7324 | countingStream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 7325 | countingStream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7326 | } |
| 7327 | uint32_t packetSize_vkCmdSetDepthBias = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7328 | countingStream->rewind(); |
| 7329 | uint32_t opcode_vkCmdSetDepthBias = OP_vkCmdSetDepthBias; |
| 7330 | stream->write(&opcode_vkCmdSetDepthBias, sizeof(uint32_t)); |
| 7331 | stream->write(&packetSize_vkCmdSetDepthBias, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7332 | uint64_t cgen_var_516; |
| 7333 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_516, 1); |
| 7334 | stream->write((uint64_t*)&cgen_var_516, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7335 | stream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 7336 | stream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 7337 | stream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7338 | AEMU_SCOPED_TRACE("vkCmdSetDepthBias readParams"); |
| 7339 | AEMU_SCOPED_TRACE("vkCmdSetDepthBias returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7340 | mImpl->log("finish vkCmdSetDepthBias");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7341 | } |
| 7342 | |
| 7343 | void VkEncoder::vkCmdSetBlendConstants( |
| 7344 | VkCommandBuffer commandBuffer, |
| Lingfeng Yang | 97ddeb8 | 2019-04-20 14:32:52 -0700 | [diff] [blame] | 7345 | const float blendConstants[4]) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7346 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7347 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7348 | AEMU_SCOPED_TRACE("vkCmdSetBlendConstants encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7349 | mImpl->log("start vkCmdSetBlendConstants"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7350 | auto stream = mImpl->stream(); |
| 7351 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7352 | auto resources = mImpl->resources(); |
| 7353 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7354 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7355 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7356 | float local_blendConstants[4]; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7357 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | bb775b2 | 2019-08-09 08:28:28 -0700 | [diff] [blame^] | 7358 | memcpy(local_blendConstants, blendConstants, 4 * sizeof(const float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7359 | countingStream->rewind(); |
| 7360 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7361 | uint64_t cgen_var_517; |
| 7362 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_517, 1); |
| 7363 | countingStream->write((uint64_t*)&cgen_var_517, 1 * 8); |
| Lingfeng Yang | bb775b2 | 2019-08-09 08:28:28 -0700 | [diff] [blame^] | 7364 | countingStream->write((float*)local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7365 | } |
| 7366 | uint32_t packetSize_vkCmdSetBlendConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7367 | countingStream->rewind(); |
| 7368 | uint32_t opcode_vkCmdSetBlendConstants = OP_vkCmdSetBlendConstants; |
| 7369 | stream->write(&opcode_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| 7370 | stream->write(&packetSize_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7371 | uint64_t cgen_var_518; |
| 7372 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_518, 1); |
| 7373 | stream->write((uint64_t*)&cgen_var_518, 1 * 8); |
| Lingfeng Yang | bb775b2 | 2019-08-09 08:28:28 -0700 | [diff] [blame^] | 7374 | stream->write((float*)local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7375 | AEMU_SCOPED_TRACE("vkCmdSetBlendConstants readParams"); |
| 7376 | AEMU_SCOPED_TRACE("vkCmdSetBlendConstants returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7377 | mImpl->log("finish vkCmdSetBlendConstants");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7378 | } |
| 7379 | |
| 7380 | void VkEncoder::vkCmdSetDepthBounds( |
| 7381 | VkCommandBuffer commandBuffer, |
| 7382 | float minDepthBounds, |
| 7383 | float maxDepthBounds) |
| 7384 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7385 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7386 | AEMU_SCOPED_TRACE("vkCmdSetDepthBounds encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7387 | mImpl->log("start vkCmdSetDepthBounds"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7388 | auto stream = mImpl->stream(); |
| 7389 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7390 | auto resources = mImpl->resources(); |
| 7391 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7392 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7393 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7394 | float local_minDepthBounds; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7395 | float local_maxDepthBounds; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7396 | local_commandBuffer = commandBuffer; |
| 7397 | local_minDepthBounds = minDepthBounds; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7398 | local_maxDepthBounds = maxDepthBounds; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7399 | countingStream->rewind(); |
| 7400 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7401 | uint64_t cgen_var_519; |
| 7402 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_519, 1); |
| 7403 | countingStream->write((uint64_t*)&cgen_var_519, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7404 | countingStream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 7405 | countingStream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7406 | } |
| 7407 | uint32_t packetSize_vkCmdSetDepthBounds = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7408 | countingStream->rewind(); |
| 7409 | uint32_t opcode_vkCmdSetDepthBounds = OP_vkCmdSetDepthBounds; |
| 7410 | stream->write(&opcode_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| 7411 | stream->write(&packetSize_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7412 | uint64_t cgen_var_520; |
| 7413 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_520, 1); |
| 7414 | stream->write((uint64_t*)&cgen_var_520, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7415 | stream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 7416 | stream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7417 | AEMU_SCOPED_TRACE("vkCmdSetDepthBounds readParams"); |
| 7418 | AEMU_SCOPED_TRACE("vkCmdSetDepthBounds returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7419 | mImpl->log("finish vkCmdSetDepthBounds");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7420 | } |
| 7421 | |
| 7422 | void VkEncoder::vkCmdSetStencilCompareMask( |
| 7423 | VkCommandBuffer commandBuffer, |
| 7424 | VkStencilFaceFlags faceMask, |
| 7425 | uint32_t compareMask) |
| 7426 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7427 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7428 | AEMU_SCOPED_TRACE("vkCmdSetStencilCompareMask encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7429 | mImpl->log("start vkCmdSetStencilCompareMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7430 | auto stream = mImpl->stream(); |
| 7431 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7432 | auto resources = mImpl->resources(); |
| 7433 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7434 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7435 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7436 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7437 | uint32_t local_compareMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7438 | local_commandBuffer = commandBuffer; |
| 7439 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7440 | local_compareMask = compareMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7441 | countingStream->rewind(); |
| 7442 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7443 | uint64_t cgen_var_521; |
| 7444 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_521, 1); |
| 7445 | countingStream->write((uint64_t*)&cgen_var_521, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7446 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7447 | countingStream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7448 | } |
| 7449 | uint32_t packetSize_vkCmdSetStencilCompareMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7450 | countingStream->rewind(); |
| 7451 | uint32_t opcode_vkCmdSetStencilCompareMask = OP_vkCmdSetStencilCompareMask; |
| 7452 | stream->write(&opcode_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| 7453 | stream->write(&packetSize_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7454 | uint64_t cgen_var_522; |
| 7455 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_522, 1); |
| 7456 | stream->write((uint64_t*)&cgen_var_522, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7457 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7458 | stream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7459 | AEMU_SCOPED_TRACE("vkCmdSetStencilCompareMask readParams"); |
| 7460 | AEMU_SCOPED_TRACE("vkCmdSetStencilCompareMask returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7461 | mImpl->log("finish vkCmdSetStencilCompareMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7462 | } |
| 7463 | |
| 7464 | void VkEncoder::vkCmdSetStencilWriteMask( |
| 7465 | VkCommandBuffer commandBuffer, |
| 7466 | VkStencilFaceFlags faceMask, |
| 7467 | uint32_t writeMask) |
| 7468 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7469 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7470 | AEMU_SCOPED_TRACE("vkCmdSetStencilWriteMask encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7471 | mImpl->log("start vkCmdSetStencilWriteMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7472 | auto stream = mImpl->stream(); |
| 7473 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7474 | auto resources = mImpl->resources(); |
| 7475 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7476 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7477 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7478 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7479 | uint32_t local_writeMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7480 | local_commandBuffer = commandBuffer; |
| 7481 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7482 | local_writeMask = writeMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7483 | countingStream->rewind(); |
| 7484 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7485 | uint64_t cgen_var_523; |
| 7486 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_523, 1); |
| 7487 | countingStream->write((uint64_t*)&cgen_var_523, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7488 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7489 | countingStream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7490 | } |
| 7491 | uint32_t packetSize_vkCmdSetStencilWriteMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7492 | countingStream->rewind(); |
| 7493 | uint32_t opcode_vkCmdSetStencilWriteMask = OP_vkCmdSetStencilWriteMask; |
| 7494 | stream->write(&opcode_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| 7495 | stream->write(&packetSize_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7496 | uint64_t cgen_var_524; |
| 7497 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_524, 1); |
| 7498 | stream->write((uint64_t*)&cgen_var_524, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7499 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7500 | stream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7501 | AEMU_SCOPED_TRACE("vkCmdSetStencilWriteMask readParams"); |
| 7502 | AEMU_SCOPED_TRACE("vkCmdSetStencilWriteMask returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7503 | mImpl->log("finish vkCmdSetStencilWriteMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7504 | } |
| 7505 | |
| 7506 | void VkEncoder::vkCmdSetStencilReference( |
| 7507 | VkCommandBuffer commandBuffer, |
| 7508 | VkStencilFaceFlags faceMask, |
| 7509 | uint32_t reference) |
| 7510 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7511 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7512 | AEMU_SCOPED_TRACE("vkCmdSetStencilReference encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7513 | mImpl->log("start vkCmdSetStencilReference"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7514 | auto stream = mImpl->stream(); |
| 7515 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7516 | auto resources = mImpl->resources(); |
| 7517 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7518 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7519 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7520 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7521 | uint32_t local_reference; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7522 | local_commandBuffer = commandBuffer; |
| 7523 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7524 | local_reference = reference; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7525 | countingStream->rewind(); |
| 7526 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7527 | uint64_t cgen_var_525; |
| 7528 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_525, 1); |
| 7529 | countingStream->write((uint64_t*)&cgen_var_525, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7530 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7531 | countingStream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7532 | } |
| 7533 | uint32_t packetSize_vkCmdSetStencilReference = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7534 | countingStream->rewind(); |
| 7535 | uint32_t opcode_vkCmdSetStencilReference = OP_vkCmdSetStencilReference; |
| 7536 | stream->write(&opcode_vkCmdSetStencilReference, sizeof(uint32_t)); |
| 7537 | stream->write(&packetSize_vkCmdSetStencilReference, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7538 | uint64_t cgen_var_526; |
| 7539 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_526, 1); |
| 7540 | stream->write((uint64_t*)&cgen_var_526, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7541 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7542 | stream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7543 | AEMU_SCOPED_TRACE("vkCmdSetStencilReference readParams"); |
| 7544 | AEMU_SCOPED_TRACE("vkCmdSetStencilReference returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7545 | mImpl->log("finish vkCmdSetStencilReference");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7546 | } |
| 7547 | |
| 7548 | void VkEncoder::vkCmdBindDescriptorSets( |
| 7549 | VkCommandBuffer commandBuffer, |
| 7550 | VkPipelineBindPoint pipelineBindPoint, |
| 7551 | VkPipelineLayout layout, |
| 7552 | uint32_t firstSet, |
| 7553 | uint32_t descriptorSetCount, |
| 7554 | const VkDescriptorSet* pDescriptorSets, |
| 7555 | uint32_t dynamicOffsetCount, |
| 7556 | const uint32_t* pDynamicOffsets) |
| 7557 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7558 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7559 | AEMU_SCOPED_TRACE("vkCmdBindDescriptorSets encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7560 | mImpl->log("start vkCmdBindDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7561 | auto stream = mImpl->stream(); |
| 7562 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7563 | auto resources = mImpl->resources(); |
| 7564 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7565 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7566 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7567 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7568 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7569 | uint32_t local_firstSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7570 | uint32_t local_descriptorSetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7571 | VkDescriptorSet* local_pDescriptorSets; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7572 | uint32_t local_dynamicOffsetCount; |
| 7573 | uint32_t* local_pDynamicOffsets; |
| 7574 | local_commandBuffer = commandBuffer; |
| 7575 | local_pipelineBindPoint = pipelineBindPoint; |
| 7576 | local_layout = layout; |
| 7577 | local_firstSet = firstSet; |
| 7578 | local_descriptorSetCount = descriptorSetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7579 | local_pDescriptorSets = nullptr; |
| 7580 | if (pDescriptorSets) |
| 7581 | { |
| 7582 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 7583 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7584 | local_dynamicOffsetCount = dynamicOffsetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7585 | local_pDynamicOffsets = nullptr; |
| 7586 | if (pDynamicOffsets) |
| 7587 | { |
| 7588 | local_pDynamicOffsets = (uint32_t*)pool->dupArray(pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(const uint32_t)); |
| 7589 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7590 | countingStream->rewind(); |
| 7591 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7592 | uint64_t cgen_var_527; |
| 7593 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_527, 1); |
| 7594 | countingStream->write((uint64_t*)&cgen_var_527, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7595 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7596 | uint64_t cgen_var_528; |
| 7597 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_528, 1); |
| 7598 | countingStream->write((uint64_t*)&cgen_var_528, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7599 | countingStream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 7600 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7601 | if (((descriptorSetCount))) |
| 7602 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7603 | uint64_t* cgen_var_529; |
| 7604 | countingStream->alloc((void**)&cgen_var_529, ((descriptorSetCount)) * 8); |
| 7605 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_529, ((descriptorSetCount))); |
| 7606 | countingStream->write((uint64_t*)cgen_var_529, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7607 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7608 | countingStream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 7609 | countingStream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7610 | } |
| 7611 | uint32_t packetSize_vkCmdBindDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7612 | countingStream->rewind(); |
| 7613 | uint32_t opcode_vkCmdBindDescriptorSets = OP_vkCmdBindDescriptorSets; |
| 7614 | stream->write(&opcode_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| 7615 | stream->write(&packetSize_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7616 | uint64_t cgen_var_530; |
| 7617 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_530, 1); |
| 7618 | stream->write((uint64_t*)&cgen_var_530, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7619 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7620 | uint64_t cgen_var_531; |
| 7621 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_531, 1); |
| 7622 | stream->write((uint64_t*)&cgen_var_531, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7623 | stream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 7624 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7625 | if (((descriptorSetCount))) |
| 7626 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7627 | uint64_t* cgen_var_532; |
| 7628 | stream->alloc((void**)&cgen_var_532, ((descriptorSetCount)) * 8); |
| 7629 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_532, ((descriptorSetCount))); |
| 7630 | stream->write((uint64_t*)cgen_var_532, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7631 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7632 | stream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 7633 | stream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7634 | AEMU_SCOPED_TRACE("vkCmdBindDescriptorSets readParams"); |
| 7635 | AEMU_SCOPED_TRACE("vkCmdBindDescriptorSets returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7636 | mImpl->log("finish vkCmdBindDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7637 | } |
| 7638 | |
| 7639 | void VkEncoder::vkCmdBindIndexBuffer( |
| 7640 | VkCommandBuffer commandBuffer, |
| 7641 | VkBuffer buffer, |
| 7642 | VkDeviceSize offset, |
| 7643 | VkIndexType indexType) |
| 7644 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7645 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7646 | AEMU_SCOPED_TRACE("vkCmdBindIndexBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7647 | mImpl->log("start vkCmdBindIndexBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7648 | auto stream = mImpl->stream(); |
| 7649 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7650 | auto resources = mImpl->resources(); |
| 7651 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7652 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7653 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7654 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7655 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7656 | VkIndexType local_indexType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7657 | local_commandBuffer = commandBuffer; |
| 7658 | local_buffer = buffer; |
| 7659 | local_offset = offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7660 | local_indexType = indexType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7661 | countingStream->rewind(); |
| 7662 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7663 | uint64_t cgen_var_533; |
| 7664 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_533, 1); |
| 7665 | countingStream->write((uint64_t*)&cgen_var_533, 1 * 8); |
| 7666 | uint64_t cgen_var_534; |
| 7667 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_534, 1); |
| 7668 | countingStream->write((uint64_t*)&cgen_var_534, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7669 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7670 | countingStream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7671 | } |
| 7672 | uint32_t packetSize_vkCmdBindIndexBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7673 | countingStream->rewind(); |
| 7674 | uint32_t opcode_vkCmdBindIndexBuffer = OP_vkCmdBindIndexBuffer; |
| 7675 | stream->write(&opcode_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| 7676 | stream->write(&packetSize_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7677 | uint64_t cgen_var_535; |
| 7678 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_535, 1); |
| 7679 | stream->write((uint64_t*)&cgen_var_535, 1 * 8); |
| 7680 | uint64_t cgen_var_536; |
| 7681 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_536, 1); |
| 7682 | stream->write((uint64_t*)&cgen_var_536, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7683 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7684 | stream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7685 | AEMU_SCOPED_TRACE("vkCmdBindIndexBuffer readParams"); |
| 7686 | AEMU_SCOPED_TRACE("vkCmdBindIndexBuffer returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7687 | mImpl->log("finish vkCmdBindIndexBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7688 | } |
| 7689 | |
| 7690 | void VkEncoder::vkCmdBindVertexBuffers( |
| 7691 | VkCommandBuffer commandBuffer, |
| 7692 | uint32_t firstBinding, |
| 7693 | uint32_t bindingCount, |
| 7694 | const VkBuffer* pBuffers, |
| 7695 | const VkDeviceSize* pOffsets) |
| 7696 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7697 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7698 | AEMU_SCOPED_TRACE("vkCmdBindVertexBuffers encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7699 | mImpl->log("start vkCmdBindVertexBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7700 | auto stream = mImpl->stream(); |
| 7701 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7702 | auto resources = mImpl->resources(); |
| 7703 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7704 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7705 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7706 | uint32_t local_firstBinding; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7707 | uint32_t local_bindingCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7708 | VkBuffer* local_pBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7709 | VkDeviceSize* local_pOffsets; |
| 7710 | local_commandBuffer = commandBuffer; |
| 7711 | local_firstBinding = firstBinding; |
| 7712 | local_bindingCount = bindingCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7713 | local_pBuffers = nullptr; |
| 7714 | if (pBuffers) |
| 7715 | { |
| 7716 | local_pBuffers = (VkBuffer*)pool->dupArray(pBuffers, ((bindingCount)) * sizeof(const VkBuffer)); |
| 7717 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7718 | local_pOffsets = nullptr; |
| 7719 | if (pOffsets) |
| 7720 | { |
| 7721 | local_pOffsets = (VkDeviceSize*)pool->dupArray(pOffsets, ((bindingCount)) * sizeof(const VkDeviceSize)); |
| 7722 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7723 | countingStream->rewind(); |
| 7724 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7725 | uint64_t cgen_var_537; |
| 7726 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_537, 1); |
| 7727 | countingStream->write((uint64_t*)&cgen_var_537, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7728 | countingStream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 7729 | countingStream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7730 | if (((bindingCount))) |
| 7731 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7732 | uint64_t* cgen_var_538; |
| 7733 | countingStream->alloc((void**)&cgen_var_538, ((bindingCount)) * 8); |
| 7734 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_538, ((bindingCount))); |
| 7735 | countingStream->write((uint64_t*)cgen_var_538, ((bindingCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7736 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7737 | countingStream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7738 | } |
| 7739 | uint32_t packetSize_vkCmdBindVertexBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7740 | countingStream->rewind(); |
| 7741 | uint32_t opcode_vkCmdBindVertexBuffers = OP_vkCmdBindVertexBuffers; |
| 7742 | stream->write(&opcode_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| 7743 | stream->write(&packetSize_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7744 | uint64_t cgen_var_539; |
| 7745 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_539, 1); |
| 7746 | stream->write((uint64_t*)&cgen_var_539, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7747 | stream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 7748 | stream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7749 | if (((bindingCount))) |
| 7750 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7751 | uint64_t* cgen_var_540; |
| 7752 | stream->alloc((void**)&cgen_var_540, ((bindingCount)) * 8); |
| 7753 | stream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_540, ((bindingCount))); |
| 7754 | stream->write((uint64_t*)cgen_var_540, ((bindingCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7755 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7756 | stream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7757 | AEMU_SCOPED_TRACE("vkCmdBindVertexBuffers readParams"); |
| 7758 | AEMU_SCOPED_TRACE("vkCmdBindVertexBuffers returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7759 | mImpl->log("finish vkCmdBindVertexBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7760 | } |
| 7761 | |
| 7762 | void VkEncoder::vkCmdDraw( |
| 7763 | VkCommandBuffer commandBuffer, |
| 7764 | uint32_t vertexCount, |
| 7765 | uint32_t instanceCount, |
| 7766 | uint32_t firstVertex, |
| 7767 | uint32_t firstInstance) |
| 7768 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7769 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7770 | AEMU_SCOPED_TRACE("vkCmdDraw encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7771 | mImpl->log("start vkCmdDraw"); |
| 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 | uint32_t local_vertexCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7779 | uint32_t local_instanceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7780 | uint32_t local_firstVertex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7781 | uint32_t local_firstInstance; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7782 | local_commandBuffer = commandBuffer; |
| 7783 | local_vertexCount = vertexCount; |
| 7784 | local_instanceCount = instanceCount; |
| 7785 | local_firstVertex = firstVertex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7786 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7787 | countingStream->rewind(); |
| 7788 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7789 | uint64_t cgen_var_541; |
| 7790 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_541, 1); |
| 7791 | countingStream->write((uint64_t*)&cgen_var_541, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7792 | countingStream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 7793 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7794 | countingStream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 7795 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7796 | } |
| 7797 | uint32_t packetSize_vkCmdDraw = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7798 | countingStream->rewind(); |
| 7799 | uint32_t opcode_vkCmdDraw = OP_vkCmdDraw; |
| 7800 | stream->write(&opcode_vkCmdDraw, sizeof(uint32_t)); |
| 7801 | stream->write(&packetSize_vkCmdDraw, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7802 | uint64_t cgen_var_542; |
| 7803 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_542, 1); |
| 7804 | stream->write((uint64_t*)&cgen_var_542, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7805 | stream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 7806 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7807 | stream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 7808 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7809 | AEMU_SCOPED_TRACE("vkCmdDraw readParams"); |
| 7810 | AEMU_SCOPED_TRACE("vkCmdDraw returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7811 | mImpl->log("finish vkCmdDraw");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7812 | } |
| 7813 | |
| 7814 | void VkEncoder::vkCmdDrawIndexed( |
| 7815 | VkCommandBuffer commandBuffer, |
| 7816 | uint32_t indexCount, |
| 7817 | uint32_t instanceCount, |
| 7818 | uint32_t firstIndex, |
| 7819 | int32_t vertexOffset, |
| 7820 | uint32_t firstInstance) |
| 7821 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7822 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7823 | AEMU_SCOPED_TRACE("vkCmdDrawIndexed encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7824 | mImpl->log("start vkCmdDrawIndexed"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7825 | auto stream = mImpl->stream(); |
| 7826 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7827 | auto resources = mImpl->resources(); |
| 7828 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7829 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7830 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7831 | uint32_t local_indexCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7832 | uint32_t local_instanceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7833 | uint32_t local_firstIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7834 | int32_t local_vertexOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7835 | uint32_t local_firstInstance; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7836 | local_commandBuffer = commandBuffer; |
| 7837 | local_indexCount = indexCount; |
| 7838 | local_instanceCount = instanceCount; |
| 7839 | local_firstIndex = firstIndex; |
| 7840 | local_vertexOffset = vertexOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7841 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7842 | countingStream->rewind(); |
| 7843 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7844 | uint64_t cgen_var_543; |
| 7845 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_543, 1); |
| 7846 | countingStream->write((uint64_t*)&cgen_var_543, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7847 | countingStream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 7848 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7849 | countingStream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 7850 | countingStream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 7851 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7852 | } |
| 7853 | uint32_t packetSize_vkCmdDrawIndexed = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7854 | countingStream->rewind(); |
| 7855 | uint32_t opcode_vkCmdDrawIndexed = OP_vkCmdDrawIndexed; |
| 7856 | stream->write(&opcode_vkCmdDrawIndexed, sizeof(uint32_t)); |
| 7857 | stream->write(&packetSize_vkCmdDrawIndexed, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7858 | uint64_t cgen_var_544; |
| 7859 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_544, 1); |
| 7860 | stream->write((uint64_t*)&cgen_var_544, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7861 | stream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 7862 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7863 | stream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 7864 | stream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 7865 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7866 | AEMU_SCOPED_TRACE("vkCmdDrawIndexed readParams"); |
| 7867 | AEMU_SCOPED_TRACE("vkCmdDrawIndexed returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7868 | mImpl->log("finish vkCmdDrawIndexed");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7869 | } |
| 7870 | |
| 7871 | void VkEncoder::vkCmdDrawIndirect( |
| 7872 | VkCommandBuffer commandBuffer, |
| 7873 | VkBuffer buffer, |
| 7874 | VkDeviceSize offset, |
| 7875 | uint32_t drawCount, |
| 7876 | uint32_t stride) |
| 7877 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7878 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7879 | AEMU_SCOPED_TRACE("vkCmdDrawIndirect encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7880 | mImpl->log("start vkCmdDrawIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7881 | auto stream = mImpl->stream(); |
| 7882 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7883 | auto resources = mImpl->resources(); |
| 7884 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7885 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7886 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7887 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7888 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7889 | uint32_t local_drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7890 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7891 | local_commandBuffer = commandBuffer; |
| 7892 | local_buffer = buffer; |
| 7893 | local_offset = offset; |
| 7894 | local_drawCount = drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7895 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7896 | countingStream->rewind(); |
| 7897 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7898 | uint64_t cgen_var_545; |
| 7899 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_545, 1); |
| 7900 | countingStream->write((uint64_t*)&cgen_var_545, 1 * 8); |
| 7901 | uint64_t cgen_var_546; |
| 7902 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_546, 1); |
| 7903 | countingStream->write((uint64_t*)&cgen_var_546, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7904 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7905 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7906 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7907 | } |
| 7908 | uint32_t packetSize_vkCmdDrawIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7909 | countingStream->rewind(); |
| 7910 | uint32_t opcode_vkCmdDrawIndirect = OP_vkCmdDrawIndirect; |
| 7911 | stream->write(&opcode_vkCmdDrawIndirect, sizeof(uint32_t)); |
| 7912 | stream->write(&packetSize_vkCmdDrawIndirect, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7913 | uint64_t cgen_var_547; |
| 7914 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_547, 1); |
| 7915 | stream->write((uint64_t*)&cgen_var_547, 1 * 8); |
| 7916 | uint64_t cgen_var_548; |
| 7917 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_548, 1); |
| 7918 | stream->write((uint64_t*)&cgen_var_548, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7919 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7920 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7921 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7922 | AEMU_SCOPED_TRACE("vkCmdDrawIndirect readParams"); |
| 7923 | AEMU_SCOPED_TRACE("vkCmdDrawIndirect returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7924 | mImpl->log("finish vkCmdDrawIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7925 | } |
| 7926 | |
| 7927 | void VkEncoder::vkCmdDrawIndexedIndirect( |
| 7928 | VkCommandBuffer commandBuffer, |
| 7929 | VkBuffer buffer, |
| 7930 | VkDeviceSize offset, |
| 7931 | uint32_t drawCount, |
| 7932 | uint32_t stride) |
| 7933 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7934 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7935 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirect encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7936 | mImpl->log("start vkCmdDrawIndexedIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7937 | auto stream = mImpl->stream(); |
| 7938 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7939 | auto resources = mImpl->resources(); |
| 7940 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7941 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7942 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7943 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7944 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7945 | uint32_t local_drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7946 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7947 | local_commandBuffer = commandBuffer; |
| 7948 | local_buffer = buffer; |
| 7949 | local_offset = offset; |
| 7950 | local_drawCount = drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7951 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7952 | countingStream->rewind(); |
| 7953 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7954 | uint64_t cgen_var_549; |
| 7955 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_549, 1); |
| 7956 | countingStream->write((uint64_t*)&cgen_var_549, 1 * 8); |
| 7957 | uint64_t cgen_var_550; |
| 7958 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_550, 1); |
| 7959 | countingStream->write((uint64_t*)&cgen_var_550, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7960 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7961 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7962 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7963 | } |
| 7964 | uint32_t packetSize_vkCmdDrawIndexedIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7965 | countingStream->rewind(); |
| 7966 | uint32_t opcode_vkCmdDrawIndexedIndirect = OP_vkCmdDrawIndexedIndirect; |
| 7967 | stream->write(&opcode_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| 7968 | stream->write(&packetSize_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7969 | uint64_t cgen_var_551; |
| 7970 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_551, 1); |
| 7971 | stream->write((uint64_t*)&cgen_var_551, 1 * 8); |
| 7972 | uint64_t cgen_var_552; |
| 7973 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_552, 1); |
| 7974 | stream->write((uint64_t*)&cgen_var_552, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7975 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7976 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7977 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7978 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirect readParams"); |
| 7979 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirect returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7980 | mImpl->log("finish vkCmdDrawIndexedIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7981 | } |
| 7982 | |
| 7983 | void VkEncoder::vkCmdDispatch( |
| 7984 | VkCommandBuffer commandBuffer, |
| 7985 | uint32_t groupCountX, |
| 7986 | uint32_t groupCountY, |
| 7987 | uint32_t groupCountZ) |
| 7988 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7989 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7990 | AEMU_SCOPED_TRACE("vkCmdDispatch encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7991 | mImpl->log("start vkCmdDispatch"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7992 | auto stream = mImpl->stream(); |
| 7993 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7994 | auto resources = mImpl->resources(); |
| 7995 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7996 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7997 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7998 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7999 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8000 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8001 | local_commandBuffer = commandBuffer; |
| 8002 | local_groupCountX = groupCountX; |
| 8003 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8004 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8005 | countingStream->rewind(); |
| 8006 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8007 | uint64_t cgen_var_553; |
| 8008 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_553, 1); |
| 8009 | countingStream->write((uint64_t*)&cgen_var_553, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8010 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 8011 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 8012 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8013 | } |
| 8014 | uint32_t packetSize_vkCmdDispatch = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8015 | countingStream->rewind(); |
| 8016 | uint32_t opcode_vkCmdDispatch = OP_vkCmdDispatch; |
| 8017 | stream->write(&opcode_vkCmdDispatch, sizeof(uint32_t)); |
| 8018 | stream->write(&packetSize_vkCmdDispatch, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8019 | uint64_t cgen_var_554; |
| 8020 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_554, 1); |
| 8021 | stream->write((uint64_t*)&cgen_var_554, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8022 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 8023 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 8024 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8025 | AEMU_SCOPED_TRACE("vkCmdDispatch readParams"); |
| 8026 | AEMU_SCOPED_TRACE("vkCmdDispatch returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8027 | mImpl->log("finish vkCmdDispatch");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8028 | } |
| 8029 | |
| 8030 | void VkEncoder::vkCmdDispatchIndirect( |
| 8031 | VkCommandBuffer commandBuffer, |
| 8032 | VkBuffer buffer, |
| 8033 | VkDeviceSize offset) |
| 8034 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8035 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8036 | AEMU_SCOPED_TRACE("vkCmdDispatchIndirect encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8037 | mImpl->log("start vkCmdDispatchIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8038 | auto stream = mImpl->stream(); |
| 8039 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8040 | auto resources = mImpl->resources(); |
| 8041 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8042 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8043 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8044 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8045 | VkDeviceSize local_offset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8046 | local_commandBuffer = commandBuffer; |
| 8047 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8048 | local_offset = offset; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8049 | countingStream->rewind(); |
| 8050 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8051 | uint64_t cgen_var_555; |
| 8052 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_555, 1); |
| 8053 | countingStream->write((uint64_t*)&cgen_var_555, 1 * 8); |
| 8054 | uint64_t cgen_var_556; |
| 8055 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_556, 1); |
| 8056 | countingStream->write((uint64_t*)&cgen_var_556, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8057 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8058 | } |
| 8059 | uint32_t packetSize_vkCmdDispatchIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8060 | countingStream->rewind(); |
| 8061 | uint32_t opcode_vkCmdDispatchIndirect = OP_vkCmdDispatchIndirect; |
| 8062 | stream->write(&opcode_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| 8063 | stream->write(&packetSize_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8064 | uint64_t cgen_var_557; |
| 8065 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_557, 1); |
| 8066 | stream->write((uint64_t*)&cgen_var_557, 1 * 8); |
| 8067 | uint64_t cgen_var_558; |
| 8068 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_558, 1); |
| 8069 | stream->write((uint64_t*)&cgen_var_558, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8070 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8071 | AEMU_SCOPED_TRACE("vkCmdDispatchIndirect readParams"); |
| 8072 | AEMU_SCOPED_TRACE("vkCmdDispatchIndirect returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8073 | mImpl->log("finish vkCmdDispatchIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8074 | } |
| 8075 | |
| 8076 | void VkEncoder::vkCmdCopyBuffer( |
| 8077 | VkCommandBuffer commandBuffer, |
| 8078 | VkBuffer srcBuffer, |
| 8079 | VkBuffer dstBuffer, |
| 8080 | uint32_t regionCount, |
| 8081 | const VkBufferCopy* pRegions) |
| 8082 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8083 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8084 | AEMU_SCOPED_TRACE("vkCmdCopyBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8085 | mImpl->log("start vkCmdCopyBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8086 | auto stream = mImpl->stream(); |
| 8087 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8088 | auto resources = mImpl->resources(); |
| 8089 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8090 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8091 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8092 | VkBuffer local_srcBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8093 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8094 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8095 | VkBufferCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8096 | local_commandBuffer = commandBuffer; |
| 8097 | local_srcBuffer = srcBuffer; |
| 8098 | local_dstBuffer = dstBuffer; |
| 8099 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8100 | local_pRegions = nullptr; |
| 8101 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8102 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8103 | local_pRegions = (VkBufferCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8104 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8105 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8106 | deepcopy_VkBufferCopy(pool, pRegions + i, (VkBufferCopy*)(local_pRegions + i)); |
| 8107 | } |
| 8108 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8109 | if (local_pRegions) |
| 8110 | { |
| 8111 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8112 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8113 | transform_tohost_VkBufferCopy(mImpl->resources(), (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8114 | } |
| 8115 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8116 | countingStream->rewind(); |
| 8117 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8118 | uint64_t cgen_var_559; |
| 8119 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_559, 1); |
| 8120 | countingStream->write((uint64_t*)&cgen_var_559, 1 * 8); |
| 8121 | uint64_t cgen_var_560; |
| 8122 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_560, 1); |
| 8123 | countingStream->write((uint64_t*)&cgen_var_560, 1 * 8); |
| 8124 | uint64_t cgen_var_561; |
| 8125 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_561, 1); |
| 8126 | countingStream->write((uint64_t*)&cgen_var_561, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8127 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8128 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8129 | { |
| 8130 | marshal_VkBufferCopy(countingStream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8131 | } |
| 8132 | } |
| 8133 | uint32_t packetSize_vkCmdCopyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8134 | countingStream->rewind(); |
| 8135 | uint32_t opcode_vkCmdCopyBuffer = OP_vkCmdCopyBuffer; |
| 8136 | stream->write(&opcode_vkCmdCopyBuffer, sizeof(uint32_t)); |
| 8137 | stream->write(&packetSize_vkCmdCopyBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8138 | uint64_t cgen_var_562; |
| 8139 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_562, 1); |
| 8140 | stream->write((uint64_t*)&cgen_var_562, 1 * 8); |
| 8141 | uint64_t cgen_var_563; |
| 8142 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_563, 1); |
| 8143 | stream->write((uint64_t*)&cgen_var_563, 1 * 8); |
| 8144 | uint64_t cgen_var_564; |
| 8145 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_564, 1); |
| 8146 | stream->write((uint64_t*)&cgen_var_564, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8147 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8148 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8149 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8150 | marshal_VkBufferCopy(stream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8151 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8152 | AEMU_SCOPED_TRACE("vkCmdCopyBuffer readParams"); |
| 8153 | AEMU_SCOPED_TRACE("vkCmdCopyBuffer returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8154 | mImpl->log("finish vkCmdCopyBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8155 | } |
| 8156 | |
| 8157 | void VkEncoder::vkCmdCopyImage( |
| 8158 | VkCommandBuffer commandBuffer, |
| 8159 | VkImage srcImage, |
| 8160 | VkImageLayout srcImageLayout, |
| 8161 | VkImage dstImage, |
| 8162 | VkImageLayout dstImageLayout, |
| 8163 | uint32_t regionCount, |
| 8164 | const VkImageCopy* pRegions) |
| 8165 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8166 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8167 | AEMU_SCOPED_TRACE("vkCmdCopyImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8168 | mImpl->log("start vkCmdCopyImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8169 | auto stream = mImpl->stream(); |
| 8170 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8171 | auto resources = mImpl->resources(); |
| 8172 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8173 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8174 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8175 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8176 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8177 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8178 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8179 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8180 | VkImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8181 | local_commandBuffer = commandBuffer; |
| 8182 | local_srcImage = srcImage; |
| 8183 | local_srcImageLayout = srcImageLayout; |
| 8184 | local_dstImage = dstImage; |
| 8185 | local_dstImageLayout = dstImageLayout; |
| 8186 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8187 | local_pRegions = nullptr; |
| 8188 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8189 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8190 | local_pRegions = (VkImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8191 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8192 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8193 | deepcopy_VkImageCopy(pool, pRegions + i, (VkImageCopy*)(local_pRegions + i)); |
| 8194 | } |
| 8195 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8196 | if (local_pRegions) |
| 8197 | { |
| 8198 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8199 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8200 | transform_tohost_VkImageCopy(mImpl->resources(), (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8201 | } |
| 8202 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8203 | countingStream->rewind(); |
| 8204 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8205 | uint64_t cgen_var_565; |
| 8206 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_565, 1); |
| 8207 | countingStream->write((uint64_t*)&cgen_var_565, 1 * 8); |
| 8208 | uint64_t cgen_var_566; |
| 8209 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_566, 1); |
| 8210 | countingStream->write((uint64_t*)&cgen_var_566, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8211 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8212 | uint64_t cgen_var_567; |
| 8213 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_567, 1); |
| 8214 | countingStream->write((uint64_t*)&cgen_var_567, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8215 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8216 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8217 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8218 | { |
| 8219 | marshal_VkImageCopy(countingStream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8220 | } |
| 8221 | } |
| 8222 | uint32_t packetSize_vkCmdCopyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8223 | countingStream->rewind(); |
| 8224 | uint32_t opcode_vkCmdCopyImage = OP_vkCmdCopyImage; |
| 8225 | stream->write(&opcode_vkCmdCopyImage, sizeof(uint32_t)); |
| 8226 | stream->write(&packetSize_vkCmdCopyImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8227 | uint64_t cgen_var_568; |
| 8228 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_568, 1); |
| 8229 | stream->write((uint64_t*)&cgen_var_568, 1 * 8); |
| 8230 | uint64_t cgen_var_569; |
| 8231 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_569, 1); |
| 8232 | stream->write((uint64_t*)&cgen_var_569, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8233 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8234 | uint64_t cgen_var_570; |
| 8235 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_570, 1); |
| 8236 | stream->write((uint64_t*)&cgen_var_570, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8237 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8238 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8239 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8240 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8241 | marshal_VkImageCopy(stream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8242 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8243 | AEMU_SCOPED_TRACE("vkCmdCopyImage readParams"); |
| 8244 | AEMU_SCOPED_TRACE("vkCmdCopyImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8245 | mImpl->log("finish vkCmdCopyImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8246 | } |
| 8247 | |
| 8248 | void VkEncoder::vkCmdBlitImage( |
| 8249 | VkCommandBuffer commandBuffer, |
| 8250 | VkImage srcImage, |
| 8251 | VkImageLayout srcImageLayout, |
| 8252 | VkImage dstImage, |
| 8253 | VkImageLayout dstImageLayout, |
| 8254 | uint32_t regionCount, |
| 8255 | const VkImageBlit* pRegions, |
| 8256 | VkFilter filter) |
| 8257 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8258 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8259 | AEMU_SCOPED_TRACE("vkCmdBlitImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8260 | mImpl->log("start vkCmdBlitImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8261 | auto stream = mImpl->stream(); |
| 8262 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8263 | auto resources = mImpl->resources(); |
| 8264 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8265 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8266 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8267 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8268 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8269 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8270 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8271 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8272 | VkImageBlit* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8273 | VkFilter local_filter; |
| 8274 | local_commandBuffer = commandBuffer; |
| 8275 | local_srcImage = srcImage; |
| 8276 | local_srcImageLayout = srcImageLayout; |
| 8277 | local_dstImage = dstImage; |
| 8278 | local_dstImageLayout = dstImageLayout; |
| 8279 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8280 | local_pRegions = nullptr; |
| 8281 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8282 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8283 | local_pRegions = (VkImageBlit*)pool->alloc(((regionCount)) * sizeof(const VkImageBlit)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8284 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8285 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8286 | deepcopy_VkImageBlit(pool, pRegions + i, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8287 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8288 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8289 | local_filter = filter; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8290 | if (local_pRegions) |
| 8291 | { |
| 8292 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8293 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8294 | transform_tohost_VkImageBlit(mImpl->resources(), (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8295 | } |
| 8296 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8297 | countingStream->rewind(); |
| 8298 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8299 | uint64_t cgen_var_571; |
| 8300 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_571, 1); |
| 8301 | countingStream->write((uint64_t*)&cgen_var_571, 1 * 8); |
| 8302 | uint64_t cgen_var_572; |
| 8303 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_572, 1); |
| 8304 | countingStream->write((uint64_t*)&cgen_var_572, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8305 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8306 | uint64_t cgen_var_573; |
| 8307 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_573, 1); |
| 8308 | countingStream->write((uint64_t*)&cgen_var_573, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8309 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8310 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8311 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8312 | { |
| 8313 | marshal_VkImageBlit(countingStream, (VkImageBlit*)(local_pRegions + i)); |
| 8314 | } |
| 8315 | countingStream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8316 | } |
| 8317 | uint32_t packetSize_vkCmdBlitImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8318 | countingStream->rewind(); |
| 8319 | uint32_t opcode_vkCmdBlitImage = OP_vkCmdBlitImage; |
| 8320 | stream->write(&opcode_vkCmdBlitImage, sizeof(uint32_t)); |
| 8321 | stream->write(&packetSize_vkCmdBlitImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8322 | uint64_t cgen_var_574; |
| 8323 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_574, 1); |
| 8324 | stream->write((uint64_t*)&cgen_var_574, 1 * 8); |
| 8325 | uint64_t cgen_var_575; |
| 8326 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_575, 1); |
| 8327 | stream->write((uint64_t*)&cgen_var_575, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8328 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8329 | uint64_t cgen_var_576; |
| 8330 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_576, 1); |
| 8331 | stream->write((uint64_t*)&cgen_var_576, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8332 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8333 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8334 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8335 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8336 | marshal_VkImageBlit(stream, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8337 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8338 | stream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8339 | AEMU_SCOPED_TRACE("vkCmdBlitImage readParams"); |
| 8340 | AEMU_SCOPED_TRACE("vkCmdBlitImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8341 | mImpl->log("finish vkCmdBlitImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8342 | } |
| 8343 | |
| 8344 | void VkEncoder::vkCmdCopyBufferToImage( |
| 8345 | VkCommandBuffer commandBuffer, |
| 8346 | VkBuffer srcBuffer, |
| 8347 | VkImage dstImage, |
| 8348 | VkImageLayout dstImageLayout, |
| 8349 | uint32_t regionCount, |
| 8350 | const VkBufferImageCopy* pRegions) |
| 8351 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8352 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8353 | AEMU_SCOPED_TRACE("vkCmdCopyBufferToImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8354 | mImpl->log("start vkCmdCopyBufferToImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8355 | auto stream = mImpl->stream(); |
| 8356 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8357 | auto resources = mImpl->resources(); |
| 8358 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8359 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8360 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8361 | VkBuffer local_srcBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8362 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8363 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8364 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8365 | VkBufferImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8366 | local_commandBuffer = commandBuffer; |
| 8367 | local_srcBuffer = srcBuffer; |
| 8368 | local_dstImage = dstImage; |
| 8369 | local_dstImageLayout = dstImageLayout; |
| 8370 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8371 | local_pRegions = nullptr; |
| 8372 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8373 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8374 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8375 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8376 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8377 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 8378 | } |
| 8379 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8380 | if (local_pRegions) |
| 8381 | { |
| 8382 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8383 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8384 | transform_tohost_VkBufferImageCopy(mImpl->resources(), (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8385 | } |
| 8386 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8387 | countingStream->rewind(); |
| 8388 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8389 | uint64_t cgen_var_577; |
| 8390 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_577, 1); |
| 8391 | countingStream->write((uint64_t*)&cgen_var_577, 1 * 8); |
| 8392 | uint64_t cgen_var_578; |
| 8393 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_578, 1); |
| 8394 | countingStream->write((uint64_t*)&cgen_var_578, 1 * 8); |
| 8395 | uint64_t cgen_var_579; |
| 8396 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_579, 1); |
| 8397 | countingStream->write((uint64_t*)&cgen_var_579, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8398 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8399 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8400 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8401 | { |
| 8402 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8403 | } |
| 8404 | } |
| 8405 | uint32_t packetSize_vkCmdCopyBufferToImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8406 | countingStream->rewind(); |
| 8407 | uint32_t opcode_vkCmdCopyBufferToImage = OP_vkCmdCopyBufferToImage; |
| 8408 | stream->write(&opcode_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| 8409 | stream->write(&packetSize_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8410 | uint64_t cgen_var_580; |
| 8411 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_580, 1); |
| 8412 | stream->write((uint64_t*)&cgen_var_580, 1 * 8); |
| 8413 | uint64_t cgen_var_581; |
| 8414 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_581, 1); |
| 8415 | stream->write((uint64_t*)&cgen_var_581, 1 * 8); |
| 8416 | uint64_t cgen_var_582; |
| 8417 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_582, 1); |
| 8418 | stream->write((uint64_t*)&cgen_var_582, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8419 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8420 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8421 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8422 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8423 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8424 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8425 | AEMU_SCOPED_TRACE("vkCmdCopyBufferToImage readParams"); |
| 8426 | AEMU_SCOPED_TRACE("vkCmdCopyBufferToImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8427 | mImpl->log("finish vkCmdCopyBufferToImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8428 | } |
| 8429 | |
| 8430 | void VkEncoder::vkCmdCopyImageToBuffer( |
| 8431 | VkCommandBuffer commandBuffer, |
| 8432 | VkImage srcImage, |
| 8433 | VkImageLayout srcImageLayout, |
| 8434 | VkBuffer dstBuffer, |
| 8435 | uint32_t regionCount, |
| 8436 | const VkBufferImageCopy* pRegions) |
| 8437 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8438 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8439 | AEMU_SCOPED_TRACE("vkCmdCopyImageToBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8440 | mImpl->log("start vkCmdCopyImageToBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8441 | auto stream = mImpl->stream(); |
| 8442 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8443 | auto resources = mImpl->resources(); |
| 8444 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8445 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8446 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8447 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8448 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8449 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8450 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8451 | VkBufferImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8452 | local_commandBuffer = commandBuffer; |
| 8453 | local_srcImage = srcImage; |
| 8454 | local_srcImageLayout = srcImageLayout; |
| 8455 | local_dstBuffer = dstBuffer; |
| 8456 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8457 | local_pRegions = nullptr; |
| 8458 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8459 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8460 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8461 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8462 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8463 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 8464 | } |
| 8465 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8466 | if (local_pRegions) |
| 8467 | { |
| 8468 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8469 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8470 | transform_tohost_VkBufferImageCopy(mImpl->resources(), (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8471 | } |
| 8472 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8473 | countingStream->rewind(); |
| 8474 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8475 | uint64_t cgen_var_583; |
| 8476 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_583, 1); |
| 8477 | countingStream->write((uint64_t*)&cgen_var_583, 1 * 8); |
| 8478 | uint64_t cgen_var_584; |
| 8479 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_584, 1); |
| 8480 | countingStream->write((uint64_t*)&cgen_var_584, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8481 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8482 | uint64_t cgen_var_585; |
| 8483 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_585, 1); |
| 8484 | countingStream->write((uint64_t*)&cgen_var_585, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8485 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8486 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8487 | { |
| 8488 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8489 | } |
| 8490 | } |
| 8491 | uint32_t packetSize_vkCmdCopyImageToBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8492 | countingStream->rewind(); |
| 8493 | uint32_t opcode_vkCmdCopyImageToBuffer = OP_vkCmdCopyImageToBuffer; |
| 8494 | stream->write(&opcode_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| 8495 | stream->write(&packetSize_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8496 | uint64_t cgen_var_586; |
| 8497 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_586, 1); |
| 8498 | stream->write((uint64_t*)&cgen_var_586, 1 * 8); |
| 8499 | uint64_t cgen_var_587; |
| 8500 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_587, 1); |
| 8501 | stream->write((uint64_t*)&cgen_var_587, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8502 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8503 | uint64_t cgen_var_588; |
| 8504 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_588, 1); |
| 8505 | stream->write((uint64_t*)&cgen_var_588, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8506 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8507 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8508 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8509 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8510 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8511 | AEMU_SCOPED_TRACE("vkCmdCopyImageToBuffer readParams"); |
| 8512 | AEMU_SCOPED_TRACE("vkCmdCopyImageToBuffer returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8513 | mImpl->log("finish vkCmdCopyImageToBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8514 | } |
| 8515 | |
| 8516 | void VkEncoder::vkCmdUpdateBuffer( |
| 8517 | VkCommandBuffer commandBuffer, |
| 8518 | VkBuffer dstBuffer, |
| 8519 | VkDeviceSize dstOffset, |
| 8520 | VkDeviceSize dataSize, |
| 8521 | const void* pData) |
| 8522 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8523 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8524 | AEMU_SCOPED_TRACE("vkCmdUpdateBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8525 | mImpl->log("start vkCmdUpdateBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8526 | auto stream = mImpl->stream(); |
| 8527 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8528 | auto resources = mImpl->resources(); |
| 8529 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8530 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8531 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8532 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8533 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8534 | VkDeviceSize local_dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8535 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8536 | local_commandBuffer = commandBuffer; |
| 8537 | local_dstBuffer = dstBuffer; |
| 8538 | local_dstOffset = dstOffset; |
| 8539 | local_dataSize = dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8540 | local_pData = nullptr; |
| 8541 | if (pData) |
| 8542 | { |
| 8543 | local_pData = (void*)pool->dupArray(pData, ((dataSize)) * sizeof(const uint8_t)); |
| 8544 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8545 | countingStream->rewind(); |
| 8546 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8547 | uint64_t cgen_var_589; |
| 8548 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_589, 1); |
| 8549 | countingStream->write((uint64_t*)&cgen_var_589, 1 * 8); |
| 8550 | uint64_t cgen_var_590; |
| 8551 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_590, 1); |
| 8552 | countingStream->write((uint64_t*)&cgen_var_590, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8553 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8554 | countingStream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 8555 | countingStream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8556 | } |
| 8557 | uint32_t packetSize_vkCmdUpdateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8558 | countingStream->rewind(); |
| 8559 | uint32_t opcode_vkCmdUpdateBuffer = OP_vkCmdUpdateBuffer; |
| 8560 | stream->write(&opcode_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| 8561 | stream->write(&packetSize_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8562 | uint64_t cgen_var_591; |
| 8563 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_591, 1); |
| 8564 | stream->write((uint64_t*)&cgen_var_591, 1 * 8); |
| 8565 | uint64_t cgen_var_592; |
| 8566 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_592, 1); |
| 8567 | stream->write((uint64_t*)&cgen_var_592, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8568 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8569 | stream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 8570 | stream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8571 | AEMU_SCOPED_TRACE("vkCmdUpdateBuffer readParams"); |
| 8572 | AEMU_SCOPED_TRACE("vkCmdUpdateBuffer returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8573 | mImpl->log("finish vkCmdUpdateBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8574 | } |
| 8575 | |
| 8576 | void VkEncoder::vkCmdFillBuffer( |
| 8577 | VkCommandBuffer commandBuffer, |
| 8578 | VkBuffer dstBuffer, |
| 8579 | VkDeviceSize dstOffset, |
| 8580 | VkDeviceSize size, |
| 8581 | uint32_t data) |
| 8582 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8583 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8584 | AEMU_SCOPED_TRACE("vkCmdFillBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8585 | mImpl->log("start vkCmdFillBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8586 | auto stream = mImpl->stream(); |
| 8587 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8588 | auto resources = mImpl->resources(); |
| 8589 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8590 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8591 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8592 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8593 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8594 | VkDeviceSize local_size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8595 | uint32_t local_data; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8596 | local_commandBuffer = commandBuffer; |
| 8597 | local_dstBuffer = dstBuffer; |
| 8598 | local_dstOffset = dstOffset; |
| 8599 | local_size = size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8600 | local_data = data; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8601 | countingStream->rewind(); |
| 8602 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8603 | uint64_t cgen_var_593; |
| 8604 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_593, 1); |
| 8605 | countingStream->write((uint64_t*)&cgen_var_593, 1 * 8); |
| 8606 | uint64_t cgen_var_594; |
| 8607 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_594, 1); |
| 8608 | countingStream->write((uint64_t*)&cgen_var_594, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8609 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8610 | countingStream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 8611 | countingStream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8612 | } |
| 8613 | uint32_t packetSize_vkCmdFillBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8614 | countingStream->rewind(); |
| 8615 | uint32_t opcode_vkCmdFillBuffer = OP_vkCmdFillBuffer; |
| 8616 | stream->write(&opcode_vkCmdFillBuffer, sizeof(uint32_t)); |
| 8617 | stream->write(&packetSize_vkCmdFillBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8618 | uint64_t cgen_var_595; |
| 8619 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_595, 1); |
| 8620 | stream->write((uint64_t*)&cgen_var_595, 1 * 8); |
| 8621 | uint64_t cgen_var_596; |
| 8622 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_596, 1); |
| 8623 | stream->write((uint64_t*)&cgen_var_596, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8624 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8625 | stream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 8626 | stream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8627 | AEMU_SCOPED_TRACE("vkCmdFillBuffer readParams"); |
| 8628 | AEMU_SCOPED_TRACE("vkCmdFillBuffer returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8629 | mImpl->log("finish vkCmdFillBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8630 | } |
| 8631 | |
| 8632 | void VkEncoder::vkCmdClearColorImage( |
| 8633 | VkCommandBuffer commandBuffer, |
| 8634 | VkImage image, |
| 8635 | VkImageLayout imageLayout, |
| 8636 | const VkClearColorValue* pColor, |
| 8637 | uint32_t rangeCount, |
| 8638 | const VkImageSubresourceRange* pRanges) |
| 8639 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8640 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8641 | AEMU_SCOPED_TRACE("vkCmdClearColorImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8642 | mImpl->log("start vkCmdClearColorImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8643 | auto stream = mImpl->stream(); |
| 8644 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8645 | auto resources = mImpl->resources(); |
| 8646 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8647 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8648 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8649 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8650 | VkImageLayout local_imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8651 | VkClearColorValue* local_pColor; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8652 | uint32_t local_rangeCount; |
| 8653 | VkImageSubresourceRange* local_pRanges; |
| 8654 | local_commandBuffer = commandBuffer; |
| 8655 | local_image = image; |
| 8656 | local_imageLayout = imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8657 | local_pColor = nullptr; |
| 8658 | if (pColor) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8659 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8660 | local_pColor = (VkClearColorValue*)pool->alloc(sizeof(const VkClearColorValue)); |
| 8661 | deepcopy_VkClearColorValue(pool, pColor, (VkClearColorValue*)(local_pColor)); |
| 8662 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8663 | local_rangeCount = rangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8664 | local_pRanges = nullptr; |
| 8665 | if (pRanges) |
| 8666 | { |
| 8667 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8668 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8669 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8670 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 8671 | } |
| 8672 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8673 | if (local_pColor) |
| 8674 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8675 | transform_tohost_VkClearColorValue(mImpl->resources(), (VkClearColorValue*)(local_pColor)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8676 | } |
| 8677 | if (local_pRanges) |
| 8678 | { |
| 8679 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8680 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8681 | transform_tohost_VkImageSubresourceRange(mImpl->resources(), (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8682 | } |
| 8683 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8684 | countingStream->rewind(); |
| 8685 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8686 | uint64_t cgen_var_597; |
| 8687 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_597, 1); |
| 8688 | countingStream->write((uint64_t*)&cgen_var_597, 1 * 8); |
| 8689 | uint64_t cgen_var_598; |
| 8690 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_598, 1); |
| 8691 | countingStream->write((uint64_t*)&cgen_var_598, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8692 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8693 | marshal_VkClearColorValue(countingStream, (VkClearColorValue*)(local_pColor)); |
| 8694 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 8695 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8696 | { |
| 8697 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8698 | } |
| 8699 | } |
| 8700 | uint32_t packetSize_vkCmdClearColorImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8701 | countingStream->rewind(); |
| 8702 | uint32_t opcode_vkCmdClearColorImage = OP_vkCmdClearColorImage; |
| 8703 | stream->write(&opcode_vkCmdClearColorImage, sizeof(uint32_t)); |
| 8704 | stream->write(&packetSize_vkCmdClearColorImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8705 | uint64_t cgen_var_599; |
| 8706 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_599, 1); |
| 8707 | stream->write((uint64_t*)&cgen_var_599, 1 * 8); |
| 8708 | uint64_t cgen_var_600; |
| 8709 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_600, 1); |
| 8710 | stream->write((uint64_t*)&cgen_var_600, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8711 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8712 | marshal_VkClearColorValue(stream, (VkClearColorValue*)(local_pColor)); |
| 8713 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8714 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8715 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8716 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8717 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8718 | AEMU_SCOPED_TRACE("vkCmdClearColorImage readParams"); |
| 8719 | AEMU_SCOPED_TRACE("vkCmdClearColorImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8720 | mImpl->log("finish vkCmdClearColorImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8721 | } |
| 8722 | |
| 8723 | void VkEncoder::vkCmdClearDepthStencilImage( |
| 8724 | VkCommandBuffer commandBuffer, |
| 8725 | VkImage image, |
| 8726 | VkImageLayout imageLayout, |
| 8727 | const VkClearDepthStencilValue* pDepthStencil, |
| 8728 | uint32_t rangeCount, |
| 8729 | const VkImageSubresourceRange* pRanges) |
| 8730 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8731 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8732 | AEMU_SCOPED_TRACE("vkCmdClearDepthStencilImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8733 | mImpl->log("start vkCmdClearDepthStencilImage"); |
| 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 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8741 | VkImageLayout local_imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8742 | VkClearDepthStencilValue* local_pDepthStencil; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8743 | uint32_t local_rangeCount; |
| 8744 | VkImageSubresourceRange* local_pRanges; |
| 8745 | local_commandBuffer = commandBuffer; |
| 8746 | local_image = image; |
| 8747 | local_imageLayout = imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8748 | local_pDepthStencil = nullptr; |
| 8749 | if (pDepthStencil) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8750 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8751 | local_pDepthStencil = (VkClearDepthStencilValue*)pool->alloc(sizeof(const VkClearDepthStencilValue)); |
| 8752 | deepcopy_VkClearDepthStencilValue(pool, pDepthStencil, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8753 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8754 | local_rangeCount = rangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8755 | local_pRanges = nullptr; |
| 8756 | if (pRanges) |
| 8757 | { |
| 8758 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8759 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8760 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8761 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 8762 | } |
| 8763 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8764 | if (local_pDepthStencil) |
| 8765 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8766 | transform_tohost_VkClearDepthStencilValue(mImpl->resources(), (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8767 | } |
| 8768 | if (local_pRanges) |
| 8769 | { |
| 8770 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8771 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8772 | transform_tohost_VkImageSubresourceRange(mImpl->resources(), (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8773 | } |
| 8774 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8775 | countingStream->rewind(); |
| 8776 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8777 | uint64_t cgen_var_601; |
| 8778 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_601, 1); |
| 8779 | countingStream->write((uint64_t*)&cgen_var_601, 1 * 8); |
| 8780 | uint64_t cgen_var_602; |
| 8781 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_602, 1); |
| 8782 | countingStream->write((uint64_t*)&cgen_var_602, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8783 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8784 | marshal_VkClearDepthStencilValue(countingStream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8785 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 8786 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8787 | { |
| 8788 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8789 | } |
| 8790 | } |
| 8791 | uint32_t packetSize_vkCmdClearDepthStencilImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8792 | countingStream->rewind(); |
| 8793 | uint32_t opcode_vkCmdClearDepthStencilImage = OP_vkCmdClearDepthStencilImage; |
| 8794 | stream->write(&opcode_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| 8795 | stream->write(&packetSize_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8796 | uint64_t cgen_var_603; |
| 8797 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_603, 1); |
| 8798 | stream->write((uint64_t*)&cgen_var_603, 1 * 8); |
| 8799 | uint64_t cgen_var_604; |
| 8800 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_604, 1); |
| 8801 | stream->write((uint64_t*)&cgen_var_604, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8802 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8803 | marshal_VkClearDepthStencilValue(stream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8804 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8805 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8806 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8807 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8808 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8809 | AEMU_SCOPED_TRACE("vkCmdClearDepthStencilImage readParams"); |
| 8810 | AEMU_SCOPED_TRACE("vkCmdClearDepthStencilImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8811 | mImpl->log("finish vkCmdClearDepthStencilImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8812 | } |
| 8813 | |
| 8814 | void VkEncoder::vkCmdClearAttachments( |
| 8815 | VkCommandBuffer commandBuffer, |
| 8816 | uint32_t attachmentCount, |
| 8817 | const VkClearAttachment* pAttachments, |
| 8818 | uint32_t rectCount, |
| 8819 | const VkClearRect* pRects) |
| 8820 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8821 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8822 | AEMU_SCOPED_TRACE("vkCmdClearAttachments encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8823 | mImpl->log("start vkCmdClearAttachments"); |
| 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 | uint32_t local_attachmentCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8831 | VkClearAttachment* local_pAttachments; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8832 | uint32_t local_rectCount; |
| 8833 | VkClearRect* local_pRects; |
| 8834 | local_commandBuffer = commandBuffer; |
| 8835 | local_attachmentCount = attachmentCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8836 | local_pAttachments = nullptr; |
| 8837 | if (pAttachments) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8838 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8839 | local_pAttachments = (VkClearAttachment*)pool->alloc(((attachmentCount)) * sizeof(const VkClearAttachment)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8840 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8841 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8842 | deepcopy_VkClearAttachment(pool, pAttachments + i, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8843 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8844 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8845 | local_rectCount = rectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8846 | local_pRects = nullptr; |
| 8847 | if (pRects) |
| 8848 | { |
| 8849 | local_pRects = (VkClearRect*)pool->alloc(((rectCount)) * sizeof(const VkClearRect)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8850 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8851 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8852 | deepcopy_VkClearRect(pool, pRects + i, (VkClearRect*)(local_pRects + i)); |
| 8853 | } |
| 8854 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8855 | if (local_pAttachments) |
| 8856 | { |
| 8857 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8858 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8859 | transform_tohost_VkClearAttachment(mImpl->resources(), (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8860 | } |
| 8861 | } |
| 8862 | if (local_pRects) |
| 8863 | { |
| 8864 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8865 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8866 | transform_tohost_VkClearRect(mImpl->resources(), (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8867 | } |
| 8868 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8869 | countingStream->rewind(); |
| 8870 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8871 | uint64_t cgen_var_605; |
| 8872 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_605, 1); |
| 8873 | countingStream->write((uint64_t*)&cgen_var_605, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8874 | countingStream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| 8875 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8876 | { |
| 8877 | marshal_VkClearAttachment(countingStream, (VkClearAttachment*)(local_pAttachments + i)); |
| 8878 | } |
| 8879 | countingStream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| 8880 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8881 | { |
| 8882 | marshal_VkClearRect(countingStream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8883 | } |
| 8884 | } |
| 8885 | uint32_t packetSize_vkCmdClearAttachments = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8886 | countingStream->rewind(); |
| 8887 | uint32_t opcode_vkCmdClearAttachments = OP_vkCmdClearAttachments; |
| 8888 | stream->write(&opcode_vkCmdClearAttachments, sizeof(uint32_t)); |
| 8889 | stream->write(&packetSize_vkCmdClearAttachments, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8890 | uint64_t cgen_var_606; |
| 8891 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_606, 1); |
| 8892 | stream->write((uint64_t*)&cgen_var_606, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8893 | stream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8894 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8895 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8896 | marshal_VkClearAttachment(stream, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8897 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8898 | stream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8899 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8900 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8901 | marshal_VkClearRect(stream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8902 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8903 | AEMU_SCOPED_TRACE("vkCmdClearAttachments readParams"); |
| 8904 | AEMU_SCOPED_TRACE("vkCmdClearAttachments returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8905 | mImpl->log("finish vkCmdClearAttachments");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8906 | } |
| 8907 | |
| 8908 | void VkEncoder::vkCmdResolveImage( |
| 8909 | VkCommandBuffer commandBuffer, |
| 8910 | VkImage srcImage, |
| 8911 | VkImageLayout srcImageLayout, |
| 8912 | VkImage dstImage, |
| 8913 | VkImageLayout dstImageLayout, |
| 8914 | uint32_t regionCount, |
| 8915 | const VkImageResolve* pRegions) |
| 8916 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8917 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8918 | AEMU_SCOPED_TRACE("vkCmdResolveImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8919 | mImpl->log("start vkCmdResolveImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8920 | auto stream = mImpl->stream(); |
| 8921 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8922 | auto resources = mImpl->resources(); |
| 8923 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8924 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8925 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8926 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8927 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8928 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8929 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8930 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8931 | VkImageResolve* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8932 | local_commandBuffer = commandBuffer; |
| 8933 | local_srcImage = srcImage; |
| 8934 | local_srcImageLayout = srcImageLayout; |
| 8935 | local_dstImage = dstImage; |
| 8936 | local_dstImageLayout = dstImageLayout; |
| 8937 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8938 | local_pRegions = nullptr; |
| 8939 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8940 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8941 | local_pRegions = (VkImageResolve*)pool->alloc(((regionCount)) * sizeof(const VkImageResolve)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8942 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8943 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8944 | deepcopy_VkImageResolve(pool, pRegions + i, (VkImageResolve*)(local_pRegions + i)); |
| 8945 | } |
| 8946 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8947 | if (local_pRegions) |
| 8948 | { |
| 8949 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8950 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8951 | transform_tohost_VkImageResolve(mImpl->resources(), (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8952 | } |
| 8953 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8954 | countingStream->rewind(); |
| 8955 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8956 | uint64_t cgen_var_607; |
| 8957 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_607, 1); |
| 8958 | countingStream->write((uint64_t*)&cgen_var_607, 1 * 8); |
| 8959 | uint64_t cgen_var_608; |
| 8960 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_608, 1); |
| 8961 | countingStream->write((uint64_t*)&cgen_var_608, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8962 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8963 | uint64_t cgen_var_609; |
| 8964 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_609, 1); |
| 8965 | countingStream->write((uint64_t*)&cgen_var_609, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8966 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8967 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8968 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8969 | { |
| 8970 | marshal_VkImageResolve(countingStream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8971 | } |
| 8972 | } |
| 8973 | uint32_t packetSize_vkCmdResolveImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8974 | countingStream->rewind(); |
| 8975 | uint32_t opcode_vkCmdResolveImage = OP_vkCmdResolveImage; |
| 8976 | stream->write(&opcode_vkCmdResolveImage, sizeof(uint32_t)); |
| 8977 | stream->write(&packetSize_vkCmdResolveImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8978 | uint64_t cgen_var_610; |
| 8979 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_610, 1); |
| 8980 | stream->write((uint64_t*)&cgen_var_610, 1 * 8); |
| 8981 | uint64_t cgen_var_611; |
| 8982 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_611, 1); |
| 8983 | stream->write((uint64_t*)&cgen_var_611, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8984 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8985 | uint64_t cgen_var_612; |
| 8986 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_612, 1); |
| 8987 | stream->write((uint64_t*)&cgen_var_612, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8988 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8989 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8990 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8991 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8992 | marshal_VkImageResolve(stream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8993 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8994 | AEMU_SCOPED_TRACE("vkCmdResolveImage readParams"); |
| 8995 | AEMU_SCOPED_TRACE("vkCmdResolveImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8996 | mImpl->log("finish vkCmdResolveImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8997 | } |
| 8998 | |
| 8999 | void VkEncoder::vkCmdSetEvent( |
| 9000 | VkCommandBuffer commandBuffer, |
| 9001 | VkEvent event, |
| 9002 | VkPipelineStageFlags stageMask) |
| 9003 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9004 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9005 | AEMU_SCOPED_TRACE("vkCmdSetEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9006 | mImpl->log("start vkCmdSetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9007 | auto stream = mImpl->stream(); |
| 9008 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9009 | auto resources = mImpl->resources(); |
| 9010 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9011 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9012 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9013 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9014 | VkPipelineStageFlags local_stageMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9015 | local_commandBuffer = commandBuffer; |
| 9016 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9017 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9018 | countingStream->rewind(); |
| 9019 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9020 | uint64_t cgen_var_613; |
| 9021 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_613, 1); |
| 9022 | countingStream->write((uint64_t*)&cgen_var_613, 1 * 8); |
| 9023 | uint64_t cgen_var_614; |
| 9024 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_614, 1); |
| 9025 | countingStream->write((uint64_t*)&cgen_var_614, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9026 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9027 | } |
| 9028 | uint32_t packetSize_vkCmdSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9029 | countingStream->rewind(); |
| 9030 | uint32_t opcode_vkCmdSetEvent = OP_vkCmdSetEvent; |
| 9031 | stream->write(&opcode_vkCmdSetEvent, sizeof(uint32_t)); |
| 9032 | stream->write(&packetSize_vkCmdSetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9033 | uint64_t cgen_var_615; |
| 9034 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_615, 1); |
| 9035 | stream->write((uint64_t*)&cgen_var_615, 1 * 8); |
| 9036 | uint64_t cgen_var_616; |
| 9037 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_616, 1); |
| 9038 | stream->write((uint64_t*)&cgen_var_616, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9039 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9040 | AEMU_SCOPED_TRACE("vkCmdSetEvent readParams"); |
| 9041 | AEMU_SCOPED_TRACE("vkCmdSetEvent returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9042 | mImpl->log("finish vkCmdSetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9043 | } |
| 9044 | |
| 9045 | void VkEncoder::vkCmdResetEvent( |
| 9046 | VkCommandBuffer commandBuffer, |
| 9047 | VkEvent event, |
| 9048 | VkPipelineStageFlags stageMask) |
| 9049 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9050 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9051 | AEMU_SCOPED_TRACE("vkCmdResetEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9052 | mImpl->log("start vkCmdResetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9053 | auto stream = mImpl->stream(); |
| 9054 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9055 | auto resources = mImpl->resources(); |
| 9056 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9057 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9058 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9059 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9060 | VkPipelineStageFlags local_stageMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9061 | local_commandBuffer = commandBuffer; |
| 9062 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9063 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9064 | countingStream->rewind(); |
| 9065 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9066 | uint64_t cgen_var_617; |
| 9067 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_617, 1); |
| 9068 | countingStream->write((uint64_t*)&cgen_var_617, 1 * 8); |
| 9069 | uint64_t cgen_var_618; |
| 9070 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_618, 1); |
| 9071 | countingStream->write((uint64_t*)&cgen_var_618, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9072 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9073 | } |
| 9074 | uint32_t packetSize_vkCmdResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9075 | countingStream->rewind(); |
| 9076 | uint32_t opcode_vkCmdResetEvent = OP_vkCmdResetEvent; |
| 9077 | stream->write(&opcode_vkCmdResetEvent, sizeof(uint32_t)); |
| 9078 | stream->write(&packetSize_vkCmdResetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9079 | uint64_t cgen_var_619; |
| 9080 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_619, 1); |
| 9081 | stream->write((uint64_t*)&cgen_var_619, 1 * 8); |
| 9082 | uint64_t cgen_var_620; |
| 9083 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_620, 1); |
| 9084 | stream->write((uint64_t*)&cgen_var_620, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9085 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9086 | AEMU_SCOPED_TRACE("vkCmdResetEvent readParams"); |
| 9087 | AEMU_SCOPED_TRACE("vkCmdResetEvent returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9088 | mImpl->log("finish vkCmdResetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9089 | } |
| 9090 | |
| 9091 | void VkEncoder::vkCmdWaitEvents( |
| 9092 | VkCommandBuffer commandBuffer, |
| 9093 | uint32_t eventCount, |
| 9094 | const VkEvent* pEvents, |
| 9095 | VkPipelineStageFlags srcStageMask, |
| 9096 | VkPipelineStageFlags dstStageMask, |
| 9097 | uint32_t memoryBarrierCount, |
| 9098 | const VkMemoryBarrier* pMemoryBarriers, |
| 9099 | uint32_t bufferMemoryBarrierCount, |
| 9100 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 9101 | uint32_t imageMemoryBarrierCount, |
| 9102 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 9103 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9104 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9105 | AEMU_SCOPED_TRACE("vkCmdWaitEvents encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9106 | mImpl->log("start vkCmdWaitEvents"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9107 | auto stream = mImpl->stream(); |
| 9108 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9109 | auto resources = mImpl->resources(); |
| 9110 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9111 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9112 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9113 | uint32_t local_eventCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9114 | VkEvent* local_pEvents; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9115 | VkPipelineStageFlags local_srcStageMask; |
| 9116 | VkPipelineStageFlags local_dstStageMask; |
| 9117 | uint32_t local_memoryBarrierCount; |
| 9118 | VkMemoryBarrier* local_pMemoryBarriers; |
| 9119 | uint32_t local_bufferMemoryBarrierCount; |
| 9120 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 9121 | uint32_t local_imageMemoryBarrierCount; |
| 9122 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 9123 | local_commandBuffer = commandBuffer; |
| 9124 | local_eventCount = eventCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9125 | local_pEvents = nullptr; |
| 9126 | if (pEvents) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9127 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9128 | local_pEvents = (VkEvent*)pool->dupArray(pEvents, ((eventCount)) * sizeof(const VkEvent)); |
| 9129 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9130 | local_srcStageMask = srcStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9131 | local_dstStageMask = dstStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9132 | local_memoryBarrierCount = memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9133 | local_pMemoryBarriers = nullptr; |
| 9134 | if (pMemoryBarriers) |
| 9135 | { |
| 9136 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9137 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9138 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9139 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9140 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9141 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9142 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9143 | local_pBufferMemoryBarriers = nullptr; |
| 9144 | if (pBufferMemoryBarriers) |
| 9145 | { |
| 9146 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9147 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9148 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9149 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9150 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9151 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9152 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9153 | local_pImageMemoryBarriers = nullptr; |
| 9154 | if (pImageMemoryBarriers) |
| 9155 | { |
| 9156 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9157 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9158 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9159 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 9160 | } |
| 9161 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9162 | if (local_pMemoryBarriers) |
| 9163 | { |
| 9164 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9165 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9166 | transform_tohost_VkMemoryBarrier(mImpl->resources(), (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9167 | } |
| 9168 | } |
| 9169 | if (local_pBufferMemoryBarriers) |
| 9170 | { |
| 9171 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9172 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9173 | transform_tohost_VkBufferMemoryBarrier(mImpl->resources(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9174 | } |
| 9175 | } |
| 9176 | if (local_pImageMemoryBarriers) |
| 9177 | { |
| 9178 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9179 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9180 | transform_tohost_VkImageMemoryBarrier(mImpl->resources(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9181 | } |
| 9182 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9183 | countingStream->rewind(); |
| 9184 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9185 | uint64_t cgen_var_621; |
| 9186 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_621, 1); |
| 9187 | countingStream->write((uint64_t*)&cgen_var_621, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9188 | countingStream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9189 | if (((eventCount))) |
| 9190 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9191 | uint64_t* cgen_var_622; |
| 9192 | countingStream->alloc((void**)&cgen_var_622, ((eventCount)) * 8); |
| 9193 | countingStream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_622, ((eventCount))); |
| 9194 | countingStream->write((uint64_t*)cgen_var_622, ((eventCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9195 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9196 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 9197 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 9198 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 9199 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9200 | { |
| 9201 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 9202 | } |
| 9203 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 9204 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9205 | { |
| 9206 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 9207 | } |
| 9208 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 9209 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9210 | { |
| 9211 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9212 | } |
| 9213 | } |
| 9214 | uint32_t packetSize_vkCmdWaitEvents = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9215 | countingStream->rewind(); |
| 9216 | uint32_t opcode_vkCmdWaitEvents = OP_vkCmdWaitEvents; |
| 9217 | stream->write(&opcode_vkCmdWaitEvents, sizeof(uint32_t)); |
| 9218 | stream->write(&packetSize_vkCmdWaitEvents, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9219 | uint64_t cgen_var_623; |
| 9220 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_623, 1); |
| 9221 | stream->write((uint64_t*)&cgen_var_623, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9222 | stream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9223 | if (((eventCount))) |
| 9224 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9225 | uint64_t* cgen_var_624; |
| 9226 | stream->alloc((void**)&cgen_var_624, ((eventCount)) * 8); |
| 9227 | stream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_624, ((eventCount))); |
| 9228 | stream->write((uint64_t*)cgen_var_624, ((eventCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9229 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9230 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 9231 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 9232 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9233 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9234 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9235 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9236 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9237 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9238 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9239 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9240 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9241 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9242 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9243 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9244 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9245 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9246 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9247 | AEMU_SCOPED_TRACE("vkCmdWaitEvents readParams"); |
| 9248 | AEMU_SCOPED_TRACE("vkCmdWaitEvents returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9249 | mImpl->log("finish vkCmdWaitEvents");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9250 | } |
| 9251 | |
| 9252 | void VkEncoder::vkCmdPipelineBarrier( |
| 9253 | VkCommandBuffer commandBuffer, |
| 9254 | VkPipelineStageFlags srcStageMask, |
| 9255 | VkPipelineStageFlags dstStageMask, |
| 9256 | VkDependencyFlags dependencyFlags, |
| 9257 | uint32_t memoryBarrierCount, |
| 9258 | const VkMemoryBarrier* pMemoryBarriers, |
| 9259 | uint32_t bufferMemoryBarrierCount, |
| 9260 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 9261 | uint32_t imageMemoryBarrierCount, |
| 9262 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 9263 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9264 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9265 | AEMU_SCOPED_TRACE("vkCmdPipelineBarrier encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9266 | mImpl->log("start vkCmdPipelineBarrier"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9267 | auto stream = mImpl->stream(); |
| 9268 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9269 | auto resources = mImpl->resources(); |
| 9270 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9271 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9272 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9273 | VkPipelineStageFlags local_srcStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9274 | VkPipelineStageFlags local_dstStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9275 | VkDependencyFlags local_dependencyFlags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9276 | uint32_t local_memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9277 | VkMemoryBarrier* local_pMemoryBarriers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9278 | uint32_t local_bufferMemoryBarrierCount; |
| 9279 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 9280 | uint32_t local_imageMemoryBarrierCount; |
| 9281 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 9282 | local_commandBuffer = commandBuffer; |
| 9283 | local_srcStageMask = srcStageMask; |
| 9284 | local_dstStageMask = dstStageMask; |
| 9285 | local_dependencyFlags = dependencyFlags; |
| 9286 | local_memoryBarrierCount = memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9287 | local_pMemoryBarriers = nullptr; |
| 9288 | if (pMemoryBarriers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9289 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9290 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9291 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9292 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9293 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9294 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9295 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9296 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9297 | local_pBufferMemoryBarriers = nullptr; |
| 9298 | if (pBufferMemoryBarriers) |
| 9299 | { |
| 9300 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9301 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9302 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9303 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9304 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9305 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9306 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9307 | local_pImageMemoryBarriers = nullptr; |
| 9308 | if (pImageMemoryBarriers) |
| 9309 | { |
| 9310 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9311 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9312 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9313 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 9314 | } |
| 9315 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9316 | if (local_pMemoryBarriers) |
| 9317 | { |
| 9318 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9319 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9320 | transform_tohost_VkMemoryBarrier(mImpl->resources(), (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9321 | } |
| 9322 | } |
| 9323 | if (local_pBufferMemoryBarriers) |
| 9324 | { |
| 9325 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9326 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9327 | transform_tohost_VkBufferMemoryBarrier(mImpl->resources(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9328 | } |
| 9329 | } |
| 9330 | if (local_pImageMemoryBarriers) |
| 9331 | { |
| 9332 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9333 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9334 | transform_tohost_VkImageMemoryBarrier(mImpl->resources(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9335 | } |
| 9336 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9337 | countingStream->rewind(); |
| 9338 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9339 | uint64_t cgen_var_625; |
| 9340 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_625, 1); |
| 9341 | countingStream->write((uint64_t*)&cgen_var_625, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9342 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 9343 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 9344 | countingStream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 9345 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 9346 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9347 | { |
| 9348 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 9349 | } |
| 9350 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 9351 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9352 | { |
| 9353 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 9354 | } |
| 9355 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 9356 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9357 | { |
| 9358 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9359 | } |
| 9360 | } |
| 9361 | uint32_t packetSize_vkCmdPipelineBarrier = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9362 | countingStream->rewind(); |
| 9363 | uint32_t opcode_vkCmdPipelineBarrier = OP_vkCmdPipelineBarrier; |
| 9364 | stream->write(&opcode_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| 9365 | stream->write(&packetSize_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9366 | uint64_t cgen_var_626; |
| 9367 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_626, 1); |
| 9368 | stream->write((uint64_t*)&cgen_var_626, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9369 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 9370 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 9371 | stream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 9372 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9373 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9374 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9375 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9376 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9377 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9378 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9379 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9380 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9381 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9382 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9383 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9384 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9385 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9386 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9387 | AEMU_SCOPED_TRACE("vkCmdPipelineBarrier readParams"); |
| 9388 | AEMU_SCOPED_TRACE("vkCmdPipelineBarrier returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9389 | mImpl->log("finish vkCmdPipelineBarrier");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9390 | } |
| 9391 | |
| 9392 | void VkEncoder::vkCmdBeginQuery( |
| 9393 | VkCommandBuffer commandBuffer, |
| 9394 | VkQueryPool queryPool, |
| 9395 | uint32_t query, |
| 9396 | VkQueryControlFlags flags) |
| 9397 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9398 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9399 | AEMU_SCOPED_TRACE("vkCmdBeginQuery encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9400 | mImpl->log("start vkCmdBeginQuery"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9401 | auto stream = mImpl->stream(); |
| 9402 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9403 | auto resources = mImpl->resources(); |
| 9404 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9405 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9406 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9407 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9408 | uint32_t local_query; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9409 | VkQueryControlFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9410 | local_commandBuffer = commandBuffer; |
| 9411 | local_queryPool = queryPool; |
| 9412 | local_query = query; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9413 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9414 | countingStream->rewind(); |
| 9415 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9416 | uint64_t cgen_var_627; |
| 9417 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_627, 1); |
| 9418 | countingStream->write((uint64_t*)&cgen_var_627, 1 * 8); |
| 9419 | uint64_t cgen_var_628; |
| 9420 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_628, 1); |
| 9421 | countingStream->write((uint64_t*)&cgen_var_628, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9422 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 9423 | countingStream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9424 | } |
| 9425 | uint32_t packetSize_vkCmdBeginQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9426 | countingStream->rewind(); |
| 9427 | uint32_t opcode_vkCmdBeginQuery = OP_vkCmdBeginQuery; |
| 9428 | stream->write(&opcode_vkCmdBeginQuery, sizeof(uint32_t)); |
| 9429 | stream->write(&packetSize_vkCmdBeginQuery, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9430 | uint64_t cgen_var_629; |
| 9431 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_629, 1); |
| 9432 | stream->write((uint64_t*)&cgen_var_629, 1 * 8); |
| 9433 | uint64_t cgen_var_630; |
| 9434 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_630, 1); |
| 9435 | stream->write((uint64_t*)&cgen_var_630, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9436 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 9437 | stream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9438 | AEMU_SCOPED_TRACE("vkCmdBeginQuery readParams"); |
| 9439 | AEMU_SCOPED_TRACE("vkCmdBeginQuery returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9440 | mImpl->log("finish vkCmdBeginQuery");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9441 | } |
| 9442 | |
| 9443 | void VkEncoder::vkCmdEndQuery( |
| 9444 | VkCommandBuffer commandBuffer, |
| 9445 | VkQueryPool queryPool, |
| 9446 | uint32_t query) |
| 9447 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9448 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9449 | AEMU_SCOPED_TRACE("vkCmdEndQuery encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9450 | mImpl->log("start vkCmdEndQuery"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9451 | auto stream = mImpl->stream(); |
| 9452 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9453 | auto resources = mImpl->resources(); |
| 9454 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9455 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9456 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9457 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9458 | uint32_t local_query; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9459 | local_commandBuffer = commandBuffer; |
| 9460 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9461 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9462 | countingStream->rewind(); |
| 9463 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9464 | uint64_t cgen_var_631; |
| 9465 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_631, 1); |
| 9466 | countingStream->write((uint64_t*)&cgen_var_631, 1 * 8); |
| 9467 | uint64_t cgen_var_632; |
| 9468 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_632, 1); |
| 9469 | countingStream->write((uint64_t*)&cgen_var_632, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9470 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9471 | } |
| 9472 | uint32_t packetSize_vkCmdEndQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9473 | countingStream->rewind(); |
| 9474 | uint32_t opcode_vkCmdEndQuery = OP_vkCmdEndQuery; |
| 9475 | stream->write(&opcode_vkCmdEndQuery, sizeof(uint32_t)); |
| 9476 | stream->write(&packetSize_vkCmdEndQuery, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9477 | uint64_t cgen_var_633; |
| 9478 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_633, 1); |
| 9479 | stream->write((uint64_t*)&cgen_var_633, 1 * 8); |
| 9480 | uint64_t cgen_var_634; |
| 9481 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_634, 1); |
| 9482 | stream->write((uint64_t*)&cgen_var_634, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9483 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9484 | AEMU_SCOPED_TRACE("vkCmdEndQuery readParams"); |
| 9485 | AEMU_SCOPED_TRACE("vkCmdEndQuery returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9486 | mImpl->log("finish vkCmdEndQuery");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9487 | } |
| 9488 | |
| 9489 | void VkEncoder::vkCmdResetQueryPool( |
| 9490 | VkCommandBuffer commandBuffer, |
| 9491 | VkQueryPool queryPool, |
| 9492 | uint32_t firstQuery, |
| 9493 | uint32_t queryCount) |
| 9494 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9495 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9496 | AEMU_SCOPED_TRACE("vkCmdResetQueryPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9497 | mImpl->log("start vkCmdResetQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9498 | auto stream = mImpl->stream(); |
| 9499 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9500 | auto resources = mImpl->resources(); |
| 9501 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9502 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9503 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9504 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9505 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9506 | uint32_t local_queryCount; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9507 | local_commandBuffer = commandBuffer; |
| 9508 | local_queryPool = queryPool; |
| 9509 | local_firstQuery = firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9510 | local_queryCount = queryCount; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9511 | countingStream->rewind(); |
| 9512 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9513 | uint64_t cgen_var_635; |
| 9514 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_635, 1); |
| 9515 | countingStream->write((uint64_t*)&cgen_var_635, 1 * 8); |
| 9516 | uint64_t cgen_var_636; |
| 9517 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_636, 1); |
| 9518 | countingStream->write((uint64_t*)&cgen_var_636, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9519 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9520 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9521 | } |
| 9522 | uint32_t packetSize_vkCmdResetQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9523 | countingStream->rewind(); |
| 9524 | uint32_t opcode_vkCmdResetQueryPool = OP_vkCmdResetQueryPool; |
| 9525 | stream->write(&opcode_vkCmdResetQueryPool, sizeof(uint32_t)); |
| 9526 | stream->write(&packetSize_vkCmdResetQueryPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9527 | uint64_t cgen_var_637; |
| 9528 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_637, 1); |
| 9529 | stream->write((uint64_t*)&cgen_var_637, 1 * 8); |
| 9530 | uint64_t cgen_var_638; |
| 9531 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_638, 1); |
| 9532 | stream->write((uint64_t*)&cgen_var_638, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9533 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9534 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9535 | AEMU_SCOPED_TRACE("vkCmdResetQueryPool readParams"); |
| 9536 | AEMU_SCOPED_TRACE("vkCmdResetQueryPool returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9537 | mImpl->log("finish vkCmdResetQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9538 | } |
| 9539 | |
| 9540 | void VkEncoder::vkCmdWriteTimestamp( |
| 9541 | VkCommandBuffer commandBuffer, |
| 9542 | VkPipelineStageFlagBits pipelineStage, |
| 9543 | VkQueryPool queryPool, |
| 9544 | uint32_t query) |
| 9545 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9546 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9547 | AEMU_SCOPED_TRACE("vkCmdWriteTimestamp encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9548 | mImpl->log("start vkCmdWriteTimestamp"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9549 | auto stream = mImpl->stream(); |
| 9550 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9551 | auto resources = mImpl->resources(); |
| 9552 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9553 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9554 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9555 | VkPipelineStageFlagBits local_pipelineStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9556 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9557 | uint32_t local_query; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9558 | local_commandBuffer = commandBuffer; |
| 9559 | local_pipelineStage = pipelineStage; |
| 9560 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9561 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9562 | countingStream->rewind(); |
| 9563 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9564 | uint64_t cgen_var_639; |
| 9565 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_639, 1); |
| 9566 | countingStream->write((uint64_t*)&cgen_var_639, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9567 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9568 | uint64_t cgen_var_640; |
| 9569 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_640, 1); |
| 9570 | countingStream->write((uint64_t*)&cgen_var_640, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9571 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9572 | } |
| 9573 | uint32_t packetSize_vkCmdWriteTimestamp = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9574 | countingStream->rewind(); |
| 9575 | uint32_t opcode_vkCmdWriteTimestamp = OP_vkCmdWriteTimestamp; |
| 9576 | stream->write(&opcode_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| 9577 | stream->write(&packetSize_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9578 | uint64_t cgen_var_641; |
| 9579 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_641, 1); |
| 9580 | stream->write((uint64_t*)&cgen_var_641, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9581 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9582 | uint64_t cgen_var_642; |
| 9583 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_642, 1); |
| 9584 | stream->write((uint64_t*)&cgen_var_642, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9585 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9586 | AEMU_SCOPED_TRACE("vkCmdWriteTimestamp readParams"); |
| 9587 | AEMU_SCOPED_TRACE("vkCmdWriteTimestamp returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9588 | mImpl->log("finish vkCmdWriteTimestamp");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9589 | } |
| 9590 | |
| 9591 | void VkEncoder::vkCmdCopyQueryPoolResults( |
| 9592 | VkCommandBuffer commandBuffer, |
| 9593 | VkQueryPool queryPool, |
| 9594 | uint32_t firstQuery, |
| 9595 | uint32_t queryCount, |
| 9596 | VkBuffer dstBuffer, |
| 9597 | VkDeviceSize dstOffset, |
| 9598 | VkDeviceSize stride, |
| 9599 | VkQueryResultFlags flags) |
| 9600 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9601 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9602 | AEMU_SCOPED_TRACE("vkCmdCopyQueryPoolResults encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9603 | mImpl->log("start vkCmdCopyQueryPoolResults"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9604 | auto stream = mImpl->stream(); |
| 9605 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9606 | auto resources = mImpl->resources(); |
| 9607 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9608 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9609 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9610 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9611 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9612 | uint32_t local_queryCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9613 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9614 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9615 | VkDeviceSize local_stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9616 | VkQueryResultFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9617 | local_commandBuffer = commandBuffer; |
| 9618 | local_queryPool = queryPool; |
| 9619 | local_firstQuery = firstQuery; |
| 9620 | local_queryCount = queryCount; |
| 9621 | local_dstBuffer = dstBuffer; |
| 9622 | local_dstOffset = dstOffset; |
| 9623 | local_stride = stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9624 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9625 | countingStream->rewind(); |
| 9626 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9627 | uint64_t cgen_var_643; |
| 9628 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_643, 1); |
| 9629 | countingStream->write((uint64_t*)&cgen_var_643, 1 * 8); |
| 9630 | uint64_t cgen_var_644; |
| 9631 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_644, 1); |
| 9632 | countingStream->write((uint64_t*)&cgen_var_644, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9633 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9634 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9635 | uint64_t cgen_var_645; |
| 9636 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_645, 1); |
| 9637 | countingStream->write((uint64_t*)&cgen_var_645, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9638 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 9639 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 9640 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9641 | } |
| 9642 | uint32_t packetSize_vkCmdCopyQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9643 | countingStream->rewind(); |
| 9644 | uint32_t opcode_vkCmdCopyQueryPoolResults = OP_vkCmdCopyQueryPoolResults; |
| 9645 | stream->write(&opcode_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| 9646 | stream->write(&packetSize_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9647 | uint64_t cgen_var_646; |
| 9648 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_646, 1); |
| 9649 | stream->write((uint64_t*)&cgen_var_646, 1 * 8); |
| 9650 | uint64_t cgen_var_647; |
| 9651 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_647, 1); |
| 9652 | stream->write((uint64_t*)&cgen_var_647, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9653 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9654 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9655 | uint64_t cgen_var_648; |
| 9656 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_648, 1); |
| 9657 | stream->write((uint64_t*)&cgen_var_648, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9658 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 9659 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 9660 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9661 | AEMU_SCOPED_TRACE("vkCmdCopyQueryPoolResults readParams"); |
| 9662 | AEMU_SCOPED_TRACE("vkCmdCopyQueryPoolResults returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9663 | mImpl->log("finish vkCmdCopyQueryPoolResults");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9664 | } |
| 9665 | |
| 9666 | void VkEncoder::vkCmdPushConstants( |
| 9667 | VkCommandBuffer commandBuffer, |
| 9668 | VkPipelineLayout layout, |
| 9669 | VkShaderStageFlags stageFlags, |
| 9670 | uint32_t offset, |
| 9671 | uint32_t size, |
| 9672 | const void* pValues) |
| 9673 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9674 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9675 | AEMU_SCOPED_TRACE("vkCmdPushConstants encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9676 | mImpl->log("start vkCmdPushConstants"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9677 | auto stream = mImpl->stream(); |
| 9678 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9679 | auto resources = mImpl->resources(); |
| 9680 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9681 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9682 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9683 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9684 | VkShaderStageFlags local_stageFlags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9685 | uint32_t local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9686 | uint32_t local_size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9687 | void* local_pValues; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9688 | local_commandBuffer = commandBuffer; |
| 9689 | local_layout = layout; |
| 9690 | local_stageFlags = stageFlags; |
| 9691 | local_offset = offset; |
| 9692 | local_size = size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9693 | local_pValues = nullptr; |
| 9694 | if (pValues) |
| 9695 | { |
| 9696 | local_pValues = (void*)pool->dupArray(pValues, ((size)) * sizeof(const uint8_t)); |
| 9697 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9698 | countingStream->rewind(); |
| 9699 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9700 | uint64_t cgen_var_649; |
| 9701 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_649, 1); |
| 9702 | countingStream->write((uint64_t*)&cgen_var_649, 1 * 8); |
| 9703 | uint64_t cgen_var_650; |
| 9704 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_650, 1); |
| 9705 | countingStream->write((uint64_t*)&cgen_var_650, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9706 | countingStream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 9707 | countingStream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 9708 | countingStream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 9709 | countingStream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9710 | } |
| 9711 | uint32_t packetSize_vkCmdPushConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9712 | countingStream->rewind(); |
| 9713 | uint32_t opcode_vkCmdPushConstants = OP_vkCmdPushConstants; |
| 9714 | stream->write(&opcode_vkCmdPushConstants, sizeof(uint32_t)); |
| 9715 | stream->write(&packetSize_vkCmdPushConstants, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9716 | uint64_t cgen_var_651; |
| 9717 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_651, 1); |
| 9718 | stream->write((uint64_t*)&cgen_var_651, 1 * 8); |
| 9719 | uint64_t cgen_var_652; |
| 9720 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_652, 1); |
| 9721 | stream->write((uint64_t*)&cgen_var_652, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9722 | stream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 9723 | stream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 9724 | stream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 9725 | stream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9726 | AEMU_SCOPED_TRACE("vkCmdPushConstants readParams"); |
| 9727 | AEMU_SCOPED_TRACE("vkCmdPushConstants returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9728 | mImpl->log("finish vkCmdPushConstants");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9729 | } |
| 9730 | |
| 9731 | void VkEncoder::vkCmdBeginRenderPass( |
| 9732 | VkCommandBuffer commandBuffer, |
| 9733 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 9734 | VkSubpassContents contents) |
| 9735 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9736 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9737 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9738 | mImpl->log("start vkCmdBeginRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9739 | auto stream = mImpl->stream(); |
| 9740 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9741 | auto resources = mImpl->resources(); |
| 9742 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9743 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9744 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9745 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9746 | VkSubpassContents local_contents; |
| 9747 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9748 | local_pRenderPassBegin = nullptr; |
| 9749 | if (pRenderPassBegin) |
| 9750 | { |
| 9751 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 9752 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9753 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9754 | local_contents = contents; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9755 | if (local_pRenderPassBegin) |
| 9756 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9757 | transform_tohost_VkRenderPassBeginInfo(mImpl->resources(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9758 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9759 | countingStream->rewind(); |
| 9760 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9761 | uint64_t cgen_var_653; |
| 9762 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_653, 1); |
| 9763 | countingStream->write((uint64_t*)&cgen_var_653, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9764 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9765 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9766 | } |
| 9767 | uint32_t packetSize_vkCmdBeginRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9768 | countingStream->rewind(); |
| 9769 | uint32_t opcode_vkCmdBeginRenderPass = OP_vkCmdBeginRenderPass; |
| 9770 | stream->write(&opcode_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| 9771 | stream->write(&packetSize_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9772 | uint64_t cgen_var_654; |
| 9773 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_654, 1); |
| 9774 | stream->write((uint64_t*)&cgen_var_654, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9775 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9776 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9777 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass readParams"); |
| 9778 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9779 | mImpl->log("finish vkCmdBeginRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9780 | } |
| 9781 | |
| 9782 | void VkEncoder::vkCmdNextSubpass( |
| 9783 | VkCommandBuffer commandBuffer, |
| 9784 | VkSubpassContents contents) |
| 9785 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9786 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9787 | AEMU_SCOPED_TRACE("vkCmdNextSubpass encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9788 | mImpl->log("start vkCmdNextSubpass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9789 | auto stream = mImpl->stream(); |
| 9790 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9791 | auto resources = mImpl->resources(); |
| 9792 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9793 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9794 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9795 | VkSubpassContents local_contents; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9796 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9797 | local_contents = contents; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9798 | countingStream->rewind(); |
| 9799 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9800 | uint64_t cgen_var_655; |
| 9801 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_655, 1); |
| 9802 | countingStream->write((uint64_t*)&cgen_var_655, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9803 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9804 | } |
| 9805 | uint32_t packetSize_vkCmdNextSubpass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9806 | countingStream->rewind(); |
| 9807 | uint32_t opcode_vkCmdNextSubpass = OP_vkCmdNextSubpass; |
| 9808 | stream->write(&opcode_vkCmdNextSubpass, sizeof(uint32_t)); |
| 9809 | stream->write(&packetSize_vkCmdNextSubpass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9810 | uint64_t cgen_var_656; |
| 9811 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_656, 1); |
| 9812 | stream->write((uint64_t*)&cgen_var_656, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9813 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9814 | AEMU_SCOPED_TRACE("vkCmdNextSubpass readParams"); |
| 9815 | AEMU_SCOPED_TRACE("vkCmdNextSubpass returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9816 | mImpl->log("finish vkCmdNextSubpass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9817 | } |
| 9818 | |
| 9819 | void VkEncoder::vkCmdEndRenderPass( |
| 9820 | VkCommandBuffer commandBuffer) |
| 9821 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9822 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9823 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9824 | mImpl->log("start vkCmdEndRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9825 | auto stream = mImpl->stream(); |
| 9826 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9827 | auto resources = mImpl->resources(); |
| 9828 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9829 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9830 | VkCommandBuffer local_commandBuffer; |
| 9831 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9832 | countingStream->rewind(); |
| 9833 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9834 | uint64_t cgen_var_657; |
| 9835 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_657, 1); |
| 9836 | countingStream->write((uint64_t*)&cgen_var_657, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9837 | } |
| 9838 | uint32_t packetSize_vkCmdEndRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9839 | countingStream->rewind(); |
| 9840 | uint32_t opcode_vkCmdEndRenderPass = OP_vkCmdEndRenderPass; |
| 9841 | stream->write(&opcode_vkCmdEndRenderPass, sizeof(uint32_t)); |
| 9842 | stream->write(&packetSize_vkCmdEndRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9843 | uint64_t cgen_var_658; |
| 9844 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_658, 1); |
| 9845 | stream->write((uint64_t*)&cgen_var_658, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9846 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass readParams"); |
| 9847 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9848 | mImpl->log("finish vkCmdEndRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9849 | } |
| 9850 | |
| 9851 | void VkEncoder::vkCmdExecuteCommands( |
| 9852 | VkCommandBuffer commandBuffer, |
| 9853 | uint32_t commandBufferCount, |
| 9854 | const VkCommandBuffer* pCommandBuffers) |
| 9855 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9856 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9857 | AEMU_SCOPED_TRACE("vkCmdExecuteCommands encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9858 | mImpl->log("start vkCmdExecuteCommands"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9859 | auto stream = mImpl->stream(); |
| 9860 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9861 | auto resources = mImpl->resources(); |
| 9862 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9863 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9864 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9865 | uint32_t local_commandBufferCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9866 | VkCommandBuffer* local_pCommandBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9867 | local_commandBuffer = commandBuffer; |
| 9868 | local_commandBufferCount = commandBufferCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9869 | local_pCommandBuffers = nullptr; |
| 9870 | if (pCommandBuffers) |
| 9871 | { |
| 9872 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 9873 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9874 | countingStream->rewind(); |
| 9875 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9876 | uint64_t cgen_var_659; |
| 9877 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_659, 1); |
| 9878 | countingStream->write((uint64_t*)&cgen_var_659, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9879 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9880 | if (((commandBufferCount))) |
| 9881 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9882 | uint64_t* cgen_var_660; |
| 9883 | countingStream->alloc((void**)&cgen_var_660, ((commandBufferCount)) * 8); |
| 9884 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_660, ((commandBufferCount))); |
| 9885 | countingStream->write((uint64_t*)cgen_var_660, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9886 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9887 | } |
| 9888 | uint32_t packetSize_vkCmdExecuteCommands = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9889 | countingStream->rewind(); |
| 9890 | uint32_t opcode_vkCmdExecuteCommands = OP_vkCmdExecuteCommands; |
| 9891 | stream->write(&opcode_vkCmdExecuteCommands, sizeof(uint32_t)); |
| 9892 | stream->write(&packetSize_vkCmdExecuteCommands, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9893 | uint64_t cgen_var_661; |
| 9894 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_661, 1); |
| 9895 | stream->write((uint64_t*)&cgen_var_661, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9896 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9897 | if (((commandBufferCount))) |
| 9898 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9899 | uint64_t* cgen_var_662; |
| 9900 | stream->alloc((void**)&cgen_var_662, ((commandBufferCount)) * 8); |
| 9901 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_662, ((commandBufferCount))); |
| 9902 | stream->write((uint64_t*)cgen_var_662, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9903 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9904 | AEMU_SCOPED_TRACE("vkCmdExecuteCommands readParams"); |
| 9905 | AEMU_SCOPED_TRACE("vkCmdExecuteCommands returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9906 | mImpl->log("finish vkCmdExecuteCommands");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9907 | } |
| 9908 | |
| 9909 | #endif |
| 9910 | #ifdef VK_VERSION_1_1 |
| 9911 | VkResult VkEncoder::vkEnumerateInstanceVersion( |
| 9912 | uint32_t* pApiVersion) |
| 9913 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9914 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | e739199 | 2019-03-15 09:42:13 -0700 | [diff] [blame] | 9915 | AEMU_SCOPED_TRACE("vkEnumerateInstanceVersion encode"); |
| 9916 | mImpl->log("start vkEnumerateInstanceVersion"); |
| 9917 | auto stream = mImpl->stream(); |
| 9918 | auto countingStream = mImpl->countingStream(); |
| 9919 | auto resources = mImpl->resources(); |
| 9920 | auto pool = mImpl->pool(); |
| 9921 | stream->setHandleMapping(resources->unwrapMapping()); |
| 9922 | countingStream->rewind(); |
| 9923 | { |
| 9924 | countingStream->write((uint32_t*)pApiVersion, sizeof(uint32_t)); |
| 9925 | } |
| 9926 | uint32_t packetSize_vkEnumerateInstanceVersion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9927 | countingStream->rewind(); |
| 9928 | uint32_t opcode_vkEnumerateInstanceVersion = OP_vkEnumerateInstanceVersion; |
| 9929 | stream->write(&opcode_vkEnumerateInstanceVersion, sizeof(uint32_t)); |
| 9930 | stream->write(&packetSize_vkEnumerateInstanceVersion, sizeof(uint32_t)); |
| 9931 | stream->write((uint32_t*)pApiVersion, sizeof(uint32_t)); |
| 9932 | AEMU_SCOPED_TRACE("vkEnumerateInstanceVersion readParams"); |
| 9933 | stream->read((uint32_t*)pApiVersion, sizeof(uint32_t)); |
| 9934 | AEMU_SCOPED_TRACE("vkEnumerateInstanceVersion returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9935 | VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0; |
| Lingfeng Yang | e739199 | 2019-03-15 09:42:13 -0700 | [diff] [blame] | 9936 | stream->read(&vkEnumerateInstanceVersion_VkResult_return, sizeof(VkResult)); |
| 9937 | countingStream->clearPool(); |
| 9938 | stream->clearPool(); |
| 9939 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9940 | mImpl->log("finish vkEnumerateInstanceVersion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9941 | return vkEnumerateInstanceVersion_VkResult_return; |
| 9942 | } |
| 9943 | |
| 9944 | VkResult VkEncoder::vkBindBufferMemory2( |
| 9945 | VkDevice device, |
| 9946 | uint32_t bindInfoCount, |
| 9947 | const VkBindBufferMemoryInfo* pBindInfos) |
| 9948 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9949 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9950 | AEMU_SCOPED_TRACE("vkBindBufferMemory2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9951 | mImpl->log("start vkBindBufferMemory2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9952 | auto stream = mImpl->stream(); |
| 9953 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9954 | auto resources = mImpl->resources(); |
| 9955 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9956 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9957 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9958 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9959 | VkBindBufferMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9960 | local_device = device; |
| 9961 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9962 | local_pBindInfos = nullptr; |
| 9963 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9964 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9965 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9966 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9967 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9968 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 9969 | } |
| 9970 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9971 | if (local_pBindInfos) |
| 9972 | { |
| 9973 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9974 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9975 | transform_tohost_VkBindBufferMemoryInfo(mImpl->resources(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9976 | } |
| 9977 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9978 | countingStream->rewind(); |
| 9979 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9980 | uint64_t cgen_var_663; |
| 9981 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_663, 1); |
| 9982 | countingStream->write((uint64_t*)&cgen_var_663, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9983 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 9984 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9985 | { |
| 9986 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9987 | } |
| 9988 | } |
| 9989 | uint32_t packetSize_vkBindBufferMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9990 | countingStream->rewind(); |
| 9991 | uint32_t opcode_vkBindBufferMemory2 = OP_vkBindBufferMemory2; |
| 9992 | stream->write(&opcode_vkBindBufferMemory2, sizeof(uint32_t)); |
| 9993 | stream->write(&packetSize_vkBindBufferMemory2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9994 | uint64_t cgen_var_664; |
| 9995 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_664, 1); |
| 9996 | stream->write((uint64_t*)&cgen_var_664, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9997 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9998 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9999 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10000 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10001 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10002 | AEMU_SCOPED_TRACE("vkBindBufferMemory2 readParams"); |
| 10003 | AEMU_SCOPED_TRACE("vkBindBufferMemory2 returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10004 | VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0; |
| 10005 | stream->read(&vkBindBufferMemory2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10006 | countingStream->clearPool(); |
| 10007 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10008 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10009 | mImpl->log("finish vkBindBufferMemory2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10010 | return vkBindBufferMemory2_VkResult_return; |
| 10011 | } |
| 10012 | |
| 10013 | VkResult VkEncoder::vkBindImageMemory2( |
| 10014 | VkDevice device, |
| 10015 | uint32_t bindInfoCount, |
| 10016 | const VkBindImageMemoryInfo* pBindInfos) |
| 10017 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10018 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10019 | AEMU_SCOPED_TRACE("vkBindImageMemory2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10020 | mImpl->log("start vkBindImageMemory2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10021 | auto stream = mImpl->stream(); |
| 10022 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10023 | auto resources = mImpl->resources(); |
| 10024 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10025 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10026 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10027 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10028 | VkBindImageMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10029 | local_device = device; |
| 10030 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10031 | local_pBindInfos = nullptr; |
| 10032 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10033 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10034 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10035 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 10036 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10037 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 10038 | } |
| 10039 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10040 | if (local_pBindInfos) |
| 10041 | { |
| 10042 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 10043 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10044 | transform_tohost_VkBindImageMemoryInfo(mImpl->resources(), (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10045 | } |
| 10046 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10047 | countingStream->rewind(); |
| 10048 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10049 | uint64_t cgen_var_665; |
| 10050 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_665, 1); |
| 10051 | countingStream->write((uint64_t*)&cgen_var_665, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10052 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 10053 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 10054 | { |
| 10055 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10056 | } |
| 10057 | } |
| 10058 | uint32_t packetSize_vkBindImageMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10059 | countingStream->rewind(); |
| 10060 | uint32_t opcode_vkBindImageMemory2 = OP_vkBindImageMemory2; |
| 10061 | stream->write(&opcode_vkBindImageMemory2, sizeof(uint32_t)); |
| 10062 | stream->write(&packetSize_vkBindImageMemory2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10063 | uint64_t cgen_var_666; |
| 10064 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_666, 1); |
| 10065 | stream->write((uint64_t*)&cgen_var_666, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10066 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10067 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 10068 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10069 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10070 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10071 | AEMU_SCOPED_TRACE("vkBindImageMemory2 readParams"); |
| 10072 | AEMU_SCOPED_TRACE("vkBindImageMemory2 returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10073 | VkResult vkBindImageMemory2_VkResult_return = (VkResult)0; |
| 10074 | stream->read(&vkBindImageMemory2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10075 | countingStream->clearPool(); |
| 10076 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10077 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10078 | mImpl->log("finish vkBindImageMemory2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10079 | return vkBindImageMemory2_VkResult_return; |
| 10080 | } |
| 10081 | |
| 10082 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeatures( |
| 10083 | VkDevice device, |
| 10084 | uint32_t heapIndex, |
| 10085 | uint32_t localDeviceIndex, |
| 10086 | uint32_t remoteDeviceIndex, |
| 10087 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 10088 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10089 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10090 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeatures encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10091 | mImpl->log("start vkGetDeviceGroupPeerMemoryFeatures"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10092 | auto stream = mImpl->stream(); |
| 10093 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10094 | auto resources = mImpl->resources(); |
| 10095 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10096 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10097 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10098 | uint32_t local_heapIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10099 | uint32_t local_localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10100 | uint32_t local_remoteDeviceIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10101 | local_device = device; |
| 10102 | local_heapIndex = heapIndex; |
| 10103 | local_localDeviceIndex = localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10104 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10105 | countingStream->rewind(); |
| 10106 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10107 | uint64_t cgen_var_667; |
| 10108 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_667, 1); |
| 10109 | countingStream->write((uint64_t*)&cgen_var_667, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10110 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 10111 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 10112 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10113 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 10114 | } |
| 10115 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10116 | countingStream->rewind(); |
| 10117 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeatures = OP_vkGetDeviceGroupPeerMemoryFeatures; |
| 10118 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| 10119 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10120 | uint64_t cgen_var_668; |
| 10121 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_668, 1); |
| 10122 | stream->write((uint64_t*)&cgen_var_668, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10123 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 10124 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 10125 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10126 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10127 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeatures readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10128 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10129 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeatures returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10130 | mImpl->log("finish vkGetDeviceGroupPeerMemoryFeatures");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10131 | } |
| 10132 | |
| 10133 | void VkEncoder::vkCmdSetDeviceMask( |
| 10134 | VkCommandBuffer commandBuffer, |
| 10135 | uint32_t deviceMask) |
| 10136 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10137 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10138 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMask encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10139 | mImpl->log("start vkCmdSetDeviceMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10140 | auto stream = mImpl->stream(); |
| 10141 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10142 | auto resources = mImpl->resources(); |
| 10143 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10144 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10145 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10146 | uint32_t local_deviceMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10147 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10148 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10149 | countingStream->rewind(); |
| 10150 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10151 | uint64_t cgen_var_669; |
| 10152 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_669, 1); |
| 10153 | countingStream->write((uint64_t*)&cgen_var_669, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10154 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10155 | } |
| 10156 | uint32_t packetSize_vkCmdSetDeviceMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10157 | countingStream->rewind(); |
| 10158 | uint32_t opcode_vkCmdSetDeviceMask = OP_vkCmdSetDeviceMask; |
| 10159 | stream->write(&opcode_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| 10160 | stream->write(&packetSize_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10161 | uint64_t cgen_var_670; |
| 10162 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_670, 1); |
| 10163 | stream->write((uint64_t*)&cgen_var_670, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10164 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10165 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMask readParams"); |
| 10166 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMask returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10167 | mImpl->log("finish vkCmdSetDeviceMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10168 | } |
| 10169 | |
| 10170 | void VkEncoder::vkCmdDispatchBase( |
| 10171 | VkCommandBuffer commandBuffer, |
| 10172 | uint32_t baseGroupX, |
| 10173 | uint32_t baseGroupY, |
| 10174 | uint32_t baseGroupZ, |
| 10175 | uint32_t groupCountX, |
| 10176 | uint32_t groupCountY, |
| 10177 | uint32_t groupCountZ) |
| 10178 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10179 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10180 | AEMU_SCOPED_TRACE("vkCmdDispatchBase encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10181 | mImpl->log("start vkCmdDispatchBase"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10182 | auto stream = mImpl->stream(); |
| 10183 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10184 | auto resources = mImpl->resources(); |
| 10185 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10186 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10187 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10188 | uint32_t local_baseGroupX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10189 | uint32_t local_baseGroupY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10190 | uint32_t local_baseGroupZ; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10191 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10192 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10193 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10194 | local_commandBuffer = commandBuffer; |
| 10195 | local_baseGroupX = baseGroupX; |
| 10196 | local_baseGroupY = baseGroupY; |
| 10197 | local_baseGroupZ = baseGroupZ; |
| 10198 | local_groupCountX = groupCountX; |
| 10199 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10200 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10201 | countingStream->rewind(); |
| 10202 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10203 | uint64_t cgen_var_671; |
| 10204 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_671, 1); |
| 10205 | countingStream->write((uint64_t*)&cgen_var_671, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10206 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 10207 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 10208 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 10209 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 10210 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 10211 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10212 | } |
| 10213 | uint32_t packetSize_vkCmdDispatchBase = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10214 | countingStream->rewind(); |
| 10215 | uint32_t opcode_vkCmdDispatchBase = OP_vkCmdDispatchBase; |
| 10216 | stream->write(&opcode_vkCmdDispatchBase, sizeof(uint32_t)); |
| 10217 | stream->write(&packetSize_vkCmdDispatchBase, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10218 | uint64_t cgen_var_672; |
| 10219 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_672, 1); |
| 10220 | stream->write((uint64_t*)&cgen_var_672, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10221 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 10222 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 10223 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 10224 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 10225 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 10226 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10227 | AEMU_SCOPED_TRACE("vkCmdDispatchBase readParams"); |
| 10228 | AEMU_SCOPED_TRACE("vkCmdDispatchBase returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10229 | mImpl->log("finish vkCmdDispatchBase");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10230 | } |
| 10231 | |
| 10232 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroups( |
| 10233 | VkInstance instance, |
| 10234 | uint32_t* pPhysicalDeviceGroupCount, |
| 10235 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 10236 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10237 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10238 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroups encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10239 | mImpl->log("start vkEnumeratePhysicalDeviceGroups"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10240 | auto stream = mImpl->stream(); |
| 10241 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10242 | auto resources = mImpl->resources(); |
| 10243 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10244 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10245 | VkInstance local_instance; |
| 10246 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10247 | countingStream->rewind(); |
| 10248 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10249 | uint64_t cgen_var_673; |
| 10250 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_673, 1); |
| 10251 | countingStream->write((uint64_t*)&cgen_var_673, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10252 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10253 | uint64_t cgen_var_674 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 10254 | countingStream->putBe64(cgen_var_674); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10255 | if (pPhysicalDeviceGroupCount) |
| 10256 | { |
| 10257 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 10258 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10259 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10260 | uint64_t cgen_var_675 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 10261 | countingStream->putBe64(cgen_var_675); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10262 | if (pPhysicalDeviceGroupProperties) |
| 10263 | { |
| 10264 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10265 | { |
| 10266 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10267 | } |
| 10268 | } |
| 10269 | } |
| 10270 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroups = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10271 | countingStream->rewind(); |
| 10272 | uint32_t opcode_vkEnumeratePhysicalDeviceGroups = OP_vkEnumeratePhysicalDeviceGroups; |
| 10273 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| 10274 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10275 | uint64_t cgen_var_676; |
| 10276 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_676, 1); |
| 10277 | stream->write((uint64_t*)&cgen_var_676, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10278 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10279 | uint64_t cgen_var_677 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 10280 | stream->putBe64(cgen_var_677); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10281 | if (pPhysicalDeviceGroupCount) |
| 10282 | { |
| 10283 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 10284 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10285 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10286 | uint64_t cgen_var_678 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 10287 | stream->putBe64(cgen_var_678); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10288 | if (pPhysicalDeviceGroupProperties) |
| 10289 | { |
| 10290 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10291 | { |
| 10292 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10293 | } |
| 10294 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10295 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroups readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10296 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10297 | uint32_t* check_pPhysicalDeviceGroupCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10298 | check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10299 | if (pPhysicalDeviceGroupCount) |
| 10300 | { |
| 10301 | if (!(check_pPhysicalDeviceGroupCount)) |
| 10302 | { |
| 10303 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 10304 | } |
| 10305 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 10306 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10307 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10308 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10309 | check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10310 | if (pPhysicalDeviceGroupProperties) |
| 10311 | { |
| 10312 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 10313 | { |
| 10314 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 10315 | } |
| 10316 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10317 | { |
| 10318 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10319 | } |
| 10320 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10321 | if (pPhysicalDeviceGroupProperties) |
| 10322 | { |
| 10323 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10324 | { |
| 10325 | transform_fromhost_VkPhysicalDeviceGroupProperties(mImpl->resources(), (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10326 | } |
| 10327 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10328 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroups returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10329 | VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0; |
| 10330 | stream->read(&vkEnumeratePhysicalDeviceGroups_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10331 | countingStream->clearPool(); |
| 10332 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10333 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10334 | mImpl->log("finish vkEnumeratePhysicalDeviceGroups");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10335 | return vkEnumeratePhysicalDeviceGroups_VkResult_return; |
| 10336 | } |
| 10337 | |
| 10338 | void VkEncoder::vkGetImageMemoryRequirements2( |
| 10339 | VkDevice device, |
| 10340 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 10341 | VkMemoryRequirements2* pMemoryRequirements) |
| 10342 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10343 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10344 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10345 | mImpl->log("start vkGetImageMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10346 | auto stream = mImpl->stream(); |
| 10347 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10348 | auto resources = mImpl->resources(); |
| 10349 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10350 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10351 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10352 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10353 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10354 | local_pInfo = nullptr; |
| 10355 | if (pInfo) |
| 10356 | { |
| 10357 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 10358 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 10359 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10360 | if (local_pInfo) |
| 10361 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10362 | transform_tohost_VkImageMemoryRequirementsInfo2(mImpl->resources(), (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10363 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10364 | countingStream->rewind(); |
| 10365 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10366 | uint64_t cgen_var_681; |
| 10367 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_681, 1); |
| 10368 | countingStream->write((uint64_t*)&cgen_var_681, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10369 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10370 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10371 | } |
| 10372 | uint32_t packetSize_vkGetImageMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10373 | countingStream->rewind(); |
| 10374 | uint32_t opcode_vkGetImageMemoryRequirements2 = OP_vkGetImageMemoryRequirements2; |
| 10375 | stream->write(&opcode_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| 10376 | stream->write(&packetSize_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10377 | uint64_t cgen_var_682; |
| 10378 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_682, 1); |
| 10379 | stream->write((uint64_t*)&cgen_var_682, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10380 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10381 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10382 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10383 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10384 | if (pMemoryRequirements) |
| 10385 | { |
| 10386 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10387 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10388 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10389 | mImpl->log("finish vkGetImageMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10390 | } |
| 10391 | |
| 10392 | void VkEncoder::vkGetBufferMemoryRequirements2( |
| 10393 | VkDevice device, |
| 10394 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 10395 | VkMemoryRequirements2* pMemoryRequirements) |
| 10396 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10397 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10398 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10399 | mImpl->log("start vkGetBufferMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10400 | auto stream = mImpl->stream(); |
| 10401 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10402 | auto resources = mImpl->resources(); |
| 10403 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10404 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10405 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10406 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10407 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10408 | local_pInfo = nullptr; |
| 10409 | if (pInfo) |
| 10410 | { |
| 10411 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 10412 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 10413 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10414 | if (local_pInfo) |
| 10415 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10416 | transform_tohost_VkBufferMemoryRequirementsInfo2(mImpl->resources(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 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 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10420 | uint64_t cgen_var_683; |
| 10421 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_683, 1); |
| 10422 | countingStream->write((uint64_t*)&cgen_var_683, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10423 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10424 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10425 | } |
| 10426 | uint32_t packetSize_vkGetBufferMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10427 | countingStream->rewind(); |
| 10428 | uint32_t opcode_vkGetBufferMemoryRequirements2 = OP_vkGetBufferMemoryRequirements2; |
| 10429 | stream->write(&opcode_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| 10430 | stream->write(&packetSize_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10431 | uint64_t cgen_var_684; |
| 10432 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_684, 1); |
| 10433 | stream->write((uint64_t*)&cgen_var_684, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10434 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10435 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10436 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10437 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10438 | if (pMemoryRequirements) |
| 10439 | { |
| 10440 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10441 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10442 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10443 | mImpl->log("finish vkGetBufferMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10444 | } |
| 10445 | |
| 10446 | void VkEncoder::vkGetImageSparseMemoryRequirements2( |
| 10447 | VkDevice device, |
| 10448 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 10449 | uint32_t* pSparseMemoryRequirementCount, |
| 10450 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 10451 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10452 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10453 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10454 | mImpl->log("start vkGetImageSparseMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10455 | auto stream = mImpl->stream(); |
| 10456 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10457 | auto resources = mImpl->resources(); |
| 10458 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10459 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10460 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10461 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10462 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10463 | local_pInfo = nullptr; |
| 10464 | if (pInfo) |
| 10465 | { |
| 10466 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 10467 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 10468 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10469 | if (local_pInfo) |
| 10470 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10471 | transform_tohost_VkImageSparseMemoryRequirementsInfo2(mImpl->resources(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10472 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10473 | countingStream->rewind(); |
| 10474 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10475 | uint64_t cgen_var_685; |
| 10476 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_685, 1); |
| 10477 | countingStream->write((uint64_t*)&cgen_var_685, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10478 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10479 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10480 | uint64_t cgen_var_686 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 10481 | countingStream->putBe64(cgen_var_686); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10482 | if (pSparseMemoryRequirementCount) |
| 10483 | { |
| 10484 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 10485 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10486 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10487 | uint64_t cgen_var_687 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 10488 | countingStream->putBe64(cgen_var_687); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10489 | if (pSparseMemoryRequirements) |
| 10490 | { |
| 10491 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10492 | { |
| 10493 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10494 | } |
| 10495 | } |
| 10496 | } |
| 10497 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10498 | countingStream->rewind(); |
| 10499 | uint32_t opcode_vkGetImageSparseMemoryRequirements2 = OP_vkGetImageSparseMemoryRequirements2; |
| 10500 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| 10501 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10502 | uint64_t cgen_var_688; |
| 10503 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_688, 1); |
| 10504 | stream->write((uint64_t*)&cgen_var_688, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10505 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10506 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10507 | uint64_t cgen_var_689 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 10508 | stream->putBe64(cgen_var_689); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10509 | if (pSparseMemoryRequirementCount) |
| 10510 | { |
| 10511 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 10512 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10513 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10514 | uint64_t cgen_var_690 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 10515 | stream->putBe64(cgen_var_690); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10516 | if (pSparseMemoryRequirements) |
| 10517 | { |
| 10518 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10519 | { |
| 10520 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10521 | } |
| 10522 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10523 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2 readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10524 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10525 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10526 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10527 | if (pSparseMemoryRequirementCount) |
| 10528 | { |
| 10529 | if (!(check_pSparseMemoryRequirementCount)) |
| 10530 | { |
| 10531 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 10532 | } |
| 10533 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 10534 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10535 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10536 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10537 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10538 | if (pSparseMemoryRequirements) |
| 10539 | { |
| 10540 | if (!(check_pSparseMemoryRequirements)) |
| 10541 | { |
| 10542 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 10543 | } |
| 10544 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10545 | { |
| 10546 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10547 | } |
| 10548 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10549 | if (pSparseMemoryRequirements) |
| 10550 | { |
| 10551 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10552 | { |
| 10553 | transform_fromhost_VkSparseImageMemoryRequirements2(mImpl->resources(), (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10554 | } |
| 10555 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10556 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10557 | mImpl->log("finish vkGetImageSparseMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10558 | } |
| 10559 | |
| 10560 | void VkEncoder::vkGetPhysicalDeviceFeatures2( |
| 10561 | VkPhysicalDevice physicalDevice, |
| 10562 | VkPhysicalDeviceFeatures2* pFeatures) |
| 10563 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10564 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10565 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10566 | mImpl->log("start vkGetPhysicalDeviceFeatures2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10567 | auto stream = mImpl->stream(); |
| 10568 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10569 | auto resources = mImpl->resources(); |
| 10570 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10571 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10572 | VkPhysicalDevice local_physicalDevice; |
| 10573 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10574 | countingStream->rewind(); |
| 10575 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10576 | uint64_t cgen_var_693; |
| 10577 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_693, 1); |
| 10578 | countingStream->write((uint64_t*)&cgen_var_693, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10579 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 10580 | } |
| 10581 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10582 | countingStream->rewind(); |
| 10583 | uint32_t opcode_vkGetPhysicalDeviceFeatures2 = OP_vkGetPhysicalDeviceFeatures2; |
| 10584 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| 10585 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10586 | uint64_t cgen_var_694; |
| 10587 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_694, 1); |
| 10588 | stream->write((uint64_t*)&cgen_var_694, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10589 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10590 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10591 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10592 | if (pFeatures) |
| 10593 | { |
| 10594 | transform_fromhost_VkPhysicalDeviceFeatures2(mImpl->resources(), (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 10595 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10596 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10597 | mImpl->log("finish vkGetPhysicalDeviceFeatures2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10598 | } |
| 10599 | |
| 10600 | void VkEncoder::vkGetPhysicalDeviceProperties2( |
| 10601 | VkPhysicalDevice physicalDevice, |
| 10602 | VkPhysicalDeviceProperties2* pProperties) |
| 10603 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10604 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10605 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2 encode"); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10606 | mImpl->log("start vkGetPhysicalDeviceProperties2"); |
| 10607 | auto stream = mImpl->stream(); |
| 10608 | auto countingStream = mImpl->countingStream(); |
| 10609 | auto resources = mImpl->resources(); |
| 10610 | auto pool = mImpl->pool(); |
| 10611 | stream->setHandleMapping(resources->unwrapMapping()); |
| 10612 | VkPhysicalDevice local_physicalDevice; |
| 10613 | local_physicalDevice = physicalDevice; |
| 10614 | countingStream->rewind(); |
| 10615 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10616 | uint64_t cgen_var_695; |
| 10617 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_695, 1); |
| 10618 | countingStream->write((uint64_t*)&cgen_var_695, 1 * 8); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10619 | marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10620 | } |
| 10621 | uint32_t packetSize_vkGetPhysicalDeviceProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10622 | countingStream->rewind(); |
| 10623 | uint32_t opcode_vkGetPhysicalDeviceProperties2 = OP_vkGetPhysicalDeviceProperties2; |
| 10624 | stream->write(&opcode_vkGetPhysicalDeviceProperties2, sizeof(uint32_t)); |
| 10625 | stream->write(&packetSize_vkGetPhysicalDeviceProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10626 | uint64_t cgen_var_696; |
| 10627 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_696, 1); |
| 10628 | stream->write((uint64_t*)&cgen_var_696, 1 * 8); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10629 | marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10630 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2 readParams"); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10631 | unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10632 | if (pProperties) |
| 10633 | { |
| 10634 | transform_fromhost_VkPhysicalDeviceProperties2(mImpl->resources(), (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10635 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10636 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2 returnUnmarshal"); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10637 | mImpl->log("finish vkGetPhysicalDeviceProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10638 | } |
| 10639 | |
| 10640 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2( |
| 10641 | VkPhysicalDevice physicalDevice, |
| 10642 | VkFormat format, |
| 10643 | VkFormatProperties2* pFormatProperties) |
| 10644 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10645 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10646 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10647 | mImpl->log("start vkGetPhysicalDeviceFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10648 | auto stream = mImpl->stream(); |
| 10649 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10650 | auto resources = mImpl->resources(); |
| 10651 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10652 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10653 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10654 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10655 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10656 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10657 | countingStream->rewind(); |
| 10658 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10659 | uint64_t cgen_var_697; |
| 10660 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_697, 1); |
| 10661 | countingStream->write((uint64_t*)&cgen_var_697, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10662 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10663 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 10664 | } |
| 10665 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10666 | countingStream->rewind(); |
| 10667 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2 = OP_vkGetPhysicalDeviceFormatProperties2; |
| 10668 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| 10669 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10670 | uint64_t cgen_var_698; |
| 10671 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_698, 1); |
| 10672 | stream->write((uint64_t*)&cgen_var_698, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10673 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10674 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10675 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10676 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10677 | if (pFormatProperties) |
| 10678 | { |
| 10679 | transform_fromhost_VkFormatProperties2(mImpl->resources(), (VkFormatProperties2*)(pFormatProperties)); |
| 10680 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10681 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10682 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10683 | } |
| 10684 | |
| 10685 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2( |
| 10686 | VkPhysicalDevice physicalDevice, |
| 10687 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 10688 | VkImageFormatProperties2* pImageFormatProperties) |
| 10689 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10690 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10691 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10692 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10693 | auto stream = mImpl->stream(); |
| 10694 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10695 | auto resources = mImpl->resources(); |
| 10696 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10697 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10698 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10699 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10700 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10701 | local_pImageFormatInfo = nullptr; |
| 10702 | if (pImageFormatInfo) |
| 10703 | { |
| 10704 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 10705 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 10706 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10707 | if (local_pImageFormatInfo) |
| 10708 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10709 | transform_tohost_VkPhysicalDeviceImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10710 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10711 | countingStream->rewind(); |
| 10712 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10713 | uint64_t cgen_var_699; |
| 10714 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_699, 1); |
| 10715 | countingStream->write((uint64_t*)&cgen_var_699, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10716 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10717 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 10718 | } |
| 10719 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10720 | countingStream->rewind(); |
| 10721 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2 = OP_vkGetPhysicalDeviceImageFormatProperties2; |
| 10722 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| 10723 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10724 | uint64_t cgen_var_700; |
| 10725 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_700, 1); |
| 10726 | stream->write((uint64_t*)&cgen_var_700, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10727 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10728 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10729 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10730 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10731 | if (pImageFormatProperties) |
| 10732 | { |
| 10733 | transform_fromhost_VkImageFormatProperties2(mImpl->resources(), (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 10734 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10735 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2 returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10736 | VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0; |
| 10737 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10738 | countingStream->clearPool(); |
| 10739 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10740 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10741 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10742 | return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return; |
| 10743 | } |
| 10744 | |
| 10745 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2( |
| 10746 | VkPhysicalDevice physicalDevice, |
| 10747 | uint32_t* pQueueFamilyPropertyCount, |
| 10748 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 10749 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10750 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10751 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10752 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10753 | auto stream = mImpl->stream(); |
| 10754 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10755 | auto resources = mImpl->resources(); |
| 10756 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10757 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10758 | VkPhysicalDevice local_physicalDevice; |
| 10759 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10760 | countingStream->rewind(); |
| 10761 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10762 | uint64_t cgen_var_701; |
| 10763 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_701, 1); |
| 10764 | countingStream->write((uint64_t*)&cgen_var_701, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10765 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10766 | uint64_t cgen_var_702 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 10767 | countingStream->putBe64(cgen_var_702); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10768 | if (pQueueFamilyPropertyCount) |
| 10769 | { |
| 10770 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10771 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10772 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10773 | uint64_t cgen_var_703 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 10774 | countingStream->putBe64(cgen_var_703); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10775 | if (pQueueFamilyProperties) |
| 10776 | { |
| 10777 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10778 | { |
| 10779 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10780 | } |
| 10781 | } |
| 10782 | } |
| 10783 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10784 | countingStream->rewind(); |
| 10785 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2 = OP_vkGetPhysicalDeviceQueueFamilyProperties2; |
| 10786 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| 10787 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10788 | uint64_t cgen_var_704; |
| 10789 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_704, 1); |
| 10790 | stream->write((uint64_t*)&cgen_var_704, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10791 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10792 | uint64_t cgen_var_705 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 10793 | stream->putBe64(cgen_var_705); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10794 | if (pQueueFamilyPropertyCount) |
| 10795 | { |
| 10796 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10797 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10798 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10799 | uint64_t cgen_var_706 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 10800 | stream->putBe64(cgen_var_706); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10801 | if (pQueueFamilyProperties) |
| 10802 | { |
| 10803 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10804 | { |
| 10805 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10806 | } |
| 10807 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10808 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2 readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10809 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10810 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10811 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10812 | if (pQueueFamilyPropertyCount) |
| 10813 | { |
| 10814 | if (!(check_pQueueFamilyPropertyCount)) |
| 10815 | { |
| 10816 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 10817 | } |
| 10818 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10819 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10820 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10821 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10822 | check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10823 | if (pQueueFamilyProperties) |
| 10824 | { |
| 10825 | if (!(check_pQueueFamilyProperties)) |
| 10826 | { |
| 10827 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 10828 | } |
| 10829 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10830 | { |
| 10831 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10832 | } |
| 10833 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10834 | if (pQueueFamilyProperties) |
| 10835 | { |
| 10836 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10837 | { |
| 10838 | transform_fromhost_VkQueueFamilyProperties2(mImpl->resources(), (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10839 | } |
| 10840 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10841 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10842 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10843 | } |
| 10844 | |
| 10845 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2( |
| 10846 | VkPhysicalDevice physicalDevice, |
| 10847 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 10848 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10849 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10850 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10851 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10852 | auto stream = mImpl->stream(); |
| 10853 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10854 | auto resources = mImpl->resources(); |
| 10855 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10856 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10857 | VkPhysicalDevice local_physicalDevice; |
| 10858 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10859 | countingStream->rewind(); |
| 10860 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10861 | uint64_t cgen_var_709; |
| 10862 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_709, 1); |
| 10863 | countingStream->write((uint64_t*)&cgen_var_709, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10864 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10865 | } |
| 10866 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10867 | countingStream->rewind(); |
| 10868 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2 = OP_vkGetPhysicalDeviceMemoryProperties2; |
| 10869 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| 10870 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10871 | uint64_t cgen_var_710; |
| 10872 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_710, 1); |
| 10873 | stream->write((uint64_t*)&cgen_var_710, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10874 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10875 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10876 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10877 | if (pMemoryProperties) |
| 10878 | { |
| 10879 | transform_fromhost_VkPhysicalDeviceMemoryProperties2(mImpl->resources(), (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10880 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10881 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2 returnUnmarshal"); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10882 | encoderLock.unlock(); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10883 | mImpl->resources()->on_vkGetPhysicalDeviceMemoryProperties2(this, physicalDevice, pMemoryProperties); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10884 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10885 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10886 | } |
| 10887 | |
| 10888 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2( |
| 10889 | VkPhysicalDevice physicalDevice, |
| 10890 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 10891 | uint32_t* pPropertyCount, |
| 10892 | VkSparseImageFormatProperties2* pProperties) |
| 10893 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10894 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10895 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10896 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10897 | auto stream = mImpl->stream(); |
| 10898 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10899 | auto resources = mImpl->resources(); |
| 10900 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10901 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10902 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10903 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10904 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10905 | local_pFormatInfo = nullptr; |
| 10906 | if (pFormatInfo) |
| 10907 | { |
| 10908 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 10909 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 10910 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10911 | if (local_pFormatInfo) |
| 10912 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10913 | transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10914 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10915 | countingStream->rewind(); |
| 10916 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10917 | uint64_t cgen_var_711; |
| 10918 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_711, 1); |
| 10919 | countingStream->write((uint64_t*)&cgen_var_711, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10920 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10921 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10922 | uint64_t cgen_var_712 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10923 | countingStream->putBe64(cgen_var_712); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10924 | if (pPropertyCount) |
| 10925 | { |
| 10926 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10927 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10928 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10929 | uint64_t cgen_var_713 = (uint64_t)(uintptr_t)pProperties; |
| 10930 | countingStream->putBe64(cgen_var_713); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10931 | if (pProperties) |
| 10932 | { |
| 10933 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10934 | { |
| 10935 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10936 | } |
| 10937 | } |
| 10938 | } |
| 10939 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10940 | countingStream->rewind(); |
| 10941 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2 = OP_vkGetPhysicalDeviceSparseImageFormatProperties2; |
| 10942 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| 10943 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10944 | uint64_t cgen_var_714; |
| 10945 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_714, 1); |
| 10946 | stream->write((uint64_t*)&cgen_var_714, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10947 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10948 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10949 | uint64_t cgen_var_715 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10950 | stream->putBe64(cgen_var_715); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10951 | if (pPropertyCount) |
| 10952 | { |
| 10953 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10954 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10955 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10956 | uint64_t cgen_var_716 = (uint64_t)(uintptr_t)pProperties; |
| 10957 | stream->putBe64(cgen_var_716); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10958 | if (pProperties) |
| 10959 | { |
| 10960 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10961 | { |
| 10962 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10963 | } |
| 10964 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10965 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2 readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10966 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10967 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10968 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10969 | if (pPropertyCount) |
| 10970 | { |
| 10971 | if (!(check_pPropertyCount)) |
| 10972 | { |
| 10973 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 10974 | } |
| 10975 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10976 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10977 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10978 | VkSparseImageFormatProperties2* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10979 | check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10980 | if (pProperties) |
| 10981 | { |
| 10982 | if (!(check_pProperties)) |
| 10983 | { |
| 10984 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 10985 | } |
| 10986 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10987 | { |
| 10988 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10989 | } |
| 10990 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10991 | if (pProperties) |
| 10992 | { |
| 10993 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10994 | { |
| 10995 | transform_fromhost_VkSparseImageFormatProperties2(mImpl->resources(), (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10996 | } |
| 10997 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10998 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10999 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11000 | } |
| 11001 | |
| 11002 | void VkEncoder::vkTrimCommandPool( |
| 11003 | VkDevice device, |
| 11004 | VkCommandPool commandPool, |
| 11005 | VkCommandPoolTrimFlags flags) |
| 11006 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11007 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11008 | AEMU_SCOPED_TRACE("vkTrimCommandPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11009 | mImpl->log("start vkTrimCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11010 | auto stream = mImpl->stream(); |
| 11011 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11012 | auto resources = mImpl->resources(); |
| 11013 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11014 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11015 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11016 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11017 | VkCommandPoolTrimFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11018 | local_device = device; |
| 11019 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11020 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11021 | countingStream->rewind(); |
| 11022 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11023 | uint64_t cgen_var_719; |
| 11024 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_719, 1); |
| 11025 | countingStream->write((uint64_t*)&cgen_var_719, 1 * 8); |
| 11026 | uint64_t cgen_var_720; |
| 11027 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_720, 1); |
| 11028 | countingStream->write((uint64_t*)&cgen_var_720, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11029 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11030 | } |
| 11031 | uint32_t packetSize_vkTrimCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11032 | countingStream->rewind(); |
| 11033 | uint32_t opcode_vkTrimCommandPool = OP_vkTrimCommandPool; |
| 11034 | stream->write(&opcode_vkTrimCommandPool, sizeof(uint32_t)); |
| 11035 | stream->write(&packetSize_vkTrimCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11036 | uint64_t cgen_var_721; |
| 11037 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_721, 1); |
| 11038 | stream->write((uint64_t*)&cgen_var_721, 1 * 8); |
| 11039 | uint64_t cgen_var_722; |
| 11040 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_722, 1); |
| 11041 | stream->write((uint64_t*)&cgen_var_722, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11042 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11043 | AEMU_SCOPED_TRACE("vkTrimCommandPool readParams"); |
| 11044 | AEMU_SCOPED_TRACE("vkTrimCommandPool returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11045 | mImpl->log("finish vkTrimCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11046 | } |
| 11047 | |
| 11048 | void VkEncoder::vkGetDeviceQueue2( |
| 11049 | VkDevice device, |
| 11050 | const VkDeviceQueueInfo2* pQueueInfo, |
| 11051 | VkQueue* pQueue) |
| 11052 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11053 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11054 | AEMU_SCOPED_TRACE("vkGetDeviceQueue2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11055 | mImpl->log("start vkGetDeviceQueue2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11056 | auto stream = mImpl->stream(); |
| 11057 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11058 | auto resources = mImpl->resources(); |
| 11059 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11060 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11061 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11062 | VkDeviceQueueInfo2* local_pQueueInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11063 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11064 | local_pQueueInfo = nullptr; |
| 11065 | if (pQueueInfo) |
| 11066 | { |
| 11067 | local_pQueueInfo = (VkDeviceQueueInfo2*)pool->alloc(sizeof(const VkDeviceQueueInfo2)); |
| 11068 | deepcopy_VkDeviceQueueInfo2(pool, pQueueInfo, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| 11069 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11070 | if (local_pQueueInfo) |
| 11071 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11072 | transform_tohost_VkDeviceQueueInfo2(mImpl->resources(), (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11073 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11074 | countingStream->rewind(); |
| 11075 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11076 | uint64_t cgen_var_723; |
| 11077 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_723, 1); |
| 11078 | countingStream->write((uint64_t*)&cgen_var_723, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11079 | marshal_VkDeviceQueueInfo2(countingStream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11080 | uint64_t cgen_var_724; |
| 11081 | countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_724, 1); |
| 11082 | countingStream->write((uint64_t*)&cgen_var_724, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11083 | } |
| 11084 | uint32_t packetSize_vkGetDeviceQueue2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11085 | countingStream->rewind(); |
| 11086 | uint32_t opcode_vkGetDeviceQueue2 = OP_vkGetDeviceQueue2; |
| 11087 | stream->write(&opcode_vkGetDeviceQueue2, sizeof(uint32_t)); |
| 11088 | stream->write(&packetSize_vkGetDeviceQueue2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11089 | uint64_t cgen_var_725; |
| 11090 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_725, 1); |
| 11091 | stream->write((uint64_t*)&cgen_var_725, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11092 | marshal_VkDeviceQueueInfo2(stream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11093 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11094 | uint64_t cgen_var_726; |
| 11095 | stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_726, 1); |
| 11096 | stream->write((uint64_t*)&cgen_var_726, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11097 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11098 | AEMU_SCOPED_TRACE("vkGetDeviceQueue2 readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11099 | uint64_t cgen_var_727; |
| 11100 | stream->read((uint64_t*)&cgen_var_727, 8); |
| 11101 | stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_727, (VkQueue*)pQueue, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11102 | AEMU_SCOPED_TRACE("vkGetDeviceQueue2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11103 | mImpl->log("finish vkGetDeviceQueue2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11104 | } |
| 11105 | |
| 11106 | VkResult VkEncoder::vkCreateSamplerYcbcrConversion( |
| 11107 | VkDevice device, |
| 11108 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 11109 | const VkAllocationCallbacks* pAllocator, |
| 11110 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 11111 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11112 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11113 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversion encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11114 | mImpl->log("start vkCreateSamplerYcbcrConversion"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11115 | auto stream = mImpl->stream(); |
| 11116 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11117 | auto resources = mImpl->resources(); |
| 11118 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11119 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11120 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11121 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11122 | VkAllocationCallbacks* local_pAllocator; |
| 11123 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11124 | local_pCreateInfo = nullptr; |
| 11125 | if (pCreateInfo) |
| 11126 | { |
| 11127 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 11128 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 11129 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11130 | local_pAllocator = nullptr; |
| 11131 | if (pAllocator) |
| 11132 | { |
| 11133 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11134 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11135 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11136 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11137 | if (local_pCreateInfo) |
| 11138 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11139 | transform_tohost_VkSamplerYcbcrConversionCreateInfo(mImpl->resources(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11140 | } |
| 11141 | if (local_pAllocator) |
| 11142 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11143 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11144 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11145 | countingStream->rewind(); |
| 11146 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11147 | uint64_t cgen_var_728; |
| 11148 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_728, 1); |
| 11149 | countingStream->write((uint64_t*)&cgen_var_728, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11150 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11151 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11152 | uint64_t cgen_var_729 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11153 | countingStream->putBe64(cgen_var_729); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11154 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11155 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11156 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11157 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11158 | uint64_t cgen_var_730; |
| 11159 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_730, 1); |
| 11160 | countingStream->write((uint64_t*)&cgen_var_730, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11161 | } |
| 11162 | uint32_t packetSize_vkCreateSamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11163 | countingStream->rewind(); |
| 11164 | uint32_t opcode_vkCreateSamplerYcbcrConversion = OP_vkCreateSamplerYcbcrConversion; |
| 11165 | stream->write(&opcode_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| 11166 | stream->write(&packetSize_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11167 | uint64_t cgen_var_731; |
| 11168 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_731, 1); |
| 11169 | stream->write((uint64_t*)&cgen_var_731, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11170 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11171 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11172 | uint64_t cgen_var_732 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11173 | stream->putBe64(cgen_var_732); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11174 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11175 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11176 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11177 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11178 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11179 | uint64_t cgen_var_733; |
| 11180 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_733, 1); |
| 11181 | stream->write((uint64_t*)&cgen_var_733, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11182 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11183 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversion readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11184 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11185 | uint64_t cgen_var_734; |
| 11186 | stream->read((uint64_t*)&cgen_var_734, 8); |
| 11187 | stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_734, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11188 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11189 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversion returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11190 | VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0; |
| 11191 | stream->read(&vkCreateSamplerYcbcrConversion_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11192 | countingStream->clearPool(); |
| 11193 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11194 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11195 | mImpl->log("finish vkCreateSamplerYcbcrConversion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11196 | return vkCreateSamplerYcbcrConversion_VkResult_return; |
| 11197 | } |
| 11198 | |
| 11199 | void VkEncoder::vkDestroySamplerYcbcrConversion( |
| 11200 | VkDevice device, |
| 11201 | VkSamplerYcbcrConversion ycbcrConversion, |
| 11202 | const VkAllocationCallbacks* pAllocator) |
| 11203 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11204 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11205 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversion encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11206 | mImpl->log("start vkDestroySamplerYcbcrConversion"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11207 | auto stream = mImpl->stream(); |
| 11208 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11209 | auto resources = mImpl->resources(); |
| 11210 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11211 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11212 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11213 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11214 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11215 | local_device = device; |
| 11216 | local_ycbcrConversion = ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11217 | local_pAllocator = nullptr; |
| 11218 | if (pAllocator) |
| 11219 | { |
| 11220 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11221 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11222 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11223 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11224 | if (local_pAllocator) |
| 11225 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11226 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11227 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11228 | countingStream->rewind(); |
| 11229 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11230 | uint64_t cgen_var_735; |
| 11231 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_735, 1); |
| 11232 | countingStream->write((uint64_t*)&cgen_var_735, 1 * 8); |
| 11233 | uint64_t cgen_var_736; |
| 11234 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_736, 1); |
| 11235 | countingStream->write((uint64_t*)&cgen_var_736, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11236 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11237 | uint64_t cgen_var_737 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11238 | countingStream->putBe64(cgen_var_737); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11239 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11240 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11241 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11242 | } |
| 11243 | } |
| 11244 | uint32_t packetSize_vkDestroySamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11245 | countingStream->rewind(); |
| 11246 | uint32_t opcode_vkDestroySamplerYcbcrConversion = OP_vkDestroySamplerYcbcrConversion; |
| 11247 | stream->write(&opcode_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| 11248 | stream->write(&packetSize_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11249 | uint64_t cgen_var_738; |
| 11250 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_738, 1); |
| 11251 | stream->write((uint64_t*)&cgen_var_738, 1 * 8); |
| 11252 | uint64_t cgen_var_739; |
| 11253 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_739, 1); |
| 11254 | stream->write((uint64_t*)&cgen_var_739, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11255 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11256 | uint64_t cgen_var_740 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11257 | stream->putBe64(cgen_var_740); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11258 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11259 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11260 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11261 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11262 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversion readParams"); |
| 11263 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversion returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11264 | resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11265 | mImpl->log("finish vkDestroySamplerYcbcrConversion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11266 | } |
| 11267 | |
| 11268 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplate( |
| 11269 | VkDevice device, |
| 11270 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 11271 | const VkAllocationCallbacks* pAllocator, |
| 11272 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 11273 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11274 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11275 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplate encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11276 | mImpl->log("start vkCreateDescriptorUpdateTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11277 | auto stream = mImpl->stream(); |
| 11278 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11279 | auto resources = mImpl->resources(); |
| 11280 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11281 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11282 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11283 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11284 | VkAllocationCallbacks* local_pAllocator; |
| 11285 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11286 | local_pCreateInfo = nullptr; |
| 11287 | if (pCreateInfo) |
| 11288 | { |
| 11289 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 11290 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 11291 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11292 | local_pAllocator = nullptr; |
| 11293 | if (pAllocator) |
| 11294 | { |
| 11295 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11296 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11297 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11298 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11299 | if (local_pCreateInfo) |
| 11300 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11301 | transform_tohost_VkDescriptorUpdateTemplateCreateInfo(mImpl->resources(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11302 | } |
| 11303 | if (local_pAllocator) |
| 11304 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11305 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11306 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11307 | countingStream->rewind(); |
| 11308 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11309 | uint64_t cgen_var_741; |
| 11310 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_741, 1); |
| 11311 | countingStream->write((uint64_t*)&cgen_var_741, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11312 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11313 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11314 | uint64_t cgen_var_742 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11315 | countingStream->putBe64(cgen_var_742); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11316 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11317 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11318 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11319 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11320 | uint64_t cgen_var_743; |
| 11321 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_743, 1); |
| 11322 | countingStream->write((uint64_t*)&cgen_var_743, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11323 | } |
| 11324 | uint32_t packetSize_vkCreateDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11325 | countingStream->rewind(); |
| 11326 | uint32_t opcode_vkCreateDescriptorUpdateTemplate = OP_vkCreateDescriptorUpdateTemplate; |
| 11327 | stream->write(&opcode_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 11328 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11329 | uint64_t cgen_var_744; |
| 11330 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_744, 1); |
| 11331 | stream->write((uint64_t*)&cgen_var_744, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11332 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11333 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11334 | uint64_t cgen_var_745 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11335 | stream->putBe64(cgen_var_745); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11336 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11337 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11338 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11339 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11340 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11341 | uint64_t cgen_var_746; |
| 11342 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_746, 1); |
| 11343 | stream->write((uint64_t*)&cgen_var_746, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11344 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11345 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplate readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11346 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11347 | uint64_t cgen_var_747; |
| 11348 | stream->read((uint64_t*)&cgen_var_747, 8); |
| 11349 | stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_747, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11350 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11351 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplate returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11352 | VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0; |
| 11353 | stream->read(&vkCreateDescriptorUpdateTemplate_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11354 | countingStream->clearPool(); |
| 11355 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11356 | pool->freeAll(); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11357 | encoderLock.unlock(); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 11358 | mImpl->resources()->on_vkCreateDescriptorUpdateTemplate(this, vkCreateDescriptorUpdateTemplate_VkResult_return, device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11359 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11360 | mImpl->log("finish vkCreateDescriptorUpdateTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11361 | return vkCreateDescriptorUpdateTemplate_VkResult_return; |
| 11362 | } |
| 11363 | |
| 11364 | void VkEncoder::vkDestroyDescriptorUpdateTemplate( |
| 11365 | VkDevice device, |
| 11366 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 11367 | const VkAllocationCallbacks* pAllocator) |
| 11368 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11369 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11370 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplate encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11371 | mImpl->log("start vkDestroyDescriptorUpdateTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11372 | auto stream = mImpl->stream(); |
| 11373 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11374 | auto resources = mImpl->resources(); |
| 11375 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11376 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11377 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11378 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11379 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11380 | local_device = device; |
| 11381 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11382 | local_pAllocator = nullptr; |
| 11383 | if (pAllocator) |
| 11384 | { |
| 11385 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11386 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11387 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11388 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11389 | if (local_pAllocator) |
| 11390 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11391 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11392 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11393 | countingStream->rewind(); |
| 11394 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11395 | uint64_t cgen_var_748; |
| 11396 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_748, 1); |
| 11397 | countingStream->write((uint64_t*)&cgen_var_748, 1 * 8); |
| 11398 | uint64_t cgen_var_749; |
| 11399 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_749, 1); |
| 11400 | countingStream->write((uint64_t*)&cgen_var_749, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11401 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11402 | uint64_t cgen_var_750 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11403 | countingStream->putBe64(cgen_var_750); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11404 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11405 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11406 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11407 | } |
| 11408 | } |
| 11409 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11410 | countingStream->rewind(); |
| 11411 | uint32_t opcode_vkDestroyDescriptorUpdateTemplate = OP_vkDestroyDescriptorUpdateTemplate; |
| 11412 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 11413 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11414 | uint64_t cgen_var_751; |
| 11415 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_751, 1); |
| 11416 | stream->write((uint64_t*)&cgen_var_751, 1 * 8); |
| 11417 | uint64_t cgen_var_752; |
| 11418 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_752, 1); |
| 11419 | stream->write((uint64_t*)&cgen_var_752, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11420 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11421 | uint64_t cgen_var_753 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11422 | stream->putBe64(cgen_var_753); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11423 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11424 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11425 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11426 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11427 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplate readParams"); |
| 11428 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplate returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11429 | resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11430 | mImpl->log("finish vkDestroyDescriptorUpdateTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11431 | } |
| 11432 | |
| 11433 | void VkEncoder::vkUpdateDescriptorSetWithTemplate( |
| 11434 | VkDevice device, |
| 11435 | VkDescriptorSet descriptorSet, |
| 11436 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 11437 | const void* pData) |
| 11438 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11439 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11440 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplate encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11441 | mImpl->log("start vkUpdateDescriptorSetWithTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11442 | auto stream = mImpl->stream(); |
| 11443 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11444 | auto resources = mImpl->resources(); |
| 11445 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11446 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11447 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11448 | VkDescriptorSet local_descriptorSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11449 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11450 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11451 | local_device = device; |
| 11452 | local_descriptorSet = descriptorSet; |
| 11453 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11454 | local_pData = nullptr; |
| 11455 | if (pData) |
| 11456 | { |
| 11457 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 11458 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11459 | countingStream->rewind(); |
| 11460 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11461 | uint64_t cgen_var_754; |
| 11462 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_754, 1); |
| 11463 | countingStream->write((uint64_t*)&cgen_var_754, 1 * 8); |
| 11464 | uint64_t cgen_var_755; |
| 11465 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_755, 1); |
| 11466 | countingStream->write((uint64_t*)&cgen_var_755, 1 * 8); |
| 11467 | uint64_t cgen_var_756; |
| 11468 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_756, 1); |
| 11469 | countingStream->write((uint64_t*)&cgen_var_756, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11470 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11471 | uint64_t cgen_var_757 = (uint64_t)(uintptr_t)local_pData; |
| 11472 | countingStream->putBe64(cgen_var_757); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11473 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11474 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11475 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11476 | } |
| 11477 | } |
| 11478 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11479 | countingStream->rewind(); |
| 11480 | uint32_t opcode_vkUpdateDescriptorSetWithTemplate = OP_vkUpdateDescriptorSetWithTemplate; |
| 11481 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t)); |
| 11482 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11483 | uint64_t cgen_var_758; |
| 11484 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_758, 1); |
| 11485 | stream->write((uint64_t*)&cgen_var_758, 1 * 8); |
| 11486 | uint64_t cgen_var_759; |
| 11487 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_759, 1); |
| 11488 | stream->write((uint64_t*)&cgen_var_759, 1 * 8); |
| 11489 | uint64_t cgen_var_760; |
| 11490 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_760, 1); |
| 11491 | stream->write((uint64_t*)&cgen_var_760, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11492 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11493 | uint64_t cgen_var_761 = (uint64_t)(uintptr_t)local_pData; |
| 11494 | stream->putBe64(cgen_var_761); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11495 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11496 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11497 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11498 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11499 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplate readParams"); |
| 11500 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplate returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11501 | mImpl->log("finish vkUpdateDescriptorSetWithTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11502 | } |
| 11503 | |
| 11504 | void VkEncoder::vkGetPhysicalDeviceExternalBufferProperties( |
| 11505 | VkPhysicalDevice physicalDevice, |
| 11506 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 11507 | VkExternalBufferProperties* pExternalBufferProperties) |
| 11508 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11509 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11510 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11511 | mImpl->log("start vkGetPhysicalDeviceExternalBufferProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11512 | auto stream = mImpl->stream(); |
| 11513 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11514 | auto resources = mImpl->resources(); |
| 11515 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11516 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11517 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11518 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11519 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11520 | local_pExternalBufferInfo = nullptr; |
| 11521 | if (pExternalBufferInfo) |
| 11522 | { |
| 11523 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 11524 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 11525 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11526 | if (local_pExternalBufferInfo) |
| 11527 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 11528 | mImpl->resources()->transformImpl_VkPhysicalDeviceExternalBufferInfo_tohost(local_pExternalBufferInfo, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11529 | transform_tohost_VkPhysicalDeviceExternalBufferInfo(mImpl->resources(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11530 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11531 | countingStream->rewind(); |
| 11532 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11533 | uint64_t cgen_var_762; |
| 11534 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_762, 1); |
| 11535 | countingStream->write((uint64_t*)&cgen_var_762, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11536 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11537 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 11538 | } |
| 11539 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11540 | countingStream->rewind(); |
| 11541 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferProperties = OP_vkGetPhysicalDeviceExternalBufferProperties; |
| 11542 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t)); |
| 11543 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11544 | uint64_t cgen_var_763; |
| 11545 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_763, 1); |
| 11546 | stream->write((uint64_t*)&cgen_var_763, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11547 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11548 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11549 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11550 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11551 | if (pExternalBufferProperties) |
| 11552 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 11553 | mImpl->resources()->transformImpl_VkExternalBufferProperties_fromhost(pExternalBufferProperties, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11554 | transform_fromhost_VkExternalBufferProperties(mImpl->resources(), (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 11555 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11556 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11557 | mImpl->log("finish vkGetPhysicalDeviceExternalBufferProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11558 | } |
| 11559 | |
| 11560 | void VkEncoder::vkGetPhysicalDeviceExternalFenceProperties( |
| 11561 | VkPhysicalDevice physicalDevice, |
| 11562 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 11563 | VkExternalFenceProperties* pExternalFenceProperties) |
| 11564 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11565 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11566 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFenceProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11567 | mImpl->log("start vkGetPhysicalDeviceExternalFenceProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11568 | auto stream = mImpl->stream(); |
| 11569 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11570 | auto resources = mImpl->resources(); |
| 11571 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11572 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11573 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11574 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11575 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11576 | local_pExternalFenceInfo = nullptr; |
| 11577 | if (pExternalFenceInfo) |
| 11578 | { |
| 11579 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 11580 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 11581 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11582 | if (local_pExternalFenceInfo) |
| 11583 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11584 | transform_tohost_VkPhysicalDeviceExternalFenceInfo(mImpl->resources(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11585 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11586 | countingStream->rewind(); |
| 11587 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11588 | uint64_t cgen_var_764; |
| 11589 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_764, 1); |
| 11590 | countingStream->write((uint64_t*)&cgen_var_764, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11591 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11592 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 11593 | } |
| 11594 | uint32_t packetSize_vkGetPhysicalDeviceExternalFenceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11595 | countingStream->rewind(); |
| 11596 | uint32_t opcode_vkGetPhysicalDeviceExternalFenceProperties = OP_vkGetPhysicalDeviceExternalFenceProperties; |
| 11597 | stream->write(&opcode_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t)); |
| 11598 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11599 | uint64_t cgen_var_765; |
| 11600 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_765, 1); |
| 11601 | stream->write((uint64_t*)&cgen_var_765, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11602 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11603 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11604 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFenceProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11605 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11606 | if (pExternalFenceProperties) |
| 11607 | { |
| 11608 | transform_fromhost_VkExternalFenceProperties(mImpl->resources(), (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 11609 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11610 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFenceProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11611 | mImpl->log("finish vkGetPhysicalDeviceExternalFenceProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11612 | } |
| 11613 | |
| 11614 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphoreProperties( |
| 11615 | VkPhysicalDevice physicalDevice, |
| 11616 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 11617 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 11618 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11619 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11620 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphoreProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11621 | mImpl->log("start vkGetPhysicalDeviceExternalSemaphoreProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11622 | auto stream = mImpl->stream(); |
| 11623 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11624 | auto resources = mImpl->resources(); |
| 11625 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11626 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11627 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11628 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11629 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11630 | local_pExternalSemaphoreInfo = nullptr; |
| 11631 | if (pExternalSemaphoreInfo) |
| 11632 | { |
| 11633 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 11634 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 11635 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11636 | if (local_pExternalSemaphoreInfo) |
| 11637 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11638 | transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(mImpl->resources(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11639 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11640 | countingStream->rewind(); |
| 11641 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11642 | uint64_t cgen_var_766; |
| 11643 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_766, 1); |
| 11644 | countingStream->write((uint64_t*)&cgen_var_766, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11645 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11646 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 11647 | } |
| 11648 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11649 | countingStream->rewind(); |
| 11650 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphoreProperties = OP_vkGetPhysicalDeviceExternalSemaphoreProperties; |
| 11651 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t)); |
| 11652 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11653 | uint64_t cgen_var_767; |
| 11654 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_767, 1); |
| 11655 | stream->write((uint64_t*)&cgen_var_767, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11656 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11657 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11658 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphoreProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11659 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11660 | if (pExternalSemaphoreProperties) |
| 11661 | { |
| 11662 | transform_fromhost_VkExternalSemaphoreProperties(mImpl->resources(), (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 11663 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11664 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphoreProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11665 | mImpl->log("finish vkGetPhysicalDeviceExternalSemaphoreProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11666 | } |
| 11667 | |
| 11668 | void VkEncoder::vkGetDescriptorSetLayoutSupport( |
| 11669 | VkDevice device, |
| 11670 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 11671 | VkDescriptorSetLayoutSupport* pSupport) |
| 11672 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11673 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11674 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupport encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11675 | mImpl->log("start vkGetDescriptorSetLayoutSupport"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11676 | auto stream = mImpl->stream(); |
| 11677 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11678 | auto resources = mImpl->resources(); |
| 11679 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11680 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11681 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11682 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11683 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11684 | local_pCreateInfo = nullptr; |
| 11685 | if (pCreateInfo) |
| 11686 | { |
| 11687 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 11688 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 11689 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11690 | if (local_pCreateInfo) |
| 11691 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11692 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11693 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11694 | countingStream->rewind(); |
| 11695 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11696 | uint64_t cgen_var_768; |
| 11697 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_768, 1); |
| 11698 | countingStream->write((uint64_t*)&cgen_var_768, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11699 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11700 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 11701 | } |
| 11702 | uint32_t packetSize_vkGetDescriptorSetLayoutSupport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11703 | countingStream->rewind(); |
| 11704 | uint32_t opcode_vkGetDescriptorSetLayoutSupport = OP_vkGetDescriptorSetLayoutSupport; |
| 11705 | stream->write(&opcode_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t)); |
| 11706 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11707 | uint64_t cgen_var_769; |
| 11708 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_769, 1); |
| 11709 | stream->write((uint64_t*)&cgen_var_769, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11710 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11711 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11712 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupport readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11713 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11714 | if (pSupport) |
| 11715 | { |
| 11716 | transform_fromhost_VkDescriptorSetLayoutSupport(mImpl->resources(), (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 11717 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11718 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupport returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11719 | mImpl->log("finish vkGetDescriptorSetLayoutSupport");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11720 | } |
| 11721 | |
| 11722 | #endif |
| 11723 | #ifdef VK_KHR_surface |
| 11724 | void VkEncoder::vkDestroySurfaceKHR( |
| 11725 | VkInstance instance, |
| 11726 | VkSurfaceKHR surface, |
| 11727 | const VkAllocationCallbacks* pAllocator) |
| 11728 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11729 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11730 | AEMU_SCOPED_TRACE("vkDestroySurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11731 | mImpl->log("start vkDestroySurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11732 | auto stream = mImpl->stream(); |
| 11733 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11734 | auto resources = mImpl->resources(); |
| 11735 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11736 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11737 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11738 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11739 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11740 | local_instance = instance; |
| 11741 | local_surface = surface; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11742 | local_pAllocator = nullptr; |
| 11743 | if (pAllocator) |
| 11744 | { |
| 11745 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11746 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11747 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11748 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11749 | if (local_pAllocator) |
| 11750 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11751 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11752 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11753 | countingStream->rewind(); |
| 11754 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11755 | uint64_t cgen_var_770; |
| 11756 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_770, 1); |
| 11757 | countingStream->write((uint64_t*)&cgen_var_770, 1 * 8); |
| 11758 | uint64_t cgen_var_771; |
| 11759 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_771, 1); |
| 11760 | countingStream->write((uint64_t*)&cgen_var_771, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11761 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11762 | uint64_t cgen_var_772 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11763 | countingStream->putBe64(cgen_var_772); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11764 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11765 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11766 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11767 | } |
| 11768 | } |
| 11769 | uint32_t packetSize_vkDestroySurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11770 | countingStream->rewind(); |
| 11771 | uint32_t opcode_vkDestroySurfaceKHR = OP_vkDestroySurfaceKHR; |
| 11772 | stream->write(&opcode_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| 11773 | stream->write(&packetSize_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11774 | uint64_t cgen_var_773; |
| 11775 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_773, 1); |
| 11776 | stream->write((uint64_t*)&cgen_var_773, 1 * 8); |
| 11777 | uint64_t cgen_var_774; |
| 11778 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_774, 1); |
| 11779 | stream->write((uint64_t*)&cgen_var_774, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11780 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11781 | uint64_t cgen_var_775 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11782 | stream->putBe64(cgen_var_775); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11783 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11784 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11785 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11786 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11787 | AEMU_SCOPED_TRACE("vkDestroySurfaceKHR readParams"); |
| 11788 | AEMU_SCOPED_TRACE("vkDestroySurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11789 | resources->destroyMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&surface); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11790 | mImpl->log("finish vkDestroySurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11791 | } |
| 11792 | |
| 11793 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceSupportKHR( |
| 11794 | VkPhysicalDevice physicalDevice, |
| 11795 | uint32_t queueFamilyIndex, |
| 11796 | VkSurfaceKHR surface, |
| 11797 | VkBool32* pSupported) |
| 11798 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11799 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11800 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11801 | mImpl->log("start vkGetPhysicalDeviceSurfaceSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11802 | auto stream = mImpl->stream(); |
| 11803 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11804 | auto resources = mImpl->resources(); |
| 11805 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11806 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11807 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11808 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11809 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11810 | local_physicalDevice = physicalDevice; |
| 11811 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11812 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11813 | countingStream->rewind(); |
| 11814 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11815 | uint64_t cgen_var_776; |
| 11816 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_776, 1); |
| 11817 | countingStream->write((uint64_t*)&cgen_var_776, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11818 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11819 | uint64_t cgen_var_777; |
| 11820 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_777, 1); |
| 11821 | countingStream->write((uint64_t*)&cgen_var_777, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11822 | countingStream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| 11823 | } |
| 11824 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11825 | countingStream->rewind(); |
| 11826 | uint32_t opcode_vkGetPhysicalDeviceSurfaceSupportKHR = OP_vkGetPhysicalDeviceSurfaceSupportKHR; |
| 11827 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| 11828 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11829 | uint64_t cgen_var_778; |
| 11830 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_778, 1); |
| 11831 | stream->write((uint64_t*)&cgen_var_778, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11832 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11833 | uint64_t cgen_var_779; |
| 11834 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_779, 1); |
| 11835 | stream->write((uint64_t*)&cgen_var_779, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11836 | stream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11837 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11838 | stream->read((VkBool32*)pSupported, sizeof(VkBool32)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11839 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11840 | VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0; |
| 11841 | stream->read(&vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11842 | countingStream->clearPool(); |
| 11843 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11844 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11845 | mImpl->log("finish vkGetPhysicalDeviceSurfaceSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11846 | return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return; |
| 11847 | } |
| 11848 | |
| 11849 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilitiesKHR( |
| 11850 | VkPhysicalDevice physicalDevice, |
| 11851 | VkSurfaceKHR surface, |
| 11852 | VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) |
| 11853 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11854 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11855 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilitiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11856 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11857 | auto stream = mImpl->stream(); |
| 11858 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11859 | auto resources = mImpl->resources(); |
| 11860 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11861 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11862 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11863 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11864 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11865 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11866 | countingStream->rewind(); |
| 11867 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11868 | uint64_t cgen_var_780; |
| 11869 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_780, 1); |
| 11870 | countingStream->write((uint64_t*)&cgen_var_780, 1 * 8); |
| 11871 | uint64_t cgen_var_781; |
| 11872 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_781, 1); |
| 11873 | countingStream->write((uint64_t*)&cgen_var_781, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11874 | marshal_VkSurfaceCapabilitiesKHR(countingStream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 11875 | } |
| 11876 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11877 | countingStream->rewind(); |
| 11878 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR; |
| 11879 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| 11880 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11881 | uint64_t cgen_var_782; |
| 11882 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_782, 1); |
| 11883 | stream->write((uint64_t*)&cgen_var_782, 1 * 8); |
| 11884 | uint64_t cgen_var_783; |
| 11885 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_783, 1); |
| 11886 | stream->write((uint64_t*)&cgen_var_783, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11887 | marshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11888 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilitiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11889 | unmarshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11890 | if (pSurfaceCapabilities) |
| 11891 | { |
| 11892 | transform_fromhost_VkSurfaceCapabilitiesKHR(mImpl->resources(), (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 11893 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11894 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilitiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11895 | VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 11896 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11897 | countingStream->clearPool(); |
| 11898 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11899 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11900 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11901 | return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return; |
| 11902 | } |
| 11903 | |
| 11904 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormatsKHR( |
| 11905 | VkPhysicalDevice physicalDevice, |
| 11906 | VkSurfaceKHR surface, |
| 11907 | uint32_t* pSurfaceFormatCount, |
| 11908 | VkSurfaceFormatKHR* pSurfaceFormats) |
| 11909 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11910 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11911 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormatsKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11912 | mImpl->log("start vkGetPhysicalDeviceSurfaceFormatsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11913 | auto stream = mImpl->stream(); |
| 11914 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11915 | auto resources = mImpl->resources(); |
| 11916 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11917 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11918 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11919 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11920 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11921 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11922 | countingStream->rewind(); |
| 11923 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11924 | uint64_t cgen_var_784; |
| 11925 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_784, 1); |
| 11926 | countingStream->write((uint64_t*)&cgen_var_784, 1 * 8); |
| 11927 | uint64_t cgen_var_785; |
| 11928 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_785, 1); |
| 11929 | countingStream->write((uint64_t*)&cgen_var_785, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11930 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11931 | uint64_t cgen_var_786 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 11932 | countingStream->putBe64(cgen_var_786); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11933 | if (pSurfaceFormatCount) |
| 11934 | { |
| 11935 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11936 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11937 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11938 | uint64_t cgen_var_787 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 11939 | countingStream->putBe64(cgen_var_787); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11940 | if (pSurfaceFormats) |
| 11941 | { |
| 11942 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11943 | { |
| 11944 | marshal_VkSurfaceFormatKHR(countingStream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11945 | } |
| 11946 | } |
| 11947 | } |
| 11948 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11949 | countingStream->rewind(); |
| 11950 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormatsKHR = OP_vkGetPhysicalDeviceSurfaceFormatsKHR; |
| 11951 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| 11952 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11953 | uint64_t cgen_var_788; |
| 11954 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_788, 1); |
| 11955 | stream->write((uint64_t*)&cgen_var_788, 1 * 8); |
| 11956 | uint64_t cgen_var_789; |
| 11957 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_789, 1); |
| 11958 | stream->write((uint64_t*)&cgen_var_789, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11959 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11960 | uint64_t cgen_var_790 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 11961 | stream->putBe64(cgen_var_790); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11962 | if (pSurfaceFormatCount) |
| 11963 | { |
| 11964 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11965 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11966 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11967 | uint64_t cgen_var_791 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 11968 | stream->putBe64(cgen_var_791); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11969 | if (pSurfaceFormats) |
| 11970 | { |
| 11971 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11972 | { |
| 11973 | marshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11974 | } |
| 11975 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11976 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormatsKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11977 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11978 | uint32_t* check_pSurfaceFormatCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11979 | check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11980 | if (pSurfaceFormatCount) |
| 11981 | { |
| 11982 | if (!(check_pSurfaceFormatCount)) |
| 11983 | { |
| 11984 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 11985 | } |
| 11986 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11987 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11988 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11989 | VkSurfaceFormatKHR* check_pSurfaceFormats; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11990 | check_pSurfaceFormats = (VkSurfaceFormatKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11991 | if (pSurfaceFormats) |
| 11992 | { |
| 11993 | if (!(check_pSurfaceFormats)) |
| 11994 | { |
| 11995 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 11996 | } |
| 11997 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11998 | { |
| 11999 | unmarshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 12000 | } |
| 12001 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12002 | if (pSurfaceFormats) |
| 12003 | { |
| 12004 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 12005 | { |
| 12006 | transform_fromhost_VkSurfaceFormatKHR(mImpl->resources(), (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 12007 | } |
| 12008 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12009 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormatsKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12010 | VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0; |
| 12011 | stream->read(&vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12012 | countingStream->clearPool(); |
| 12013 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12014 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12015 | mImpl->log("finish vkGetPhysicalDeviceSurfaceFormatsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12016 | return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return; |
| 12017 | } |
| 12018 | |
| 12019 | VkResult VkEncoder::vkGetPhysicalDeviceSurfacePresentModesKHR( |
| 12020 | VkPhysicalDevice physicalDevice, |
| 12021 | VkSurfaceKHR surface, |
| 12022 | uint32_t* pPresentModeCount, |
| 12023 | VkPresentModeKHR* pPresentModes) |
| 12024 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12025 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12026 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfacePresentModesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12027 | mImpl->log("start vkGetPhysicalDeviceSurfacePresentModesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12028 | auto stream = mImpl->stream(); |
| 12029 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12030 | auto resources = mImpl->resources(); |
| 12031 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12032 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12033 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12034 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12035 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12036 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12037 | countingStream->rewind(); |
| 12038 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12039 | uint64_t cgen_var_794; |
| 12040 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_794, 1); |
| 12041 | countingStream->write((uint64_t*)&cgen_var_794, 1 * 8); |
| 12042 | uint64_t cgen_var_795; |
| 12043 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_795, 1); |
| 12044 | countingStream->write((uint64_t*)&cgen_var_795, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12045 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12046 | uint64_t cgen_var_796 = (uint64_t)(uintptr_t)pPresentModeCount; |
| 12047 | countingStream->putBe64(cgen_var_796); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12048 | if (pPresentModeCount) |
| 12049 | { |
| 12050 | countingStream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 12051 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12052 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12053 | uint64_t cgen_var_797 = (uint64_t)(uintptr_t)pPresentModes; |
| 12054 | countingStream->putBe64(cgen_var_797); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12055 | if (pPresentModes) |
| 12056 | { |
| 12057 | countingStream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 12058 | } |
| 12059 | } |
| 12060 | uint32_t packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12061 | countingStream->rewind(); |
| 12062 | uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModesKHR = OP_vkGetPhysicalDeviceSurfacePresentModesKHR; |
| 12063 | stream->write(&opcode_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| 12064 | stream->write(&packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12065 | uint64_t cgen_var_798; |
| 12066 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_798, 1); |
| 12067 | stream->write((uint64_t*)&cgen_var_798, 1 * 8); |
| 12068 | uint64_t cgen_var_799; |
| 12069 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_799, 1); |
| 12070 | stream->write((uint64_t*)&cgen_var_799, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12071 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12072 | uint64_t cgen_var_800 = (uint64_t)(uintptr_t)pPresentModeCount; |
| 12073 | stream->putBe64(cgen_var_800); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12074 | if (pPresentModeCount) |
| 12075 | { |
| 12076 | stream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 12077 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12078 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12079 | uint64_t cgen_var_801 = (uint64_t)(uintptr_t)pPresentModes; |
| 12080 | stream->putBe64(cgen_var_801); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12081 | if (pPresentModes) |
| 12082 | { |
| 12083 | stream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 12084 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12085 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfacePresentModesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12086 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12087 | uint32_t* check_pPresentModeCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12088 | check_pPresentModeCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12089 | if (pPresentModeCount) |
| 12090 | { |
| 12091 | if (!(check_pPresentModeCount)) |
| 12092 | { |
| 12093 | fprintf(stderr, "fatal: pPresentModeCount inconsistent between guest and host\n"); |
| 12094 | } |
| 12095 | stream->read((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 12096 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12097 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12098 | VkPresentModeKHR* check_pPresentModes; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12099 | check_pPresentModes = (VkPresentModeKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12100 | if (pPresentModes) |
| 12101 | { |
| 12102 | if (!(check_pPresentModes)) |
| 12103 | { |
| 12104 | fprintf(stderr, "fatal: pPresentModes inconsistent between guest and host\n"); |
| 12105 | } |
| 12106 | stream->read((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 12107 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12108 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfacePresentModesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12109 | VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 12110 | stream->read(&vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12111 | countingStream->clearPool(); |
| 12112 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12113 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12114 | mImpl->log("finish vkGetPhysicalDeviceSurfacePresentModesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12115 | return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return; |
| 12116 | } |
| 12117 | |
| 12118 | #endif |
| 12119 | #ifdef VK_KHR_swapchain |
| 12120 | VkResult VkEncoder::vkCreateSwapchainKHR( |
| 12121 | VkDevice device, |
| 12122 | const VkSwapchainCreateInfoKHR* pCreateInfo, |
| 12123 | const VkAllocationCallbacks* pAllocator, |
| 12124 | VkSwapchainKHR* pSwapchain) |
| 12125 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12126 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12127 | AEMU_SCOPED_TRACE("vkCreateSwapchainKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12128 | mImpl->log("start vkCreateSwapchainKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12129 | auto stream = mImpl->stream(); |
| 12130 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12131 | auto resources = mImpl->resources(); |
| 12132 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12133 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12134 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12135 | VkSwapchainCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12136 | VkAllocationCallbacks* local_pAllocator; |
| 12137 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12138 | local_pCreateInfo = nullptr; |
| 12139 | if (pCreateInfo) |
| 12140 | { |
| 12141 | local_pCreateInfo = (VkSwapchainCreateInfoKHR*)pool->alloc(sizeof(const VkSwapchainCreateInfoKHR)); |
| 12142 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfo, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| 12143 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12144 | local_pAllocator = nullptr; |
| 12145 | if (pAllocator) |
| 12146 | { |
| 12147 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12148 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12149 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12150 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12151 | if (local_pCreateInfo) |
| 12152 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12153 | transform_tohost_VkSwapchainCreateInfoKHR(mImpl->resources(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12154 | } |
| 12155 | if (local_pAllocator) |
| 12156 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12157 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12158 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12159 | countingStream->rewind(); |
| 12160 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12161 | uint64_t cgen_var_804; |
| 12162 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_804, 1); |
| 12163 | countingStream->write((uint64_t*)&cgen_var_804, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12164 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12165 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12166 | uint64_t cgen_var_805 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12167 | countingStream->putBe64(cgen_var_805); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12168 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12169 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12170 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12171 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12172 | uint64_t cgen_var_806; |
| 12173 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_806, 1); |
| 12174 | countingStream->write((uint64_t*)&cgen_var_806, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12175 | } |
| 12176 | uint32_t packetSize_vkCreateSwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12177 | countingStream->rewind(); |
| 12178 | uint32_t opcode_vkCreateSwapchainKHR = OP_vkCreateSwapchainKHR; |
| 12179 | stream->write(&opcode_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| 12180 | stream->write(&packetSize_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12181 | uint64_t cgen_var_807; |
| 12182 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_807, 1); |
| 12183 | stream->write((uint64_t*)&cgen_var_807, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12184 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12185 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12186 | uint64_t cgen_var_808 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12187 | stream->putBe64(cgen_var_808); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12188 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12189 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12190 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12191 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12192 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12193 | uint64_t cgen_var_809; |
| 12194 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_809, 1); |
| 12195 | stream->write((uint64_t*)&cgen_var_809, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12196 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12197 | AEMU_SCOPED_TRACE("vkCreateSwapchainKHR readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12198 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12199 | uint64_t cgen_var_810; |
| 12200 | stream->read((uint64_t*)&cgen_var_810, 8); |
| 12201 | stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(&cgen_var_810, (VkSwapchainKHR*)pSwapchain, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12202 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12203 | AEMU_SCOPED_TRACE("vkCreateSwapchainKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12204 | VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0; |
| 12205 | stream->read(&vkCreateSwapchainKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12206 | countingStream->clearPool(); |
| 12207 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12208 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12209 | mImpl->log("finish vkCreateSwapchainKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12210 | return vkCreateSwapchainKHR_VkResult_return; |
| 12211 | } |
| 12212 | |
| 12213 | void VkEncoder::vkDestroySwapchainKHR( |
| 12214 | VkDevice device, |
| 12215 | VkSwapchainKHR swapchain, |
| 12216 | const VkAllocationCallbacks* pAllocator) |
| 12217 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12218 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12219 | AEMU_SCOPED_TRACE("vkDestroySwapchainKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12220 | mImpl->log("start vkDestroySwapchainKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12221 | auto stream = mImpl->stream(); |
| 12222 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12223 | auto resources = mImpl->resources(); |
| 12224 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12225 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12226 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12227 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12228 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12229 | local_device = device; |
| 12230 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12231 | local_pAllocator = nullptr; |
| 12232 | if (pAllocator) |
| 12233 | { |
| 12234 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12235 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12236 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12237 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12238 | if (local_pAllocator) |
| 12239 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12240 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12241 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12242 | countingStream->rewind(); |
| 12243 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12244 | uint64_t cgen_var_811; |
| 12245 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_811, 1); |
| 12246 | countingStream->write((uint64_t*)&cgen_var_811, 1 * 8); |
| 12247 | uint64_t cgen_var_812; |
| 12248 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_812, 1); |
| 12249 | countingStream->write((uint64_t*)&cgen_var_812, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12250 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12251 | uint64_t cgen_var_813 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12252 | countingStream->putBe64(cgen_var_813); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12253 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12254 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12255 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12256 | } |
| 12257 | } |
| 12258 | uint32_t packetSize_vkDestroySwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12259 | countingStream->rewind(); |
| 12260 | uint32_t opcode_vkDestroySwapchainKHR = OP_vkDestroySwapchainKHR; |
| 12261 | stream->write(&opcode_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| 12262 | stream->write(&packetSize_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12263 | uint64_t cgen_var_814; |
| 12264 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_814, 1); |
| 12265 | stream->write((uint64_t*)&cgen_var_814, 1 * 8); |
| 12266 | uint64_t cgen_var_815; |
| 12267 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_815, 1); |
| 12268 | stream->write((uint64_t*)&cgen_var_815, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12269 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12270 | uint64_t cgen_var_816 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12271 | stream->putBe64(cgen_var_816); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12272 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12273 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12274 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12275 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12276 | AEMU_SCOPED_TRACE("vkDestroySwapchainKHR readParams"); |
| 12277 | AEMU_SCOPED_TRACE("vkDestroySwapchainKHR returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12278 | resources->destroyMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&swapchain); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12279 | mImpl->log("finish vkDestroySwapchainKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12280 | } |
| 12281 | |
| 12282 | VkResult VkEncoder::vkGetSwapchainImagesKHR( |
| 12283 | VkDevice device, |
| 12284 | VkSwapchainKHR swapchain, |
| 12285 | uint32_t* pSwapchainImageCount, |
| 12286 | VkImage* pSwapchainImages) |
| 12287 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12288 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12289 | AEMU_SCOPED_TRACE("vkGetSwapchainImagesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12290 | mImpl->log("start vkGetSwapchainImagesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12291 | auto stream = mImpl->stream(); |
| 12292 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12293 | auto resources = mImpl->resources(); |
| 12294 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12295 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12296 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12297 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12298 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12299 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12300 | countingStream->rewind(); |
| 12301 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12302 | uint64_t cgen_var_817; |
| 12303 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_817, 1); |
| 12304 | countingStream->write((uint64_t*)&cgen_var_817, 1 * 8); |
| 12305 | uint64_t cgen_var_818; |
| 12306 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_818, 1); |
| 12307 | countingStream->write((uint64_t*)&cgen_var_818, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12308 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12309 | uint64_t cgen_var_819 = (uint64_t)(uintptr_t)pSwapchainImageCount; |
| 12310 | countingStream->putBe64(cgen_var_819); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12311 | if (pSwapchainImageCount) |
| 12312 | { |
| 12313 | countingStream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 12314 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12315 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12316 | uint64_t cgen_var_820 = (uint64_t)(uintptr_t)pSwapchainImages; |
| 12317 | countingStream->putBe64(cgen_var_820); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12318 | if (pSwapchainImages) |
| 12319 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12320 | if ((*(pSwapchainImageCount))) |
| 12321 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12322 | uint64_t* cgen_var_821; |
| 12323 | countingStream->alloc((void**)&cgen_var_821, (*(pSwapchainImageCount)) * 8); |
| 12324 | countingStream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_821, (*(pSwapchainImageCount))); |
| 12325 | countingStream->write((uint64_t*)cgen_var_821, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12326 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12327 | } |
| 12328 | } |
| 12329 | uint32_t packetSize_vkGetSwapchainImagesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12330 | countingStream->rewind(); |
| 12331 | uint32_t opcode_vkGetSwapchainImagesKHR = OP_vkGetSwapchainImagesKHR; |
| 12332 | stream->write(&opcode_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| 12333 | stream->write(&packetSize_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12334 | uint64_t cgen_var_822; |
| 12335 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_822, 1); |
| 12336 | stream->write((uint64_t*)&cgen_var_822, 1 * 8); |
| 12337 | uint64_t cgen_var_823; |
| 12338 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_823, 1); |
| 12339 | stream->write((uint64_t*)&cgen_var_823, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12340 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12341 | uint64_t cgen_var_824 = (uint64_t)(uintptr_t)pSwapchainImageCount; |
| 12342 | stream->putBe64(cgen_var_824); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12343 | if (pSwapchainImageCount) |
| 12344 | { |
| 12345 | stream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 12346 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12347 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12348 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12349 | uint64_t cgen_var_825 = (uint64_t)(uintptr_t)pSwapchainImages; |
| 12350 | stream->putBe64(cgen_var_825); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12351 | if (pSwapchainImages) |
| 12352 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12353 | if ((*(pSwapchainImageCount))) |
| 12354 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12355 | uint64_t* cgen_var_826; |
| 12356 | stream->alloc((void**)&cgen_var_826, (*(pSwapchainImageCount)) * 8); |
| 12357 | stream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_826, (*(pSwapchainImageCount))); |
| 12358 | stream->write((uint64_t*)cgen_var_826, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12359 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12360 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12361 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12362 | AEMU_SCOPED_TRACE("vkGetSwapchainImagesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12363 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12364 | uint32_t* check_pSwapchainImageCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12365 | check_pSwapchainImageCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12366 | if (pSwapchainImageCount) |
| 12367 | { |
| 12368 | if (!(check_pSwapchainImageCount)) |
| 12369 | { |
| 12370 | fprintf(stderr, "fatal: pSwapchainImageCount inconsistent between guest and host\n"); |
| 12371 | } |
| 12372 | stream->read((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 12373 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12374 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12375 | VkImage* check_pSwapchainImages; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12376 | check_pSwapchainImages = (VkImage*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12377 | if (pSwapchainImages) |
| 12378 | { |
| 12379 | if (!(check_pSwapchainImages)) |
| 12380 | { |
| 12381 | fprintf(stderr, "fatal: pSwapchainImages inconsistent between guest and host\n"); |
| 12382 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12383 | if ((*(pSwapchainImageCount))) |
| 12384 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12385 | uint64_t* cgen_var_829; |
| 12386 | stream->alloc((void**)&cgen_var_829, (*(pSwapchainImageCount)) * 8); |
| 12387 | stream->read((uint64_t*)cgen_var_829, (*(pSwapchainImageCount)) * 8); |
| 12388 | stream->handleMapping()->mapHandles_u64_VkImage(cgen_var_829, (VkImage*)pSwapchainImages, (*(pSwapchainImageCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12389 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12390 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12391 | AEMU_SCOPED_TRACE("vkGetSwapchainImagesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12392 | VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0; |
| 12393 | stream->read(&vkGetSwapchainImagesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12394 | countingStream->clearPool(); |
| 12395 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12396 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12397 | mImpl->log("finish vkGetSwapchainImagesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12398 | return vkGetSwapchainImagesKHR_VkResult_return; |
| 12399 | } |
| 12400 | |
| 12401 | VkResult VkEncoder::vkAcquireNextImageKHR( |
| 12402 | VkDevice device, |
| 12403 | VkSwapchainKHR swapchain, |
| 12404 | uint64_t timeout, |
| 12405 | VkSemaphore semaphore, |
| 12406 | VkFence fence, |
| 12407 | uint32_t* pImageIndex) |
| 12408 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12409 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12410 | AEMU_SCOPED_TRACE("vkAcquireNextImageKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12411 | mImpl->log("start vkAcquireNextImageKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12412 | auto stream = mImpl->stream(); |
| 12413 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12414 | auto resources = mImpl->resources(); |
| 12415 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12416 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12417 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12418 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12419 | uint64_t local_timeout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12420 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12421 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12422 | local_device = device; |
| 12423 | local_swapchain = swapchain; |
| 12424 | local_timeout = timeout; |
| 12425 | local_semaphore = semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12426 | local_fence = fence; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12427 | countingStream->rewind(); |
| 12428 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12429 | uint64_t cgen_var_830; |
| 12430 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_830, 1); |
| 12431 | countingStream->write((uint64_t*)&cgen_var_830, 1 * 8); |
| 12432 | uint64_t cgen_var_831; |
| 12433 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_831, 1); |
| 12434 | countingStream->write((uint64_t*)&cgen_var_831, 1 * 8); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12435 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12436 | uint64_t cgen_var_832; |
| 12437 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_832, 1); |
| 12438 | countingStream->write((uint64_t*)&cgen_var_832, 1 * 8); |
| 12439 | uint64_t cgen_var_833; |
| 12440 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_833, 1); |
| 12441 | countingStream->write((uint64_t*)&cgen_var_833, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12442 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 12443 | } |
| 12444 | uint32_t packetSize_vkAcquireNextImageKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12445 | countingStream->rewind(); |
| 12446 | uint32_t opcode_vkAcquireNextImageKHR = OP_vkAcquireNextImageKHR; |
| 12447 | stream->write(&opcode_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| 12448 | stream->write(&packetSize_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12449 | uint64_t cgen_var_834; |
| 12450 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_834, 1); |
| 12451 | stream->write((uint64_t*)&cgen_var_834, 1 * 8); |
| 12452 | uint64_t cgen_var_835; |
| 12453 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_835, 1); |
| 12454 | stream->write((uint64_t*)&cgen_var_835, 1 * 8); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12455 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12456 | uint64_t cgen_var_836; |
| 12457 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_836, 1); |
| 12458 | stream->write((uint64_t*)&cgen_var_836, 1 * 8); |
| 12459 | uint64_t cgen_var_837; |
| 12460 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_837, 1); |
| 12461 | stream->write((uint64_t*)&cgen_var_837, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12462 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12463 | AEMU_SCOPED_TRACE("vkAcquireNextImageKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12464 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12465 | AEMU_SCOPED_TRACE("vkAcquireNextImageKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12466 | VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0; |
| 12467 | stream->read(&vkAcquireNextImageKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12468 | countingStream->clearPool(); |
| 12469 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12470 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12471 | mImpl->log("finish vkAcquireNextImageKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12472 | return vkAcquireNextImageKHR_VkResult_return; |
| 12473 | } |
| 12474 | |
| 12475 | VkResult VkEncoder::vkQueuePresentKHR( |
| 12476 | VkQueue queue, |
| 12477 | const VkPresentInfoKHR* pPresentInfo) |
| 12478 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12479 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12480 | AEMU_SCOPED_TRACE("vkQueuePresentKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12481 | mImpl->log("start vkQueuePresentKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12482 | auto stream = mImpl->stream(); |
| 12483 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12484 | auto resources = mImpl->resources(); |
| 12485 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12486 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12487 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12488 | VkPresentInfoKHR* local_pPresentInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12489 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12490 | local_pPresentInfo = nullptr; |
| 12491 | if (pPresentInfo) |
| 12492 | { |
| 12493 | local_pPresentInfo = (VkPresentInfoKHR*)pool->alloc(sizeof(const VkPresentInfoKHR)); |
| 12494 | deepcopy_VkPresentInfoKHR(pool, pPresentInfo, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| 12495 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12496 | if (local_pPresentInfo) |
| 12497 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12498 | transform_tohost_VkPresentInfoKHR(mImpl->resources(), (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12499 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12500 | countingStream->rewind(); |
| 12501 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12502 | uint64_t cgen_var_838; |
| 12503 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_838, 1); |
| 12504 | countingStream->write((uint64_t*)&cgen_var_838, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12505 | marshal_VkPresentInfoKHR(countingStream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12506 | } |
| 12507 | uint32_t packetSize_vkQueuePresentKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12508 | countingStream->rewind(); |
| 12509 | uint32_t opcode_vkQueuePresentKHR = OP_vkQueuePresentKHR; |
| 12510 | stream->write(&opcode_vkQueuePresentKHR, sizeof(uint32_t)); |
| 12511 | stream->write(&packetSize_vkQueuePresentKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12512 | uint64_t cgen_var_839; |
| 12513 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_839, 1); |
| 12514 | stream->write((uint64_t*)&cgen_var_839, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12515 | marshal_VkPresentInfoKHR(stream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12516 | AEMU_SCOPED_TRACE("vkQueuePresentKHR readParams"); |
| 12517 | AEMU_SCOPED_TRACE("vkQueuePresentKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12518 | VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0; |
| 12519 | stream->read(&vkQueuePresentKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12520 | countingStream->clearPool(); |
| 12521 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12522 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12523 | mImpl->log("finish vkQueuePresentKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12524 | return vkQueuePresentKHR_VkResult_return; |
| 12525 | } |
| 12526 | |
| 12527 | VkResult VkEncoder::vkGetDeviceGroupPresentCapabilitiesKHR( |
| 12528 | VkDevice device, |
| 12529 | VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) |
| 12530 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12531 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12532 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPresentCapabilitiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12533 | mImpl->log("start vkGetDeviceGroupPresentCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12534 | auto stream = mImpl->stream(); |
| 12535 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12536 | auto resources = mImpl->resources(); |
| 12537 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12538 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12539 | VkDevice local_device; |
| 12540 | local_device = device; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12541 | countingStream->rewind(); |
| 12542 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12543 | uint64_t cgen_var_840; |
| 12544 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_840, 1); |
| 12545 | countingStream->write((uint64_t*)&cgen_var_840, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12546 | marshal_VkDeviceGroupPresentCapabilitiesKHR(countingStream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 12547 | } |
| 12548 | uint32_t packetSize_vkGetDeviceGroupPresentCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12549 | countingStream->rewind(); |
| 12550 | uint32_t opcode_vkGetDeviceGroupPresentCapabilitiesKHR = OP_vkGetDeviceGroupPresentCapabilitiesKHR; |
| 12551 | stream->write(&opcode_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| 12552 | stream->write(&packetSize_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12553 | uint64_t cgen_var_841; |
| 12554 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_841, 1); |
| 12555 | stream->write((uint64_t*)&cgen_var_841, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12556 | marshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12557 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPresentCapabilitiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12558 | unmarshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12559 | if (pDeviceGroupPresentCapabilities) |
| 12560 | { |
| 12561 | transform_fromhost_VkDeviceGroupPresentCapabilitiesKHR(mImpl->resources(), (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 12562 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12563 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPresentCapabilitiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12564 | VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 12565 | stream->read(&vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12566 | countingStream->clearPool(); |
| 12567 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12568 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12569 | mImpl->log("finish vkGetDeviceGroupPresentCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12570 | return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return; |
| 12571 | } |
| 12572 | |
| 12573 | VkResult VkEncoder::vkGetDeviceGroupSurfacePresentModesKHR( |
| 12574 | VkDevice device, |
| 12575 | VkSurfaceKHR surface, |
| 12576 | VkDeviceGroupPresentModeFlagsKHR* pModes) |
| 12577 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12578 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12579 | AEMU_SCOPED_TRACE("vkGetDeviceGroupSurfacePresentModesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12580 | mImpl->log("start vkGetDeviceGroupSurfacePresentModesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12581 | auto stream = mImpl->stream(); |
| 12582 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12583 | auto resources = mImpl->resources(); |
| 12584 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12585 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12586 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12587 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12588 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12589 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12590 | countingStream->rewind(); |
| 12591 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12592 | uint64_t cgen_var_842; |
| 12593 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_842, 1); |
| 12594 | countingStream->write((uint64_t*)&cgen_var_842, 1 * 8); |
| 12595 | uint64_t cgen_var_843; |
| 12596 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_843, 1); |
| 12597 | countingStream->write((uint64_t*)&cgen_var_843, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12598 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12599 | uint64_t cgen_var_844 = (uint64_t)(uintptr_t)pModes; |
| 12600 | countingStream->putBe64(cgen_var_844); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12601 | if (pModes) |
| 12602 | { |
| 12603 | countingStream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 12604 | } |
| 12605 | } |
| 12606 | uint32_t packetSize_vkGetDeviceGroupSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12607 | countingStream->rewind(); |
| 12608 | uint32_t opcode_vkGetDeviceGroupSurfacePresentModesKHR = OP_vkGetDeviceGroupSurfacePresentModesKHR; |
| 12609 | stream->write(&opcode_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| 12610 | stream->write(&packetSize_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12611 | uint64_t cgen_var_845; |
| 12612 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_845, 1); |
| 12613 | stream->write((uint64_t*)&cgen_var_845, 1 * 8); |
| 12614 | uint64_t cgen_var_846; |
| 12615 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_846, 1); |
| 12616 | stream->write((uint64_t*)&cgen_var_846, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12617 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12618 | uint64_t cgen_var_847 = (uint64_t)(uintptr_t)pModes; |
| 12619 | stream->putBe64(cgen_var_847); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12620 | if (pModes) |
| 12621 | { |
| 12622 | stream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 12623 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12624 | AEMU_SCOPED_TRACE("vkGetDeviceGroupSurfacePresentModesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12625 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12626 | VkDeviceGroupPresentModeFlagsKHR* check_pModes; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12627 | check_pModes = (VkDeviceGroupPresentModeFlagsKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12628 | if (pModes) |
| 12629 | { |
| 12630 | if (!(check_pModes)) |
| 12631 | { |
| 12632 | fprintf(stderr, "fatal: pModes inconsistent between guest and host\n"); |
| 12633 | } |
| 12634 | stream->read((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 12635 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12636 | AEMU_SCOPED_TRACE("vkGetDeviceGroupSurfacePresentModesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12637 | VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 12638 | stream->read(&vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12639 | countingStream->clearPool(); |
| 12640 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12641 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12642 | mImpl->log("finish vkGetDeviceGroupSurfacePresentModesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12643 | return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return; |
| 12644 | } |
| 12645 | |
| 12646 | VkResult VkEncoder::vkGetPhysicalDevicePresentRectanglesKHR( |
| 12647 | VkPhysicalDevice physicalDevice, |
| 12648 | VkSurfaceKHR surface, |
| 12649 | uint32_t* pRectCount, |
| 12650 | VkRect2D* pRects) |
| 12651 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12652 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12653 | AEMU_SCOPED_TRACE("vkGetPhysicalDevicePresentRectanglesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12654 | mImpl->log("start vkGetPhysicalDevicePresentRectanglesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12655 | auto stream = mImpl->stream(); |
| 12656 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12657 | auto resources = mImpl->resources(); |
| 12658 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12659 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12660 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12661 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12662 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12663 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12664 | countingStream->rewind(); |
| 12665 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12666 | uint64_t cgen_var_849; |
| 12667 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_849, 1); |
| 12668 | countingStream->write((uint64_t*)&cgen_var_849, 1 * 8); |
| 12669 | uint64_t cgen_var_850; |
| 12670 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_850, 1); |
| 12671 | countingStream->write((uint64_t*)&cgen_var_850, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12672 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12673 | uint64_t cgen_var_851 = (uint64_t)(uintptr_t)pRectCount; |
| 12674 | countingStream->putBe64(cgen_var_851); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12675 | if (pRectCount) |
| 12676 | { |
| 12677 | countingStream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 12678 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12679 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12680 | uint64_t cgen_var_852 = (uint64_t)(uintptr_t)pRects; |
| 12681 | countingStream->putBe64(cgen_var_852); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12682 | if (pRects) |
| 12683 | { |
| 12684 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12685 | { |
| 12686 | marshal_VkRect2D(countingStream, (VkRect2D*)(pRects + i)); |
| 12687 | } |
| 12688 | } |
| 12689 | } |
| 12690 | uint32_t packetSize_vkGetPhysicalDevicePresentRectanglesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12691 | countingStream->rewind(); |
| 12692 | uint32_t opcode_vkGetPhysicalDevicePresentRectanglesKHR = OP_vkGetPhysicalDevicePresentRectanglesKHR; |
| 12693 | stream->write(&opcode_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| 12694 | stream->write(&packetSize_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12695 | uint64_t cgen_var_853; |
| 12696 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_853, 1); |
| 12697 | stream->write((uint64_t*)&cgen_var_853, 1 * 8); |
| 12698 | uint64_t cgen_var_854; |
| 12699 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_854, 1); |
| 12700 | stream->write((uint64_t*)&cgen_var_854, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12701 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12702 | uint64_t cgen_var_855 = (uint64_t)(uintptr_t)pRectCount; |
| 12703 | stream->putBe64(cgen_var_855); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12704 | if (pRectCount) |
| 12705 | { |
| 12706 | stream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 12707 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12708 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12709 | uint64_t cgen_var_856 = (uint64_t)(uintptr_t)pRects; |
| 12710 | stream->putBe64(cgen_var_856); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12711 | if (pRects) |
| 12712 | { |
| 12713 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12714 | { |
| 12715 | marshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 12716 | } |
| 12717 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12718 | AEMU_SCOPED_TRACE("vkGetPhysicalDevicePresentRectanglesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12719 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12720 | uint32_t* check_pRectCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12721 | check_pRectCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12722 | if (pRectCount) |
| 12723 | { |
| 12724 | if (!(check_pRectCount)) |
| 12725 | { |
| 12726 | fprintf(stderr, "fatal: pRectCount inconsistent between guest and host\n"); |
| 12727 | } |
| 12728 | stream->read((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 12729 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12730 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12731 | VkRect2D* check_pRects; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12732 | check_pRects = (VkRect2D*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12733 | if (pRects) |
| 12734 | { |
| 12735 | if (!(check_pRects)) |
| 12736 | { |
| 12737 | fprintf(stderr, "fatal: pRects inconsistent between guest and host\n"); |
| 12738 | } |
| 12739 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12740 | { |
| 12741 | unmarshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 12742 | } |
| 12743 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12744 | if (pRects) |
| 12745 | { |
| 12746 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12747 | { |
| 12748 | transform_fromhost_VkRect2D(mImpl->resources(), (VkRect2D*)(pRects + i)); |
| 12749 | } |
| 12750 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12751 | AEMU_SCOPED_TRACE("vkGetPhysicalDevicePresentRectanglesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12752 | VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0; |
| 12753 | stream->read(&vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12754 | countingStream->clearPool(); |
| 12755 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12756 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12757 | mImpl->log("finish vkGetPhysicalDevicePresentRectanglesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12758 | return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return; |
| 12759 | } |
| 12760 | |
| 12761 | VkResult VkEncoder::vkAcquireNextImage2KHR( |
| 12762 | VkDevice device, |
| 12763 | const VkAcquireNextImageInfoKHR* pAcquireInfo, |
| 12764 | uint32_t* pImageIndex) |
| 12765 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12766 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12767 | AEMU_SCOPED_TRACE("vkAcquireNextImage2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12768 | mImpl->log("start vkAcquireNextImage2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12769 | auto stream = mImpl->stream(); |
| 12770 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12771 | auto resources = mImpl->resources(); |
| 12772 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12773 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12774 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12775 | VkAcquireNextImageInfoKHR* local_pAcquireInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12776 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12777 | local_pAcquireInfo = nullptr; |
| 12778 | if (pAcquireInfo) |
| 12779 | { |
| 12780 | local_pAcquireInfo = (VkAcquireNextImageInfoKHR*)pool->alloc(sizeof(const VkAcquireNextImageInfoKHR)); |
| 12781 | deepcopy_VkAcquireNextImageInfoKHR(pool, pAcquireInfo, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| 12782 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12783 | if (local_pAcquireInfo) |
| 12784 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12785 | transform_tohost_VkAcquireNextImageInfoKHR(mImpl->resources(), (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12786 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12787 | countingStream->rewind(); |
| 12788 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12789 | uint64_t cgen_var_859; |
| 12790 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_859, 1); |
| 12791 | countingStream->write((uint64_t*)&cgen_var_859, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12792 | marshal_VkAcquireNextImageInfoKHR(countingStream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12793 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 12794 | } |
| 12795 | uint32_t packetSize_vkAcquireNextImage2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12796 | countingStream->rewind(); |
| 12797 | uint32_t opcode_vkAcquireNextImage2KHR = OP_vkAcquireNextImage2KHR; |
| 12798 | stream->write(&opcode_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| 12799 | stream->write(&packetSize_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12800 | uint64_t cgen_var_860; |
| 12801 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_860, 1); |
| 12802 | stream->write((uint64_t*)&cgen_var_860, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12803 | marshal_VkAcquireNextImageInfoKHR(stream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12804 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12805 | AEMU_SCOPED_TRACE("vkAcquireNextImage2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12806 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12807 | AEMU_SCOPED_TRACE("vkAcquireNextImage2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12808 | VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0; |
| 12809 | stream->read(&vkAcquireNextImage2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12810 | countingStream->clearPool(); |
| 12811 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12812 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12813 | mImpl->log("finish vkAcquireNextImage2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12814 | return vkAcquireNextImage2KHR_VkResult_return; |
| 12815 | } |
| 12816 | |
| 12817 | #endif |
| 12818 | #ifdef VK_KHR_display |
| 12819 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPropertiesKHR( |
| 12820 | VkPhysicalDevice physicalDevice, |
| 12821 | uint32_t* pPropertyCount, |
| 12822 | VkDisplayPropertiesKHR* pProperties) |
| 12823 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12824 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12825 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12826 | mImpl->log("start vkGetPhysicalDeviceDisplayPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12827 | auto stream = mImpl->stream(); |
| 12828 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12829 | auto resources = mImpl->resources(); |
| 12830 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12831 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12832 | VkPhysicalDevice local_physicalDevice; |
| 12833 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12834 | countingStream->rewind(); |
| 12835 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12836 | uint64_t cgen_var_861; |
| 12837 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_861, 1); |
| 12838 | countingStream->write((uint64_t*)&cgen_var_861, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12839 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12840 | uint64_t cgen_var_862 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12841 | countingStream->putBe64(cgen_var_862); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12842 | if (pPropertyCount) |
| 12843 | { |
| 12844 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12845 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12846 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12847 | uint64_t cgen_var_863 = (uint64_t)(uintptr_t)pProperties; |
| 12848 | countingStream->putBe64(cgen_var_863); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12849 | if (pProperties) |
| 12850 | { |
| 12851 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12852 | { |
| 12853 | marshal_VkDisplayPropertiesKHR(countingStream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12854 | } |
| 12855 | } |
| 12856 | } |
| 12857 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12858 | countingStream->rewind(); |
| 12859 | uint32_t opcode_vkGetPhysicalDeviceDisplayPropertiesKHR = OP_vkGetPhysicalDeviceDisplayPropertiesKHR; |
| 12860 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| 12861 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12862 | uint64_t cgen_var_864; |
| 12863 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_864, 1); |
| 12864 | stream->write((uint64_t*)&cgen_var_864, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12865 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12866 | uint64_t cgen_var_865 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12867 | stream->putBe64(cgen_var_865); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12868 | if (pPropertyCount) |
| 12869 | { |
| 12870 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12871 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12872 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12873 | uint64_t cgen_var_866 = (uint64_t)(uintptr_t)pProperties; |
| 12874 | stream->putBe64(cgen_var_866); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12875 | if (pProperties) |
| 12876 | { |
| 12877 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12878 | { |
| 12879 | marshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12880 | } |
| 12881 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12882 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPropertiesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12883 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12884 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12885 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12886 | if (pPropertyCount) |
| 12887 | { |
| 12888 | if (!(check_pPropertyCount)) |
| 12889 | { |
| 12890 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12891 | } |
| 12892 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12893 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12894 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12895 | VkDisplayPropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12896 | check_pProperties = (VkDisplayPropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12897 | if (pProperties) |
| 12898 | { |
| 12899 | if (!(check_pProperties)) |
| 12900 | { |
| 12901 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12902 | } |
| 12903 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12904 | { |
| 12905 | unmarshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12906 | } |
| 12907 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12908 | if (pProperties) |
| 12909 | { |
| 12910 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12911 | { |
| 12912 | transform_fromhost_VkDisplayPropertiesKHR(mImpl->resources(), (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12913 | } |
| 12914 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12915 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12916 | VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0; |
| 12917 | stream->read(&vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12918 | countingStream->clearPool(); |
| 12919 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12920 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12921 | mImpl->log("finish vkGetPhysicalDeviceDisplayPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12922 | return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return; |
| 12923 | } |
| 12924 | |
| 12925 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlanePropertiesKHR( |
| 12926 | VkPhysicalDevice physicalDevice, |
| 12927 | uint32_t* pPropertyCount, |
| 12928 | VkDisplayPlanePropertiesKHR* pProperties) |
| 12929 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12930 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12931 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlanePropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12932 | mImpl->log("start vkGetPhysicalDeviceDisplayPlanePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12933 | auto stream = mImpl->stream(); |
| 12934 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12935 | auto resources = mImpl->resources(); |
| 12936 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12937 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12938 | VkPhysicalDevice local_physicalDevice; |
| 12939 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12940 | countingStream->rewind(); |
| 12941 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12942 | uint64_t cgen_var_869; |
| 12943 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_869, 1); |
| 12944 | countingStream->write((uint64_t*)&cgen_var_869, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12945 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12946 | uint64_t cgen_var_870 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12947 | countingStream->putBe64(cgen_var_870); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12948 | if (pPropertyCount) |
| 12949 | { |
| 12950 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12951 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12952 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12953 | uint64_t cgen_var_871 = (uint64_t)(uintptr_t)pProperties; |
| 12954 | countingStream->putBe64(cgen_var_871); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12955 | if (pProperties) |
| 12956 | { |
| 12957 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12958 | { |
| 12959 | marshal_VkDisplayPlanePropertiesKHR(countingStream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12960 | } |
| 12961 | } |
| 12962 | } |
| 12963 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12964 | countingStream->rewind(); |
| 12965 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR; |
| 12966 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| 12967 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12968 | uint64_t cgen_var_872; |
| 12969 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_872, 1); |
| 12970 | stream->write((uint64_t*)&cgen_var_872, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12971 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12972 | uint64_t cgen_var_873 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12973 | stream->putBe64(cgen_var_873); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12974 | if (pPropertyCount) |
| 12975 | { |
| 12976 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12977 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12978 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12979 | uint64_t cgen_var_874 = (uint64_t)(uintptr_t)pProperties; |
| 12980 | stream->putBe64(cgen_var_874); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12981 | if (pProperties) |
| 12982 | { |
| 12983 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12984 | { |
| 12985 | marshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12986 | } |
| 12987 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12988 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlanePropertiesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12989 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12990 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12991 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12992 | if (pPropertyCount) |
| 12993 | { |
| 12994 | if (!(check_pPropertyCount)) |
| 12995 | { |
| 12996 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12997 | } |
| 12998 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12999 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13000 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13001 | VkDisplayPlanePropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13002 | check_pProperties = (VkDisplayPlanePropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13003 | if (pProperties) |
| 13004 | { |
| 13005 | if (!(check_pProperties)) |
| 13006 | { |
| 13007 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 13008 | } |
| 13009 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13010 | { |
| 13011 | unmarshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 13012 | } |
| 13013 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13014 | if (pProperties) |
| 13015 | { |
| 13016 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13017 | { |
| 13018 | transform_fromhost_VkDisplayPlanePropertiesKHR(mImpl->resources(), (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 13019 | } |
| 13020 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13021 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlanePropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13022 | VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0; |
| 13023 | stream->read(&vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13024 | countingStream->clearPool(); |
| 13025 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13026 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13027 | mImpl->log("finish vkGetPhysicalDeviceDisplayPlanePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13028 | return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return; |
| 13029 | } |
| 13030 | |
| 13031 | VkResult VkEncoder::vkGetDisplayPlaneSupportedDisplaysKHR( |
| 13032 | VkPhysicalDevice physicalDevice, |
| 13033 | uint32_t planeIndex, |
| 13034 | uint32_t* pDisplayCount, |
| 13035 | VkDisplayKHR* pDisplays) |
| 13036 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13037 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13038 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneSupportedDisplaysKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13039 | mImpl->log("start vkGetDisplayPlaneSupportedDisplaysKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13040 | auto stream = mImpl->stream(); |
| 13041 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13042 | auto resources = mImpl->resources(); |
| 13043 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13044 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13045 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13046 | uint32_t local_planeIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13047 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13048 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13049 | countingStream->rewind(); |
| 13050 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13051 | uint64_t cgen_var_877; |
| 13052 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_877, 1); |
| 13053 | countingStream->write((uint64_t*)&cgen_var_877, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13054 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13055 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13056 | uint64_t cgen_var_878 = (uint64_t)(uintptr_t)pDisplayCount; |
| 13057 | countingStream->putBe64(cgen_var_878); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13058 | if (pDisplayCount) |
| 13059 | { |
| 13060 | countingStream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 13061 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13062 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13063 | uint64_t cgen_var_879 = (uint64_t)(uintptr_t)pDisplays; |
| 13064 | countingStream->putBe64(cgen_var_879); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13065 | if (pDisplays) |
| 13066 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13067 | if ((*(pDisplayCount))) |
| 13068 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13069 | uint64_t* cgen_var_880; |
| 13070 | countingStream->alloc((void**)&cgen_var_880, (*(pDisplayCount)) * 8); |
| 13071 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_880, (*(pDisplayCount))); |
| 13072 | countingStream->write((uint64_t*)cgen_var_880, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13073 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13074 | } |
| 13075 | } |
| 13076 | uint32_t packetSize_vkGetDisplayPlaneSupportedDisplaysKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13077 | countingStream->rewind(); |
| 13078 | uint32_t opcode_vkGetDisplayPlaneSupportedDisplaysKHR = OP_vkGetDisplayPlaneSupportedDisplaysKHR; |
| 13079 | stream->write(&opcode_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| 13080 | stream->write(&packetSize_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13081 | uint64_t cgen_var_881; |
| 13082 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_881, 1); |
| 13083 | stream->write((uint64_t*)&cgen_var_881, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13084 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13085 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13086 | uint64_t cgen_var_882 = (uint64_t)(uintptr_t)pDisplayCount; |
| 13087 | stream->putBe64(cgen_var_882); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13088 | if (pDisplayCount) |
| 13089 | { |
| 13090 | stream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 13091 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13092 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13093 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13094 | uint64_t cgen_var_883 = (uint64_t)(uintptr_t)pDisplays; |
| 13095 | stream->putBe64(cgen_var_883); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13096 | if (pDisplays) |
| 13097 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13098 | if ((*(pDisplayCount))) |
| 13099 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13100 | uint64_t* cgen_var_884; |
| 13101 | stream->alloc((void**)&cgen_var_884, (*(pDisplayCount)) * 8); |
| 13102 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_884, (*(pDisplayCount))); |
| 13103 | stream->write((uint64_t*)cgen_var_884, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13104 | } |
| 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->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13107 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneSupportedDisplaysKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13108 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13109 | uint32_t* check_pDisplayCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13110 | check_pDisplayCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13111 | if (pDisplayCount) |
| 13112 | { |
| 13113 | if (!(check_pDisplayCount)) |
| 13114 | { |
| 13115 | fprintf(stderr, "fatal: pDisplayCount inconsistent between guest and host\n"); |
| 13116 | } |
| 13117 | stream->read((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 13118 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13119 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13120 | VkDisplayKHR* check_pDisplays; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13121 | check_pDisplays = (VkDisplayKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13122 | if (pDisplays) |
| 13123 | { |
| 13124 | if (!(check_pDisplays)) |
| 13125 | { |
| 13126 | fprintf(stderr, "fatal: pDisplays inconsistent between guest and host\n"); |
| 13127 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13128 | if ((*(pDisplayCount))) |
| 13129 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13130 | uint64_t* cgen_var_887; |
| 13131 | stream->alloc((void**)&cgen_var_887, (*(pDisplayCount)) * 8); |
| 13132 | stream->read((uint64_t*)cgen_var_887, (*(pDisplayCount)) * 8); |
| 13133 | stream->handleMapping()->mapHandles_u64_VkDisplayKHR(cgen_var_887, (VkDisplayKHR*)pDisplays, (*(pDisplayCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13134 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13135 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13136 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneSupportedDisplaysKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13137 | VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0; |
| 13138 | stream->read(&vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13139 | countingStream->clearPool(); |
| 13140 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13141 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13142 | mImpl->log("finish vkGetDisplayPlaneSupportedDisplaysKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13143 | return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return; |
| 13144 | } |
| 13145 | |
| 13146 | VkResult VkEncoder::vkGetDisplayModePropertiesKHR( |
| 13147 | VkPhysicalDevice physicalDevice, |
| 13148 | VkDisplayKHR display, |
| 13149 | uint32_t* pPropertyCount, |
| 13150 | VkDisplayModePropertiesKHR* pProperties) |
| 13151 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13152 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13153 | AEMU_SCOPED_TRACE("vkGetDisplayModePropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13154 | mImpl->log("start vkGetDisplayModePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13155 | auto stream = mImpl->stream(); |
| 13156 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13157 | auto resources = mImpl->resources(); |
| 13158 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13159 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13160 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13161 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13162 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13163 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13164 | countingStream->rewind(); |
| 13165 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13166 | uint64_t cgen_var_888; |
| 13167 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_888, 1); |
| 13168 | countingStream->write((uint64_t*)&cgen_var_888, 1 * 8); |
| 13169 | uint64_t cgen_var_889; |
| 13170 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_889, 1); |
| 13171 | countingStream->write((uint64_t*)&cgen_var_889, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13172 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13173 | uint64_t cgen_var_890 = (uint64_t)(uintptr_t)pPropertyCount; |
| 13174 | countingStream->putBe64(cgen_var_890); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13175 | if (pPropertyCount) |
| 13176 | { |
| 13177 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 13178 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13179 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13180 | uint64_t cgen_var_891 = (uint64_t)(uintptr_t)pProperties; |
| 13181 | countingStream->putBe64(cgen_var_891); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13182 | if (pProperties) |
| 13183 | { |
| 13184 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13185 | { |
| 13186 | marshal_VkDisplayModePropertiesKHR(countingStream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 13187 | } |
| 13188 | } |
| 13189 | } |
| 13190 | uint32_t packetSize_vkGetDisplayModePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13191 | countingStream->rewind(); |
| 13192 | uint32_t opcode_vkGetDisplayModePropertiesKHR = OP_vkGetDisplayModePropertiesKHR; |
| 13193 | stream->write(&opcode_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| 13194 | stream->write(&packetSize_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13195 | uint64_t cgen_var_892; |
| 13196 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_892, 1); |
| 13197 | stream->write((uint64_t*)&cgen_var_892, 1 * 8); |
| 13198 | uint64_t cgen_var_893; |
| 13199 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_893, 1); |
| 13200 | stream->write((uint64_t*)&cgen_var_893, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13201 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13202 | uint64_t cgen_var_894 = (uint64_t)(uintptr_t)pPropertyCount; |
| 13203 | stream->putBe64(cgen_var_894); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13204 | if (pPropertyCount) |
| 13205 | { |
| 13206 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 13207 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13208 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13209 | uint64_t cgen_var_895 = (uint64_t)(uintptr_t)pProperties; |
| 13210 | stream->putBe64(cgen_var_895); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13211 | if (pProperties) |
| 13212 | { |
| 13213 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13214 | { |
| 13215 | marshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 13216 | } |
| 13217 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13218 | AEMU_SCOPED_TRACE("vkGetDisplayModePropertiesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13219 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13220 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13221 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13222 | if (pPropertyCount) |
| 13223 | { |
| 13224 | if (!(check_pPropertyCount)) |
| 13225 | { |
| 13226 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 13227 | } |
| 13228 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 13229 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13230 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13231 | VkDisplayModePropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13232 | check_pProperties = (VkDisplayModePropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13233 | if (pProperties) |
| 13234 | { |
| 13235 | if (!(check_pProperties)) |
| 13236 | { |
| 13237 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 13238 | } |
| 13239 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13240 | { |
| 13241 | unmarshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 13242 | } |
| 13243 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13244 | if (pProperties) |
| 13245 | { |
| 13246 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13247 | { |
| 13248 | transform_fromhost_VkDisplayModePropertiesKHR(mImpl->resources(), (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 13249 | } |
| 13250 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13251 | AEMU_SCOPED_TRACE("vkGetDisplayModePropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13252 | VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0; |
| 13253 | stream->read(&vkGetDisplayModePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13254 | countingStream->clearPool(); |
| 13255 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13256 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13257 | mImpl->log("finish vkGetDisplayModePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13258 | return vkGetDisplayModePropertiesKHR_VkResult_return; |
| 13259 | } |
| 13260 | |
| 13261 | VkResult VkEncoder::vkCreateDisplayModeKHR( |
| 13262 | VkPhysicalDevice physicalDevice, |
| 13263 | VkDisplayKHR display, |
| 13264 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
| 13265 | const VkAllocationCallbacks* pAllocator, |
| 13266 | VkDisplayModeKHR* pMode) |
| 13267 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13268 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13269 | AEMU_SCOPED_TRACE("vkCreateDisplayModeKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13270 | mImpl->log("start vkCreateDisplayModeKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13271 | auto stream = mImpl->stream(); |
| 13272 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13273 | auto resources = mImpl->resources(); |
| 13274 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13275 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13276 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13277 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13278 | VkDisplayModeCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13279 | VkAllocationCallbacks* local_pAllocator; |
| 13280 | local_physicalDevice = physicalDevice; |
| 13281 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13282 | local_pCreateInfo = nullptr; |
| 13283 | if (pCreateInfo) |
| 13284 | { |
| 13285 | local_pCreateInfo = (VkDisplayModeCreateInfoKHR*)pool->alloc(sizeof(const VkDisplayModeCreateInfoKHR)); |
| 13286 | deepcopy_VkDisplayModeCreateInfoKHR(pool, pCreateInfo, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| 13287 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13288 | local_pAllocator = nullptr; |
| 13289 | if (pAllocator) |
| 13290 | { |
| 13291 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13292 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13293 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13294 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13295 | if (local_pCreateInfo) |
| 13296 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13297 | transform_tohost_VkDisplayModeCreateInfoKHR(mImpl->resources(), (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13298 | } |
| 13299 | if (local_pAllocator) |
| 13300 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13301 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13302 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13303 | countingStream->rewind(); |
| 13304 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13305 | uint64_t cgen_var_898; |
| 13306 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_898, 1); |
| 13307 | countingStream->write((uint64_t*)&cgen_var_898, 1 * 8); |
| 13308 | uint64_t cgen_var_899; |
| 13309 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_899, 1); |
| 13310 | countingStream->write((uint64_t*)&cgen_var_899, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13311 | marshal_VkDisplayModeCreateInfoKHR(countingStream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13312 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13313 | uint64_t cgen_var_900 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13314 | countingStream->putBe64(cgen_var_900); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13315 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13316 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13317 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13318 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13319 | uint64_t cgen_var_901; |
| 13320 | countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_901, 1); |
| 13321 | countingStream->write((uint64_t*)&cgen_var_901, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13322 | } |
| 13323 | uint32_t packetSize_vkCreateDisplayModeKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13324 | countingStream->rewind(); |
| 13325 | uint32_t opcode_vkCreateDisplayModeKHR = OP_vkCreateDisplayModeKHR; |
| 13326 | stream->write(&opcode_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| 13327 | stream->write(&packetSize_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13328 | uint64_t cgen_var_902; |
| 13329 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_902, 1); |
| 13330 | stream->write((uint64_t*)&cgen_var_902, 1 * 8); |
| 13331 | uint64_t cgen_var_903; |
| 13332 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_903, 1); |
| 13333 | stream->write((uint64_t*)&cgen_var_903, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13334 | marshal_VkDisplayModeCreateInfoKHR(stream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13335 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13336 | uint64_t cgen_var_904 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13337 | stream->putBe64(cgen_var_904); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13338 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13339 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13340 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13341 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13342 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13343 | uint64_t cgen_var_905; |
| 13344 | stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_905, 1); |
| 13345 | stream->write((uint64_t*)&cgen_var_905, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13346 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13347 | AEMU_SCOPED_TRACE("vkCreateDisplayModeKHR readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13348 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13349 | uint64_t cgen_var_906; |
| 13350 | stream->read((uint64_t*)&cgen_var_906, 8); |
| 13351 | stream->handleMapping()->mapHandles_u64_VkDisplayModeKHR(&cgen_var_906, (VkDisplayModeKHR*)pMode, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13352 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13353 | AEMU_SCOPED_TRACE("vkCreateDisplayModeKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13354 | VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0; |
| 13355 | stream->read(&vkCreateDisplayModeKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13356 | countingStream->clearPool(); |
| 13357 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13358 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13359 | mImpl->log("finish vkCreateDisplayModeKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13360 | return vkCreateDisplayModeKHR_VkResult_return; |
| 13361 | } |
| 13362 | |
| 13363 | VkResult VkEncoder::vkGetDisplayPlaneCapabilitiesKHR( |
| 13364 | VkPhysicalDevice physicalDevice, |
| 13365 | VkDisplayModeKHR mode, |
| 13366 | uint32_t planeIndex, |
| 13367 | VkDisplayPlaneCapabilitiesKHR* pCapabilities) |
| 13368 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13369 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13370 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilitiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13371 | mImpl->log("start vkGetDisplayPlaneCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13372 | auto stream = mImpl->stream(); |
| 13373 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13374 | auto resources = mImpl->resources(); |
| 13375 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13376 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13377 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13378 | VkDisplayModeKHR local_mode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13379 | uint32_t local_planeIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13380 | local_physicalDevice = physicalDevice; |
| 13381 | local_mode = mode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13382 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13383 | countingStream->rewind(); |
| 13384 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13385 | uint64_t cgen_var_907; |
| 13386 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_907, 1); |
| 13387 | countingStream->write((uint64_t*)&cgen_var_907, 1 * 8); |
| 13388 | uint64_t cgen_var_908; |
| 13389 | countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_908, 1); |
| 13390 | countingStream->write((uint64_t*)&cgen_var_908, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13391 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13392 | marshal_VkDisplayPlaneCapabilitiesKHR(countingStream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 13393 | } |
| 13394 | uint32_t packetSize_vkGetDisplayPlaneCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13395 | countingStream->rewind(); |
| 13396 | uint32_t opcode_vkGetDisplayPlaneCapabilitiesKHR = OP_vkGetDisplayPlaneCapabilitiesKHR; |
| 13397 | stream->write(&opcode_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| 13398 | stream->write(&packetSize_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13399 | uint64_t cgen_var_909; |
| 13400 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_909, 1); |
| 13401 | stream->write((uint64_t*)&cgen_var_909, 1 * 8); |
| 13402 | uint64_t cgen_var_910; |
| 13403 | stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_910, 1); |
| 13404 | stream->write((uint64_t*)&cgen_var_910, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13405 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13406 | marshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13407 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilitiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13408 | unmarshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13409 | if (pCapabilities) |
| 13410 | { |
| 13411 | transform_fromhost_VkDisplayPlaneCapabilitiesKHR(mImpl->resources(), (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 13412 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13413 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilitiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13414 | VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 13415 | stream->read(&vkGetDisplayPlaneCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13416 | countingStream->clearPool(); |
| 13417 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13418 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13419 | mImpl->log("finish vkGetDisplayPlaneCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13420 | return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return; |
| 13421 | } |
| 13422 | |
| 13423 | VkResult VkEncoder::vkCreateDisplayPlaneSurfaceKHR( |
| 13424 | VkInstance instance, |
| 13425 | const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, |
| 13426 | const VkAllocationCallbacks* pAllocator, |
| 13427 | VkSurfaceKHR* pSurface) |
| 13428 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13429 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13430 | AEMU_SCOPED_TRACE("vkCreateDisplayPlaneSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13431 | mImpl->log("start vkCreateDisplayPlaneSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13432 | auto stream = mImpl->stream(); |
| 13433 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13434 | auto resources = mImpl->resources(); |
| 13435 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13436 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13437 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13438 | VkDisplaySurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13439 | VkAllocationCallbacks* local_pAllocator; |
| 13440 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13441 | local_pCreateInfo = nullptr; |
| 13442 | if (pCreateInfo) |
| 13443 | { |
| 13444 | local_pCreateInfo = (VkDisplaySurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkDisplaySurfaceCreateInfoKHR)); |
| 13445 | deepcopy_VkDisplaySurfaceCreateInfoKHR(pool, pCreateInfo, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13446 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13447 | local_pAllocator = nullptr; |
| 13448 | if (pAllocator) |
| 13449 | { |
| 13450 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13451 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13452 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13453 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13454 | if (local_pCreateInfo) |
| 13455 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13456 | transform_tohost_VkDisplaySurfaceCreateInfoKHR(mImpl->resources(), (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13457 | } |
| 13458 | if (local_pAllocator) |
| 13459 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13460 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13461 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13462 | countingStream->rewind(); |
| 13463 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13464 | uint64_t cgen_var_911; |
| 13465 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_911, 1); |
| 13466 | countingStream->write((uint64_t*)&cgen_var_911, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13467 | marshal_VkDisplaySurfaceCreateInfoKHR(countingStream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13468 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13469 | uint64_t cgen_var_912 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13470 | countingStream->putBe64(cgen_var_912); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13471 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13472 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13473 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13474 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13475 | uint64_t cgen_var_913; |
| 13476 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_913, 1); |
| 13477 | countingStream->write((uint64_t*)&cgen_var_913, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13478 | } |
| 13479 | uint32_t packetSize_vkCreateDisplayPlaneSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13480 | countingStream->rewind(); |
| 13481 | uint32_t opcode_vkCreateDisplayPlaneSurfaceKHR = OP_vkCreateDisplayPlaneSurfaceKHR; |
| 13482 | stream->write(&opcode_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| 13483 | stream->write(&packetSize_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13484 | uint64_t cgen_var_914; |
| 13485 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_914, 1); |
| 13486 | stream->write((uint64_t*)&cgen_var_914, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13487 | marshal_VkDisplaySurfaceCreateInfoKHR(stream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13488 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13489 | uint64_t cgen_var_915 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13490 | stream->putBe64(cgen_var_915); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13491 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13492 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13493 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13494 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13495 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13496 | uint64_t cgen_var_916; |
| 13497 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_916, 1); |
| 13498 | stream->write((uint64_t*)&cgen_var_916, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13499 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13500 | AEMU_SCOPED_TRACE("vkCreateDisplayPlaneSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13501 | uint64_t cgen_var_917; |
| 13502 | stream->read((uint64_t*)&cgen_var_917, 8); |
| 13503 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_917, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13504 | AEMU_SCOPED_TRACE("vkCreateDisplayPlaneSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13505 | VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0; |
| 13506 | stream->read(&vkCreateDisplayPlaneSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13507 | countingStream->clearPool(); |
| 13508 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13509 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13510 | mImpl->log("finish vkCreateDisplayPlaneSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13511 | return vkCreateDisplayPlaneSurfaceKHR_VkResult_return; |
| 13512 | } |
| 13513 | |
| 13514 | #endif |
| 13515 | #ifdef VK_KHR_display_swapchain |
| 13516 | VkResult VkEncoder::vkCreateSharedSwapchainsKHR( |
| 13517 | VkDevice device, |
| 13518 | uint32_t swapchainCount, |
| 13519 | const VkSwapchainCreateInfoKHR* pCreateInfos, |
| 13520 | const VkAllocationCallbacks* pAllocator, |
| 13521 | VkSwapchainKHR* pSwapchains) |
| 13522 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13523 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13524 | AEMU_SCOPED_TRACE("vkCreateSharedSwapchainsKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13525 | mImpl->log("start vkCreateSharedSwapchainsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13526 | auto stream = mImpl->stream(); |
| 13527 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13528 | auto resources = mImpl->resources(); |
| 13529 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13530 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13531 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13532 | uint32_t local_swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13533 | VkSwapchainCreateInfoKHR* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13534 | VkAllocationCallbacks* local_pAllocator; |
| 13535 | local_device = device; |
| 13536 | local_swapchainCount = swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13537 | local_pCreateInfos = nullptr; |
| 13538 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13539 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13540 | local_pCreateInfos = (VkSwapchainCreateInfoKHR*)pool->alloc(((swapchainCount)) * sizeof(const VkSwapchainCreateInfoKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13541 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13542 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13543 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfos + i, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13544 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13545 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13546 | local_pAllocator = nullptr; |
| 13547 | if (pAllocator) |
| 13548 | { |
| 13549 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13550 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13551 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13552 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13553 | if (local_pCreateInfos) |
| 13554 | { |
| 13555 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13556 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13557 | transform_tohost_VkSwapchainCreateInfoKHR(mImpl->resources(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13558 | } |
| 13559 | } |
| 13560 | if (local_pAllocator) |
| 13561 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13562 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13563 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13564 | countingStream->rewind(); |
| 13565 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13566 | uint64_t cgen_var_918; |
| 13567 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_918, 1); |
| 13568 | countingStream->write((uint64_t*)&cgen_var_918, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13569 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| 13570 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13571 | { |
| 13572 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| 13573 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13574 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13575 | uint64_t cgen_var_919 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13576 | countingStream->putBe64(cgen_var_919); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13577 | if (local_pAllocator) |
| 13578 | { |
| 13579 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13580 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13581 | if (((swapchainCount))) |
| 13582 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13583 | uint64_t* cgen_var_920; |
| 13584 | countingStream->alloc((void**)&cgen_var_920, ((swapchainCount)) * 8); |
| 13585 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_920, ((swapchainCount))); |
| 13586 | countingStream->write((uint64_t*)cgen_var_920, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13587 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13588 | } |
| 13589 | uint32_t packetSize_vkCreateSharedSwapchainsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13590 | countingStream->rewind(); |
| 13591 | uint32_t opcode_vkCreateSharedSwapchainsKHR = OP_vkCreateSharedSwapchainsKHR; |
| 13592 | stream->write(&opcode_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| 13593 | stream->write(&packetSize_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13594 | uint64_t cgen_var_921; |
| 13595 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_921, 1); |
| 13596 | stream->write((uint64_t*)&cgen_var_921, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13597 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13598 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13599 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13600 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13601 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13602 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13603 | uint64_t cgen_var_922 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13604 | stream->putBe64(cgen_var_922); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13605 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13606 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13607 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13608 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13609 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13610 | if (((swapchainCount))) |
| 13611 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13612 | uint64_t* cgen_var_923; |
| 13613 | stream->alloc((void**)&cgen_var_923, ((swapchainCount)) * 8); |
| 13614 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_923, ((swapchainCount))); |
| 13615 | stream->write((uint64_t*)cgen_var_923, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13616 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13617 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13618 | AEMU_SCOPED_TRACE("vkCreateSharedSwapchainsKHR readParams"); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13619 | if (((swapchainCount))) |
| 13620 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13621 | uint64_t* cgen_var_924; |
| 13622 | stream->alloc((void**)&cgen_var_924, ((swapchainCount)) * 8); |
| 13623 | stream->read((uint64_t*)cgen_var_924, ((swapchainCount)) * 8); |
| 13624 | stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(cgen_var_924, (VkSwapchainKHR*)pSwapchains, ((swapchainCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13625 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13626 | AEMU_SCOPED_TRACE("vkCreateSharedSwapchainsKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13627 | VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0; |
| 13628 | stream->read(&vkCreateSharedSwapchainsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13629 | countingStream->clearPool(); |
| 13630 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13631 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13632 | mImpl->log("finish vkCreateSharedSwapchainsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13633 | return vkCreateSharedSwapchainsKHR_VkResult_return; |
| 13634 | } |
| 13635 | |
| 13636 | #endif |
| 13637 | #ifdef VK_KHR_xlib_surface |
| 13638 | VkResult VkEncoder::vkCreateXlibSurfaceKHR( |
| 13639 | VkInstance instance, |
| 13640 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, |
| 13641 | const VkAllocationCallbacks* pAllocator, |
| 13642 | VkSurfaceKHR* pSurface) |
| 13643 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13644 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13645 | AEMU_SCOPED_TRACE("vkCreateXlibSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13646 | mImpl->log("start vkCreateXlibSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13647 | auto stream = mImpl->stream(); |
| 13648 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13649 | auto resources = mImpl->resources(); |
| 13650 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13651 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13652 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13653 | VkXlibSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13654 | VkAllocationCallbacks* local_pAllocator; |
| 13655 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13656 | local_pCreateInfo = nullptr; |
| 13657 | if (pCreateInfo) |
| 13658 | { |
| 13659 | local_pCreateInfo = (VkXlibSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXlibSurfaceCreateInfoKHR)); |
| 13660 | deepcopy_VkXlibSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13661 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13662 | local_pAllocator = nullptr; |
| 13663 | if (pAllocator) |
| 13664 | { |
| 13665 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13666 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13667 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13668 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13669 | if (local_pCreateInfo) |
| 13670 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13671 | transform_tohost_VkXlibSurfaceCreateInfoKHR(mImpl->resources(), (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13672 | } |
| 13673 | if (local_pAllocator) |
| 13674 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13675 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13676 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13677 | countingStream->rewind(); |
| 13678 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13679 | uint64_t cgen_var_925; |
| 13680 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_925, 1); |
| 13681 | countingStream->write((uint64_t*)&cgen_var_925, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13682 | marshal_VkXlibSurfaceCreateInfoKHR(countingStream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13683 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13684 | uint64_t cgen_var_926 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13685 | countingStream->putBe64(cgen_var_926); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13686 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13687 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13688 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13689 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13690 | uint64_t cgen_var_927; |
| 13691 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_927, 1); |
| 13692 | countingStream->write((uint64_t*)&cgen_var_927, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13693 | } |
| 13694 | uint32_t packetSize_vkCreateXlibSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13695 | countingStream->rewind(); |
| 13696 | uint32_t opcode_vkCreateXlibSurfaceKHR = OP_vkCreateXlibSurfaceKHR; |
| 13697 | stream->write(&opcode_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| 13698 | stream->write(&packetSize_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13699 | uint64_t cgen_var_928; |
| 13700 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_928, 1); |
| 13701 | stream->write((uint64_t*)&cgen_var_928, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13702 | marshal_VkXlibSurfaceCreateInfoKHR(stream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13703 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13704 | uint64_t cgen_var_929 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13705 | stream->putBe64(cgen_var_929); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13706 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13707 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13708 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13709 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13710 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13711 | uint64_t cgen_var_930; |
| 13712 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_930, 1); |
| 13713 | stream->write((uint64_t*)&cgen_var_930, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13714 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13715 | AEMU_SCOPED_TRACE("vkCreateXlibSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13716 | uint64_t cgen_var_931; |
| 13717 | stream->read((uint64_t*)&cgen_var_931, 8); |
| 13718 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_931, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13719 | AEMU_SCOPED_TRACE("vkCreateXlibSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13720 | VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0; |
| 13721 | stream->read(&vkCreateXlibSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13722 | countingStream->clearPool(); |
| 13723 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13724 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13725 | mImpl->log("finish vkCreateXlibSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13726 | return vkCreateXlibSurfaceKHR_VkResult_return; |
| 13727 | } |
| 13728 | |
| 13729 | VkBool32 VkEncoder::vkGetPhysicalDeviceXlibPresentationSupportKHR( |
| 13730 | VkPhysicalDevice physicalDevice, |
| 13731 | uint32_t queueFamilyIndex, |
| 13732 | Display* dpy, |
| 13733 | VisualID visualID) |
| 13734 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13735 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13736 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXlibPresentationSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13737 | mImpl->log("start vkGetPhysicalDeviceXlibPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13738 | auto stream = mImpl->stream(); |
| 13739 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13740 | auto resources = mImpl->resources(); |
| 13741 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13742 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13743 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13744 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13745 | VisualID local_visualID; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13746 | local_physicalDevice = physicalDevice; |
| 13747 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13748 | local_visualID = visualID; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13749 | countingStream->rewind(); |
| 13750 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13751 | uint64_t cgen_var_932; |
| 13752 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_932, 1); |
| 13753 | countingStream->write((uint64_t*)&cgen_var_932, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13754 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13755 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13756 | countingStream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13757 | } |
| 13758 | uint32_t packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13759 | countingStream->rewind(); |
| 13760 | uint32_t opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR = OP_vkGetPhysicalDeviceXlibPresentationSupportKHR; |
| 13761 | stream->write(&opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| 13762 | stream->write(&packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13763 | uint64_t cgen_var_933; |
| 13764 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_933, 1); |
| 13765 | stream->write((uint64_t*)&cgen_var_933, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13766 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13767 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13768 | stream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13769 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXlibPresentationSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13770 | stream->read((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13771 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXlibPresentationSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13772 | VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13773 | stream->read(&vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13774 | countingStream->clearPool(); |
| 13775 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13776 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13777 | mImpl->log("finish vkGetPhysicalDeviceXlibPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13778 | return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return; |
| 13779 | } |
| 13780 | |
| 13781 | #endif |
| 13782 | #ifdef VK_KHR_xcb_surface |
| 13783 | VkResult VkEncoder::vkCreateXcbSurfaceKHR( |
| 13784 | VkInstance instance, |
| 13785 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, |
| 13786 | const VkAllocationCallbacks* pAllocator, |
| 13787 | VkSurfaceKHR* pSurface) |
| 13788 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13789 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13790 | AEMU_SCOPED_TRACE("vkCreateXcbSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13791 | mImpl->log("start vkCreateXcbSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13792 | auto stream = mImpl->stream(); |
| 13793 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13794 | auto resources = mImpl->resources(); |
| 13795 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13796 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13797 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13798 | VkXcbSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13799 | VkAllocationCallbacks* local_pAllocator; |
| 13800 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13801 | local_pCreateInfo = nullptr; |
| 13802 | if (pCreateInfo) |
| 13803 | { |
| 13804 | local_pCreateInfo = (VkXcbSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXcbSurfaceCreateInfoKHR)); |
| 13805 | deepcopy_VkXcbSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13806 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13807 | local_pAllocator = nullptr; |
| 13808 | if (pAllocator) |
| 13809 | { |
| 13810 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13811 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13812 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13813 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13814 | if (local_pCreateInfo) |
| 13815 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13816 | transform_tohost_VkXcbSurfaceCreateInfoKHR(mImpl->resources(), (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13817 | } |
| 13818 | if (local_pAllocator) |
| 13819 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13820 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13821 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13822 | countingStream->rewind(); |
| 13823 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13824 | uint64_t cgen_var_934; |
| 13825 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_934, 1); |
| 13826 | countingStream->write((uint64_t*)&cgen_var_934, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13827 | marshal_VkXcbSurfaceCreateInfoKHR(countingStream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13828 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13829 | uint64_t cgen_var_935 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13830 | countingStream->putBe64(cgen_var_935); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13831 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13832 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13833 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13834 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13835 | uint64_t cgen_var_936; |
| 13836 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_936, 1); |
| 13837 | countingStream->write((uint64_t*)&cgen_var_936, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13838 | } |
| 13839 | uint32_t packetSize_vkCreateXcbSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13840 | countingStream->rewind(); |
| 13841 | uint32_t opcode_vkCreateXcbSurfaceKHR = OP_vkCreateXcbSurfaceKHR; |
| 13842 | stream->write(&opcode_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| 13843 | stream->write(&packetSize_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13844 | uint64_t cgen_var_937; |
| 13845 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_937, 1); |
| 13846 | stream->write((uint64_t*)&cgen_var_937, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13847 | marshal_VkXcbSurfaceCreateInfoKHR(stream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13848 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13849 | uint64_t cgen_var_938 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13850 | stream->putBe64(cgen_var_938); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13851 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13852 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13853 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13854 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13855 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13856 | uint64_t cgen_var_939; |
| 13857 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_939, 1); |
| 13858 | stream->write((uint64_t*)&cgen_var_939, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13859 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13860 | AEMU_SCOPED_TRACE("vkCreateXcbSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13861 | uint64_t cgen_var_940; |
| 13862 | stream->read((uint64_t*)&cgen_var_940, 8); |
| 13863 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_940, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13864 | AEMU_SCOPED_TRACE("vkCreateXcbSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13865 | VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0; |
| 13866 | stream->read(&vkCreateXcbSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13867 | countingStream->clearPool(); |
| 13868 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13869 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13870 | mImpl->log("finish vkCreateXcbSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13871 | return vkCreateXcbSurfaceKHR_VkResult_return; |
| 13872 | } |
| 13873 | |
| 13874 | VkBool32 VkEncoder::vkGetPhysicalDeviceXcbPresentationSupportKHR( |
| 13875 | VkPhysicalDevice physicalDevice, |
| 13876 | uint32_t queueFamilyIndex, |
| 13877 | xcb_connection_t* connection, |
| 13878 | xcb_visualid_t visual_id) |
| 13879 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13880 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13881 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXcbPresentationSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13882 | mImpl->log("start vkGetPhysicalDeviceXcbPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13883 | auto stream = mImpl->stream(); |
| 13884 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13885 | auto resources = mImpl->resources(); |
| 13886 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13887 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13888 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13889 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13890 | xcb_visualid_t local_visual_id; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13891 | local_physicalDevice = physicalDevice; |
| 13892 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13893 | local_visual_id = visual_id; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13894 | countingStream->rewind(); |
| 13895 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13896 | uint64_t cgen_var_941; |
| 13897 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_941, 1); |
| 13898 | countingStream->write((uint64_t*)&cgen_var_941, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13899 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13900 | countingStream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13901 | countingStream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13902 | } |
| 13903 | uint32_t packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13904 | countingStream->rewind(); |
| 13905 | uint32_t opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR = OP_vkGetPhysicalDeviceXcbPresentationSupportKHR; |
| 13906 | stream->write(&opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| 13907 | stream->write(&packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13908 | uint64_t cgen_var_942; |
| 13909 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_942, 1); |
| 13910 | stream->write((uint64_t*)&cgen_var_942, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13911 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13912 | stream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13913 | stream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13914 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXcbPresentationSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13915 | stream->read((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13916 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXcbPresentationSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13917 | VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13918 | stream->read(&vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13919 | countingStream->clearPool(); |
| 13920 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13921 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13922 | mImpl->log("finish vkGetPhysicalDeviceXcbPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13923 | return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return; |
| 13924 | } |
| 13925 | |
| 13926 | #endif |
| 13927 | #ifdef VK_KHR_wayland_surface |
| 13928 | VkResult VkEncoder::vkCreateWaylandSurfaceKHR( |
| 13929 | VkInstance instance, |
| 13930 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, |
| 13931 | const VkAllocationCallbacks* pAllocator, |
| 13932 | VkSurfaceKHR* pSurface) |
| 13933 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13934 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13935 | AEMU_SCOPED_TRACE("vkCreateWaylandSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13936 | mImpl->log("start vkCreateWaylandSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13937 | auto stream = mImpl->stream(); |
| 13938 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13939 | auto resources = mImpl->resources(); |
| 13940 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13941 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13942 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13943 | VkWaylandSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13944 | VkAllocationCallbacks* local_pAllocator; |
| 13945 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13946 | local_pCreateInfo = nullptr; |
| 13947 | if (pCreateInfo) |
| 13948 | { |
| 13949 | local_pCreateInfo = (VkWaylandSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWaylandSurfaceCreateInfoKHR)); |
| 13950 | deepcopy_VkWaylandSurfaceCreateInfoKHR(pool, pCreateInfo, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13951 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13952 | local_pAllocator = nullptr; |
| 13953 | if (pAllocator) |
| 13954 | { |
| 13955 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13956 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13957 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13958 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13959 | if (local_pCreateInfo) |
| 13960 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13961 | transform_tohost_VkWaylandSurfaceCreateInfoKHR(mImpl->resources(), (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13962 | } |
| 13963 | if (local_pAllocator) |
| 13964 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13965 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13966 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13967 | countingStream->rewind(); |
| 13968 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13969 | uint64_t cgen_var_943; |
| 13970 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_943, 1); |
| 13971 | countingStream->write((uint64_t*)&cgen_var_943, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13972 | marshal_VkWaylandSurfaceCreateInfoKHR(countingStream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13973 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13974 | uint64_t cgen_var_944 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13975 | countingStream->putBe64(cgen_var_944); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13976 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13977 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13978 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13979 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13980 | uint64_t cgen_var_945; |
| 13981 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_945, 1); |
| 13982 | countingStream->write((uint64_t*)&cgen_var_945, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13983 | } |
| 13984 | uint32_t packetSize_vkCreateWaylandSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13985 | countingStream->rewind(); |
| 13986 | uint32_t opcode_vkCreateWaylandSurfaceKHR = OP_vkCreateWaylandSurfaceKHR; |
| 13987 | stream->write(&opcode_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| 13988 | stream->write(&packetSize_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13989 | uint64_t cgen_var_946; |
| 13990 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_946, 1); |
| 13991 | stream->write((uint64_t*)&cgen_var_946, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13992 | marshal_VkWaylandSurfaceCreateInfoKHR(stream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13993 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13994 | uint64_t cgen_var_947 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13995 | stream->putBe64(cgen_var_947); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13996 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13997 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13998 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13999 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14000 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14001 | uint64_t cgen_var_948; |
| 14002 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_948, 1); |
| 14003 | stream->write((uint64_t*)&cgen_var_948, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14004 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14005 | AEMU_SCOPED_TRACE("vkCreateWaylandSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14006 | uint64_t cgen_var_949; |
| 14007 | stream->read((uint64_t*)&cgen_var_949, 8); |
| 14008 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_949, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14009 | AEMU_SCOPED_TRACE("vkCreateWaylandSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14010 | VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0; |
| 14011 | stream->read(&vkCreateWaylandSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14012 | countingStream->clearPool(); |
| 14013 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14014 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14015 | mImpl->log("finish vkCreateWaylandSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14016 | return vkCreateWaylandSurfaceKHR_VkResult_return; |
| 14017 | } |
| 14018 | |
| 14019 | VkBool32 VkEncoder::vkGetPhysicalDeviceWaylandPresentationSupportKHR( |
| 14020 | VkPhysicalDevice physicalDevice, |
| 14021 | uint32_t queueFamilyIndex, |
| 14022 | wl_display* display) |
| 14023 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14024 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14025 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWaylandPresentationSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14026 | mImpl->log("start vkGetPhysicalDeviceWaylandPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14027 | auto stream = mImpl->stream(); |
| 14028 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14029 | auto resources = mImpl->resources(); |
| 14030 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14031 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14032 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14033 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14034 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14035 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14036 | countingStream->rewind(); |
| 14037 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14038 | uint64_t cgen_var_950; |
| 14039 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_950, 1); |
| 14040 | countingStream->write((uint64_t*)&cgen_var_950, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14041 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14042 | countingStream->write((wl_display*)display, sizeof(wl_display)); |
| 14043 | } |
| 14044 | uint32_t packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14045 | countingStream->rewind(); |
| 14046 | uint32_t opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR = OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR; |
| 14047 | stream->write(&opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| 14048 | stream->write(&packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14049 | uint64_t cgen_var_951; |
| 14050 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_951, 1); |
| 14051 | stream->write((uint64_t*)&cgen_var_951, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14052 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14053 | stream->write((wl_display*)display, sizeof(wl_display)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14054 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWaylandPresentationSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14055 | stream->read((wl_display*)display, sizeof(wl_display)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14056 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWaylandPresentationSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14057 | VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 14058 | stream->read(&vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14059 | countingStream->clearPool(); |
| 14060 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14061 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14062 | mImpl->log("finish vkGetPhysicalDeviceWaylandPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14063 | return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return; |
| 14064 | } |
| 14065 | |
| 14066 | #endif |
| 14067 | #ifdef VK_KHR_mir_surface |
| 14068 | VkResult VkEncoder::vkCreateMirSurfaceKHR( |
| 14069 | VkInstance instance, |
| 14070 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, |
| 14071 | const VkAllocationCallbacks* pAllocator, |
| 14072 | VkSurfaceKHR* pSurface) |
| 14073 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14074 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14075 | AEMU_SCOPED_TRACE("vkCreateMirSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14076 | mImpl->log("start vkCreateMirSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14077 | auto stream = mImpl->stream(); |
| 14078 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14079 | auto resources = mImpl->resources(); |
| 14080 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14081 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14082 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14083 | VkMirSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14084 | VkAllocationCallbacks* local_pAllocator; |
| 14085 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14086 | local_pCreateInfo = nullptr; |
| 14087 | if (pCreateInfo) |
| 14088 | { |
| 14089 | local_pCreateInfo = (VkMirSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkMirSurfaceCreateInfoKHR)); |
| 14090 | deepcopy_VkMirSurfaceCreateInfoKHR(pool, pCreateInfo, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 14091 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14092 | local_pAllocator = nullptr; |
| 14093 | if (pAllocator) |
| 14094 | { |
| 14095 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14096 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14097 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 14098 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14099 | if (local_pCreateInfo) |
| 14100 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14101 | transform_tohost_VkMirSurfaceCreateInfoKHR(mImpl->resources(), (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14102 | } |
| 14103 | if (local_pAllocator) |
| 14104 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14105 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14106 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14107 | countingStream->rewind(); |
| 14108 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14109 | uint64_t cgen_var_952; |
| 14110 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_952, 1); |
| 14111 | countingStream->write((uint64_t*)&cgen_var_952, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14112 | marshal_VkMirSurfaceCreateInfoKHR(countingStream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14113 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14114 | uint64_t cgen_var_953 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14115 | countingStream->putBe64(cgen_var_953); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14116 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14117 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14118 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14119 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14120 | uint64_t cgen_var_954; |
| 14121 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_954, 1); |
| 14122 | countingStream->write((uint64_t*)&cgen_var_954, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14123 | } |
| 14124 | uint32_t packetSize_vkCreateMirSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14125 | countingStream->rewind(); |
| 14126 | uint32_t opcode_vkCreateMirSurfaceKHR = OP_vkCreateMirSurfaceKHR; |
| 14127 | stream->write(&opcode_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| 14128 | stream->write(&packetSize_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14129 | uint64_t cgen_var_955; |
| 14130 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_955, 1); |
| 14131 | stream->write((uint64_t*)&cgen_var_955, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14132 | marshal_VkMirSurfaceCreateInfoKHR(stream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14133 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14134 | uint64_t cgen_var_956 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14135 | stream->putBe64(cgen_var_956); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14136 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14137 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14138 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14139 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14140 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14141 | uint64_t cgen_var_957; |
| 14142 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_957, 1); |
| 14143 | stream->write((uint64_t*)&cgen_var_957, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14144 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14145 | AEMU_SCOPED_TRACE("vkCreateMirSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14146 | uint64_t cgen_var_958; |
| 14147 | stream->read((uint64_t*)&cgen_var_958, 8); |
| 14148 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_958, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14149 | AEMU_SCOPED_TRACE("vkCreateMirSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14150 | VkResult vkCreateMirSurfaceKHR_VkResult_return = (VkResult)0; |
| 14151 | stream->read(&vkCreateMirSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14152 | countingStream->clearPool(); |
| 14153 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14154 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14155 | mImpl->log("finish vkCreateMirSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14156 | return vkCreateMirSurfaceKHR_VkResult_return; |
| 14157 | } |
| 14158 | |
| 14159 | VkBool32 VkEncoder::vkGetPhysicalDeviceMirPresentationSupportKHR( |
| 14160 | VkPhysicalDevice physicalDevice, |
| 14161 | uint32_t queueFamilyIndex, |
| 14162 | MirConnection* connection) |
| 14163 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14164 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14165 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMirPresentationSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14166 | mImpl->log("start vkGetPhysicalDeviceMirPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14167 | auto stream = mImpl->stream(); |
| 14168 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14169 | auto resources = mImpl->resources(); |
| 14170 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14171 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14172 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14173 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14174 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14175 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14176 | countingStream->rewind(); |
| 14177 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14178 | uint64_t cgen_var_959; |
| 14179 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_959, 1); |
| 14180 | countingStream->write((uint64_t*)&cgen_var_959, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14181 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14182 | countingStream->write((MirConnection*)connection, sizeof(MirConnection)); |
| 14183 | } |
| 14184 | uint32_t packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14185 | countingStream->rewind(); |
| 14186 | uint32_t opcode_vkGetPhysicalDeviceMirPresentationSupportKHR = OP_vkGetPhysicalDeviceMirPresentationSupportKHR; |
| 14187 | stream->write(&opcode_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| 14188 | stream->write(&packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14189 | uint64_t cgen_var_960; |
| 14190 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_960, 1); |
| 14191 | stream->write((uint64_t*)&cgen_var_960, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14192 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14193 | stream->write((MirConnection*)connection, sizeof(MirConnection)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14194 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMirPresentationSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14195 | stream->read((MirConnection*)connection, sizeof(MirConnection)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14196 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMirPresentationSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14197 | VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 14198 | stream->read(&vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14199 | countingStream->clearPool(); |
| 14200 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14201 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14202 | mImpl->log("finish vkGetPhysicalDeviceMirPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14203 | return vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return; |
| 14204 | } |
| 14205 | |
| 14206 | #endif |
| 14207 | #ifdef VK_KHR_android_surface |
| 14208 | VkResult VkEncoder::vkCreateAndroidSurfaceKHR( |
| 14209 | VkInstance instance, |
| 14210 | const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
| 14211 | const VkAllocationCallbacks* pAllocator, |
| 14212 | VkSurfaceKHR* pSurface) |
| 14213 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14214 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14215 | AEMU_SCOPED_TRACE("vkCreateAndroidSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14216 | mImpl->log("start vkCreateAndroidSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14217 | auto stream = mImpl->stream(); |
| 14218 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14219 | auto resources = mImpl->resources(); |
| 14220 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14221 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14222 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14223 | VkAndroidSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14224 | VkAllocationCallbacks* local_pAllocator; |
| 14225 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14226 | local_pCreateInfo = nullptr; |
| 14227 | if (pCreateInfo) |
| 14228 | { |
| 14229 | local_pCreateInfo = (VkAndroidSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkAndroidSurfaceCreateInfoKHR)); |
| 14230 | deepcopy_VkAndroidSurfaceCreateInfoKHR(pool, pCreateInfo, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 14231 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14232 | local_pAllocator = nullptr; |
| 14233 | if (pAllocator) |
| 14234 | { |
| 14235 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14236 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14237 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 14238 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14239 | if (local_pCreateInfo) |
| 14240 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14241 | transform_tohost_VkAndroidSurfaceCreateInfoKHR(mImpl->resources(), (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14242 | } |
| 14243 | if (local_pAllocator) |
| 14244 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14245 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14246 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14247 | countingStream->rewind(); |
| 14248 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14249 | uint64_t cgen_var_961; |
| 14250 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_961, 1); |
| 14251 | countingStream->write((uint64_t*)&cgen_var_961, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14252 | marshal_VkAndroidSurfaceCreateInfoKHR(countingStream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14253 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14254 | uint64_t cgen_var_962 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14255 | countingStream->putBe64(cgen_var_962); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14256 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14257 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14258 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14259 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14260 | uint64_t cgen_var_963; |
| 14261 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_963, 1); |
| 14262 | countingStream->write((uint64_t*)&cgen_var_963, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14263 | } |
| 14264 | uint32_t packetSize_vkCreateAndroidSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14265 | countingStream->rewind(); |
| 14266 | uint32_t opcode_vkCreateAndroidSurfaceKHR = OP_vkCreateAndroidSurfaceKHR; |
| 14267 | stream->write(&opcode_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| 14268 | stream->write(&packetSize_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14269 | uint64_t cgen_var_964; |
| 14270 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_964, 1); |
| 14271 | stream->write((uint64_t*)&cgen_var_964, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14272 | marshal_VkAndroidSurfaceCreateInfoKHR(stream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14273 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14274 | uint64_t cgen_var_965 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14275 | stream->putBe64(cgen_var_965); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14276 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14277 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14278 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14279 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14280 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14281 | uint64_t cgen_var_966; |
| 14282 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_966, 1); |
| 14283 | stream->write((uint64_t*)&cgen_var_966, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14284 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14285 | AEMU_SCOPED_TRACE("vkCreateAndroidSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14286 | uint64_t cgen_var_967; |
| 14287 | stream->read((uint64_t*)&cgen_var_967, 8); |
| 14288 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_967, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14289 | AEMU_SCOPED_TRACE("vkCreateAndroidSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14290 | VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0; |
| 14291 | stream->read(&vkCreateAndroidSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14292 | countingStream->clearPool(); |
| 14293 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14294 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14295 | mImpl->log("finish vkCreateAndroidSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14296 | return vkCreateAndroidSurfaceKHR_VkResult_return; |
| 14297 | } |
| 14298 | |
| 14299 | #endif |
| 14300 | #ifdef VK_KHR_win32_surface |
| 14301 | VkResult VkEncoder::vkCreateWin32SurfaceKHR( |
| 14302 | VkInstance instance, |
| 14303 | const VkWin32SurfaceCreateInfoKHR* pCreateInfo, |
| 14304 | const VkAllocationCallbacks* pAllocator, |
| 14305 | VkSurfaceKHR* pSurface) |
| 14306 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14307 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14308 | AEMU_SCOPED_TRACE("vkCreateWin32SurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14309 | mImpl->log("start vkCreateWin32SurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14310 | auto stream = mImpl->stream(); |
| 14311 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14312 | auto resources = mImpl->resources(); |
| 14313 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14314 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14315 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14316 | VkWin32SurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14317 | VkAllocationCallbacks* local_pAllocator; |
| 14318 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14319 | local_pCreateInfo = nullptr; |
| 14320 | if (pCreateInfo) |
| 14321 | { |
| 14322 | local_pCreateInfo = (VkWin32SurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWin32SurfaceCreateInfoKHR)); |
| 14323 | deepcopy_VkWin32SurfaceCreateInfoKHR(pool, pCreateInfo, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 14324 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14325 | local_pAllocator = nullptr; |
| 14326 | if (pAllocator) |
| 14327 | { |
| 14328 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14329 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14330 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 14331 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14332 | if (local_pCreateInfo) |
| 14333 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14334 | transform_tohost_VkWin32SurfaceCreateInfoKHR(mImpl->resources(), (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14335 | } |
| 14336 | if (local_pAllocator) |
| 14337 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14338 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14339 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14340 | countingStream->rewind(); |
| 14341 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14342 | uint64_t cgen_var_968; |
| 14343 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_968, 1); |
| 14344 | countingStream->write((uint64_t*)&cgen_var_968, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14345 | marshal_VkWin32SurfaceCreateInfoKHR(countingStream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14346 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14347 | uint64_t cgen_var_969 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14348 | countingStream->putBe64(cgen_var_969); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14349 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14350 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14351 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14352 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14353 | uint64_t cgen_var_970; |
| 14354 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_970, 1); |
| 14355 | countingStream->write((uint64_t*)&cgen_var_970, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14356 | } |
| 14357 | uint32_t packetSize_vkCreateWin32SurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14358 | countingStream->rewind(); |
| 14359 | uint32_t opcode_vkCreateWin32SurfaceKHR = OP_vkCreateWin32SurfaceKHR; |
| 14360 | stream->write(&opcode_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| 14361 | stream->write(&packetSize_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14362 | uint64_t cgen_var_971; |
| 14363 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_971, 1); |
| 14364 | stream->write((uint64_t*)&cgen_var_971, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14365 | marshal_VkWin32SurfaceCreateInfoKHR(stream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14366 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14367 | uint64_t cgen_var_972 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14368 | stream->putBe64(cgen_var_972); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14369 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14370 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14371 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14372 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14373 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14374 | uint64_t cgen_var_973; |
| 14375 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_973, 1); |
| 14376 | stream->write((uint64_t*)&cgen_var_973, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14377 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14378 | AEMU_SCOPED_TRACE("vkCreateWin32SurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14379 | uint64_t cgen_var_974; |
| 14380 | stream->read((uint64_t*)&cgen_var_974, 8); |
| 14381 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_974, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14382 | AEMU_SCOPED_TRACE("vkCreateWin32SurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14383 | VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0; |
| 14384 | stream->read(&vkCreateWin32SurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14385 | countingStream->clearPool(); |
| 14386 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14387 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14388 | mImpl->log("finish vkCreateWin32SurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14389 | return vkCreateWin32SurfaceKHR_VkResult_return; |
| 14390 | } |
| 14391 | |
| 14392 | VkBool32 VkEncoder::vkGetPhysicalDeviceWin32PresentationSupportKHR( |
| 14393 | VkPhysicalDevice physicalDevice, |
| 14394 | uint32_t queueFamilyIndex) |
| 14395 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14396 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14397 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWin32PresentationSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14398 | mImpl->log("start vkGetPhysicalDeviceWin32PresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14399 | auto stream = mImpl->stream(); |
| 14400 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14401 | auto resources = mImpl->resources(); |
| 14402 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14403 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14404 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14405 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14406 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14407 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14408 | countingStream->rewind(); |
| 14409 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14410 | uint64_t cgen_var_975; |
| 14411 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_975, 1); |
| 14412 | countingStream->write((uint64_t*)&cgen_var_975, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14413 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14414 | } |
| 14415 | uint32_t packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14416 | countingStream->rewind(); |
| 14417 | uint32_t opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR = OP_vkGetPhysicalDeviceWin32PresentationSupportKHR; |
| 14418 | stream->write(&opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| 14419 | stream->write(&packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14420 | uint64_t cgen_var_976; |
| 14421 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_976, 1); |
| 14422 | stream->write((uint64_t*)&cgen_var_976, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14423 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14424 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWin32PresentationSupportKHR readParams"); |
| 14425 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWin32PresentationSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14426 | VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 14427 | stream->read(&vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14428 | countingStream->clearPool(); |
| 14429 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14430 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14431 | mImpl->log("finish vkGetPhysicalDeviceWin32PresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14432 | return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return; |
| 14433 | } |
| 14434 | |
| 14435 | #endif |
| 14436 | #ifdef VK_KHR_sampler_mirror_clamp_to_edge |
| 14437 | #endif |
| 14438 | #ifdef VK_KHR_multiview |
| 14439 | #endif |
| 14440 | #ifdef VK_KHR_get_physical_device_properties2 |
| 14441 | void VkEncoder::vkGetPhysicalDeviceFeatures2KHR( |
| 14442 | VkPhysicalDevice physicalDevice, |
| 14443 | VkPhysicalDeviceFeatures2* pFeatures) |
| 14444 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14445 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14446 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14447 | mImpl->log("start vkGetPhysicalDeviceFeatures2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14448 | auto stream = mImpl->stream(); |
| 14449 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14450 | auto resources = mImpl->resources(); |
| 14451 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14452 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14453 | VkPhysicalDevice local_physicalDevice; |
| 14454 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14455 | countingStream->rewind(); |
| 14456 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14457 | uint64_t cgen_var_977; |
| 14458 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_977, 1); |
| 14459 | countingStream->write((uint64_t*)&cgen_var_977, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14460 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 14461 | } |
| 14462 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14463 | countingStream->rewind(); |
| 14464 | uint32_t opcode_vkGetPhysicalDeviceFeatures2KHR = OP_vkGetPhysicalDeviceFeatures2KHR; |
| 14465 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| 14466 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14467 | uint64_t cgen_var_978; |
| 14468 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_978, 1); |
| 14469 | stream->write((uint64_t*)&cgen_var_978, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14470 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14471 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14472 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14473 | if (pFeatures) |
| 14474 | { |
| 14475 | transform_fromhost_VkPhysicalDeviceFeatures2(mImpl->resources(), (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 14476 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14477 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14478 | mImpl->log("finish vkGetPhysicalDeviceFeatures2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14479 | } |
| 14480 | |
| 14481 | void VkEncoder::vkGetPhysicalDeviceProperties2KHR( |
| 14482 | VkPhysicalDevice physicalDevice, |
| 14483 | VkPhysicalDeviceProperties2* pProperties) |
| 14484 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14485 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14486 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14487 | mImpl->log("start vkGetPhysicalDeviceProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14488 | auto stream = mImpl->stream(); |
| 14489 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14490 | auto resources = mImpl->resources(); |
| 14491 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14492 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14493 | VkPhysicalDevice local_physicalDevice; |
| 14494 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14495 | countingStream->rewind(); |
| 14496 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14497 | uint64_t cgen_var_979; |
| 14498 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_979, 1); |
| 14499 | countingStream->write((uint64_t*)&cgen_var_979, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14500 | marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 14501 | } |
| 14502 | uint32_t packetSize_vkGetPhysicalDeviceProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14503 | countingStream->rewind(); |
| 14504 | uint32_t opcode_vkGetPhysicalDeviceProperties2KHR = OP_vkGetPhysicalDeviceProperties2KHR; |
| 14505 | stream->write(&opcode_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| 14506 | stream->write(&packetSize_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14507 | uint64_t cgen_var_980; |
| 14508 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_980, 1); |
| 14509 | stream->write((uint64_t*)&cgen_var_980, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14510 | marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14511 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14512 | unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14513 | if (pProperties) |
| 14514 | { |
| 14515 | transform_fromhost_VkPhysicalDeviceProperties2(mImpl->resources(), (VkPhysicalDeviceProperties2*)(pProperties)); |
| 14516 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14517 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14518 | mImpl->log("finish vkGetPhysicalDeviceProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14519 | } |
| 14520 | |
| 14521 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2KHR( |
| 14522 | VkPhysicalDevice physicalDevice, |
| 14523 | VkFormat format, |
| 14524 | VkFormatProperties2* pFormatProperties) |
| 14525 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14526 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14527 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14528 | mImpl->log("start vkGetPhysicalDeviceFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14529 | auto stream = mImpl->stream(); |
| 14530 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14531 | auto resources = mImpl->resources(); |
| 14532 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14533 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14534 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14535 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14536 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14537 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14538 | countingStream->rewind(); |
| 14539 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14540 | uint64_t cgen_var_981; |
| 14541 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_981, 1); |
| 14542 | countingStream->write((uint64_t*)&cgen_var_981, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14543 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14544 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 14545 | } |
| 14546 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14547 | countingStream->rewind(); |
| 14548 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2KHR = OP_vkGetPhysicalDeviceFormatProperties2KHR; |
| 14549 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| 14550 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14551 | uint64_t cgen_var_982; |
| 14552 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_982, 1); |
| 14553 | stream->write((uint64_t*)&cgen_var_982, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14554 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14555 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14556 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14557 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14558 | if (pFormatProperties) |
| 14559 | { |
| 14560 | transform_fromhost_VkFormatProperties2(mImpl->resources(), (VkFormatProperties2*)(pFormatProperties)); |
| 14561 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14562 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14563 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14564 | } |
| 14565 | |
| 14566 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2KHR( |
| 14567 | VkPhysicalDevice physicalDevice, |
| 14568 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 14569 | VkImageFormatProperties2* pImageFormatProperties) |
| 14570 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14571 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14572 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14573 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14574 | auto stream = mImpl->stream(); |
| 14575 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14576 | auto resources = mImpl->resources(); |
| 14577 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14578 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14579 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14580 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14581 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14582 | local_pImageFormatInfo = nullptr; |
| 14583 | if (pImageFormatInfo) |
| 14584 | { |
| 14585 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 14586 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 14587 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14588 | if (local_pImageFormatInfo) |
| 14589 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14590 | transform_tohost_VkPhysicalDeviceImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14591 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14592 | countingStream->rewind(); |
| 14593 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14594 | uint64_t cgen_var_983; |
| 14595 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_983, 1); |
| 14596 | countingStream->write((uint64_t*)&cgen_var_983, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14597 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14598 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 14599 | } |
| 14600 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14601 | countingStream->rewind(); |
| 14602 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2KHR = OP_vkGetPhysicalDeviceImageFormatProperties2KHR; |
| 14603 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| 14604 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14605 | uint64_t cgen_var_984; |
| 14606 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_984, 1); |
| 14607 | stream->write((uint64_t*)&cgen_var_984, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14608 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14609 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14610 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14611 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14612 | if (pImageFormatProperties) |
| 14613 | { |
| 14614 | transform_fromhost_VkImageFormatProperties2(mImpl->resources(), (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 14615 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14616 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14617 | VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0; |
| 14618 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14619 | countingStream->clearPool(); |
| 14620 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14621 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14622 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14623 | return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return; |
| 14624 | } |
| 14625 | |
| 14626 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2KHR( |
| 14627 | VkPhysicalDevice physicalDevice, |
| 14628 | uint32_t* pQueueFamilyPropertyCount, |
| 14629 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 14630 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14631 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14632 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14633 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14634 | auto stream = mImpl->stream(); |
| 14635 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14636 | auto resources = mImpl->resources(); |
| 14637 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14638 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14639 | VkPhysicalDevice local_physicalDevice; |
| 14640 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14641 | countingStream->rewind(); |
| 14642 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14643 | uint64_t cgen_var_985; |
| 14644 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_985, 1); |
| 14645 | countingStream->write((uint64_t*)&cgen_var_985, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14646 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14647 | uint64_t cgen_var_986 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 14648 | countingStream->putBe64(cgen_var_986); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14649 | if (pQueueFamilyPropertyCount) |
| 14650 | { |
| 14651 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 14652 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14653 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14654 | uint64_t cgen_var_987 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 14655 | countingStream->putBe64(cgen_var_987); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14656 | if (pQueueFamilyProperties) |
| 14657 | { |
| 14658 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14659 | { |
| 14660 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14661 | } |
| 14662 | } |
| 14663 | } |
| 14664 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14665 | countingStream->rewind(); |
| 14666 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR = OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR; |
| 14667 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| 14668 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14669 | uint64_t cgen_var_988; |
| 14670 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_988, 1); |
| 14671 | stream->write((uint64_t*)&cgen_var_988, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14672 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14673 | uint64_t cgen_var_989 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 14674 | stream->putBe64(cgen_var_989); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14675 | if (pQueueFamilyPropertyCount) |
| 14676 | { |
| 14677 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 14678 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14679 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14680 | uint64_t cgen_var_990 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 14681 | stream->putBe64(cgen_var_990); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14682 | if (pQueueFamilyProperties) |
| 14683 | { |
| 14684 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14685 | { |
| 14686 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14687 | } |
| 14688 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14689 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14690 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14691 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14692 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14693 | if (pQueueFamilyPropertyCount) |
| 14694 | { |
| 14695 | if (!(check_pQueueFamilyPropertyCount)) |
| 14696 | { |
| 14697 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 14698 | } |
| 14699 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 14700 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14701 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14702 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14703 | check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14704 | if (pQueueFamilyProperties) |
| 14705 | { |
| 14706 | if (!(check_pQueueFamilyProperties)) |
| 14707 | { |
| 14708 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 14709 | } |
| 14710 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14711 | { |
| 14712 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14713 | } |
| 14714 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14715 | if (pQueueFamilyProperties) |
| 14716 | { |
| 14717 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14718 | { |
| 14719 | transform_fromhost_VkQueueFamilyProperties2(mImpl->resources(), (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14720 | } |
| 14721 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14722 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14723 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14724 | } |
| 14725 | |
| 14726 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2KHR( |
| 14727 | VkPhysicalDevice physicalDevice, |
| 14728 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 14729 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14730 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14731 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14732 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14733 | auto stream = mImpl->stream(); |
| 14734 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14735 | auto resources = mImpl->resources(); |
| 14736 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14737 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14738 | VkPhysicalDevice local_physicalDevice; |
| 14739 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14740 | countingStream->rewind(); |
| 14741 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14742 | uint64_t cgen_var_993; |
| 14743 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_993, 1); |
| 14744 | countingStream->write((uint64_t*)&cgen_var_993, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14745 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 14746 | } |
| 14747 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14748 | countingStream->rewind(); |
| 14749 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2KHR = OP_vkGetPhysicalDeviceMemoryProperties2KHR; |
| 14750 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| 14751 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14752 | uint64_t cgen_var_994; |
| 14753 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_994, 1); |
| 14754 | stream->write((uint64_t*)&cgen_var_994, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14755 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14756 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14757 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14758 | if (pMemoryProperties) |
| 14759 | { |
| 14760 | transform_fromhost_VkPhysicalDeviceMemoryProperties2(mImpl->resources(), (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 14761 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14762 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14763 | encoderLock.unlock(); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 14764 | mImpl->resources()->on_vkGetPhysicalDeviceMemoryProperties2KHR(this, physicalDevice, pMemoryProperties); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14765 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14766 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14767 | } |
| 14768 | |
| 14769 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 14770 | VkPhysicalDevice physicalDevice, |
| 14771 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 14772 | uint32_t* pPropertyCount, |
| 14773 | VkSparseImageFormatProperties2* pProperties) |
| 14774 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14775 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14776 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14777 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14778 | auto stream = mImpl->stream(); |
| 14779 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14780 | auto resources = mImpl->resources(); |
| 14781 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14782 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14783 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14784 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14785 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14786 | local_pFormatInfo = nullptr; |
| 14787 | if (pFormatInfo) |
| 14788 | { |
| 14789 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 14790 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 14791 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14792 | if (local_pFormatInfo) |
| 14793 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14794 | transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14795 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14796 | countingStream->rewind(); |
| 14797 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14798 | uint64_t cgen_var_995; |
| 14799 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_995, 1); |
| 14800 | countingStream->write((uint64_t*)&cgen_var_995, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14801 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14802 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14803 | uint64_t cgen_var_996 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14804 | countingStream->putBe64(cgen_var_996); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14805 | if (pPropertyCount) |
| 14806 | { |
| 14807 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14808 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14809 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14810 | uint64_t cgen_var_997 = (uint64_t)(uintptr_t)pProperties; |
| 14811 | countingStream->putBe64(cgen_var_997); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14812 | if (pProperties) |
| 14813 | { |
| 14814 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14815 | { |
| 14816 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14817 | } |
| 14818 | } |
| 14819 | } |
| 14820 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14821 | countingStream->rewind(); |
| 14822 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR; |
| 14823 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| 14824 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14825 | uint64_t cgen_var_998; |
| 14826 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_998, 1); |
| 14827 | stream->write((uint64_t*)&cgen_var_998, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14828 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14829 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14830 | uint64_t cgen_var_999 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14831 | stream->putBe64(cgen_var_999); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14832 | if (pPropertyCount) |
| 14833 | { |
| 14834 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14835 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14836 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14837 | uint64_t cgen_var_1000 = (uint64_t)(uintptr_t)pProperties; |
| 14838 | stream->putBe64(cgen_var_1000); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14839 | if (pProperties) |
| 14840 | { |
| 14841 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14842 | { |
| 14843 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14844 | } |
| 14845 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14846 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14847 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14848 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14849 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14850 | if (pPropertyCount) |
| 14851 | { |
| 14852 | if (!(check_pPropertyCount)) |
| 14853 | { |
| 14854 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 14855 | } |
| 14856 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14857 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14858 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14859 | VkSparseImageFormatProperties2* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14860 | check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14861 | if (pProperties) |
| 14862 | { |
| 14863 | if (!(check_pProperties)) |
| 14864 | { |
| 14865 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 14866 | } |
| 14867 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14868 | { |
| 14869 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14870 | } |
| 14871 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14872 | if (pProperties) |
| 14873 | { |
| 14874 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14875 | { |
| 14876 | transform_fromhost_VkSparseImageFormatProperties2(mImpl->resources(), (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14877 | } |
| 14878 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14879 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14880 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14881 | } |
| 14882 | |
| 14883 | #endif |
| 14884 | #ifdef VK_KHR_device_group |
| 14885 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeaturesKHR( |
| 14886 | VkDevice device, |
| 14887 | uint32_t heapIndex, |
| 14888 | uint32_t localDeviceIndex, |
| 14889 | uint32_t remoteDeviceIndex, |
| 14890 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 14891 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14892 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14893 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeaturesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14894 | mImpl->log("start vkGetDeviceGroupPeerMemoryFeaturesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14895 | auto stream = mImpl->stream(); |
| 14896 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14897 | auto resources = mImpl->resources(); |
| 14898 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14899 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14900 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14901 | uint32_t local_heapIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14902 | uint32_t local_localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14903 | uint32_t local_remoteDeviceIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14904 | local_device = device; |
| 14905 | local_heapIndex = heapIndex; |
| 14906 | local_localDeviceIndex = localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14907 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14908 | countingStream->rewind(); |
| 14909 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14910 | uint64_t cgen_var_1003; |
| 14911 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1003, 1); |
| 14912 | countingStream->write((uint64_t*)&cgen_var_1003, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14913 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 14914 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 14915 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14916 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 14917 | } |
| 14918 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14919 | countingStream->rewind(); |
| 14920 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR = OP_vkGetDeviceGroupPeerMemoryFeaturesKHR; |
| 14921 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| 14922 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14923 | uint64_t cgen_var_1004; |
| 14924 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1004, 1); |
| 14925 | stream->write((uint64_t*)&cgen_var_1004, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14926 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 14927 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 14928 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14929 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14930 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeaturesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14931 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14932 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeaturesKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14933 | mImpl->log("finish vkGetDeviceGroupPeerMemoryFeaturesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14934 | } |
| 14935 | |
| 14936 | void VkEncoder::vkCmdSetDeviceMaskKHR( |
| 14937 | VkCommandBuffer commandBuffer, |
| 14938 | uint32_t deviceMask) |
| 14939 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14940 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14941 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMaskKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14942 | mImpl->log("start vkCmdSetDeviceMaskKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14943 | auto stream = mImpl->stream(); |
| 14944 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14945 | auto resources = mImpl->resources(); |
| 14946 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14947 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14948 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14949 | uint32_t local_deviceMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14950 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14951 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14952 | countingStream->rewind(); |
| 14953 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14954 | uint64_t cgen_var_1005; |
| 14955 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1005, 1); |
| 14956 | countingStream->write((uint64_t*)&cgen_var_1005, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14957 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14958 | } |
| 14959 | uint32_t packetSize_vkCmdSetDeviceMaskKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14960 | countingStream->rewind(); |
| 14961 | uint32_t opcode_vkCmdSetDeviceMaskKHR = OP_vkCmdSetDeviceMaskKHR; |
| 14962 | stream->write(&opcode_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| 14963 | stream->write(&packetSize_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14964 | uint64_t cgen_var_1006; |
| 14965 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1006, 1); |
| 14966 | stream->write((uint64_t*)&cgen_var_1006, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14967 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14968 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMaskKHR readParams"); |
| 14969 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMaskKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14970 | mImpl->log("finish vkCmdSetDeviceMaskKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14971 | } |
| 14972 | |
| 14973 | void VkEncoder::vkCmdDispatchBaseKHR( |
| 14974 | VkCommandBuffer commandBuffer, |
| 14975 | uint32_t baseGroupX, |
| 14976 | uint32_t baseGroupY, |
| 14977 | uint32_t baseGroupZ, |
| 14978 | uint32_t groupCountX, |
| 14979 | uint32_t groupCountY, |
| 14980 | uint32_t groupCountZ) |
| 14981 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14982 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14983 | AEMU_SCOPED_TRACE("vkCmdDispatchBaseKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14984 | mImpl->log("start vkCmdDispatchBaseKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14985 | auto stream = mImpl->stream(); |
| 14986 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14987 | auto resources = mImpl->resources(); |
| 14988 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14989 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14990 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14991 | uint32_t local_baseGroupX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14992 | uint32_t local_baseGroupY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14993 | uint32_t local_baseGroupZ; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14994 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14995 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14996 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14997 | local_commandBuffer = commandBuffer; |
| 14998 | local_baseGroupX = baseGroupX; |
| 14999 | local_baseGroupY = baseGroupY; |
| 15000 | local_baseGroupZ = baseGroupZ; |
| 15001 | local_groupCountX = groupCountX; |
| 15002 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15003 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15004 | countingStream->rewind(); |
| 15005 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15006 | uint64_t cgen_var_1007; |
| 15007 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1007, 1); |
| 15008 | countingStream->write((uint64_t*)&cgen_var_1007, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15009 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 15010 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 15011 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 15012 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 15013 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 15014 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15015 | } |
| 15016 | uint32_t packetSize_vkCmdDispatchBaseKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15017 | countingStream->rewind(); |
| 15018 | uint32_t opcode_vkCmdDispatchBaseKHR = OP_vkCmdDispatchBaseKHR; |
| 15019 | stream->write(&opcode_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| 15020 | stream->write(&packetSize_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15021 | uint64_t cgen_var_1008; |
| 15022 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1008, 1); |
| 15023 | stream->write((uint64_t*)&cgen_var_1008, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15024 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 15025 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 15026 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 15027 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 15028 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 15029 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15030 | AEMU_SCOPED_TRACE("vkCmdDispatchBaseKHR readParams"); |
| 15031 | AEMU_SCOPED_TRACE("vkCmdDispatchBaseKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15032 | mImpl->log("finish vkCmdDispatchBaseKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15033 | } |
| 15034 | |
| 15035 | #endif |
| 15036 | #ifdef VK_KHR_shader_draw_parameters |
| 15037 | #endif |
| 15038 | #ifdef VK_KHR_maintenance1 |
| 15039 | void VkEncoder::vkTrimCommandPoolKHR( |
| 15040 | VkDevice device, |
| 15041 | VkCommandPool commandPool, |
| 15042 | VkCommandPoolTrimFlags flags) |
| 15043 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15044 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15045 | AEMU_SCOPED_TRACE("vkTrimCommandPoolKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15046 | mImpl->log("start vkTrimCommandPoolKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15047 | auto stream = mImpl->stream(); |
| 15048 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15049 | auto resources = mImpl->resources(); |
| 15050 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15051 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15052 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15053 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15054 | VkCommandPoolTrimFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15055 | local_device = device; |
| 15056 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15057 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15058 | countingStream->rewind(); |
| 15059 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15060 | uint64_t cgen_var_1009; |
| 15061 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1009, 1); |
| 15062 | countingStream->write((uint64_t*)&cgen_var_1009, 1 * 8); |
| 15063 | uint64_t cgen_var_1010; |
| 15064 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_1010, 1); |
| 15065 | countingStream->write((uint64_t*)&cgen_var_1010, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15066 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15067 | } |
| 15068 | uint32_t packetSize_vkTrimCommandPoolKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15069 | countingStream->rewind(); |
| 15070 | uint32_t opcode_vkTrimCommandPoolKHR = OP_vkTrimCommandPoolKHR; |
| 15071 | stream->write(&opcode_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| 15072 | stream->write(&packetSize_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15073 | uint64_t cgen_var_1011; |
| 15074 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1011, 1); |
| 15075 | stream->write((uint64_t*)&cgen_var_1011, 1 * 8); |
| 15076 | uint64_t cgen_var_1012; |
| 15077 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_1012, 1); |
| 15078 | stream->write((uint64_t*)&cgen_var_1012, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15079 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15080 | AEMU_SCOPED_TRACE("vkTrimCommandPoolKHR readParams"); |
| 15081 | AEMU_SCOPED_TRACE("vkTrimCommandPoolKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15082 | mImpl->log("finish vkTrimCommandPoolKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15083 | } |
| 15084 | |
| 15085 | #endif |
| 15086 | #ifdef VK_KHR_device_group_creation |
| 15087 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroupsKHR( |
| 15088 | VkInstance instance, |
| 15089 | uint32_t* pPhysicalDeviceGroupCount, |
| 15090 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 15091 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15092 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15093 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroupsKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15094 | mImpl->log("start vkEnumeratePhysicalDeviceGroupsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15095 | auto stream = mImpl->stream(); |
| 15096 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15097 | auto resources = mImpl->resources(); |
| 15098 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15099 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15100 | VkInstance local_instance; |
| 15101 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15102 | countingStream->rewind(); |
| 15103 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15104 | uint64_t cgen_var_1013; |
| 15105 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1013, 1); |
| 15106 | countingStream->write((uint64_t*)&cgen_var_1013, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15107 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15108 | uint64_t cgen_var_1014 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 15109 | countingStream->putBe64(cgen_var_1014); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15110 | if (pPhysicalDeviceGroupCount) |
| 15111 | { |
| 15112 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 15113 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15114 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15115 | uint64_t cgen_var_1015 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 15116 | countingStream->putBe64(cgen_var_1015); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15117 | if (pPhysicalDeviceGroupProperties) |
| 15118 | { |
| 15119 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 15120 | { |
| 15121 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 15122 | } |
| 15123 | } |
| 15124 | } |
| 15125 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroupsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15126 | countingStream->rewind(); |
| 15127 | uint32_t opcode_vkEnumeratePhysicalDeviceGroupsKHR = OP_vkEnumeratePhysicalDeviceGroupsKHR; |
| 15128 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| 15129 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15130 | uint64_t cgen_var_1016; |
| 15131 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1016, 1); |
| 15132 | stream->write((uint64_t*)&cgen_var_1016, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15133 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15134 | uint64_t cgen_var_1017 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 15135 | stream->putBe64(cgen_var_1017); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15136 | if (pPhysicalDeviceGroupCount) |
| 15137 | { |
| 15138 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 15139 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15140 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15141 | uint64_t cgen_var_1018 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 15142 | stream->putBe64(cgen_var_1018); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15143 | if (pPhysicalDeviceGroupProperties) |
| 15144 | { |
| 15145 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 15146 | { |
| 15147 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 15148 | } |
| 15149 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15150 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroupsKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15151 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15152 | uint32_t* check_pPhysicalDeviceGroupCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15153 | check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15154 | if (pPhysicalDeviceGroupCount) |
| 15155 | { |
| 15156 | if (!(check_pPhysicalDeviceGroupCount)) |
| 15157 | { |
| 15158 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 15159 | } |
| 15160 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 15161 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15162 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15163 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15164 | check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15165 | if (pPhysicalDeviceGroupProperties) |
| 15166 | { |
| 15167 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 15168 | { |
| 15169 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 15170 | } |
| 15171 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 15172 | { |
| 15173 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 15174 | } |
| 15175 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15176 | if (pPhysicalDeviceGroupProperties) |
| 15177 | { |
| 15178 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 15179 | { |
| 15180 | transform_fromhost_VkPhysicalDeviceGroupProperties(mImpl->resources(), (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 15181 | } |
| 15182 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15183 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroupsKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15184 | VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0; |
| 15185 | stream->read(&vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15186 | countingStream->clearPool(); |
| 15187 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15188 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15189 | mImpl->log("finish vkEnumeratePhysicalDeviceGroupsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15190 | return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return; |
| 15191 | } |
| 15192 | |
| 15193 | #endif |
| 15194 | #ifdef VK_KHR_external_memory_capabilities |
| 15195 | void VkEncoder::vkGetPhysicalDeviceExternalBufferPropertiesKHR( |
| 15196 | VkPhysicalDevice physicalDevice, |
| 15197 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 15198 | VkExternalBufferProperties* pExternalBufferProperties) |
| 15199 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15200 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15201 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferPropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15202 | mImpl->log("start vkGetPhysicalDeviceExternalBufferPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15203 | auto stream = mImpl->stream(); |
| 15204 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15205 | auto resources = mImpl->resources(); |
| 15206 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15207 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15208 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15209 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15210 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15211 | local_pExternalBufferInfo = nullptr; |
| 15212 | if (pExternalBufferInfo) |
| 15213 | { |
| 15214 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 15215 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 15216 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15217 | if (local_pExternalBufferInfo) |
| 15218 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 15219 | mImpl->resources()->transformImpl_VkPhysicalDeviceExternalBufferInfo_tohost(local_pExternalBufferInfo, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15220 | transform_tohost_VkPhysicalDeviceExternalBufferInfo(mImpl->resources(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15221 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15222 | countingStream->rewind(); |
| 15223 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15224 | uint64_t cgen_var_1021; |
| 15225 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1021, 1); |
| 15226 | countingStream->write((uint64_t*)&cgen_var_1021, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15227 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15228 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 15229 | } |
| 15230 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15231 | countingStream->rewind(); |
| 15232 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR = OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR; |
| 15233 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| 15234 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15235 | uint64_t cgen_var_1022; |
| 15236 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1022, 1); |
| 15237 | stream->write((uint64_t*)&cgen_var_1022, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15238 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15239 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15240 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferPropertiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15241 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15242 | if (pExternalBufferProperties) |
| 15243 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 15244 | mImpl->resources()->transformImpl_VkExternalBufferProperties_fromhost(pExternalBufferProperties, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15245 | transform_fromhost_VkExternalBufferProperties(mImpl->resources(), (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 15246 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15247 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferPropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15248 | mImpl->log("finish vkGetPhysicalDeviceExternalBufferPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15249 | } |
| 15250 | |
| 15251 | #endif |
| 15252 | #ifdef VK_KHR_external_memory |
| 15253 | #endif |
| 15254 | #ifdef VK_KHR_external_memory_win32 |
| 15255 | VkResult VkEncoder::vkGetMemoryWin32HandleKHR( |
| 15256 | VkDevice device, |
| 15257 | const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 15258 | HANDLE* pHandle) |
| 15259 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15260 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15261 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15262 | mImpl->log("start vkGetMemoryWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15263 | auto stream = mImpl->stream(); |
| 15264 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15265 | auto resources = mImpl->resources(); |
| 15266 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15267 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15268 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15269 | VkMemoryGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15270 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15271 | local_pGetWin32HandleInfo = nullptr; |
| 15272 | if (pGetWin32HandleInfo) |
| 15273 | { |
| 15274 | local_pGetWin32HandleInfo = (VkMemoryGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkMemoryGetWin32HandleInfoKHR)); |
| 15275 | deepcopy_VkMemoryGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 15276 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15277 | if (local_pGetWin32HandleInfo) |
| 15278 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15279 | transform_tohost_VkMemoryGetWin32HandleInfoKHR(mImpl->resources(), (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15280 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15281 | countingStream->rewind(); |
| 15282 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15283 | uint64_t cgen_var_1023; |
| 15284 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1023, 1); |
| 15285 | countingStream->write((uint64_t*)&cgen_var_1023, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15286 | marshal_VkMemoryGetWin32HandleInfoKHR(countingStream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15287 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15288 | } |
| 15289 | uint32_t packetSize_vkGetMemoryWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15290 | countingStream->rewind(); |
| 15291 | uint32_t opcode_vkGetMemoryWin32HandleKHR = OP_vkGetMemoryWin32HandleKHR; |
| 15292 | stream->write(&opcode_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| 15293 | stream->write(&packetSize_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15294 | uint64_t cgen_var_1024; |
| 15295 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1024, 1); |
| 15296 | stream->write((uint64_t*)&cgen_var_1024, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15297 | marshal_VkMemoryGetWin32HandleInfoKHR(stream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15298 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15299 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15300 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15301 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15302 | VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0; |
| 15303 | stream->read(&vkGetMemoryWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15304 | countingStream->clearPool(); |
| 15305 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15306 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15307 | mImpl->log("finish vkGetMemoryWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15308 | return vkGetMemoryWin32HandleKHR_VkResult_return; |
| 15309 | } |
| 15310 | |
| 15311 | VkResult VkEncoder::vkGetMemoryWin32HandlePropertiesKHR( |
| 15312 | VkDevice device, |
| 15313 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 15314 | HANDLE handle, |
| 15315 | VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) |
| 15316 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15317 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15318 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandlePropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15319 | mImpl->log("start vkGetMemoryWin32HandlePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15320 | auto stream = mImpl->stream(); |
| 15321 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15322 | auto resources = mImpl->resources(); |
| 15323 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15324 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15325 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15326 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15327 | HANDLE local_handle; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15328 | local_device = device; |
| 15329 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15330 | local_handle = handle; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15331 | countingStream->rewind(); |
| 15332 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15333 | uint64_t cgen_var_1025; |
| 15334 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1025, 1); |
| 15335 | countingStream->write((uint64_t*)&cgen_var_1025, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15336 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 15337 | countingStream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15338 | marshal_VkMemoryWin32HandlePropertiesKHR(countingStream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 15339 | } |
| 15340 | uint32_t packetSize_vkGetMemoryWin32HandlePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15341 | countingStream->rewind(); |
| 15342 | uint32_t opcode_vkGetMemoryWin32HandlePropertiesKHR = OP_vkGetMemoryWin32HandlePropertiesKHR; |
| 15343 | stream->write(&opcode_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| 15344 | stream->write(&packetSize_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15345 | uint64_t cgen_var_1026; |
| 15346 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1026, 1); |
| 15347 | stream->write((uint64_t*)&cgen_var_1026, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15348 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 15349 | stream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15350 | marshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15351 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandlePropertiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15352 | unmarshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15353 | if (pMemoryWin32HandleProperties) |
| 15354 | { |
| 15355 | transform_fromhost_VkMemoryWin32HandlePropertiesKHR(mImpl->resources(), (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 15356 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15357 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandlePropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15358 | VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0; |
| 15359 | stream->read(&vkGetMemoryWin32HandlePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15360 | countingStream->clearPool(); |
| 15361 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15362 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15363 | mImpl->log("finish vkGetMemoryWin32HandlePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15364 | return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return; |
| 15365 | } |
| 15366 | |
| 15367 | #endif |
| 15368 | #ifdef VK_KHR_external_memory_fd |
| 15369 | VkResult VkEncoder::vkGetMemoryFdKHR( |
| 15370 | VkDevice device, |
| 15371 | const VkMemoryGetFdInfoKHR* pGetFdInfo, |
| 15372 | int* pFd) |
| 15373 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15374 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15375 | AEMU_SCOPED_TRACE("vkGetMemoryFdKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15376 | mImpl->log("start vkGetMemoryFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15377 | auto stream = mImpl->stream(); |
| 15378 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15379 | auto resources = mImpl->resources(); |
| 15380 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15381 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15382 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15383 | VkMemoryGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15384 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15385 | local_pGetFdInfo = nullptr; |
| 15386 | if (pGetFdInfo) |
| 15387 | { |
| 15388 | local_pGetFdInfo = (VkMemoryGetFdInfoKHR*)pool->alloc(sizeof(const VkMemoryGetFdInfoKHR)); |
| 15389 | deepcopy_VkMemoryGetFdInfoKHR(pool, pGetFdInfo, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| 15390 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15391 | if (local_pGetFdInfo) |
| 15392 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15393 | transform_tohost_VkMemoryGetFdInfoKHR(mImpl->resources(), (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15394 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15395 | countingStream->rewind(); |
| 15396 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15397 | uint64_t cgen_var_1027; |
| 15398 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1027, 1); |
| 15399 | countingStream->write((uint64_t*)&cgen_var_1027, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15400 | marshal_VkMemoryGetFdInfoKHR(countingStream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15401 | countingStream->write((int*)pFd, sizeof(int)); |
| 15402 | } |
| 15403 | uint32_t packetSize_vkGetMemoryFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15404 | countingStream->rewind(); |
| 15405 | uint32_t opcode_vkGetMemoryFdKHR = OP_vkGetMemoryFdKHR; |
| 15406 | stream->write(&opcode_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| 15407 | stream->write(&packetSize_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15408 | uint64_t cgen_var_1028; |
| 15409 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1028, 1); |
| 15410 | stream->write((uint64_t*)&cgen_var_1028, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15411 | marshal_VkMemoryGetFdInfoKHR(stream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15412 | stream->write((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15413 | AEMU_SCOPED_TRACE("vkGetMemoryFdKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15414 | stream->read((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15415 | AEMU_SCOPED_TRACE("vkGetMemoryFdKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15416 | VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0; |
| 15417 | stream->read(&vkGetMemoryFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15418 | countingStream->clearPool(); |
| 15419 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15420 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15421 | mImpl->log("finish vkGetMemoryFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15422 | return vkGetMemoryFdKHR_VkResult_return; |
| 15423 | } |
| 15424 | |
| 15425 | VkResult VkEncoder::vkGetMemoryFdPropertiesKHR( |
| 15426 | VkDevice device, |
| 15427 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 15428 | int fd, |
| 15429 | VkMemoryFdPropertiesKHR* pMemoryFdProperties) |
| 15430 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15431 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15432 | AEMU_SCOPED_TRACE("vkGetMemoryFdPropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15433 | mImpl->log("start vkGetMemoryFdPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15434 | auto stream = mImpl->stream(); |
| 15435 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15436 | auto resources = mImpl->resources(); |
| 15437 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15438 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15439 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15440 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15441 | int local_fd; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15442 | local_device = device; |
| 15443 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15444 | local_fd = fd; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15445 | countingStream->rewind(); |
| 15446 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15447 | uint64_t cgen_var_1029; |
| 15448 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1029, 1); |
| 15449 | countingStream->write((uint64_t*)&cgen_var_1029, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15450 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 15451 | countingStream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15452 | marshal_VkMemoryFdPropertiesKHR(countingStream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 15453 | } |
| 15454 | uint32_t packetSize_vkGetMemoryFdPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15455 | countingStream->rewind(); |
| 15456 | uint32_t opcode_vkGetMemoryFdPropertiesKHR = OP_vkGetMemoryFdPropertiesKHR; |
| 15457 | stream->write(&opcode_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| 15458 | stream->write(&packetSize_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15459 | uint64_t cgen_var_1030; |
| 15460 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1030, 1); |
| 15461 | stream->write((uint64_t*)&cgen_var_1030, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15462 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 15463 | stream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15464 | marshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15465 | AEMU_SCOPED_TRACE("vkGetMemoryFdPropertiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15466 | unmarshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15467 | if (pMemoryFdProperties) |
| 15468 | { |
| 15469 | transform_fromhost_VkMemoryFdPropertiesKHR(mImpl->resources(), (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 15470 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15471 | AEMU_SCOPED_TRACE("vkGetMemoryFdPropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15472 | VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0; |
| 15473 | stream->read(&vkGetMemoryFdPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15474 | countingStream->clearPool(); |
| 15475 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15476 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15477 | mImpl->log("finish vkGetMemoryFdPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15478 | return vkGetMemoryFdPropertiesKHR_VkResult_return; |
| 15479 | } |
| 15480 | |
| 15481 | #endif |
| 15482 | #ifdef VK_KHR_win32_keyed_mutex |
| 15483 | #endif |
| 15484 | #ifdef VK_KHR_external_semaphore_capabilities |
| 15485 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( |
| 15486 | VkPhysicalDevice physicalDevice, |
| 15487 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 15488 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 15489 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15490 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15491 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphorePropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15492 | mImpl->log("start vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15493 | auto stream = mImpl->stream(); |
| 15494 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15495 | auto resources = mImpl->resources(); |
| 15496 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15497 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15498 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15499 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15500 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15501 | local_pExternalSemaphoreInfo = nullptr; |
| 15502 | if (pExternalSemaphoreInfo) |
| 15503 | { |
| 15504 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 15505 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 15506 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15507 | if (local_pExternalSemaphoreInfo) |
| 15508 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15509 | transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(mImpl->resources(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15510 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15511 | countingStream->rewind(); |
| 15512 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15513 | uint64_t cgen_var_1031; |
| 15514 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1031, 1); |
| 15515 | countingStream->write((uint64_t*)&cgen_var_1031, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15516 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15517 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 15518 | } |
| 15519 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15520 | countingStream->rewind(); |
| 15521 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; |
| 15522 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| 15523 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15524 | uint64_t cgen_var_1032; |
| 15525 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1032, 1); |
| 15526 | stream->write((uint64_t*)&cgen_var_1032, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15527 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15528 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15529 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphorePropertiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15530 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15531 | if (pExternalSemaphoreProperties) |
| 15532 | { |
| 15533 | transform_fromhost_VkExternalSemaphoreProperties(mImpl->resources(), (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 15534 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15535 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphorePropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15536 | mImpl->log("finish vkGetPhysicalDeviceExternalSemaphorePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15537 | } |
| 15538 | |
| 15539 | #endif |
| 15540 | #ifdef VK_KHR_external_semaphore |
| 15541 | #endif |
| 15542 | #ifdef VK_KHR_external_semaphore_win32 |
| 15543 | VkResult VkEncoder::vkImportSemaphoreWin32HandleKHR( |
| 15544 | VkDevice device, |
| 15545 | const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) |
| 15546 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15547 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15548 | AEMU_SCOPED_TRACE("vkImportSemaphoreWin32HandleKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15549 | mImpl->log("start vkImportSemaphoreWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15550 | auto stream = mImpl->stream(); |
| 15551 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15552 | auto resources = mImpl->resources(); |
| 15553 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15554 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15555 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15556 | VkImportSemaphoreWin32HandleInfoKHR* local_pImportSemaphoreWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15557 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15558 | local_pImportSemaphoreWin32HandleInfo = nullptr; |
| 15559 | if (pImportSemaphoreWin32HandleInfo) |
| 15560 | { |
| 15561 | local_pImportSemaphoreWin32HandleInfo = (VkImportSemaphoreWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreWin32HandleInfoKHR)); |
| 15562 | deepcopy_VkImportSemaphoreWin32HandleInfoKHR(pool, pImportSemaphoreWin32HandleInfo, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| 15563 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15564 | if (local_pImportSemaphoreWin32HandleInfo) |
| 15565 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15566 | transform_tohost_VkImportSemaphoreWin32HandleInfoKHR(mImpl->resources(), (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15567 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15568 | countingStream->rewind(); |
| 15569 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15570 | uint64_t cgen_var_1033; |
| 15571 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1033, 1); |
| 15572 | countingStream->write((uint64_t*)&cgen_var_1033, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15573 | marshal_VkImportSemaphoreWin32HandleInfoKHR(countingStream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15574 | } |
| 15575 | uint32_t packetSize_vkImportSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15576 | countingStream->rewind(); |
| 15577 | uint32_t opcode_vkImportSemaphoreWin32HandleKHR = OP_vkImportSemaphoreWin32HandleKHR; |
| 15578 | stream->write(&opcode_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 15579 | stream->write(&packetSize_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15580 | uint64_t cgen_var_1034; |
| 15581 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1034, 1); |
| 15582 | stream->write((uint64_t*)&cgen_var_1034, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15583 | marshal_VkImportSemaphoreWin32HandleInfoKHR(stream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15584 | AEMU_SCOPED_TRACE("vkImportSemaphoreWin32HandleKHR readParams"); |
| 15585 | AEMU_SCOPED_TRACE("vkImportSemaphoreWin32HandleKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15586 | VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 15587 | stream->read(&vkImportSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15588 | countingStream->clearPool(); |
| 15589 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15590 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15591 | mImpl->log("finish vkImportSemaphoreWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15592 | return vkImportSemaphoreWin32HandleKHR_VkResult_return; |
| 15593 | } |
| 15594 | |
| 15595 | VkResult VkEncoder::vkGetSemaphoreWin32HandleKHR( |
| 15596 | VkDevice device, |
| 15597 | const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 15598 | HANDLE* pHandle) |
| 15599 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15600 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15601 | AEMU_SCOPED_TRACE("vkGetSemaphoreWin32HandleKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15602 | mImpl->log("start vkGetSemaphoreWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15603 | auto stream = mImpl->stream(); |
| 15604 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15605 | auto resources = mImpl->resources(); |
| 15606 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15607 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15608 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15609 | VkSemaphoreGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15610 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15611 | local_pGetWin32HandleInfo = nullptr; |
| 15612 | if (pGetWin32HandleInfo) |
| 15613 | { |
| 15614 | local_pGetWin32HandleInfo = (VkSemaphoreGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetWin32HandleInfoKHR)); |
| 15615 | deepcopy_VkSemaphoreGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 15616 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15617 | if (local_pGetWin32HandleInfo) |
| 15618 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15619 | transform_tohost_VkSemaphoreGetWin32HandleInfoKHR(mImpl->resources(), (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15620 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15621 | countingStream->rewind(); |
| 15622 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15623 | uint64_t cgen_var_1035; |
| 15624 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1035, 1); |
| 15625 | countingStream->write((uint64_t*)&cgen_var_1035, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15626 | marshal_VkSemaphoreGetWin32HandleInfoKHR(countingStream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15627 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15628 | } |
| 15629 | uint32_t packetSize_vkGetSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15630 | countingStream->rewind(); |
| 15631 | uint32_t opcode_vkGetSemaphoreWin32HandleKHR = OP_vkGetSemaphoreWin32HandleKHR; |
| 15632 | stream->write(&opcode_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 15633 | stream->write(&packetSize_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15634 | uint64_t cgen_var_1036; |
| 15635 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1036, 1); |
| 15636 | stream->write((uint64_t*)&cgen_var_1036, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15637 | marshal_VkSemaphoreGetWin32HandleInfoKHR(stream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15638 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15639 | AEMU_SCOPED_TRACE("vkGetSemaphoreWin32HandleKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15640 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15641 | AEMU_SCOPED_TRACE("vkGetSemaphoreWin32HandleKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15642 | VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 15643 | stream->read(&vkGetSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15644 | countingStream->clearPool(); |
| 15645 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15646 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15647 | mImpl->log("finish vkGetSemaphoreWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15648 | return vkGetSemaphoreWin32HandleKHR_VkResult_return; |
| 15649 | } |
| 15650 | |
| 15651 | #endif |
| 15652 | #ifdef VK_KHR_external_semaphore_fd |
| 15653 | VkResult VkEncoder::vkImportSemaphoreFdKHR( |
| 15654 | VkDevice device, |
| 15655 | const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) |
| 15656 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15657 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15658 | AEMU_SCOPED_TRACE("vkImportSemaphoreFdKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15659 | mImpl->log("start vkImportSemaphoreFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15660 | auto stream = mImpl->stream(); |
| 15661 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15662 | auto resources = mImpl->resources(); |
| 15663 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15664 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15665 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15666 | VkImportSemaphoreFdInfoKHR* local_pImportSemaphoreFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15667 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15668 | local_pImportSemaphoreFdInfo = nullptr; |
| 15669 | if (pImportSemaphoreFdInfo) |
| 15670 | { |
| 15671 | local_pImportSemaphoreFdInfo = (VkImportSemaphoreFdInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreFdInfoKHR)); |
| 15672 | deepcopy_VkImportSemaphoreFdInfoKHR(pool, pImportSemaphoreFdInfo, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| 15673 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15674 | if (local_pImportSemaphoreFdInfo) |
| 15675 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15676 | transform_tohost_VkImportSemaphoreFdInfoKHR(mImpl->resources(), (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15677 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15678 | countingStream->rewind(); |
| 15679 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15680 | uint64_t cgen_var_1037; |
| 15681 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1037, 1); |
| 15682 | countingStream->write((uint64_t*)&cgen_var_1037, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15683 | marshal_VkImportSemaphoreFdInfoKHR(countingStream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15684 | } |
| 15685 | uint32_t packetSize_vkImportSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15686 | countingStream->rewind(); |
| 15687 | uint32_t opcode_vkImportSemaphoreFdKHR = OP_vkImportSemaphoreFdKHR; |
| 15688 | stream->write(&opcode_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| 15689 | stream->write(&packetSize_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15690 | uint64_t cgen_var_1038; |
| 15691 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1038, 1); |
| 15692 | stream->write((uint64_t*)&cgen_var_1038, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15693 | marshal_VkImportSemaphoreFdInfoKHR(stream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15694 | AEMU_SCOPED_TRACE("vkImportSemaphoreFdKHR readParams"); |
| 15695 | AEMU_SCOPED_TRACE("vkImportSemaphoreFdKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15696 | VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 15697 | stream->read(&vkImportSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15698 | countingStream->clearPool(); |
| 15699 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15700 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15701 | mImpl->log("finish vkImportSemaphoreFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15702 | return vkImportSemaphoreFdKHR_VkResult_return; |
| 15703 | } |
| 15704 | |
| 15705 | VkResult VkEncoder::vkGetSemaphoreFdKHR( |
| 15706 | VkDevice device, |
| 15707 | const VkSemaphoreGetFdInfoKHR* pGetFdInfo, |
| 15708 | int* pFd) |
| 15709 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15710 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15711 | AEMU_SCOPED_TRACE("vkGetSemaphoreFdKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15712 | mImpl->log("start vkGetSemaphoreFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15713 | auto stream = mImpl->stream(); |
| 15714 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15715 | auto resources = mImpl->resources(); |
| 15716 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15717 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15718 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15719 | VkSemaphoreGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15720 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15721 | local_pGetFdInfo = nullptr; |
| 15722 | if (pGetFdInfo) |
| 15723 | { |
| 15724 | local_pGetFdInfo = (VkSemaphoreGetFdInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetFdInfoKHR)); |
| 15725 | deepcopy_VkSemaphoreGetFdInfoKHR(pool, pGetFdInfo, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| 15726 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15727 | if (local_pGetFdInfo) |
| 15728 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15729 | transform_tohost_VkSemaphoreGetFdInfoKHR(mImpl->resources(), (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15730 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15731 | countingStream->rewind(); |
| 15732 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15733 | uint64_t cgen_var_1039; |
| 15734 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1039, 1); |
| 15735 | countingStream->write((uint64_t*)&cgen_var_1039, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15736 | marshal_VkSemaphoreGetFdInfoKHR(countingStream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15737 | countingStream->write((int*)pFd, sizeof(int)); |
| 15738 | } |
| 15739 | uint32_t packetSize_vkGetSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15740 | countingStream->rewind(); |
| 15741 | uint32_t opcode_vkGetSemaphoreFdKHR = OP_vkGetSemaphoreFdKHR; |
| 15742 | stream->write(&opcode_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| 15743 | stream->write(&packetSize_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15744 | uint64_t cgen_var_1040; |
| 15745 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1040, 1); |
| 15746 | stream->write((uint64_t*)&cgen_var_1040, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15747 | marshal_VkSemaphoreGetFdInfoKHR(stream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15748 | stream->write((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15749 | AEMU_SCOPED_TRACE("vkGetSemaphoreFdKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15750 | stream->read((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15751 | AEMU_SCOPED_TRACE("vkGetSemaphoreFdKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15752 | VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 15753 | stream->read(&vkGetSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15754 | countingStream->clearPool(); |
| 15755 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15756 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15757 | mImpl->log("finish vkGetSemaphoreFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15758 | return vkGetSemaphoreFdKHR_VkResult_return; |
| 15759 | } |
| 15760 | |
| 15761 | #endif |
| 15762 | #ifdef VK_KHR_push_descriptor |
| 15763 | void VkEncoder::vkCmdPushDescriptorSetKHR( |
| 15764 | VkCommandBuffer commandBuffer, |
| 15765 | VkPipelineBindPoint pipelineBindPoint, |
| 15766 | VkPipelineLayout layout, |
| 15767 | uint32_t set, |
| 15768 | uint32_t descriptorWriteCount, |
| 15769 | const VkWriteDescriptorSet* pDescriptorWrites) |
| 15770 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15771 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15772 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15773 | mImpl->log("start vkCmdPushDescriptorSetKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15774 | auto stream = mImpl->stream(); |
| 15775 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15776 | auto resources = mImpl->resources(); |
| 15777 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15778 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15779 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15780 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15781 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15782 | uint32_t local_set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15783 | uint32_t local_descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15784 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15785 | local_commandBuffer = commandBuffer; |
| 15786 | local_pipelineBindPoint = pipelineBindPoint; |
| 15787 | local_layout = layout; |
| 15788 | local_set = set; |
| 15789 | local_descriptorWriteCount = descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15790 | local_pDescriptorWrites = nullptr; |
| 15791 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15792 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15793 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15794 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15795 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15796 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 15797 | } |
| 15798 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15799 | if (local_pDescriptorWrites) |
| 15800 | { |
| 15801 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15802 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15803 | transform_tohost_VkWriteDescriptorSet(mImpl->resources(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15804 | } |
| 15805 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15806 | countingStream->rewind(); |
| 15807 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15808 | uint64_t cgen_var_1041; |
| 15809 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1041, 1); |
| 15810 | countingStream->write((uint64_t*)&cgen_var_1041, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15811 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15812 | uint64_t cgen_var_1042; |
| 15813 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1042, 1); |
| 15814 | countingStream->write((uint64_t*)&cgen_var_1042, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15815 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 15816 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 15817 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15818 | { |
| 15819 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15820 | } |
| 15821 | } |
| 15822 | uint32_t packetSize_vkCmdPushDescriptorSetKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15823 | countingStream->rewind(); |
| 15824 | uint32_t opcode_vkCmdPushDescriptorSetKHR = OP_vkCmdPushDescriptorSetKHR; |
| 15825 | stream->write(&opcode_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| 15826 | stream->write(&packetSize_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15827 | uint64_t cgen_var_1043; |
| 15828 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1043, 1); |
| 15829 | stream->write((uint64_t*)&cgen_var_1043, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15830 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15831 | uint64_t cgen_var_1044; |
| 15832 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1044, 1); |
| 15833 | stream->write((uint64_t*)&cgen_var_1044, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15834 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 15835 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15836 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15837 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15838 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15839 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15840 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetKHR readParams"); |
| 15841 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15842 | mImpl->log("finish vkCmdPushDescriptorSetKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15843 | } |
| 15844 | |
| 15845 | void VkEncoder::vkCmdPushDescriptorSetWithTemplateKHR( |
| 15846 | VkCommandBuffer commandBuffer, |
| 15847 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 15848 | VkPipelineLayout layout, |
| 15849 | uint32_t set, |
| 15850 | const void* pData) |
| 15851 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15852 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15853 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetWithTemplateKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15854 | mImpl->log("start vkCmdPushDescriptorSetWithTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15855 | auto stream = mImpl->stream(); |
| 15856 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15857 | auto resources = mImpl->resources(); |
| 15858 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15859 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15860 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15861 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15862 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15863 | uint32_t local_set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15864 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15865 | local_commandBuffer = commandBuffer; |
| 15866 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 15867 | local_layout = layout; |
| 15868 | local_set = set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15869 | local_pData = nullptr; |
| 15870 | if (pData) |
| 15871 | { |
| 15872 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 15873 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15874 | countingStream->rewind(); |
| 15875 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15876 | uint64_t cgen_var_1045; |
| 15877 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1045, 1); |
| 15878 | countingStream->write((uint64_t*)&cgen_var_1045, 1 * 8); |
| 15879 | uint64_t cgen_var_1046; |
| 15880 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1046, 1); |
| 15881 | countingStream->write((uint64_t*)&cgen_var_1046, 1 * 8); |
| 15882 | uint64_t cgen_var_1047; |
| 15883 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1047, 1); |
| 15884 | countingStream->write((uint64_t*)&cgen_var_1047, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15885 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15886 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15887 | uint64_t cgen_var_1048 = (uint64_t)(uintptr_t)local_pData; |
| 15888 | countingStream->putBe64(cgen_var_1048); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15889 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15890 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15891 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15892 | } |
| 15893 | } |
| 15894 | uint32_t packetSize_vkCmdPushDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15895 | countingStream->rewind(); |
| 15896 | uint32_t opcode_vkCmdPushDescriptorSetWithTemplateKHR = OP_vkCmdPushDescriptorSetWithTemplateKHR; |
| 15897 | stream->write(&opcode_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 15898 | stream->write(&packetSize_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15899 | uint64_t cgen_var_1049; |
| 15900 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1049, 1); |
| 15901 | stream->write((uint64_t*)&cgen_var_1049, 1 * 8); |
| 15902 | uint64_t cgen_var_1050; |
| 15903 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1050, 1); |
| 15904 | stream->write((uint64_t*)&cgen_var_1050, 1 * 8); |
| 15905 | uint64_t cgen_var_1051; |
| 15906 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1051, 1); |
| 15907 | stream->write((uint64_t*)&cgen_var_1051, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15908 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15909 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15910 | uint64_t cgen_var_1052 = (uint64_t)(uintptr_t)local_pData; |
| 15911 | stream->putBe64(cgen_var_1052); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15912 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15913 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15914 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15915 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15916 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetWithTemplateKHR readParams"); |
| 15917 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetWithTemplateKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15918 | mImpl->log("finish vkCmdPushDescriptorSetWithTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15919 | } |
| 15920 | |
| 15921 | #endif |
| 15922 | #ifdef VK_KHR_16bit_storage |
| 15923 | #endif |
| 15924 | #ifdef VK_KHR_incremental_present |
| 15925 | #endif |
| 15926 | #ifdef VK_KHR_descriptor_update_template |
| 15927 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplateKHR( |
| 15928 | VkDevice device, |
| 15929 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 15930 | const VkAllocationCallbacks* pAllocator, |
| 15931 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 15932 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15933 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15934 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplateKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15935 | mImpl->log("start vkCreateDescriptorUpdateTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15936 | auto stream = mImpl->stream(); |
| 15937 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15938 | auto resources = mImpl->resources(); |
| 15939 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15940 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15941 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15942 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15943 | VkAllocationCallbacks* local_pAllocator; |
| 15944 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15945 | local_pCreateInfo = nullptr; |
| 15946 | if (pCreateInfo) |
| 15947 | { |
| 15948 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 15949 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 15950 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15951 | local_pAllocator = nullptr; |
| 15952 | if (pAllocator) |
| 15953 | { |
| 15954 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15955 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15956 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 15957 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15958 | if (local_pCreateInfo) |
| 15959 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15960 | transform_tohost_VkDescriptorUpdateTemplateCreateInfo(mImpl->resources(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15961 | } |
| 15962 | if (local_pAllocator) |
| 15963 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15964 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15965 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15966 | countingStream->rewind(); |
| 15967 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15968 | uint64_t cgen_var_1053; |
| 15969 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1053, 1); |
| 15970 | countingStream->write((uint64_t*)&cgen_var_1053, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15971 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15972 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15973 | uint64_t cgen_var_1054 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15974 | countingStream->putBe64(cgen_var_1054); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15975 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15976 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15977 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15978 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15979 | uint64_t cgen_var_1055; |
| 15980 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1055, 1); |
| 15981 | countingStream->write((uint64_t*)&cgen_var_1055, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15982 | } |
| 15983 | uint32_t packetSize_vkCreateDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15984 | countingStream->rewind(); |
| 15985 | uint32_t opcode_vkCreateDescriptorUpdateTemplateKHR = OP_vkCreateDescriptorUpdateTemplateKHR; |
| 15986 | stream->write(&opcode_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 15987 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15988 | uint64_t cgen_var_1056; |
| 15989 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1056, 1); |
| 15990 | stream->write((uint64_t*)&cgen_var_1056, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15991 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15992 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15993 | uint64_t cgen_var_1057 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15994 | stream->putBe64(cgen_var_1057); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15995 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15996 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15997 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15998 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15999 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16000 | uint64_t cgen_var_1058; |
| 16001 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1058, 1); |
| 16002 | stream->write((uint64_t*)&cgen_var_1058, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16003 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16004 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplateKHR readParams"); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 16005 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16006 | uint64_t cgen_var_1059; |
| 16007 | stream->read((uint64_t*)&cgen_var_1059, 8); |
| 16008 | stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_1059, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 16009 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16010 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplateKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16011 | VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0; |
| 16012 | stream->read(&vkCreateDescriptorUpdateTemplateKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16013 | countingStream->clearPool(); |
| 16014 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16015 | pool->freeAll(); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16016 | encoderLock.unlock(); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 16017 | mImpl->resources()->on_vkCreateDescriptorUpdateTemplateKHR(this, vkCreateDescriptorUpdateTemplateKHR_VkResult_return, device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16018 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16019 | mImpl->log("finish vkCreateDescriptorUpdateTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16020 | return vkCreateDescriptorUpdateTemplateKHR_VkResult_return; |
| 16021 | } |
| 16022 | |
| 16023 | void VkEncoder::vkDestroyDescriptorUpdateTemplateKHR( |
| 16024 | VkDevice device, |
| 16025 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 16026 | const VkAllocationCallbacks* pAllocator) |
| 16027 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16028 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16029 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplateKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16030 | mImpl->log("start vkDestroyDescriptorUpdateTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16031 | auto stream = mImpl->stream(); |
| 16032 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16033 | auto resources = mImpl->resources(); |
| 16034 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16035 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16036 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16037 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16038 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16039 | local_device = device; |
| 16040 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16041 | local_pAllocator = nullptr; |
| 16042 | if (pAllocator) |
| 16043 | { |
| 16044 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16045 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16046 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16047 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16048 | if (local_pAllocator) |
| 16049 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16050 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16051 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16052 | countingStream->rewind(); |
| 16053 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16054 | uint64_t cgen_var_1060; |
| 16055 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1060, 1); |
| 16056 | countingStream->write((uint64_t*)&cgen_var_1060, 1 * 8); |
| 16057 | uint64_t cgen_var_1061; |
| 16058 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1061, 1); |
| 16059 | countingStream->write((uint64_t*)&cgen_var_1061, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16060 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16061 | uint64_t cgen_var_1062 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16062 | countingStream->putBe64(cgen_var_1062); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16063 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16064 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16065 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16066 | } |
| 16067 | } |
| 16068 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16069 | countingStream->rewind(); |
| 16070 | uint32_t opcode_vkDestroyDescriptorUpdateTemplateKHR = OP_vkDestroyDescriptorUpdateTemplateKHR; |
| 16071 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 16072 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16073 | uint64_t cgen_var_1063; |
| 16074 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1063, 1); |
| 16075 | stream->write((uint64_t*)&cgen_var_1063, 1 * 8); |
| 16076 | uint64_t cgen_var_1064; |
| 16077 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1064, 1); |
| 16078 | stream->write((uint64_t*)&cgen_var_1064, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16079 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16080 | uint64_t cgen_var_1065 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16081 | stream->putBe64(cgen_var_1065); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16082 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16083 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16084 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16085 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16086 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplateKHR readParams"); |
| 16087 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplateKHR returnUnmarshal"); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 16088 | resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16089 | mImpl->log("finish vkDestroyDescriptorUpdateTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16090 | } |
| 16091 | |
| 16092 | void VkEncoder::vkUpdateDescriptorSetWithTemplateKHR( |
| 16093 | VkDevice device, |
| 16094 | VkDescriptorSet descriptorSet, |
| 16095 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 16096 | const void* pData) |
| 16097 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16098 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16099 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16100 | mImpl->log("start vkUpdateDescriptorSetWithTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16101 | auto stream = mImpl->stream(); |
| 16102 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16103 | auto resources = mImpl->resources(); |
| 16104 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16105 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16106 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16107 | VkDescriptorSet local_descriptorSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16108 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16109 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16110 | local_device = device; |
| 16111 | local_descriptorSet = descriptorSet; |
| 16112 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16113 | local_pData = nullptr; |
| 16114 | if (pData) |
| 16115 | { |
| 16116 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 16117 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16118 | countingStream->rewind(); |
| 16119 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16120 | uint64_t cgen_var_1066; |
| 16121 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1066, 1); |
| 16122 | countingStream->write((uint64_t*)&cgen_var_1066, 1 * 8); |
| 16123 | uint64_t cgen_var_1067; |
| 16124 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1067, 1); |
| 16125 | countingStream->write((uint64_t*)&cgen_var_1067, 1 * 8); |
| 16126 | uint64_t cgen_var_1068; |
| 16127 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1068, 1); |
| 16128 | countingStream->write((uint64_t*)&cgen_var_1068, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16129 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16130 | uint64_t cgen_var_1069 = (uint64_t)(uintptr_t)local_pData; |
| 16131 | countingStream->putBe64(cgen_var_1069); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16132 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16133 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16134 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16135 | } |
| 16136 | } |
| 16137 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16138 | countingStream->rewind(); |
| 16139 | uint32_t opcode_vkUpdateDescriptorSetWithTemplateKHR = OP_vkUpdateDescriptorSetWithTemplateKHR; |
| 16140 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 16141 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16142 | uint64_t cgen_var_1070; |
| 16143 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1070, 1); |
| 16144 | stream->write((uint64_t*)&cgen_var_1070, 1 * 8); |
| 16145 | uint64_t cgen_var_1071; |
| 16146 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1071, 1); |
| 16147 | stream->write((uint64_t*)&cgen_var_1071, 1 * 8); |
| 16148 | uint64_t cgen_var_1072; |
| 16149 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1072, 1); |
| 16150 | stream->write((uint64_t*)&cgen_var_1072, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16151 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16152 | uint64_t cgen_var_1073 = (uint64_t)(uintptr_t)local_pData; |
| 16153 | stream->putBe64(cgen_var_1073); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16154 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16155 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16156 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16157 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16158 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateKHR readParams"); |
| 16159 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16160 | mImpl->log("finish vkUpdateDescriptorSetWithTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16161 | } |
| 16162 | |
| 16163 | #endif |
| 16164 | #ifdef VK_KHR_create_renderpass2 |
| 16165 | VkResult VkEncoder::vkCreateRenderPass2KHR( |
| 16166 | VkDevice device, |
| 16167 | const VkRenderPassCreateInfo2KHR* pCreateInfo, |
| 16168 | const VkAllocationCallbacks* pAllocator, |
| 16169 | VkRenderPass* pRenderPass) |
| 16170 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16171 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16172 | AEMU_SCOPED_TRACE("vkCreateRenderPass2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16173 | mImpl->log("start vkCreateRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16174 | auto stream = mImpl->stream(); |
| 16175 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16176 | auto resources = mImpl->resources(); |
| 16177 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16178 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16179 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16180 | VkRenderPassCreateInfo2KHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16181 | VkAllocationCallbacks* local_pAllocator; |
| 16182 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16183 | local_pCreateInfo = nullptr; |
| 16184 | if (pCreateInfo) |
| 16185 | { |
| 16186 | local_pCreateInfo = (VkRenderPassCreateInfo2KHR*)pool->alloc(sizeof(const VkRenderPassCreateInfo2KHR)); |
| 16187 | deepcopy_VkRenderPassCreateInfo2KHR(pool, pCreateInfo, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| 16188 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16189 | local_pAllocator = nullptr; |
| 16190 | if (pAllocator) |
| 16191 | { |
| 16192 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16193 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16194 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16195 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16196 | if (local_pCreateInfo) |
| 16197 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16198 | transform_tohost_VkRenderPassCreateInfo2KHR(mImpl->resources(), (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16199 | } |
| 16200 | if (local_pAllocator) |
| 16201 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16202 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16203 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16204 | countingStream->rewind(); |
| 16205 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16206 | uint64_t cgen_var_1074; |
| 16207 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1074, 1); |
| 16208 | countingStream->write((uint64_t*)&cgen_var_1074, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16209 | marshal_VkRenderPassCreateInfo2KHR(countingStream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16210 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16211 | uint64_t cgen_var_1075 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16212 | countingStream->putBe64(cgen_var_1075); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16213 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16214 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16215 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16216 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16217 | uint64_t cgen_var_1076; |
| 16218 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1076, 1); |
| 16219 | countingStream->write((uint64_t*)&cgen_var_1076, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16220 | } |
| 16221 | uint32_t packetSize_vkCreateRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16222 | countingStream->rewind(); |
| 16223 | uint32_t opcode_vkCreateRenderPass2KHR = OP_vkCreateRenderPass2KHR; |
| 16224 | stream->write(&opcode_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| 16225 | stream->write(&packetSize_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16226 | uint64_t cgen_var_1077; |
| 16227 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1077, 1); |
| 16228 | stream->write((uint64_t*)&cgen_var_1077, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16229 | marshal_VkRenderPassCreateInfo2KHR(stream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16230 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16231 | uint64_t cgen_var_1078 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16232 | stream->putBe64(cgen_var_1078); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16233 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16234 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16235 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16236 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16237 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16238 | uint64_t cgen_var_1079; |
| 16239 | stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1079, 1); |
| 16240 | stream->write((uint64_t*)&cgen_var_1079, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16241 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16242 | AEMU_SCOPED_TRACE("vkCreateRenderPass2KHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16243 | uint64_t cgen_var_1080; |
| 16244 | stream->read((uint64_t*)&cgen_var_1080, 8); |
| 16245 | stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_1080, (VkRenderPass*)pRenderPass, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16246 | AEMU_SCOPED_TRACE("vkCreateRenderPass2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16247 | VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0; |
| 16248 | stream->read(&vkCreateRenderPass2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16249 | countingStream->clearPool(); |
| 16250 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16251 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16252 | mImpl->log("finish vkCreateRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16253 | return vkCreateRenderPass2KHR_VkResult_return; |
| 16254 | } |
| 16255 | |
| 16256 | void VkEncoder::vkCmdBeginRenderPass2KHR( |
| 16257 | VkCommandBuffer commandBuffer, |
| 16258 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 16259 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo) |
| 16260 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16261 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16262 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16263 | mImpl->log("start vkCmdBeginRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16264 | auto stream = mImpl->stream(); |
| 16265 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16266 | auto resources = mImpl->resources(); |
| 16267 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16268 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16269 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16270 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16271 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| 16272 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16273 | local_pRenderPassBegin = nullptr; |
| 16274 | if (pRenderPassBegin) |
| 16275 | { |
| 16276 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 16277 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 16278 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16279 | local_pSubpassBeginInfo = nullptr; |
| 16280 | if (pSubpassBeginInfo) |
| 16281 | { |
| 16282 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 16283 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 16284 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16285 | if (local_pRenderPassBegin) |
| 16286 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16287 | transform_tohost_VkRenderPassBeginInfo(mImpl->resources(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16288 | } |
| 16289 | if (local_pSubpassBeginInfo) |
| 16290 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16291 | transform_tohost_VkSubpassBeginInfoKHR(mImpl->resources(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16292 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16293 | countingStream->rewind(); |
| 16294 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16295 | uint64_t cgen_var_1081; |
| 16296 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1081, 1); |
| 16297 | countingStream->write((uint64_t*)&cgen_var_1081, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16298 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 16299 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16300 | } |
| 16301 | uint32_t packetSize_vkCmdBeginRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16302 | countingStream->rewind(); |
| 16303 | uint32_t opcode_vkCmdBeginRenderPass2KHR = OP_vkCmdBeginRenderPass2KHR; |
| 16304 | stream->write(&opcode_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| 16305 | stream->write(&packetSize_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16306 | uint64_t cgen_var_1082; |
| 16307 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1082, 1); |
| 16308 | stream->write((uint64_t*)&cgen_var_1082, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16309 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 16310 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16311 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass2KHR readParams"); |
| 16312 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16313 | mImpl->log("finish vkCmdBeginRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16314 | } |
| 16315 | |
| 16316 | void VkEncoder::vkCmdNextSubpass2KHR( |
| 16317 | VkCommandBuffer commandBuffer, |
| 16318 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo, |
| 16319 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 16320 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16321 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16322 | AEMU_SCOPED_TRACE("vkCmdNextSubpass2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16323 | mImpl->log("start vkCmdNextSubpass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16324 | auto stream = mImpl->stream(); |
| 16325 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16326 | auto resources = mImpl->resources(); |
| 16327 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16328 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16329 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16330 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16331 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| 16332 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16333 | local_pSubpassBeginInfo = nullptr; |
| 16334 | if (pSubpassBeginInfo) |
| 16335 | { |
| 16336 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 16337 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 16338 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16339 | local_pSubpassEndInfo = nullptr; |
| 16340 | if (pSubpassEndInfo) |
| 16341 | { |
| 16342 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 16343 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 16344 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16345 | if (local_pSubpassBeginInfo) |
| 16346 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16347 | transform_tohost_VkSubpassBeginInfoKHR(mImpl->resources(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16348 | } |
| 16349 | if (local_pSubpassEndInfo) |
| 16350 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16351 | transform_tohost_VkSubpassEndInfoKHR(mImpl->resources(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16352 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16353 | countingStream->rewind(); |
| 16354 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16355 | uint64_t cgen_var_1083; |
| 16356 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1083, 1); |
| 16357 | countingStream->write((uint64_t*)&cgen_var_1083, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16358 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 16359 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16360 | } |
| 16361 | uint32_t packetSize_vkCmdNextSubpass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16362 | countingStream->rewind(); |
| 16363 | uint32_t opcode_vkCmdNextSubpass2KHR = OP_vkCmdNextSubpass2KHR; |
| 16364 | stream->write(&opcode_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| 16365 | stream->write(&packetSize_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16366 | uint64_t cgen_var_1084; |
| 16367 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1084, 1); |
| 16368 | stream->write((uint64_t*)&cgen_var_1084, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16369 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 16370 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16371 | AEMU_SCOPED_TRACE("vkCmdNextSubpass2KHR readParams"); |
| 16372 | AEMU_SCOPED_TRACE("vkCmdNextSubpass2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16373 | mImpl->log("finish vkCmdNextSubpass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16374 | } |
| 16375 | |
| 16376 | void VkEncoder::vkCmdEndRenderPass2KHR( |
| 16377 | VkCommandBuffer commandBuffer, |
| 16378 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 16379 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16380 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16381 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16382 | mImpl->log("start vkCmdEndRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16383 | auto stream = mImpl->stream(); |
| 16384 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16385 | auto resources = mImpl->resources(); |
| 16386 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16387 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16388 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16389 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16390 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16391 | local_pSubpassEndInfo = nullptr; |
| 16392 | if (pSubpassEndInfo) |
| 16393 | { |
| 16394 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 16395 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 16396 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16397 | if (local_pSubpassEndInfo) |
| 16398 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16399 | transform_tohost_VkSubpassEndInfoKHR(mImpl->resources(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16400 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16401 | countingStream->rewind(); |
| 16402 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16403 | uint64_t cgen_var_1085; |
| 16404 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1085, 1); |
| 16405 | countingStream->write((uint64_t*)&cgen_var_1085, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16406 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16407 | } |
| 16408 | uint32_t packetSize_vkCmdEndRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16409 | countingStream->rewind(); |
| 16410 | uint32_t opcode_vkCmdEndRenderPass2KHR = OP_vkCmdEndRenderPass2KHR; |
| 16411 | stream->write(&opcode_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| 16412 | stream->write(&packetSize_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16413 | uint64_t cgen_var_1086; |
| 16414 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1086, 1); |
| 16415 | stream->write((uint64_t*)&cgen_var_1086, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16416 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16417 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass2KHR readParams"); |
| 16418 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16419 | mImpl->log("finish vkCmdEndRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16420 | } |
| 16421 | |
| 16422 | #endif |
| 16423 | #ifdef VK_KHR_shared_presentable_image |
| 16424 | VkResult VkEncoder::vkGetSwapchainStatusKHR( |
| 16425 | VkDevice device, |
| 16426 | VkSwapchainKHR swapchain) |
| 16427 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16428 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16429 | AEMU_SCOPED_TRACE("vkGetSwapchainStatusKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16430 | mImpl->log("start vkGetSwapchainStatusKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16431 | auto stream = mImpl->stream(); |
| 16432 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16433 | auto resources = mImpl->resources(); |
| 16434 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16435 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16436 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16437 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16438 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16439 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16440 | countingStream->rewind(); |
| 16441 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16442 | uint64_t cgen_var_1087; |
| 16443 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1087, 1); |
| 16444 | countingStream->write((uint64_t*)&cgen_var_1087, 1 * 8); |
| 16445 | uint64_t cgen_var_1088; |
| 16446 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1088, 1); |
| 16447 | countingStream->write((uint64_t*)&cgen_var_1088, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16448 | } |
| 16449 | uint32_t packetSize_vkGetSwapchainStatusKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16450 | countingStream->rewind(); |
| 16451 | uint32_t opcode_vkGetSwapchainStatusKHR = OP_vkGetSwapchainStatusKHR; |
| 16452 | stream->write(&opcode_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| 16453 | stream->write(&packetSize_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16454 | uint64_t cgen_var_1089; |
| 16455 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1089, 1); |
| 16456 | stream->write((uint64_t*)&cgen_var_1089, 1 * 8); |
| 16457 | uint64_t cgen_var_1090; |
| 16458 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1090, 1); |
| 16459 | stream->write((uint64_t*)&cgen_var_1090, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16460 | AEMU_SCOPED_TRACE("vkGetSwapchainStatusKHR readParams"); |
| 16461 | AEMU_SCOPED_TRACE("vkGetSwapchainStatusKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16462 | VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0; |
| 16463 | stream->read(&vkGetSwapchainStatusKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16464 | countingStream->clearPool(); |
| 16465 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16466 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16467 | mImpl->log("finish vkGetSwapchainStatusKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16468 | return vkGetSwapchainStatusKHR_VkResult_return; |
| 16469 | } |
| 16470 | |
| 16471 | #endif |
| 16472 | #ifdef VK_KHR_external_fence_capabilities |
| 16473 | void VkEncoder::vkGetPhysicalDeviceExternalFencePropertiesKHR( |
| 16474 | VkPhysicalDevice physicalDevice, |
| 16475 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 16476 | VkExternalFenceProperties* pExternalFenceProperties) |
| 16477 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16478 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16479 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFencePropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16480 | mImpl->log("start vkGetPhysicalDeviceExternalFencePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16481 | auto stream = mImpl->stream(); |
| 16482 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16483 | auto resources = mImpl->resources(); |
| 16484 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16485 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16486 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16487 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16488 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16489 | local_pExternalFenceInfo = nullptr; |
| 16490 | if (pExternalFenceInfo) |
| 16491 | { |
| 16492 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 16493 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 16494 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16495 | if (local_pExternalFenceInfo) |
| 16496 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16497 | transform_tohost_VkPhysicalDeviceExternalFenceInfo(mImpl->resources(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16498 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16499 | countingStream->rewind(); |
| 16500 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16501 | uint64_t cgen_var_1091; |
| 16502 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1091, 1); |
| 16503 | countingStream->write((uint64_t*)&cgen_var_1091, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16504 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16505 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 16506 | } |
| 16507 | uint32_t packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16508 | countingStream->rewind(); |
| 16509 | uint32_t opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR = OP_vkGetPhysicalDeviceExternalFencePropertiesKHR; |
| 16510 | stream->write(&opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| 16511 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16512 | uint64_t cgen_var_1092; |
| 16513 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1092, 1); |
| 16514 | stream->write((uint64_t*)&cgen_var_1092, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16515 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16516 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16517 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFencePropertiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16518 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16519 | if (pExternalFenceProperties) |
| 16520 | { |
| 16521 | transform_fromhost_VkExternalFenceProperties(mImpl->resources(), (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 16522 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16523 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFencePropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16524 | mImpl->log("finish vkGetPhysicalDeviceExternalFencePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16525 | } |
| 16526 | |
| 16527 | #endif |
| 16528 | #ifdef VK_KHR_external_fence |
| 16529 | #endif |
| 16530 | #ifdef VK_KHR_external_fence_win32 |
| 16531 | VkResult VkEncoder::vkImportFenceWin32HandleKHR( |
| 16532 | VkDevice device, |
| 16533 | const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) |
| 16534 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16535 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16536 | AEMU_SCOPED_TRACE("vkImportFenceWin32HandleKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16537 | mImpl->log("start vkImportFenceWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16538 | auto stream = mImpl->stream(); |
| 16539 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16540 | auto resources = mImpl->resources(); |
| 16541 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16542 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16543 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16544 | VkImportFenceWin32HandleInfoKHR* local_pImportFenceWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16545 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16546 | local_pImportFenceWin32HandleInfo = nullptr; |
| 16547 | if (pImportFenceWin32HandleInfo) |
| 16548 | { |
| 16549 | local_pImportFenceWin32HandleInfo = (VkImportFenceWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportFenceWin32HandleInfoKHR)); |
| 16550 | deepcopy_VkImportFenceWin32HandleInfoKHR(pool, pImportFenceWin32HandleInfo, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| 16551 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16552 | if (local_pImportFenceWin32HandleInfo) |
| 16553 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16554 | transform_tohost_VkImportFenceWin32HandleInfoKHR(mImpl->resources(), (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16555 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16556 | countingStream->rewind(); |
| 16557 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16558 | uint64_t cgen_var_1093; |
| 16559 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1093, 1); |
| 16560 | countingStream->write((uint64_t*)&cgen_var_1093, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16561 | marshal_VkImportFenceWin32HandleInfoKHR(countingStream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16562 | } |
| 16563 | uint32_t packetSize_vkImportFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16564 | countingStream->rewind(); |
| 16565 | uint32_t opcode_vkImportFenceWin32HandleKHR = OP_vkImportFenceWin32HandleKHR; |
| 16566 | stream->write(&opcode_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| 16567 | stream->write(&packetSize_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16568 | uint64_t cgen_var_1094; |
| 16569 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1094, 1); |
| 16570 | stream->write((uint64_t*)&cgen_var_1094, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16571 | marshal_VkImportFenceWin32HandleInfoKHR(stream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16572 | AEMU_SCOPED_TRACE("vkImportFenceWin32HandleKHR readParams"); |
| 16573 | AEMU_SCOPED_TRACE("vkImportFenceWin32HandleKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16574 | VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 16575 | stream->read(&vkImportFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16576 | countingStream->clearPool(); |
| 16577 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16578 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16579 | mImpl->log("finish vkImportFenceWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16580 | return vkImportFenceWin32HandleKHR_VkResult_return; |
| 16581 | } |
| 16582 | |
| 16583 | VkResult VkEncoder::vkGetFenceWin32HandleKHR( |
| 16584 | VkDevice device, |
| 16585 | const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 16586 | HANDLE* pHandle) |
| 16587 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16588 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16589 | AEMU_SCOPED_TRACE("vkGetFenceWin32HandleKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16590 | mImpl->log("start vkGetFenceWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16591 | auto stream = mImpl->stream(); |
| 16592 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16593 | auto resources = mImpl->resources(); |
| 16594 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16595 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16596 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16597 | VkFenceGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16598 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16599 | local_pGetWin32HandleInfo = nullptr; |
| 16600 | if (pGetWin32HandleInfo) |
| 16601 | { |
| 16602 | local_pGetWin32HandleInfo = (VkFenceGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkFenceGetWin32HandleInfoKHR)); |
| 16603 | deepcopy_VkFenceGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 16604 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16605 | if (local_pGetWin32HandleInfo) |
| 16606 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16607 | transform_tohost_VkFenceGetWin32HandleInfoKHR(mImpl->resources(), (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16608 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16609 | countingStream->rewind(); |
| 16610 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16611 | uint64_t cgen_var_1095; |
| 16612 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1095, 1); |
| 16613 | countingStream->write((uint64_t*)&cgen_var_1095, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16614 | marshal_VkFenceGetWin32HandleInfoKHR(countingStream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16615 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 16616 | } |
| 16617 | uint32_t packetSize_vkGetFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16618 | countingStream->rewind(); |
| 16619 | uint32_t opcode_vkGetFenceWin32HandleKHR = OP_vkGetFenceWin32HandleKHR; |
| 16620 | stream->write(&opcode_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| 16621 | stream->write(&packetSize_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16622 | uint64_t cgen_var_1096; |
| 16623 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1096, 1); |
| 16624 | stream->write((uint64_t*)&cgen_var_1096, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16625 | marshal_VkFenceGetWin32HandleInfoKHR(stream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16626 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16627 | AEMU_SCOPED_TRACE("vkGetFenceWin32HandleKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16628 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16629 | AEMU_SCOPED_TRACE("vkGetFenceWin32HandleKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16630 | VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 16631 | stream->read(&vkGetFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16632 | countingStream->clearPool(); |
| 16633 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16634 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16635 | mImpl->log("finish vkGetFenceWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16636 | return vkGetFenceWin32HandleKHR_VkResult_return; |
| 16637 | } |
| 16638 | |
| 16639 | #endif |
| 16640 | #ifdef VK_KHR_external_fence_fd |
| 16641 | VkResult VkEncoder::vkImportFenceFdKHR( |
| 16642 | VkDevice device, |
| 16643 | const VkImportFenceFdInfoKHR* pImportFenceFdInfo) |
| 16644 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16645 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16646 | AEMU_SCOPED_TRACE("vkImportFenceFdKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16647 | mImpl->log("start vkImportFenceFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16648 | auto stream = mImpl->stream(); |
| 16649 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16650 | auto resources = mImpl->resources(); |
| 16651 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16652 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16653 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16654 | VkImportFenceFdInfoKHR* local_pImportFenceFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16655 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16656 | local_pImportFenceFdInfo = nullptr; |
| 16657 | if (pImportFenceFdInfo) |
| 16658 | { |
| 16659 | local_pImportFenceFdInfo = (VkImportFenceFdInfoKHR*)pool->alloc(sizeof(const VkImportFenceFdInfoKHR)); |
| 16660 | deepcopy_VkImportFenceFdInfoKHR(pool, pImportFenceFdInfo, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| 16661 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16662 | if (local_pImportFenceFdInfo) |
| 16663 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16664 | transform_tohost_VkImportFenceFdInfoKHR(mImpl->resources(), (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16665 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16666 | countingStream->rewind(); |
| 16667 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16668 | uint64_t cgen_var_1097; |
| 16669 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1097, 1); |
| 16670 | countingStream->write((uint64_t*)&cgen_var_1097, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16671 | marshal_VkImportFenceFdInfoKHR(countingStream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16672 | } |
| 16673 | uint32_t packetSize_vkImportFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16674 | countingStream->rewind(); |
| 16675 | uint32_t opcode_vkImportFenceFdKHR = OP_vkImportFenceFdKHR; |
| 16676 | stream->write(&opcode_vkImportFenceFdKHR, sizeof(uint32_t)); |
| 16677 | stream->write(&packetSize_vkImportFenceFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16678 | uint64_t cgen_var_1098; |
| 16679 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1098, 1); |
| 16680 | stream->write((uint64_t*)&cgen_var_1098, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16681 | marshal_VkImportFenceFdInfoKHR(stream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16682 | AEMU_SCOPED_TRACE("vkImportFenceFdKHR readParams"); |
| 16683 | AEMU_SCOPED_TRACE("vkImportFenceFdKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16684 | VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0; |
| 16685 | stream->read(&vkImportFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16686 | countingStream->clearPool(); |
| 16687 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16688 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16689 | mImpl->log("finish vkImportFenceFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16690 | return vkImportFenceFdKHR_VkResult_return; |
| 16691 | } |
| 16692 | |
| 16693 | VkResult VkEncoder::vkGetFenceFdKHR( |
| 16694 | VkDevice device, |
| 16695 | const VkFenceGetFdInfoKHR* pGetFdInfo, |
| 16696 | int* pFd) |
| 16697 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16698 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16699 | AEMU_SCOPED_TRACE("vkGetFenceFdKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16700 | mImpl->log("start vkGetFenceFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16701 | auto stream = mImpl->stream(); |
| 16702 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16703 | auto resources = mImpl->resources(); |
| 16704 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16705 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16706 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16707 | VkFenceGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16708 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16709 | local_pGetFdInfo = nullptr; |
| 16710 | if (pGetFdInfo) |
| 16711 | { |
| 16712 | local_pGetFdInfo = (VkFenceGetFdInfoKHR*)pool->alloc(sizeof(const VkFenceGetFdInfoKHR)); |
| 16713 | deepcopy_VkFenceGetFdInfoKHR(pool, pGetFdInfo, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| 16714 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16715 | if (local_pGetFdInfo) |
| 16716 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16717 | transform_tohost_VkFenceGetFdInfoKHR(mImpl->resources(), (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16718 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16719 | countingStream->rewind(); |
| 16720 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16721 | uint64_t cgen_var_1099; |
| 16722 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1099, 1); |
| 16723 | countingStream->write((uint64_t*)&cgen_var_1099, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16724 | marshal_VkFenceGetFdInfoKHR(countingStream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16725 | countingStream->write((int*)pFd, sizeof(int)); |
| 16726 | } |
| 16727 | uint32_t packetSize_vkGetFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16728 | countingStream->rewind(); |
| 16729 | uint32_t opcode_vkGetFenceFdKHR = OP_vkGetFenceFdKHR; |
| 16730 | stream->write(&opcode_vkGetFenceFdKHR, sizeof(uint32_t)); |
| 16731 | stream->write(&packetSize_vkGetFenceFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16732 | uint64_t cgen_var_1100; |
| 16733 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1100, 1); |
| 16734 | stream->write((uint64_t*)&cgen_var_1100, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16735 | marshal_VkFenceGetFdInfoKHR(stream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16736 | stream->write((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16737 | AEMU_SCOPED_TRACE("vkGetFenceFdKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16738 | stream->read((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16739 | AEMU_SCOPED_TRACE("vkGetFenceFdKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16740 | VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0; |
| 16741 | stream->read(&vkGetFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16742 | countingStream->clearPool(); |
| 16743 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16744 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16745 | mImpl->log("finish vkGetFenceFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16746 | return vkGetFenceFdKHR_VkResult_return; |
| 16747 | } |
| 16748 | |
| 16749 | #endif |
| 16750 | #ifdef VK_KHR_maintenance2 |
| 16751 | #endif |
| 16752 | #ifdef VK_KHR_get_surface_capabilities2 |
| 16753 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2KHR( |
| 16754 | VkPhysicalDevice physicalDevice, |
| 16755 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 16756 | VkSurfaceCapabilities2KHR* pSurfaceCapabilities) |
| 16757 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16758 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16759 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16760 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilities2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16761 | auto stream = mImpl->stream(); |
| 16762 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16763 | auto resources = mImpl->resources(); |
| 16764 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16765 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16766 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16767 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16768 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16769 | local_pSurfaceInfo = nullptr; |
| 16770 | if (pSurfaceInfo) |
| 16771 | { |
| 16772 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 16773 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 16774 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16775 | if (local_pSurfaceInfo) |
| 16776 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16777 | transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(mImpl->resources(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16778 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16779 | countingStream->rewind(); |
| 16780 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16781 | uint64_t cgen_var_1101; |
| 16782 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1101, 1); |
| 16783 | countingStream->write((uint64_t*)&cgen_var_1101, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16784 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16785 | marshal_VkSurfaceCapabilities2KHR(countingStream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 16786 | } |
| 16787 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16788 | countingStream->rewind(); |
| 16789 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR = OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR; |
| 16790 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| 16791 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16792 | uint64_t cgen_var_1102; |
| 16793 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1102, 1); |
| 16794 | stream->write((uint64_t*)&cgen_var_1102, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16795 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16796 | marshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16797 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16798 | unmarshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16799 | if (pSurfaceCapabilities) |
| 16800 | { |
| 16801 | transform_fromhost_VkSurfaceCapabilities2KHR(mImpl->resources(), (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 16802 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16803 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16804 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0; |
| 16805 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16806 | countingStream->clearPool(); |
| 16807 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16808 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16809 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilities2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16810 | return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return; |
| 16811 | } |
| 16812 | |
| 16813 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormats2KHR( |
| 16814 | VkPhysicalDevice physicalDevice, |
| 16815 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 16816 | uint32_t* pSurfaceFormatCount, |
| 16817 | VkSurfaceFormat2KHR* pSurfaceFormats) |
| 16818 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16819 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16820 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormats2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16821 | mImpl->log("start vkGetPhysicalDeviceSurfaceFormats2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16822 | auto stream = mImpl->stream(); |
| 16823 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16824 | auto resources = mImpl->resources(); |
| 16825 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16826 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16827 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16828 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16829 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16830 | local_pSurfaceInfo = nullptr; |
| 16831 | if (pSurfaceInfo) |
| 16832 | { |
| 16833 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 16834 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 16835 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16836 | if (local_pSurfaceInfo) |
| 16837 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16838 | transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(mImpl->resources(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16839 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16840 | countingStream->rewind(); |
| 16841 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16842 | uint64_t cgen_var_1103; |
| 16843 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1103, 1); |
| 16844 | countingStream->write((uint64_t*)&cgen_var_1103, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16845 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16846 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16847 | uint64_t cgen_var_1104 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 16848 | countingStream->putBe64(cgen_var_1104); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16849 | if (pSurfaceFormatCount) |
| 16850 | { |
| 16851 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 16852 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16853 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16854 | uint64_t cgen_var_1105 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 16855 | countingStream->putBe64(cgen_var_1105); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16856 | if (pSurfaceFormats) |
| 16857 | { |
| 16858 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16859 | { |
| 16860 | marshal_VkSurfaceFormat2KHR(countingStream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16861 | } |
| 16862 | } |
| 16863 | } |
| 16864 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16865 | countingStream->rewind(); |
| 16866 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormats2KHR = OP_vkGetPhysicalDeviceSurfaceFormats2KHR; |
| 16867 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| 16868 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16869 | uint64_t cgen_var_1106; |
| 16870 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1106, 1); |
| 16871 | stream->write((uint64_t*)&cgen_var_1106, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16872 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16873 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16874 | uint64_t cgen_var_1107 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 16875 | stream->putBe64(cgen_var_1107); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16876 | if (pSurfaceFormatCount) |
| 16877 | { |
| 16878 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 16879 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16880 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16881 | uint64_t cgen_var_1108 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 16882 | stream->putBe64(cgen_var_1108); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16883 | if (pSurfaceFormats) |
| 16884 | { |
| 16885 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16886 | { |
| 16887 | marshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16888 | } |
| 16889 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16890 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormats2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16891 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16892 | uint32_t* check_pSurfaceFormatCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16893 | check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16894 | if (pSurfaceFormatCount) |
| 16895 | { |
| 16896 | if (!(check_pSurfaceFormatCount)) |
| 16897 | { |
| 16898 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 16899 | } |
| 16900 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 16901 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16902 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16903 | VkSurfaceFormat2KHR* check_pSurfaceFormats; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16904 | check_pSurfaceFormats = (VkSurfaceFormat2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16905 | if (pSurfaceFormats) |
| 16906 | { |
| 16907 | if (!(check_pSurfaceFormats)) |
| 16908 | { |
| 16909 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 16910 | } |
| 16911 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16912 | { |
| 16913 | unmarshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16914 | } |
| 16915 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16916 | if (pSurfaceFormats) |
| 16917 | { |
| 16918 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16919 | { |
| 16920 | transform_fromhost_VkSurfaceFormat2KHR(mImpl->resources(), (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16921 | } |
| 16922 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16923 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormats2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16924 | VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0; |
| 16925 | stream->read(&vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16926 | countingStream->clearPool(); |
| 16927 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16928 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16929 | mImpl->log("finish vkGetPhysicalDeviceSurfaceFormats2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16930 | return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return; |
| 16931 | } |
| 16932 | |
| 16933 | #endif |
| 16934 | #ifdef VK_KHR_variable_pointers |
| 16935 | #endif |
| 16936 | #ifdef VK_KHR_get_display_properties2 |
| 16937 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayProperties2KHR( |
| 16938 | VkPhysicalDevice physicalDevice, |
| 16939 | uint32_t* pPropertyCount, |
| 16940 | VkDisplayProperties2KHR* pProperties) |
| 16941 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16942 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16943 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16944 | mImpl->log("start vkGetPhysicalDeviceDisplayProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16945 | auto stream = mImpl->stream(); |
| 16946 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16947 | auto resources = mImpl->resources(); |
| 16948 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16949 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16950 | VkPhysicalDevice local_physicalDevice; |
| 16951 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16952 | countingStream->rewind(); |
| 16953 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16954 | uint64_t cgen_var_1111; |
| 16955 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1111, 1); |
| 16956 | countingStream->write((uint64_t*)&cgen_var_1111, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16957 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16958 | uint64_t cgen_var_1112 = (uint64_t)(uintptr_t)pPropertyCount; |
| 16959 | countingStream->putBe64(cgen_var_1112); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16960 | if (pPropertyCount) |
| 16961 | { |
| 16962 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16963 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16964 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16965 | uint64_t cgen_var_1113 = (uint64_t)(uintptr_t)pProperties; |
| 16966 | countingStream->putBe64(cgen_var_1113); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16967 | if (pProperties) |
| 16968 | { |
| 16969 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16970 | { |
| 16971 | marshal_VkDisplayProperties2KHR(countingStream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 16972 | } |
| 16973 | } |
| 16974 | } |
| 16975 | uint32_t packetSize_vkGetPhysicalDeviceDisplayProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16976 | countingStream->rewind(); |
| 16977 | uint32_t opcode_vkGetPhysicalDeviceDisplayProperties2KHR = OP_vkGetPhysicalDeviceDisplayProperties2KHR; |
| 16978 | stream->write(&opcode_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| 16979 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16980 | uint64_t cgen_var_1114; |
| 16981 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1114, 1); |
| 16982 | stream->write((uint64_t*)&cgen_var_1114, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16983 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16984 | uint64_t cgen_var_1115 = (uint64_t)(uintptr_t)pPropertyCount; |
| 16985 | stream->putBe64(cgen_var_1115); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16986 | if (pPropertyCount) |
| 16987 | { |
| 16988 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16989 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16990 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16991 | uint64_t cgen_var_1116 = (uint64_t)(uintptr_t)pProperties; |
| 16992 | stream->putBe64(cgen_var_1116); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16993 | if (pProperties) |
| 16994 | { |
| 16995 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16996 | { |
| 16997 | marshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 16998 | } |
| 16999 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17000 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayProperties2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17001 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17002 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17003 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17004 | if (pPropertyCount) |
| 17005 | { |
| 17006 | if (!(check_pPropertyCount)) |
| 17007 | { |
| 17008 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 17009 | } |
| 17010 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17011 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17012 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17013 | VkDisplayProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17014 | check_pProperties = (VkDisplayProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17015 | if (pProperties) |
| 17016 | { |
| 17017 | if (!(check_pProperties)) |
| 17018 | { |
| 17019 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 17020 | } |
| 17021 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17022 | { |
| 17023 | unmarshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 17024 | } |
| 17025 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17026 | if (pProperties) |
| 17027 | { |
| 17028 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17029 | { |
| 17030 | transform_fromhost_VkDisplayProperties2KHR(mImpl->resources(), (VkDisplayProperties2KHR*)(pProperties + i)); |
| 17031 | } |
| 17032 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17033 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17034 | VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0; |
| 17035 | stream->read(&vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17036 | countingStream->clearPool(); |
| 17037 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17038 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17039 | mImpl->log("finish vkGetPhysicalDeviceDisplayProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17040 | return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return; |
| 17041 | } |
| 17042 | |
| 17043 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlaneProperties2KHR( |
| 17044 | VkPhysicalDevice physicalDevice, |
| 17045 | uint32_t* pPropertyCount, |
| 17046 | VkDisplayPlaneProperties2KHR* pProperties) |
| 17047 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17048 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17049 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlaneProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17050 | mImpl->log("start vkGetPhysicalDeviceDisplayPlaneProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17051 | auto stream = mImpl->stream(); |
| 17052 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17053 | auto resources = mImpl->resources(); |
| 17054 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17055 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17056 | VkPhysicalDevice local_physicalDevice; |
| 17057 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17058 | countingStream->rewind(); |
| 17059 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17060 | uint64_t cgen_var_1119; |
| 17061 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1119, 1); |
| 17062 | countingStream->write((uint64_t*)&cgen_var_1119, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17063 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17064 | uint64_t cgen_var_1120 = (uint64_t)(uintptr_t)pPropertyCount; |
| 17065 | countingStream->putBe64(cgen_var_1120); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17066 | if (pPropertyCount) |
| 17067 | { |
| 17068 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17069 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17070 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17071 | uint64_t cgen_var_1121 = (uint64_t)(uintptr_t)pProperties; |
| 17072 | countingStream->putBe64(cgen_var_1121); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17073 | if (pProperties) |
| 17074 | { |
| 17075 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17076 | { |
| 17077 | marshal_VkDisplayPlaneProperties2KHR(countingStream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 17078 | } |
| 17079 | } |
| 17080 | } |
| 17081 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17082 | countingStream->rewind(); |
| 17083 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR; |
| 17084 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| 17085 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17086 | uint64_t cgen_var_1122; |
| 17087 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1122, 1); |
| 17088 | stream->write((uint64_t*)&cgen_var_1122, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17089 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17090 | uint64_t cgen_var_1123 = (uint64_t)(uintptr_t)pPropertyCount; |
| 17091 | stream->putBe64(cgen_var_1123); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17092 | if (pPropertyCount) |
| 17093 | { |
| 17094 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17095 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17096 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17097 | uint64_t cgen_var_1124 = (uint64_t)(uintptr_t)pProperties; |
| 17098 | stream->putBe64(cgen_var_1124); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17099 | if (pProperties) |
| 17100 | { |
| 17101 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17102 | { |
| 17103 | marshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 17104 | } |
| 17105 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17106 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlaneProperties2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17107 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17108 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17109 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17110 | if (pPropertyCount) |
| 17111 | { |
| 17112 | if (!(check_pPropertyCount)) |
| 17113 | { |
| 17114 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 17115 | } |
| 17116 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17117 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17118 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17119 | VkDisplayPlaneProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17120 | check_pProperties = (VkDisplayPlaneProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17121 | if (pProperties) |
| 17122 | { |
| 17123 | if (!(check_pProperties)) |
| 17124 | { |
| 17125 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 17126 | } |
| 17127 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17128 | { |
| 17129 | unmarshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 17130 | } |
| 17131 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17132 | if (pProperties) |
| 17133 | { |
| 17134 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17135 | { |
| 17136 | transform_fromhost_VkDisplayPlaneProperties2KHR(mImpl->resources(), (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 17137 | } |
| 17138 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17139 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlaneProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17140 | VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0; |
| 17141 | stream->read(&vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17142 | countingStream->clearPool(); |
| 17143 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17144 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17145 | mImpl->log("finish vkGetPhysicalDeviceDisplayPlaneProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17146 | return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return; |
| 17147 | } |
| 17148 | |
| 17149 | VkResult VkEncoder::vkGetDisplayModeProperties2KHR( |
| 17150 | VkPhysicalDevice physicalDevice, |
| 17151 | VkDisplayKHR display, |
| 17152 | uint32_t* pPropertyCount, |
| 17153 | VkDisplayModeProperties2KHR* pProperties) |
| 17154 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17155 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17156 | AEMU_SCOPED_TRACE("vkGetDisplayModeProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17157 | mImpl->log("start vkGetDisplayModeProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17158 | auto stream = mImpl->stream(); |
| 17159 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17160 | auto resources = mImpl->resources(); |
| 17161 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17162 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17163 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17164 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17165 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17166 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17167 | countingStream->rewind(); |
| 17168 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17169 | uint64_t cgen_var_1127; |
| 17170 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1127, 1); |
| 17171 | countingStream->write((uint64_t*)&cgen_var_1127, 1 * 8); |
| 17172 | uint64_t cgen_var_1128; |
| 17173 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1128, 1); |
| 17174 | countingStream->write((uint64_t*)&cgen_var_1128, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17175 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17176 | uint64_t cgen_var_1129 = (uint64_t)(uintptr_t)pPropertyCount; |
| 17177 | countingStream->putBe64(cgen_var_1129); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17178 | if (pPropertyCount) |
| 17179 | { |
| 17180 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17181 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17182 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17183 | uint64_t cgen_var_1130 = (uint64_t)(uintptr_t)pProperties; |
| 17184 | countingStream->putBe64(cgen_var_1130); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17185 | if (pProperties) |
| 17186 | { |
| 17187 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17188 | { |
| 17189 | marshal_VkDisplayModeProperties2KHR(countingStream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 17190 | } |
| 17191 | } |
| 17192 | } |
| 17193 | uint32_t packetSize_vkGetDisplayModeProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17194 | countingStream->rewind(); |
| 17195 | uint32_t opcode_vkGetDisplayModeProperties2KHR = OP_vkGetDisplayModeProperties2KHR; |
| 17196 | stream->write(&opcode_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| 17197 | stream->write(&packetSize_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17198 | uint64_t cgen_var_1131; |
| 17199 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1131, 1); |
| 17200 | stream->write((uint64_t*)&cgen_var_1131, 1 * 8); |
| 17201 | uint64_t cgen_var_1132; |
| 17202 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1132, 1); |
| 17203 | stream->write((uint64_t*)&cgen_var_1132, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17204 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17205 | uint64_t cgen_var_1133 = (uint64_t)(uintptr_t)pPropertyCount; |
| 17206 | stream->putBe64(cgen_var_1133); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17207 | if (pPropertyCount) |
| 17208 | { |
| 17209 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17210 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17211 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17212 | uint64_t cgen_var_1134 = (uint64_t)(uintptr_t)pProperties; |
| 17213 | stream->putBe64(cgen_var_1134); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17214 | if (pProperties) |
| 17215 | { |
| 17216 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17217 | { |
| 17218 | marshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 17219 | } |
| 17220 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17221 | AEMU_SCOPED_TRACE("vkGetDisplayModeProperties2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17222 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17223 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17224 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17225 | if (pPropertyCount) |
| 17226 | { |
| 17227 | if (!(check_pPropertyCount)) |
| 17228 | { |
| 17229 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 17230 | } |
| 17231 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17232 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17233 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17234 | VkDisplayModeProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17235 | check_pProperties = (VkDisplayModeProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17236 | if (pProperties) |
| 17237 | { |
| 17238 | if (!(check_pProperties)) |
| 17239 | { |
| 17240 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 17241 | } |
| 17242 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17243 | { |
| 17244 | unmarshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 17245 | } |
| 17246 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17247 | if (pProperties) |
| 17248 | { |
| 17249 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17250 | { |
| 17251 | transform_fromhost_VkDisplayModeProperties2KHR(mImpl->resources(), (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 17252 | } |
| 17253 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17254 | AEMU_SCOPED_TRACE("vkGetDisplayModeProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17255 | VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0; |
| 17256 | stream->read(&vkGetDisplayModeProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17257 | countingStream->clearPool(); |
| 17258 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17259 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17260 | mImpl->log("finish vkGetDisplayModeProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17261 | return vkGetDisplayModeProperties2KHR_VkResult_return; |
| 17262 | } |
| 17263 | |
| 17264 | VkResult VkEncoder::vkGetDisplayPlaneCapabilities2KHR( |
| 17265 | VkPhysicalDevice physicalDevice, |
| 17266 | const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, |
| 17267 | VkDisplayPlaneCapabilities2KHR* pCapabilities) |
| 17268 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17269 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17270 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilities2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17271 | mImpl->log("start vkGetDisplayPlaneCapabilities2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17272 | auto stream = mImpl->stream(); |
| 17273 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17274 | auto resources = mImpl->resources(); |
| 17275 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17276 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17277 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17278 | VkDisplayPlaneInfo2KHR* local_pDisplayPlaneInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17279 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17280 | local_pDisplayPlaneInfo = nullptr; |
| 17281 | if (pDisplayPlaneInfo) |
| 17282 | { |
| 17283 | local_pDisplayPlaneInfo = (VkDisplayPlaneInfo2KHR*)pool->alloc(sizeof(const VkDisplayPlaneInfo2KHR)); |
| 17284 | deepcopy_VkDisplayPlaneInfo2KHR(pool, pDisplayPlaneInfo, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| 17285 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17286 | if (local_pDisplayPlaneInfo) |
| 17287 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17288 | transform_tohost_VkDisplayPlaneInfo2KHR(mImpl->resources(), (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17289 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17290 | countingStream->rewind(); |
| 17291 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17292 | uint64_t cgen_var_1137; |
| 17293 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1137, 1); |
| 17294 | countingStream->write((uint64_t*)&cgen_var_1137, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17295 | marshal_VkDisplayPlaneInfo2KHR(countingStream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17296 | marshal_VkDisplayPlaneCapabilities2KHR(countingStream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 17297 | } |
| 17298 | uint32_t packetSize_vkGetDisplayPlaneCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17299 | countingStream->rewind(); |
| 17300 | uint32_t opcode_vkGetDisplayPlaneCapabilities2KHR = OP_vkGetDisplayPlaneCapabilities2KHR; |
| 17301 | stream->write(&opcode_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| 17302 | stream->write(&packetSize_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17303 | uint64_t cgen_var_1138; |
| 17304 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1138, 1); |
| 17305 | stream->write((uint64_t*)&cgen_var_1138, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17306 | marshal_VkDisplayPlaneInfo2KHR(stream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17307 | marshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17308 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilities2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17309 | unmarshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17310 | if (pCapabilities) |
| 17311 | { |
| 17312 | transform_fromhost_VkDisplayPlaneCapabilities2KHR(mImpl->resources(), (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 17313 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17314 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilities2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17315 | VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0; |
| 17316 | stream->read(&vkGetDisplayPlaneCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17317 | countingStream->clearPool(); |
| 17318 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17319 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17320 | mImpl->log("finish vkGetDisplayPlaneCapabilities2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17321 | return vkGetDisplayPlaneCapabilities2KHR_VkResult_return; |
| 17322 | } |
| 17323 | |
| 17324 | #endif |
| 17325 | #ifdef VK_KHR_dedicated_allocation |
| 17326 | #endif |
| 17327 | #ifdef VK_KHR_storage_buffer_storage_class |
| 17328 | #endif |
| 17329 | #ifdef VK_KHR_relaxed_block_layout |
| 17330 | #endif |
| 17331 | #ifdef VK_KHR_get_memory_requirements2 |
| 17332 | void VkEncoder::vkGetImageMemoryRequirements2KHR( |
| 17333 | VkDevice device, |
| 17334 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 17335 | VkMemoryRequirements2* pMemoryRequirements) |
| 17336 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17337 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17338 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17339 | mImpl->log("start vkGetImageMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17340 | auto stream = mImpl->stream(); |
| 17341 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17342 | auto resources = mImpl->resources(); |
| 17343 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17344 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17345 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17346 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17347 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17348 | local_pInfo = nullptr; |
| 17349 | if (pInfo) |
| 17350 | { |
| 17351 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 17352 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 17353 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17354 | if (local_pInfo) |
| 17355 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17356 | transform_tohost_VkImageMemoryRequirementsInfo2(mImpl->resources(), (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17357 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17358 | countingStream->rewind(); |
| 17359 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17360 | uint64_t cgen_var_1139; |
| 17361 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1139, 1); |
| 17362 | countingStream->write((uint64_t*)&cgen_var_1139, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17363 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17364 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 17365 | } |
| 17366 | uint32_t packetSize_vkGetImageMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17367 | countingStream->rewind(); |
| 17368 | uint32_t opcode_vkGetImageMemoryRequirements2KHR = OP_vkGetImageMemoryRequirements2KHR; |
| 17369 | stream->write(&opcode_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| 17370 | stream->write(&packetSize_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17371 | uint64_t cgen_var_1140; |
| 17372 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1140, 1); |
| 17373 | stream->write((uint64_t*)&cgen_var_1140, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17374 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17375 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17376 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17377 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17378 | if (pMemoryRequirements) |
| 17379 | { |
| 17380 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 17381 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17382 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17383 | mImpl->log("finish vkGetImageMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17384 | } |
| 17385 | |
| 17386 | void VkEncoder::vkGetBufferMemoryRequirements2KHR( |
| 17387 | VkDevice device, |
| 17388 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 17389 | VkMemoryRequirements2* pMemoryRequirements) |
| 17390 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17391 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17392 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17393 | mImpl->log("start vkGetBufferMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17394 | auto stream = mImpl->stream(); |
| 17395 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17396 | auto resources = mImpl->resources(); |
| 17397 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17398 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17399 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17400 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17401 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17402 | local_pInfo = nullptr; |
| 17403 | if (pInfo) |
| 17404 | { |
| 17405 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 17406 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 17407 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17408 | if (local_pInfo) |
| 17409 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17410 | transform_tohost_VkBufferMemoryRequirementsInfo2(mImpl->resources(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17411 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17412 | countingStream->rewind(); |
| 17413 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17414 | uint64_t cgen_var_1141; |
| 17415 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1141, 1); |
| 17416 | countingStream->write((uint64_t*)&cgen_var_1141, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17417 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17418 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 17419 | } |
| 17420 | uint32_t packetSize_vkGetBufferMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17421 | countingStream->rewind(); |
| 17422 | uint32_t opcode_vkGetBufferMemoryRequirements2KHR = OP_vkGetBufferMemoryRequirements2KHR; |
| 17423 | stream->write(&opcode_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| 17424 | stream->write(&packetSize_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17425 | uint64_t cgen_var_1142; |
| 17426 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1142, 1); |
| 17427 | stream->write((uint64_t*)&cgen_var_1142, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17428 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17429 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17430 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17431 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17432 | if (pMemoryRequirements) |
| 17433 | { |
| 17434 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 17435 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17436 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17437 | mImpl->log("finish vkGetBufferMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17438 | } |
| 17439 | |
| 17440 | void VkEncoder::vkGetImageSparseMemoryRequirements2KHR( |
| 17441 | VkDevice device, |
| 17442 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 17443 | uint32_t* pSparseMemoryRequirementCount, |
| 17444 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 17445 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17446 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17447 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17448 | mImpl->log("start vkGetImageSparseMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17449 | auto stream = mImpl->stream(); |
| 17450 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17451 | auto resources = mImpl->resources(); |
| 17452 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17453 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17454 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17455 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17456 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17457 | local_pInfo = nullptr; |
| 17458 | if (pInfo) |
| 17459 | { |
| 17460 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 17461 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 17462 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17463 | if (local_pInfo) |
| 17464 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17465 | transform_tohost_VkImageSparseMemoryRequirementsInfo2(mImpl->resources(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17466 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17467 | countingStream->rewind(); |
| 17468 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17469 | uint64_t cgen_var_1143; |
| 17470 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1143, 1); |
| 17471 | countingStream->write((uint64_t*)&cgen_var_1143, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17472 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17473 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17474 | uint64_t cgen_var_1144 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 17475 | countingStream->putBe64(cgen_var_1144); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17476 | if (pSparseMemoryRequirementCount) |
| 17477 | { |
| 17478 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 17479 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17480 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17481 | uint64_t cgen_var_1145 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 17482 | countingStream->putBe64(cgen_var_1145); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17483 | if (pSparseMemoryRequirements) |
| 17484 | { |
| 17485 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17486 | { |
| 17487 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17488 | } |
| 17489 | } |
| 17490 | } |
| 17491 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17492 | countingStream->rewind(); |
| 17493 | uint32_t opcode_vkGetImageSparseMemoryRequirements2KHR = OP_vkGetImageSparseMemoryRequirements2KHR; |
| 17494 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| 17495 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17496 | uint64_t cgen_var_1146; |
| 17497 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1146, 1); |
| 17498 | stream->write((uint64_t*)&cgen_var_1146, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17499 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17500 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17501 | uint64_t cgen_var_1147 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 17502 | stream->putBe64(cgen_var_1147); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17503 | if (pSparseMemoryRequirementCount) |
| 17504 | { |
| 17505 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 17506 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17507 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17508 | uint64_t cgen_var_1148 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 17509 | stream->putBe64(cgen_var_1148); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17510 | if (pSparseMemoryRequirements) |
| 17511 | { |
| 17512 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17513 | { |
| 17514 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17515 | } |
| 17516 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17517 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17518 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17519 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17520 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17521 | if (pSparseMemoryRequirementCount) |
| 17522 | { |
| 17523 | if (!(check_pSparseMemoryRequirementCount)) |
| 17524 | { |
| 17525 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 17526 | } |
| 17527 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 17528 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17529 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17530 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17531 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17532 | if (pSparseMemoryRequirements) |
| 17533 | { |
| 17534 | if (!(check_pSparseMemoryRequirements)) |
| 17535 | { |
| 17536 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 17537 | } |
| 17538 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17539 | { |
| 17540 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17541 | } |
| 17542 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17543 | if (pSparseMemoryRequirements) |
| 17544 | { |
| 17545 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17546 | { |
| 17547 | transform_fromhost_VkSparseImageMemoryRequirements2(mImpl->resources(), (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17548 | } |
| 17549 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17550 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17551 | mImpl->log("finish vkGetImageSparseMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17552 | } |
| 17553 | |
| 17554 | #endif |
| 17555 | #ifdef VK_KHR_image_format_list |
| 17556 | #endif |
| 17557 | #ifdef VK_KHR_sampler_ycbcr_conversion |
| 17558 | VkResult VkEncoder::vkCreateSamplerYcbcrConversionKHR( |
| 17559 | VkDevice device, |
| 17560 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 17561 | const VkAllocationCallbacks* pAllocator, |
| 17562 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 17563 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17564 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17565 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversionKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17566 | mImpl->log("start vkCreateSamplerYcbcrConversionKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17567 | auto stream = mImpl->stream(); |
| 17568 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17569 | auto resources = mImpl->resources(); |
| 17570 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17571 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17572 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17573 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17574 | VkAllocationCallbacks* local_pAllocator; |
| 17575 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17576 | local_pCreateInfo = nullptr; |
| 17577 | if (pCreateInfo) |
| 17578 | { |
| 17579 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 17580 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 17581 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17582 | local_pAllocator = nullptr; |
| 17583 | if (pAllocator) |
| 17584 | { |
| 17585 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17586 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17587 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17588 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17589 | if (local_pCreateInfo) |
| 17590 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17591 | transform_tohost_VkSamplerYcbcrConversionCreateInfo(mImpl->resources(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17592 | } |
| 17593 | if (local_pAllocator) |
| 17594 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17595 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17596 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17597 | countingStream->rewind(); |
| 17598 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17599 | uint64_t cgen_var_1151; |
| 17600 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1151, 1); |
| 17601 | countingStream->write((uint64_t*)&cgen_var_1151, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17602 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17603 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17604 | uint64_t cgen_var_1152 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17605 | countingStream->putBe64(cgen_var_1152); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17606 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17607 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17608 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17609 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17610 | uint64_t cgen_var_1153; |
| 17611 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1153, 1); |
| 17612 | countingStream->write((uint64_t*)&cgen_var_1153, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17613 | } |
| 17614 | uint32_t packetSize_vkCreateSamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17615 | countingStream->rewind(); |
| 17616 | uint32_t opcode_vkCreateSamplerYcbcrConversionKHR = OP_vkCreateSamplerYcbcrConversionKHR; |
| 17617 | stream->write(&opcode_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 17618 | stream->write(&packetSize_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17619 | uint64_t cgen_var_1154; |
| 17620 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1154, 1); |
| 17621 | stream->write((uint64_t*)&cgen_var_1154, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17622 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17623 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17624 | uint64_t cgen_var_1155 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17625 | stream->putBe64(cgen_var_1155); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17626 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17627 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17628 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17629 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17630 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17631 | uint64_t cgen_var_1156; |
| 17632 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1156, 1); |
| 17633 | stream->write((uint64_t*)&cgen_var_1156, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17634 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17635 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversionKHR readParams"); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 17636 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17637 | uint64_t cgen_var_1157; |
| 17638 | stream->read((uint64_t*)&cgen_var_1157, 8); |
| 17639 | stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_1157, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 17640 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17641 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversionKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17642 | VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0; |
| 17643 | stream->read(&vkCreateSamplerYcbcrConversionKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17644 | countingStream->clearPool(); |
| 17645 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17646 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17647 | mImpl->log("finish vkCreateSamplerYcbcrConversionKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17648 | return vkCreateSamplerYcbcrConversionKHR_VkResult_return; |
| 17649 | } |
| 17650 | |
| 17651 | void VkEncoder::vkDestroySamplerYcbcrConversionKHR( |
| 17652 | VkDevice device, |
| 17653 | VkSamplerYcbcrConversion ycbcrConversion, |
| 17654 | const VkAllocationCallbacks* pAllocator) |
| 17655 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17656 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17657 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversionKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17658 | mImpl->log("start vkDestroySamplerYcbcrConversionKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17659 | auto stream = mImpl->stream(); |
| 17660 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17661 | auto resources = mImpl->resources(); |
| 17662 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17663 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17664 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17665 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17666 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17667 | local_device = device; |
| 17668 | local_ycbcrConversion = ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17669 | local_pAllocator = nullptr; |
| 17670 | if (pAllocator) |
| 17671 | { |
| 17672 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17673 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17674 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17675 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17676 | if (local_pAllocator) |
| 17677 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17678 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17679 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17680 | countingStream->rewind(); |
| 17681 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17682 | uint64_t cgen_var_1158; |
| 17683 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1158, 1); |
| 17684 | countingStream->write((uint64_t*)&cgen_var_1158, 1 * 8); |
| 17685 | uint64_t cgen_var_1159; |
| 17686 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1159, 1); |
| 17687 | countingStream->write((uint64_t*)&cgen_var_1159, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17688 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17689 | uint64_t cgen_var_1160 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17690 | countingStream->putBe64(cgen_var_1160); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17691 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17692 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17693 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17694 | } |
| 17695 | } |
| 17696 | uint32_t packetSize_vkDestroySamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17697 | countingStream->rewind(); |
| 17698 | uint32_t opcode_vkDestroySamplerYcbcrConversionKHR = OP_vkDestroySamplerYcbcrConversionKHR; |
| 17699 | stream->write(&opcode_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 17700 | stream->write(&packetSize_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17701 | uint64_t cgen_var_1161; |
| 17702 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1161, 1); |
| 17703 | stream->write((uint64_t*)&cgen_var_1161, 1 * 8); |
| 17704 | uint64_t cgen_var_1162; |
| 17705 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1162, 1); |
| 17706 | stream->write((uint64_t*)&cgen_var_1162, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17707 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17708 | uint64_t cgen_var_1163 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17709 | stream->putBe64(cgen_var_1163); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17710 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17711 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17712 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17713 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17714 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversionKHR readParams"); |
| 17715 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversionKHR returnUnmarshal"); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 17716 | resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17717 | mImpl->log("finish vkDestroySamplerYcbcrConversionKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17718 | } |
| 17719 | |
| 17720 | #endif |
| 17721 | #ifdef VK_KHR_bind_memory2 |
| 17722 | VkResult VkEncoder::vkBindBufferMemory2KHR( |
| 17723 | VkDevice device, |
| 17724 | uint32_t bindInfoCount, |
| 17725 | const VkBindBufferMemoryInfo* pBindInfos) |
| 17726 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17727 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17728 | AEMU_SCOPED_TRACE("vkBindBufferMemory2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17729 | mImpl->log("start vkBindBufferMemory2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17730 | auto stream = mImpl->stream(); |
| 17731 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17732 | auto resources = mImpl->resources(); |
| 17733 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17734 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17735 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17736 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17737 | VkBindBufferMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17738 | local_device = device; |
| 17739 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17740 | local_pBindInfos = nullptr; |
| 17741 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17742 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17743 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17744 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17745 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17746 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 17747 | } |
| 17748 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17749 | if (local_pBindInfos) |
| 17750 | { |
| 17751 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17752 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17753 | transform_tohost_VkBindBufferMemoryInfo(mImpl->resources(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17754 | } |
| 17755 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17756 | countingStream->rewind(); |
| 17757 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17758 | uint64_t cgen_var_1164; |
| 17759 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1164, 1); |
| 17760 | countingStream->write((uint64_t*)&cgen_var_1164, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17761 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 17762 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17763 | { |
| 17764 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17765 | } |
| 17766 | } |
| 17767 | uint32_t packetSize_vkBindBufferMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17768 | countingStream->rewind(); |
| 17769 | uint32_t opcode_vkBindBufferMemory2KHR = OP_vkBindBufferMemory2KHR; |
| 17770 | stream->write(&opcode_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| 17771 | stream->write(&packetSize_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17772 | uint64_t cgen_var_1165; |
| 17773 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1165, 1); |
| 17774 | stream->write((uint64_t*)&cgen_var_1165, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17775 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17776 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17777 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17778 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17779 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17780 | AEMU_SCOPED_TRACE("vkBindBufferMemory2KHR readParams"); |
| 17781 | AEMU_SCOPED_TRACE("vkBindBufferMemory2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17782 | VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0; |
| 17783 | stream->read(&vkBindBufferMemory2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17784 | countingStream->clearPool(); |
| 17785 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17786 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17787 | mImpl->log("finish vkBindBufferMemory2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17788 | return vkBindBufferMemory2KHR_VkResult_return; |
| 17789 | } |
| 17790 | |
| 17791 | VkResult VkEncoder::vkBindImageMemory2KHR( |
| 17792 | VkDevice device, |
| 17793 | uint32_t bindInfoCount, |
| 17794 | const VkBindImageMemoryInfo* pBindInfos) |
| 17795 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17796 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17797 | AEMU_SCOPED_TRACE("vkBindImageMemory2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17798 | mImpl->log("start vkBindImageMemory2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17799 | auto stream = mImpl->stream(); |
| 17800 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17801 | auto resources = mImpl->resources(); |
| 17802 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17803 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17804 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17805 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17806 | VkBindImageMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17807 | local_device = device; |
| 17808 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17809 | local_pBindInfos = nullptr; |
| 17810 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17811 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17812 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17813 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17814 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17815 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 17816 | } |
| 17817 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17818 | if (local_pBindInfos) |
| 17819 | { |
| 17820 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17821 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17822 | transform_tohost_VkBindImageMemoryInfo(mImpl->resources(), (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17823 | } |
| 17824 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17825 | countingStream->rewind(); |
| 17826 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17827 | uint64_t cgen_var_1166; |
| 17828 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1166, 1); |
| 17829 | countingStream->write((uint64_t*)&cgen_var_1166, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17830 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 17831 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17832 | { |
| 17833 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17834 | } |
| 17835 | } |
| 17836 | uint32_t packetSize_vkBindImageMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17837 | countingStream->rewind(); |
| 17838 | uint32_t opcode_vkBindImageMemory2KHR = OP_vkBindImageMemory2KHR; |
| 17839 | stream->write(&opcode_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| 17840 | stream->write(&packetSize_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17841 | uint64_t cgen_var_1167; |
| 17842 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1167, 1); |
| 17843 | stream->write((uint64_t*)&cgen_var_1167, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17844 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17845 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17846 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17847 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17848 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17849 | AEMU_SCOPED_TRACE("vkBindImageMemory2KHR readParams"); |
| 17850 | AEMU_SCOPED_TRACE("vkBindImageMemory2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17851 | VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0; |
| 17852 | stream->read(&vkBindImageMemory2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17853 | countingStream->clearPool(); |
| 17854 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17855 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17856 | mImpl->log("finish vkBindImageMemory2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17857 | return vkBindImageMemory2KHR_VkResult_return; |
| 17858 | } |
| 17859 | |
| 17860 | #endif |
| 17861 | #ifdef VK_KHR_maintenance3 |
| 17862 | void VkEncoder::vkGetDescriptorSetLayoutSupportKHR( |
| 17863 | VkDevice device, |
| 17864 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 17865 | VkDescriptorSetLayoutSupport* pSupport) |
| 17866 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17867 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17868 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17869 | mImpl->log("start vkGetDescriptorSetLayoutSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17870 | auto stream = mImpl->stream(); |
| 17871 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17872 | auto resources = mImpl->resources(); |
| 17873 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17874 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17875 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17876 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17877 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17878 | local_pCreateInfo = nullptr; |
| 17879 | if (pCreateInfo) |
| 17880 | { |
| 17881 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 17882 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 17883 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17884 | if (local_pCreateInfo) |
| 17885 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17886 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17887 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17888 | countingStream->rewind(); |
| 17889 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17890 | uint64_t cgen_var_1168; |
| 17891 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1168, 1); |
| 17892 | countingStream->write((uint64_t*)&cgen_var_1168, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17893 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17894 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 17895 | } |
| 17896 | uint32_t packetSize_vkGetDescriptorSetLayoutSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17897 | countingStream->rewind(); |
| 17898 | uint32_t opcode_vkGetDescriptorSetLayoutSupportKHR = OP_vkGetDescriptorSetLayoutSupportKHR; |
| 17899 | stream->write(&opcode_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| 17900 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17901 | uint64_t cgen_var_1169; |
| 17902 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1169, 1); |
| 17903 | stream->write((uint64_t*)&cgen_var_1169, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17904 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17905 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17906 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17907 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17908 | if (pSupport) |
| 17909 | { |
| 17910 | transform_fromhost_VkDescriptorSetLayoutSupport(mImpl->resources(), (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 17911 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17912 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupportKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17913 | mImpl->log("finish vkGetDescriptorSetLayoutSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17914 | } |
| 17915 | |
| 17916 | #endif |
| 17917 | #ifdef VK_KHR_draw_indirect_count |
| 17918 | void VkEncoder::vkCmdDrawIndirectCountKHR( |
| 17919 | VkCommandBuffer commandBuffer, |
| 17920 | VkBuffer buffer, |
| 17921 | VkDeviceSize offset, |
| 17922 | VkBuffer countBuffer, |
| 17923 | VkDeviceSize countBufferOffset, |
| 17924 | uint32_t maxDrawCount, |
| 17925 | uint32_t stride) |
| 17926 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17927 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17928 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17929 | mImpl->log("start vkCmdDrawIndirectCountKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17930 | auto stream = mImpl->stream(); |
| 17931 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17932 | auto resources = mImpl->resources(); |
| 17933 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17934 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17935 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17936 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17937 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17938 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17939 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17940 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17941 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17942 | local_commandBuffer = commandBuffer; |
| 17943 | local_buffer = buffer; |
| 17944 | local_offset = offset; |
| 17945 | local_countBuffer = countBuffer; |
| 17946 | local_countBufferOffset = countBufferOffset; |
| 17947 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17948 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17949 | countingStream->rewind(); |
| 17950 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17951 | uint64_t cgen_var_1170; |
| 17952 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1170, 1); |
| 17953 | countingStream->write((uint64_t*)&cgen_var_1170, 1 * 8); |
| 17954 | uint64_t cgen_var_1171; |
| 17955 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1171, 1); |
| 17956 | countingStream->write((uint64_t*)&cgen_var_1171, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 17957 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17958 | uint64_t cgen_var_1172; |
| 17959 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1172, 1); |
| 17960 | countingStream->write((uint64_t*)&cgen_var_1172, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17961 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17962 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17963 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17964 | } |
| 17965 | uint32_t packetSize_vkCmdDrawIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17966 | countingStream->rewind(); |
| 17967 | uint32_t opcode_vkCmdDrawIndirectCountKHR = OP_vkCmdDrawIndirectCountKHR; |
| 17968 | stream->write(&opcode_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| 17969 | stream->write(&packetSize_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17970 | uint64_t cgen_var_1173; |
| 17971 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1173, 1); |
| 17972 | stream->write((uint64_t*)&cgen_var_1173, 1 * 8); |
| 17973 | uint64_t cgen_var_1174; |
| 17974 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1174, 1); |
| 17975 | stream->write((uint64_t*)&cgen_var_1174, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 17976 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17977 | uint64_t cgen_var_1175; |
| 17978 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1175, 1); |
| 17979 | stream->write((uint64_t*)&cgen_var_1175, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17980 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17981 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17982 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17983 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountKHR readParams"); |
| 17984 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17985 | mImpl->log("finish vkCmdDrawIndirectCountKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17986 | } |
| 17987 | |
| 17988 | void VkEncoder::vkCmdDrawIndexedIndirectCountKHR( |
| 17989 | VkCommandBuffer commandBuffer, |
| 17990 | VkBuffer buffer, |
| 17991 | VkDeviceSize offset, |
| 17992 | VkBuffer countBuffer, |
| 17993 | VkDeviceSize countBufferOffset, |
| 17994 | uint32_t maxDrawCount, |
| 17995 | uint32_t stride) |
| 17996 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17997 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17998 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17999 | mImpl->log("start vkCmdDrawIndexedIndirectCountKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18000 | auto stream = mImpl->stream(); |
| 18001 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18002 | auto resources = mImpl->resources(); |
| 18003 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18004 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18005 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18006 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18007 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18008 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18009 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18010 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18011 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18012 | local_commandBuffer = commandBuffer; |
| 18013 | local_buffer = buffer; |
| 18014 | local_offset = offset; |
| 18015 | local_countBuffer = countBuffer; |
| 18016 | local_countBufferOffset = countBufferOffset; |
| 18017 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18018 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18019 | countingStream->rewind(); |
| 18020 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18021 | uint64_t cgen_var_1176; |
| 18022 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1176, 1); |
| 18023 | countingStream->write((uint64_t*)&cgen_var_1176, 1 * 8); |
| 18024 | uint64_t cgen_var_1177; |
| 18025 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1177, 1); |
| 18026 | countingStream->write((uint64_t*)&cgen_var_1177, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 18027 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18028 | uint64_t cgen_var_1178; |
| 18029 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1178, 1); |
| 18030 | countingStream->write((uint64_t*)&cgen_var_1178, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18031 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18032 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18033 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18034 | } |
| 18035 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18036 | countingStream->rewind(); |
| 18037 | uint32_t opcode_vkCmdDrawIndexedIndirectCountKHR = OP_vkCmdDrawIndexedIndirectCountKHR; |
| 18038 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| 18039 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18040 | uint64_t cgen_var_1179; |
| 18041 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1179, 1); |
| 18042 | stream->write((uint64_t*)&cgen_var_1179, 1 * 8); |
| 18043 | uint64_t cgen_var_1180; |
| 18044 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1180, 1); |
| 18045 | stream->write((uint64_t*)&cgen_var_1180, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 18046 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18047 | uint64_t cgen_var_1181; |
| 18048 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1181, 1); |
| 18049 | stream->write((uint64_t*)&cgen_var_1181, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18050 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18051 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18052 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18053 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountKHR readParams"); |
| 18054 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18055 | mImpl->log("finish vkCmdDrawIndexedIndirectCountKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18056 | } |
| 18057 | |
| 18058 | #endif |
| 18059 | #ifdef VK_KHR_8bit_storage |
| 18060 | #endif |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18061 | #ifdef VK_ANDROID_native_buffer |
| 18062 | VkResult VkEncoder::vkGetSwapchainGrallocUsageANDROID( |
| 18063 | VkDevice device, |
| 18064 | VkFormat format, |
| 18065 | VkImageUsageFlags imageUsage, |
| 18066 | int* grallocUsage) |
| 18067 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18068 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18069 | AEMU_SCOPED_TRACE("vkGetSwapchainGrallocUsageANDROID encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18070 | mImpl->log("start vkGetSwapchainGrallocUsageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18071 | auto stream = mImpl->stream(); |
| 18072 | auto countingStream = mImpl->countingStream(); |
| 18073 | auto resources = mImpl->resources(); |
| 18074 | auto pool = mImpl->pool(); |
| 18075 | stream->setHandleMapping(resources->unwrapMapping()); |
| 18076 | VkDevice local_device; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18077 | VkFormat local_format; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18078 | VkImageUsageFlags local_imageUsage; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18079 | local_device = device; |
| 18080 | local_format = format; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18081 | local_imageUsage = imageUsage; |
| 18082 | countingStream->rewind(); |
| 18083 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18084 | uint64_t cgen_var_1182; |
| 18085 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1182, 1); |
| 18086 | countingStream->write((uint64_t*)&cgen_var_1182, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18087 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 18088 | countingStream->write((VkImageUsageFlags*)&local_imageUsage, sizeof(VkImageUsageFlags)); |
| 18089 | countingStream->write((int*)grallocUsage, sizeof(int)); |
| 18090 | } |
| 18091 | uint32_t packetSize_vkGetSwapchainGrallocUsageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18092 | countingStream->rewind(); |
| 18093 | uint32_t opcode_vkGetSwapchainGrallocUsageANDROID = OP_vkGetSwapchainGrallocUsageANDROID; |
| 18094 | stream->write(&opcode_vkGetSwapchainGrallocUsageANDROID, sizeof(uint32_t)); |
| 18095 | stream->write(&packetSize_vkGetSwapchainGrallocUsageANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18096 | uint64_t cgen_var_1183; |
| 18097 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1183, 1); |
| 18098 | stream->write((uint64_t*)&cgen_var_1183, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18099 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 18100 | stream->write((VkImageUsageFlags*)&local_imageUsage, sizeof(VkImageUsageFlags)); |
| 18101 | stream->write((int*)grallocUsage, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18102 | AEMU_SCOPED_TRACE("vkGetSwapchainGrallocUsageANDROID readParams"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18103 | stream->read((int*)grallocUsage, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18104 | AEMU_SCOPED_TRACE("vkGetSwapchainGrallocUsageANDROID returnUnmarshal"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18105 | VkResult vkGetSwapchainGrallocUsageANDROID_VkResult_return = (VkResult)0; |
| 18106 | stream->read(&vkGetSwapchainGrallocUsageANDROID_VkResult_return, sizeof(VkResult)); |
| 18107 | countingStream->clearPool(); |
| 18108 | stream->clearPool(); |
| 18109 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18110 | mImpl->log("finish vkGetSwapchainGrallocUsageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18111 | return vkGetSwapchainGrallocUsageANDROID_VkResult_return; |
| 18112 | } |
| 18113 | |
| 18114 | VkResult VkEncoder::vkAcquireImageANDROID( |
| 18115 | VkDevice device, |
| 18116 | VkImage image, |
| 18117 | int nativeFenceFd, |
| 18118 | VkSemaphore semaphore, |
| 18119 | VkFence fence) |
| 18120 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18121 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18122 | AEMU_SCOPED_TRACE("vkAcquireImageANDROID encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18123 | mImpl->log("start vkAcquireImageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18124 | auto stream = mImpl->stream(); |
| 18125 | auto countingStream = mImpl->countingStream(); |
| 18126 | auto resources = mImpl->resources(); |
| 18127 | auto pool = mImpl->pool(); |
| 18128 | stream->setHandleMapping(resources->unwrapMapping()); |
| 18129 | VkDevice local_device; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18130 | VkImage local_image; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18131 | int local_nativeFenceFd; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18132 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18133 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18134 | local_device = device; |
| 18135 | local_image = image; |
| 18136 | local_nativeFenceFd = nativeFenceFd; |
| 18137 | local_semaphore = semaphore; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18138 | local_fence = fence; |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 18139 | mImpl->resources()->unwrap_vkAcquireImageANDROID_nativeFenceFd(nativeFenceFd, &local_nativeFenceFd); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18140 | countingStream->rewind(); |
| 18141 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18142 | uint64_t cgen_var_1184; |
| 18143 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1184, 1); |
| 18144 | countingStream->write((uint64_t*)&cgen_var_1184, 1 * 8); |
| 18145 | uint64_t cgen_var_1185; |
| 18146 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1185, 1); |
| 18147 | countingStream->write((uint64_t*)&cgen_var_1185, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18148 | countingStream->write((int*)&local_nativeFenceFd, sizeof(int)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18149 | uint64_t cgen_var_1186; |
| 18150 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_1186, 1); |
| 18151 | countingStream->write((uint64_t*)&cgen_var_1186, 1 * 8); |
| 18152 | uint64_t cgen_var_1187; |
| 18153 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1187, 1); |
| 18154 | countingStream->write((uint64_t*)&cgen_var_1187, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18155 | } |
| 18156 | uint32_t packetSize_vkAcquireImageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18157 | countingStream->rewind(); |
| 18158 | uint32_t opcode_vkAcquireImageANDROID = OP_vkAcquireImageANDROID; |
| 18159 | stream->write(&opcode_vkAcquireImageANDROID, sizeof(uint32_t)); |
| 18160 | stream->write(&packetSize_vkAcquireImageANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18161 | uint64_t cgen_var_1188; |
| 18162 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1188, 1); |
| 18163 | stream->write((uint64_t*)&cgen_var_1188, 1 * 8); |
| 18164 | uint64_t cgen_var_1189; |
| 18165 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1189, 1); |
| 18166 | stream->write((uint64_t*)&cgen_var_1189, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18167 | stream->write((int*)&local_nativeFenceFd, sizeof(int)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18168 | uint64_t cgen_var_1190; |
| 18169 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_1190, 1); |
| 18170 | stream->write((uint64_t*)&cgen_var_1190, 1 * 8); |
| 18171 | uint64_t cgen_var_1191; |
| 18172 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1191, 1); |
| 18173 | stream->write((uint64_t*)&cgen_var_1191, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18174 | AEMU_SCOPED_TRACE("vkAcquireImageANDROID readParams"); |
| 18175 | AEMU_SCOPED_TRACE("vkAcquireImageANDROID returnUnmarshal"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18176 | VkResult vkAcquireImageANDROID_VkResult_return = (VkResult)0; |
| 18177 | stream->read(&vkAcquireImageANDROID_VkResult_return, sizeof(VkResult)); |
| 18178 | countingStream->clearPool(); |
| 18179 | stream->clearPool(); |
| 18180 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18181 | mImpl->log("finish vkAcquireImageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18182 | return vkAcquireImageANDROID_VkResult_return; |
| 18183 | } |
| 18184 | |
| 18185 | VkResult VkEncoder::vkQueueSignalReleaseImageANDROID( |
| 18186 | VkQueue queue, |
| 18187 | uint32_t waitSemaphoreCount, |
| 18188 | const VkSemaphore* pWaitSemaphores, |
| 18189 | VkImage image, |
| 18190 | int* pNativeFenceFd) |
| 18191 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18192 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18193 | AEMU_SCOPED_TRACE("vkQueueSignalReleaseImageANDROID encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18194 | mImpl->log("start vkQueueSignalReleaseImageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18195 | auto stream = mImpl->stream(); |
| 18196 | auto countingStream = mImpl->countingStream(); |
| 18197 | auto resources = mImpl->resources(); |
| 18198 | auto pool = mImpl->pool(); |
| 18199 | stream->setHandleMapping(resources->unwrapMapping()); |
| 18200 | VkQueue local_queue; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18201 | uint32_t local_waitSemaphoreCount; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18202 | VkSemaphore* local_pWaitSemaphores; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18203 | VkImage local_image; |
| 18204 | local_queue = queue; |
| 18205 | local_waitSemaphoreCount = waitSemaphoreCount; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18206 | local_pWaitSemaphores = nullptr; |
| 18207 | if (pWaitSemaphores) |
| 18208 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18209 | local_pWaitSemaphores = (VkSemaphore*)pool->dupArray(pWaitSemaphores, ((waitSemaphoreCount)) * sizeof(const VkSemaphore)); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18210 | } |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18211 | local_image = image; |
| 18212 | countingStream->rewind(); |
| 18213 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18214 | uint64_t cgen_var_1192; |
| 18215 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1192, 1); |
| 18216 | countingStream->write((uint64_t*)&cgen_var_1192, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18217 | countingStream->write((uint32_t*)&local_waitSemaphoreCount, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18218 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18219 | uint64_t cgen_var_1193 = (uint64_t)(uintptr_t)local_pWaitSemaphores; |
| 18220 | countingStream->putBe64(cgen_var_1193); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18221 | if (local_pWaitSemaphores) |
| 18222 | { |
| 18223 | if (((waitSemaphoreCount))) |
| 18224 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18225 | uint64_t* cgen_var_1194; |
| 18226 | countingStream->alloc((void**)&cgen_var_1194, ((waitSemaphoreCount)) * 8); |
| 18227 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(local_pWaitSemaphores, cgen_var_1194, ((waitSemaphoreCount))); |
| 18228 | countingStream->write((uint64_t*)cgen_var_1194, ((waitSemaphoreCount)) * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18229 | } |
| 18230 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18231 | uint64_t cgen_var_1195; |
| 18232 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1195, 1); |
| 18233 | countingStream->write((uint64_t*)&cgen_var_1195, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18234 | countingStream->write((int*)pNativeFenceFd, sizeof(int)); |
| 18235 | } |
| 18236 | uint32_t packetSize_vkQueueSignalReleaseImageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18237 | countingStream->rewind(); |
| 18238 | uint32_t opcode_vkQueueSignalReleaseImageANDROID = OP_vkQueueSignalReleaseImageANDROID; |
| 18239 | stream->write(&opcode_vkQueueSignalReleaseImageANDROID, sizeof(uint32_t)); |
| 18240 | stream->write(&packetSize_vkQueueSignalReleaseImageANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18241 | uint64_t cgen_var_1196; |
| 18242 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1196, 1); |
| 18243 | stream->write((uint64_t*)&cgen_var_1196, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18244 | stream->write((uint32_t*)&local_waitSemaphoreCount, sizeof(uint32_t)); |
| 18245 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18246 | uint64_t cgen_var_1197 = (uint64_t)(uintptr_t)local_pWaitSemaphores; |
| 18247 | stream->putBe64(cgen_var_1197); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18248 | if (local_pWaitSemaphores) |
| 18249 | { |
| 18250 | if (((waitSemaphoreCount))) |
| 18251 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18252 | uint64_t* cgen_var_1198; |
| 18253 | stream->alloc((void**)&cgen_var_1198, ((waitSemaphoreCount)) * 8); |
| 18254 | stream->handleMapping()->mapHandles_VkSemaphore_u64(local_pWaitSemaphores, cgen_var_1198, ((waitSemaphoreCount))); |
| 18255 | stream->write((uint64_t*)cgen_var_1198, ((waitSemaphoreCount)) * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18256 | } |
| 18257 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18258 | uint64_t cgen_var_1199; |
| 18259 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1199, 1); |
| 18260 | stream->write((uint64_t*)&cgen_var_1199, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18261 | stream->write((int*)pNativeFenceFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18262 | AEMU_SCOPED_TRACE("vkQueueSignalReleaseImageANDROID readParams"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18263 | stream->read((int*)pNativeFenceFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18264 | AEMU_SCOPED_TRACE("vkQueueSignalReleaseImageANDROID returnUnmarshal"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18265 | VkResult vkQueueSignalReleaseImageANDROID_VkResult_return = (VkResult)0; |
| 18266 | stream->read(&vkQueueSignalReleaseImageANDROID_VkResult_return, sizeof(VkResult)); |
| 18267 | countingStream->clearPool(); |
| 18268 | stream->clearPool(); |
| 18269 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18270 | mImpl->log("finish vkQueueSignalReleaseImageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18271 | return vkQueueSignalReleaseImageANDROID_VkResult_return; |
| 18272 | } |
| 18273 | |
| 18274 | #endif |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18275 | #ifdef VK_EXT_debug_report |
| 18276 | VkResult VkEncoder::vkCreateDebugReportCallbackEXT( |
| 18277 | VkInstance instance, |
| 18278 | const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, |
| 18279 | const VkAllocationCallbacks* pAllocator, |
| 18280 | VkDebugReportCallbackEXT* pCallback) |
| 18281 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18282 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18283 | AEMU_SCOPED_TRACE("vkCreateDebugReportCallbackEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18284 | mImpl->log("start vkCreateDebugReportCallbackEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18285 | auto stream = mImpl->stream(); |
| 18286 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18287 | auto resources = mImpl->resources(); |
| 18288 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18289 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18290 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18291 | VkDebugReportCallbackCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18292 | VkAllocationCallbacks* local_pAllocator; |
| 18293 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18294 | local_pCreateInfo = nullptr; |
| 18295 | if (pCreateInfo) |
| 18296 | { |
| 18297 | local_pCreateInfo = (VkDebugReportCallbackCreateInfoEXT*)pool->alloc(sizeof(const VkDebugReportCallbackCreateInfoEXT)); |
| 18298 | deepcopy_VkDebugReportCallbackCreateInfoEXT(pool, pCreateInfo, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| 18299 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18300 | local_pAllocator = nullptr; |
| 18301 | if (pAllocator) |
| 18302 | { |
| 18303 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18304 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18305 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18306 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18307 | if (local_pCreateInfo) |
| 18308 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18309 | transform_tohost_VkDebugReportCallbackCreateInfoEXT(mImpl->resources(), (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18310 | } |
| 18311 | if (local_pAllocator) |
| 18312 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18313 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18314 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18315 | countingStream->rewind(); |
| 18316 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18317 | uint64_t cgen_var_1200; |
| 18318 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1200, 1); |
| 18319 | countingStream->write((uint64_t*)&cgen_var_1200, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18320 | marshal_VkDebugReportCallbackCreateInfoEXT(countingStream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18321 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18322 | uint64_t cgen_var_1201 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18323 | countingStream->putBe64(cgen_var_1201); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18324 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18325 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18326 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18327 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18328 | uint64_t cgen_var_1202; |
| 18329 | countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1202, 1); |
| 18330 | countingStream->write((uint64_t*)&cgen_var_1202, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18331 | } |
| 18332 | uint32_t packetSize_vkCreateDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18333 | countingStream->rewind(); |
| 18334 | uint32_t opcode_vkCreateDebugReportCallbackEXT = OP_vkCreateDebugReportCallbackEXT; |
| 18335 | stream->write(&opcode_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| 18336 | stream->write(&packetSize_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18337 | uint64_t cgen_var_1203; |
| 18338 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1203, 1); |
| 18339 | stream->write((uint64_t*)&cgen_var_1203, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18340 | marshal_VkDebugReportCallbackCreateInfoEXT(stream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18341 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18342 | uint64_t cgen_var_1204 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18343 | stream->putBe64(cgen_var_1204); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18344 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18345 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18346 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18347 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18348 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18349 | uint64_t cgen_var_1205; |
| 18350 | stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1205, 1); |
| 18351 | stream->write((uint64_t*)&cgen_var_1205, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18352 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18353 | AEMU_SCOPED_TRACE("vkCreateDebugReportCallbackEXT readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18354 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18355 | uint64_t cgen_var_1206; |
| 18356 | stream->read((uint64_t*)&cgen_var_1206, 8); |
| 18357 | stream->handleMapping()->mapHandles_u64_VkDebugReportCallbackEXT(&cgen_var_1206, (VkDebugReportCallbackEXT*)pCallback, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18358 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18359 | AEMU_SCOPED_TRACE("vkCreateDebugReportCallbackEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18360 | VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0; |
| 18361 | stream->read(&vkCreateDebugReportCallbackEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18362 | countingStream->clearPool(); |
| 18363 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18364 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18365 | mImpl->log("finish vkCreateDebugReportCallbackEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18366 | return vkCreateDebugReportCallbackEXT_VkResult_return; |
| 18367 | } |
| 18368 | |
| 18369 | void VkEncoder::vkDestroyDebugReportCallbackEXT( |
| 18370 | VkInstance instance, |
| 18371 | VkDebugReportCallbackEXT callback, |
| 18372 | const VkAllocationCallbacks* pAllocator) |
| 18373 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18374 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18375 | AEMU_SCOPED_TRACE("vkDestroyDebugReportCallbackEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18376 | mImpl->log("start vkDestroyDebugReportCallbackEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18377 | auto stream = mImpl->stream(); |
| 18378 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18379 | auto resources = mImpl->resources(); |
| 18380 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18381 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18382 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18383 | VkDebugReportCallbackEXT local_callback; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18384 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18385 | local_instance = instance; |
| 18386 | local_callback = callback; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18387 | local_pAllocator = nullptr; |
| 18388 | if (pAllocator) |
| 18389 | { |
| 18390 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18391 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18392 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18393 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18394 | if (local_pAllocator) |
| 18395 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18396 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18397 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18398 | countingStream->rewind(); |
| 18399 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18400 | uint64_t cgen_var_1207; |
| 18401 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1207, 1); |
| 18402 | countingStream->write((uint64_t*)&cgen_var_1207, 1 * 8); |
| 18403 | uint64_t cgen_var_1208; |
| 18404 | countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1208, 1); |
| 18405 | countingStream->write((uint64_t*)&cgen_var_1208, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18406 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18407 | uint64_t cgen_var_1209 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18408 | countingStream->putBe64(cgen_var_1209); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18409 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18410 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18411 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18412 | } |
| 18413 | } |
| 18414 | uint32_t packetSize_vkDestroyDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18415 | countingStream->rewind(); |
| 18416 | uint32_t opcode_vkDestroyDebugReportCallbackEXT = OP_vkDestroyDebugReportCallbackEXT; |
| 18417 | stream->write(&opcode_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| 18418 | stream->write(&packetSize_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18419 | uint64_t cgen_var_1210; |
| 18420 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1210, 1); |
| 18421 | stream->write((uint64_t*)&cgen_var_1210, 1 * 8); |
| 18422 | uint64_t cgen_var_1211; |
| 18423 | stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1211, 1); |
| 18424 | stream->write((uint64_t*)&cgen_var_1211, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18425 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18426 | uint64_t cgen_var_1212 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18427 | stream->putBe64(cgen_var_1212); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18428 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18429 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18430 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18431 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18432 | AEMU_SCOPED_TRACE("vkDestroyDebugReportCallbackEXT readParams"); |
| 18433 | AEMU_SCOPED_TRACE("vkDestroyDebugReportCallbackEXT returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18434 | resources->destroyMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)&callback); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18435 | mImpl->log("finish vkDestroyDebugReportCallbackEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18436 | } |
| 18437 | |
| 18438 | void VkEncoder::vkDebugReportMessageEXT( |
| 18439 | VkInstance instance, |
| 18440 | VkDebugReportFlagsEXT flags, |
| 18441 | VkDebugReportObjectTypeEXT objectType, |
| 18442 | uint64_t object, |
| 18443 | size_t location, |
| 18444 | int32_t messageCode, |
| 18445 | const char* pLayerPrefix, |
| 18446 | const char* pMessage) |
| 18447 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18448 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18449 | AEMU_SCOPED_TRACE("vkDebugReportMessageEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18450 | mImpl->log("start vkDebugReportMessageEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18451 | auto stream = mImpl->stream(); |
| 18452 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18453 | auto resources = mImpl->resources(); |
| 18454 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18455 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18456 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18457 | VkDebugReportFlagsEXT local_flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18458 | VkDebugReportObjectTypeEXT local_objectType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18459 | uint64_t local_object; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18460 | size_t local_location; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18461 | int32_t local_messageCode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18462 | char* local_pLayerPrefix; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18463 | char* local_pMessage; |
| 18464 | local_instance = instance; |
| 18465 | local_flags = flags; |
| 18466 | local_objectType = objectType; |
| 18467 | local_object = object; |
| 18468 | local_location = location; |
| 18469 | local_messageCode = messageCode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18470 | local_pLayerPrefix = nullptr; |
| 18471 | if (pLayerPrefix) |
| 18472 | { |
| 18473 | local_pLayerPrefix = pool->strDup(pLayerPrefix); |
| 18474 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18475 | local_pMessage = nullptr; |
| 18476 | if (pMessage) |
| 18477 | { |
| 18478 | local_pMessage = pool->strDup(pMessage); |
| 18479 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18480 | countingStream->rewind(); |
| 18481 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18482 | uint64_t cgen_var_1213; |
| 18483 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1213, 1); |
| 18484 | countingStream->write((uint64_t*)&cgen_var_1213, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18485 | countingStream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 18486 | countingStream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 18487 | countingStream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18488 | uint64_t cgen_var_1214 = (uint64_t)local_location; |
| 18489 | countingStream->putBe64(cgen_var_1214); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18490 | countingStream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 18491 | countingStream->putString(local_pLayerPrefix); |
| 18492 | countingStream->putString(local_pMessage); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18493 | } |
| 18494 | uint32_t packetSize_vkDebugReportMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18495 | countingStream->rewind(); |
| 18496 | uint32_t opcode_vkDebugReportMessageEXT = OP_vkDebugReportMessageEXT; |
| 18497 | stream->write(&opcode_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| 18498 | stream->write(&packetSize_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18499 | uint64_t cgen_var_1215; |
| 18500 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1215, 1); |
| 18501 | stream->write((uint64_t*)&cgen_var_1215, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18502 | stream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 18503 | stream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 18504 | stream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18505 | uint64_t cgen_var_1216 = (uint64_t)local_location; |
| 18506 | stream->putBe64(cgen_var_1216); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18507 | stream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 18508 | stream->putString(local_pLayerPrefix); |
| 18509 | stream->putString(local_pMessage); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18510 | AEMU_SCOPED_TRACE("vkDebugReportMessageEXT readParams"); |
| 18511 | AEMU_SCOPED_TRACE("vkDebugReportMessageEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18512 | mImpl->log("finish vkDebugReportMessageEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18513 | } |
| 18514 | |
| 18515 | #endif |
| 18516 | #ifdef VK_NV_glsl_shader |
| 18517 | #endif |
| 18518 | #ifdef VK_EXT_depth_range_unrestricted |
| 18519 | #endif |
| 18520 | #ifdef VK_IMG_filter_cubic |
| 18521 | #endif |
| 18522 | #ifdef VK_AMD_rasterization_order |
| 18523 | #endif |
| 18524 | #ifdef VK_AMD_shader_trinary_minmax |
| 18525 | #endif |
| 18526 | #ifdef VK_AMD_shader_explicit_vertex_parameter |
| 18527 | #endif |
| 18528 | #ifdef VK_EXT_debug_marker |
| 18529 | VkResult VkEncoder::vkDebugMarkerSetObjectTagEXT( |
| 18530 | VkDevice device, |
| 18531 | const VkDebugMarkerObjectTagInfoEXT* pTagInfo) |
| 18532 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18533 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18534 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectTagEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18535 | mImpl->log("start vkDebugMarkerSetObjectTagEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18536 | auto stream = mImpl->stream(); |
| 18537 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18538 | auto resources = mImpl->resources(); |
| 18539 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18540 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18541 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18542 | VkDebugMarkerObjectTagInfoEXT* local_pTagInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18543 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18544 | local_pTagInfo = nullptr; |
| 18545 | if (pTagInfo) |
| 18546 | { |
| 18547 | local_pTagInfo = (VkDebugMarkerObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectTagInfoEXT)); |
| 18548 | deepcopy_VkDebugMarkerObjectTagInfoEXT(pool, pTagInfo, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| 18549 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18550 | if (local_pTagInfo) |
| 18551 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18552 | transform_tohost_VkDebugMarkerObjectTagInfoEXT(mImpl->resources(), (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18553 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18554 | countingStream->rewind(); |
| 18555 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18556 | uint64_t cgen_var_1217; |
| 18557 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1217, 1); |
| 18558 | countingStream->write((uint64_t*)&cgen_var_1217, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18559 | marshal_VkDebugMarkerObjectTagInfoEXT(countingStream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18560 | } |
| 18561 | uint32_t packetSize_vkDebugMarkerSetObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18562 | countingStream->rewind(); |
| 18563 | uint32_t opcode_vkDebugMarkerSetObjectTagEXT = OP_vkDebugMarkerSetObjectTagEXT; |
| 18564 | stream->write(&opcode_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| 18565 | stream->write(&packetSize_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18566 | uint64_t cgen_var_1218; |
| 18567 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1218, 1); |
| 18568 | stream->write((uint64_t*)&cgen_var_1218, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18569 | marshal_VkDebugMarkerObjectTagInfoEXT(stream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18570 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectTagEXT readParams"); |
| 18571 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectTagEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18572 | VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0; |
| 18573 | stream->read(&vkDebugMarkerSetObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18574 | countingStream->clearPool(); |
| 18575 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18576 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18577 | mImpl->log("finish vkDebugMarkerSetObjectTagEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18578 | return vkDebugMarkerSetObjectTagEXT_VkResult_return; |
| 18579 | } |
| 18580 | |
| 18581 | VkResult VkEncoder::vkDebugMarkerSetObjectNameEXT( |
| 18582 | VkDevice device, |
| 18583 | const VkDebugMarkerObjectNameInfoEXT* pNameInfo) |
| 18584 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18585 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18586 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectNameEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18587 | mImpl->log("start vkDebugMarkerSetObjectNameEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18588 | auto stream = mImpl->stream(); |
| 18589 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18590 | auto resources = mImpl->resources(); |
| 18591 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18592 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18593 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18594 | VkDebugMarkerObjectNameInfoEXT* local_pNameInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18595 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18596 | local_pNameInfo = nullptr; |
| 18597 | if (pNameInfo) |
| 18598 | { |
| 18599 | local_pNameInfo = (VkDebugMarkerObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectNameInfoEXT)); |
| 18600 | deepcopy_VkDebugMarkerObjectNameInfoEXT(pool, pNameInfo, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| 18601 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18602 | if (local_pNameInfo) |
| 18603 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18604 | transform_tohost_VkDebugMarkerObjectNameInfoEXT(mImpl->resources(), (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18605 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18606 | countingStream->rewind(); |
| 18607 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18608 | uint64_t cgen_var_1219; |
| 18609 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1219, 1); |
| 18610 | countingStream->write((uint64_t*)&cgen_var_1219, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18611 | marshal_VkDebugMarkerObjectNameInfoEXT(countingStream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18612 | } |
| 18613 | uint32_t packetSize_vkDebugMarkerSetObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18614 | countingStream->rewind(); |
| 18615 | uint32_t opcode_vkDebugMarkerSetObjectNameEXT = OP_vkDebugMarkerSetObjectNameEXT; |
| 18616 | stream->write(&opcode_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| 18617 | stream->write(&packetSize_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18618 | uint64_t cgen_var_1220; |
| 18619 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1220, 1); |
| 18620 | stream->write((uint64_t*)&cgen_var_1220, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18621 | marshal_VkDebugMarkerObjectNameInfoEXT(stream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18622 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectNameEXT readParams"); |
| 18623 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectNameEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18624 | VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0; |
| 18625 | stream->read(&vkDebugMarkerSetObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18626 | countingStream->clearPool(); |
| 18627 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18628 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18629 | mImpl->log("finish vkDebugMarkerSetObjectNameEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18630 | return vkDebugMarkerSetObjectNameEXT_VkResult_return; |
| 18631 | } |
| 18632 | |
| 18633 | void VkEncoder::vkCmdDebugMarkerBeginEXT( |
| 18634 | VkCommandBuffer commandBuffer, |
| 18635 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 18636 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18637 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18638 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerBeginEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18639 | mImpl->log("start vkCmdDebugMarkerBeginEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18640 | auto stream = mImpl->stream(); |
| 18641 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18642 | auto resources = mImpl->resources(); |
| 18643 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18644 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18645 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18646 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18647 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18648 | local_pMarkerInfo = nullptr; |
| 18649 | if (pMarkerInfo) |
| 18650 | { |
| 18651 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 18652 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 18653 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18654 | if (local_pMarkerInfo) |
| 18655 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18656 | transform_tohost_VkDebugMarkerMarkerInfoEXT(mImpl->resources(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18657 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18658 | countingStream->rewind(); |
| 18659 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18660 | uint64_t cgen_var_1221; |
| 18661 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1221, 1); |
| 18662 | countingStream->write((uint64_t*)&cgen_var_1221, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18663 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18664 | } |
| 18665 | uint32_t packetSize_vkCmdDebugMarkerBeginEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18666 | countingStream->rewind(); |
| 18667 | uint32_t opcode_vkCmdDebugMarkerBeginEXT = OP_vkCmdDebugMarkerBeginEXT; |
| 18668 | stream->write(&opcode_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| 18669 | stream->write(&packetSize_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18670 | uint64_t cgen_var_1222; |
| 18671 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1222, 1); |
| 18672 | stream->write((uint64_t*)&cgen_var_1222, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18673 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18674 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerBeginEXT readParams"); |
| 18675 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerBeginEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18676 | mImpl->log("finish vkCmdDebugMarkerBeginEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18677 | } |
| 18678 | |
| 18679 | void VkEncoder::vkCmdDebugMarkerEndEXT( |
| 18680 | VkCommandBuffer commandBuffer) |
| 18681 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18682 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18683 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerEndEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18684 | mImpl->log("start vkCmdDebugMarkerEndEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18685 | auto stream = mImpl->stream(); |
| 18686 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18687 | auto resources = mImpl->resources(); |
| 18688 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18689 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18690 | VkCommandBuffer local_commandBuffer; |
| 18691 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18692 | countingStream->rewind(); |
| 18693 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18694 | uint64_t cgen_var_1223; |
| 18695 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1223, 1); |
| 18696 | countingStream->write((uint64_t*)&cgen_var_1223, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18697 | } |
| 18698 | uint32_t packetSize_vkCmdDebugMarkerEndEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18699 | countingStream->rewind(); |
| 18700 | uint32_t opcode_vkCmdDebugMarkerEndEXT = OP_vkCmdDebugMarkerEndEXT; |
| 18701 | stream->write(&opcode_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| 18702 | stream->write(&packetSize_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18703 | uint64_t cgen_var_1224; |
| 18704 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1224, 1); |
| 18705 | stream->write((uint64_t*)&cgen_var_1224, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18706 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerEndEXT readParams"); |
| 18707 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerEndEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18708 | mImpl->log("finish vkCmdDebugMarkerEndEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18709 | } |
| 18710 | |
| 18711 | void VkEncoder::vkCmdDebugMarkerInsertEXT( |
| 18712 | VkCommandBuffer commandBuffer, |
| 18713 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 18714 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18715 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18716 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerInsertEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18717 | mImpl->log("start vkCmdDebugMarkerInsertEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18718 | auto stream = mImpl->stream(); |
| 18719 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18720 | auto resources = mImpl->resources(); |
| 18721 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18722 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18723 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18724 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18725 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18726 | local_pMarkerInfo = nullptr; |
| 18727 | if (pMarkerInfo) |
| 18728 | { |
| 18729 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 18730 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 18731 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18732 | if (local_pMarkerInfo) |
| 18733 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18734 | transform_tohost_VkDebugMarkerMarkerInfoEXT(mImpl->resources(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18735 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18736 | countingStream->rewind(); |
| 18737 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18738 | uint64_t cgen_var_1225; |
| 18739 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1225, 1); |
| 18740 | countingStream->write((uint64_t*)&cgen_var_1225, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18741 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18742 | } |
| 18743 | uint32_t packetSize_vkCmdDebugMarkerInsertEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18744 | countingStream->rewind(); |
| 18745 | uint32_t opcode_vkCmdDebugMarkerInsertEXT = OP_vkCmdDebugMarkerInsertEXT; |
| 18746 | stream->write(&opcode_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| 18747 | stream->write(&packetSize_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18748 | uint64_t cgen_var_1226; |
| 18749 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1226, 1); |
| 18750 | stream->write((uint64_t*)&cgen_var_1226, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18751 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18752 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerInsertEXT readParams"); |
| 18753 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerInsertEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18754 | mImpl->log("finish vkCmdDebugMarkerInsertEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18755 | } |
| 18756 | |
| 18757 | #endif |
| 18758 | #ifdef VK_AMD_gcn_shader |
| 18759 | #endif |
| 18760 | #ifdef VK_NV_dedicated_allocation |
| 18761 | #endif |
| 18762 | #ifdef VK_AMD_draw_indirect_count |
| 18763 | void VkEncoder::vkCmdDrawIndirectCountAMD( |
| 18764 | VkCommandBuffer commandBuffer, |
| 18765 | VkBuffer buffer, |
| 18766 | VkDeviceSize offset, |
| 18767 | VkBuffer countBuffer, |
| 18768 | VkDeviceSize countBufferOffset, |
| 18769 | uint32_t maxDrawCount, |
| 18770 | uint32_t stride) |
| 18771 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18772 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18773 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountAMD encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18774 | mImpl->log("start vkCmdDrawIndirectCountAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18775 | auto stream = mImpl->stream(); |
| 18776 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18777 | auto resources = mImpl->resources(); |
| 18778 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18779 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18780 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18781 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18782 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18783 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18784 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18785 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18786 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18787 | local_commandBuffer = commandBuffer; |
| 18788 | local_buffer = buffer; |
| 18789 | local_offset = offset; |
| 18790 | local_countBuffer = countBuffer; |
| 18791 | local_countBufferOffset = countBufferOffset; |
| 18792 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18793 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18794 | countingStream->rewind(); |
| 18795 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18796 | uint64_t cgen_var_1227; |
| 18797 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1227, 1); |
| 18798 | countingStream->write((uint64_t*)&cgen_var_1227, 1 * 8); |
| 18799 | uint64_t cgen_var_1228; |
| 18800 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1228, 1); |
| 18801 | countingStream->write((uint64_t*)&cgen_var_1228, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18802 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18803 | uint64_t cgen_var_1229; |
| 18804 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1229, 1); |
| 18805 | countingStream->write((uint64_t*)&cgen_var_1229, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18806 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18807 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18808 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18809 | } |
| 18810 | uint32_t packetSize_vkCmdDrawIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18811 | countingStream->rewind(); |
| 18812 | uint32_t opcode_vkCmdDrawIndirectCountAMD = OP_vkCmdDrawIndirectCountAMD; |
| 18813 | stream->write(&opcode_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| 18814 | stream->write(&packetSize_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18815 | uint64_t cgen_var_1230; |
| 18816 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1230, 1); |
| 18817 | stream->write((uint64_t*)&cgen_var_1230, 1 * 8); |
| 18818 | uint64_t cgen_var_1231; |
| 18819 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1231, 1); |
| 18820 | stream->write((uint64_t*)&cgen_var_1231, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18821 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18822 | uint64_t cgen_var_1232; |
| 18823 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1232, 1); |
| 18824 | stream->write((uint64_t*)&cgen_var_1232, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18825 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18826 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18827 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18828 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountAMD readParams"); |
| 18829 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountAMD returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18830 | mImpl->log("finish vkCmdDrawIndirectCountAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18831 | } |
| 18832 | |
| 18833 | void VkEncoder::vkCmdDrawIndexedIndirectCountAMD( |
| 18834 | VkCommandBuffer commandBuffer, |
| 18835 | VkBuffer buffer, |
| 18836 | VkDeviceSize offset, |
| 18837 | VkBuffer countBuffer, |
| 18838 | VkDeviceSize countBufferOffset, |
| 18839 | uint32_t maxDrawCount, |
| 18840 | uint32_t stride) |
| 18841 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18842 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18843 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountAMD encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18844 | mImpl->log("start vkCmdDrawIndexedIndirectCountAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18845 | auto stream = mImpl->stream(); |
| 18846 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18847 | auto resources = mImpl->resources(); |
| 18848 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18849 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18850 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18851 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18852 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18853 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18854 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18855 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18856 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18857 | local_commandBuffer = commandBuffer; |
| 18858 | local_buffer = buffer; |
| 18859 | local_offset = offset; |
| 18860 | local_countBuffer = countBuffer; |
| 18861 | local_countBufferOffset = countBufferOffset; |
| 18862 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18863 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18864 | countingStream->rewind(); |
| 18865 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18866 | uint64_t cgen_var_1233; |
| 18867 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1233, 1); |
| 18868 | countingStream->write((uint64_t*)&cgen_var_1233, 1 * 8); |
| 18869 | uint64_t cgen_var_1234; |
| 18870 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1234, 1); |
| 18871 | countingStream->write((uint64_t*)&cgen_var_1234, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18872 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18873 | uint64_t cgen_var_1235; |
| 18874 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1235, 1); |
| 18875 | countingStream->write((uint64_t*)&cgen_var_1235, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18876 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18877 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18878 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18879 | } |
| 18880 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18881 | countingStream->rewind(); |
| 18882 | uint32_t opcode_vkCmdDrawIndexedIndirectCountAMD = OP_vkCmdDrawIndexedIndirectCountAMD; |
| 18883 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| 18884 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18885 | uint64_t cgen_var_1236; |
| 18886 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1236, 1); |
| 18887 | stream->write((uint64_t*)&cgen_var_1236, 1 * 8); |
| 18888 | uint64_t cgen_var_1237; |
| 18889 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1237, 1); |
| 18890 | stream->write((uint64_t*)&cgen_var_1237, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18891 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18892 | uint64_t cgen_var_1238; |
| 18893 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1238, 1); |
| 18894 | stream->write((uint64_t*)&cgen_var_1238, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18895 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18896 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18897 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18898 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountAMD readParams"); |
| 18899 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountAMD returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18900 | mImpl->log("finish vkCmdDrawIndexedIndirectCountAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18901 | } |
| 18902 | |
| 18903 | #endif |
| 18904 | #ifdef VK_AMD_negative_viewport_height |
| 18905 | #endif |
| 18906 | #ifdef VK_AMD_gpu_shader_half_float |
| 18907 | #endif |
| 18908 | #ifdef VK_AMD_shader_ballot |
| 18909 | #endif |
| 18910 | #ifdef VK_AMD_texture_gather_bias_lod |
| 18911 | #endif |
| 18912 | #ifdef VK_AMD_shader_info |
| 18913 | VkResult VkEncoder::vkGetShaderInfoAMD( |
| 18914 | VkDevice device, |
| 18915 | VkPipeline pipeline, |
| 18916 | VkShaderStageFlagBits shaderStage, |
| 18917 | VkShaderInfoTypeAMD infoType, |
| 18918 | size_t* pInfoSize, |
| 18919 | void* pInfo) |
| 18920 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18921 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18922 | AEMU_SCOPED_TRACE("vkGetShaderInfoAMD encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18923 | mImpl->log("start vkGetShaderInfoAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18924 | auto stream = mImpl->stream(); |
| 18925 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18926 | auto resources = mImpl->resources(); |
| 18927 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18928 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18929 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18930 | VkPipeline local_pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18931 | VkShaderStageFlagBits local_shaderStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18932 | VkShaderInfoTypeAMD local_infoType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18933 | local_device = device; |
| 18934 | local_pipeline = pipeline; |
| 18935 | local_shaderStage = shaderStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18936 | local_infoType = infoType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18937 | countingStream->rewind(); |
| 18938 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18939 | uint64_t cgen_var_1239; |
| 18940 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1239, 1); |
| 18941 | countingStream->write((uint64_t*)&cgen_var_1239, 1 * 8); |
| 18942 | uint64_t cgen_var_1240; |
| 18943 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1240, 1); |
| 18944 | countingStream->write((uint64_t*)&cgen_var_1240, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18945 | countingStream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 18946 | countingStream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18947 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18948 | uint64_t cgen_var_1241 = (uint64_t)(uintptr_t)pInfoSize; |
| 18949 | countingStream->putBe64(cgen_var_1241); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18950 | if (pInfoSize) |
| 18951 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18952 | uint64_t cgen_var_1242 = (uint64_t)(*pInfoSize); |
| 18953 | countingStream->putBe64(cgen_var_1242); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18954 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18955 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18956 | uint64_t cgen_var_1243 = (uint64_t)(uintptr_t)pInfo; |
| 18957 | countingStream->putBe64(cgen_var_1243); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18958 | if (pInfo) |
| 18959 | { |
| 18960 | countingStream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 18961 | } |
| 18962 | } |
| 18963 | uint32_t packetSize_vkGetShaderInfoAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18964 | countingStream->rewind(); |
| 18965 | uint32_t opcode_vkGetShaderInfoAMD = OP_vkGetShaderInfoAMD; |
| 18966 | stream->write(&opcode_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| 18967 | stream->write(&packetSize_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18968 | uint64_t cgen_var_1244; |
| 18969 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1244, 1); |
| 18970 | stream->write((uint64_t*)&cgen_var_1244, 1 * 8); |
| 18971 | uint64_t cgen_var_1245; |
| 18972 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1245, 1); |
| 18973 | stream->write((uint64_t*)&cgen_var_1245, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18974 | stream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 18975 | stream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18976 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18977 | uint64_t cgen_var_1246 = (uint64_t)(uintptr_t)pInfoSize; |
| 18978 | stream->putBe64(cgen_var_1246); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18979 | if (pInfoSize) |
| 18980 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18981 | uint64_t cgen_var_1247 = (uint64_t)(*pInfoSize); |
| 18982 | stream->putBe64(cgen_var_1247); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18983 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18984 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18985 | uint64_t cgen_var_1248 = (uint64_t)(uintptr_t)pInfo; |
| 18986 | stream->putBe64(cgen_var_1248); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18987 | if (pInfo) |
| 18988 | { |
| 18989 | stream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 18990 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18991 | AEMU_SCOPED_TRACE("vkGetShaderInfoAMD readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18992 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18993 | size_t* check_pInfoSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18994 | check_pInfoSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18995 | if (pInfoSize) |
| 18996 | { |
| 18997 | if (!(check_pInfoSize)) |
| 18998 | { |
| 18999 | fprintf(stderr, "fatal: pInfoSize inconsistent between guest and host\n"); |
| 19000 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 19001 | (*pInfoSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19002 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19003 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19004 | void* check_pInfo; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19005 | check_pInfo = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19006 | if (pInfo) |
| 19007 | { |
| 19008 | if (!(check_pInfo)) |
| 19009 | { |
| 19010 | fprintf(stderr, "fatal: pInfo inconsistent between guest and host\n"); |
| 19011 | } |
| 19012 | stream->read((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 19013 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19014 | AEMU_SCOPED_TRACE("vkGetShaderInfoAMD returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19015 | VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0; |
| 19016 | stream->read(&vkGetShaderInfoAMD_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19017 | countingStream->clearPool(); |
| 19018 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19019 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19020 | mImpl->log("finish vkGetShaderInfoAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19021 | return vkGetShaderInfoAMD_VkResult_return; |
| 19022 | } |
| 19023 | |
| 19024 | #endif |
| 19025 | #ifdef VK_AMD_shader_image_load_store_lod |
| 19026 | #endif |
| 19027 | #ifdef VK_IMG_format_pvrtc |
| 19028 | #endif |
| 19029 | #ifdef VK_NV_external_memory_capabilities |
| 19030 | VkResult VkEncoder::vkGetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 19031 | VkPhysicalDevice physicalDevice, |
| 19032 | VkFormat format, |
| 19033 | VkImageType type, |
| 19034 | VkImageTiling tiling, |
| 19035 | VkImageUsageFlags usage, |
| 19036 | VkImageCreateFlags flags, |
| 19037 | VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 19038 | VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) |
| 19039 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19040 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19041 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalImageFormatPropertiesNV encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19042 | mImpl->log("start vkGetPhysicalDeviceExternalImageFormatPropertiesNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19043 | auto stream = mImpl->stream(); |
| 19044 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19045 | auto resources = mImpl->resources(); |
| 19046 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19047 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19048 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19049 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19050 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19051 | VkImageTiling local_tiling; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19052 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19053 | VkImageCreateFlags local_flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19054 | VkExternalMemoryHandleTypeFlagsNV local_externalHandleType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19055 | local_physicalDevice = physicalDevice; |
| 19056 | local_format = format; |
| 19057 | local_type = type; |
| 19058 | local_tiling = tiling; |
| 19059 | local_usage = usage; |
| 19060 | local_flags = flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19061 | local_externalHandleType = externalHandleType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19062 | countingStream->rewind(); |
| 19063 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19064 | uint64_t cgen_var_1252; |
| 19065 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1252, 1); |
| 19066 | countingStream->write((uint64_t*)&cgen_var_1252, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19067 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 19068 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 19069 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 19070 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 19071 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 19072 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19073 | marshal_VkExternalImageFormatPropertiesNV(countingStream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 19074 | } |
| 19075 | uint32_t packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19076 | countingStream->rewind(); |
| 19077 | uint32_t opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV; |
| 19078 | stream->write(&opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| 19079 | stream->write(&packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19080 | uint64_t cgen_var_1253; |
| 19081 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1253, 1); |
| 19082 | stream->write((uint64_t*)&cgen_var_1253, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19083 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 19084 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 19085 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 19086 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 19087 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 19088 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19089 | marshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19090 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalImageFormatPropertiesNV readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19091 | unmarshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19092 | if (pExternalImageFormatProperties) |
| 19093 | { |
| 19094 | transform_fromhost_VkExternalImageFormatPropertiesNV(mImpl->resources(), (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 19095 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19096 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalImageFormatPropertiesNV returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19097 | VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0; |
| 19098 | stream->read(&vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19099 | countingStream->clearPool(); |
| 19100 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19101 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19102 | mImpl->log("finish vkGetPhysicalDeviceExternalImageFormatPropertiesNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19103 | return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return; |
| 19104 | } |
| 19105 | |
| 19106 | #endif |
| 19107 | #ifdef VK_NV_external_memory |
| 19108 | #endif |
| 19109 | #ifdef VK_NV_external_memory_win32 |
| 19110 | VkResult VkEncoder::vkGetMemoryWin32HandleNV( |
| 19111 | VkDevice device, |
| 19112 | VkDeviceMemory memory, |
| 19113 | VkExternalMemoryHandleTypeFlagsNV handleType, |
| 19114 | HANDLE* pHandle) |
| 19115 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19116 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19117 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleNV encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19118 | mImpl->log("start vkGetMemoryWin32HandleNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19119 | auto stream = mImpl->stream(); |
| 19120 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19121 | auto resources = mImpl->resources(); |
| 19122 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19123 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19124 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19125 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19126 | VkExternalMemoryHandleTypeFlagsNV local_handleType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19127 | local_device = device; |
| 19128 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19129 | local_handleType = handleType; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 19130 | mImpl->resources()->deviceMemoryTransform_tohost((VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19131 | countingStream->rewind(); |
| 19132 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19133 | uint64_t cgen_var_1254; |
| 19134 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1254, 1); |
| 19135 | countingStream->write((uint64_t*)&cgen_var_1254, 1 * 8); |
| 19136 | uint64_t cgen_var_1255; |
| 19137 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1255, 1); |
| 19138 | countingStream->write((uint64_t*)&cgen_var_1255, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19139 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19140 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 19141 | } |
| 19142 | uint32_t packetSize_vkGetMemoryWin32HandleNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19143 | countingStream->rewind(); |
| 19144 | uint32_t opcode_vkGetMemoryWin32HandleNV = OP_vkGetMemoryWin32HandleNV; |
| 19145 | stream->write(&opcode_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| 19146 | stream->write(&packetSize_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19147 | uint64_t cgen_var_1256; |
| 19148 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1256, 1); |
| 19149 | stream->write((uint64_t*)&cgen_var_1256, 1 * 8); |
| 19150 | uint64_t cgen_var_1257; |
| 19151 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1257, 1); |
| 19152 | stream->write((uint64_t*)&cgen_var_1257, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19153 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19154 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19155 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleNV readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19156 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19157 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleNV returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19158 | VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0; |
| 19159 | stream->read(&vkGetMemoryWin32HandleNV_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19160 | countingStream->clearPool(); |
| 19161 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19162 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19163 | mImpl->log("finish vkGetMemoryWin32HandleNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19164 | return vkGetMemoryWin32HandleNV_VkResult_return; |
| 19165 | } |
| 19166 | |
| 19167 | #endif |
| 19168 | #ifdef VK_NV_win32_keyed_mutex |
| 19169 | #endif |
| 19170 | #ifdef VK_EXT_validation_flags |
| 19171 | #endif |
| 19172 | #ifdef VK_NN_vi_surface |
| 19173 | VkResult VkEncoder::vkCreateViSurfaceNN( |
| 19174 | VkInstance instance, |
| 19175 | const VkViSurfaceCreateInfoNN* pCreateInfo, |
| 19176 | const VkAllocationCallbacks* pAllocator, |
| 19177 | VkSurfaceKHR* pSurface) |
| 19178 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19179 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19180 | AEMU_SCOPED_TRACE("vkCreateViSurfaceNN encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19181 | mImpl->log("start vkCreateViSurfaceNN"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19182 | auto stream = mImpl->stream(); |
| 19183 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19184 | auto resources = mImpl->resources(); |
| 19185 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19186 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19187 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19188 | VkViSurfaceCreateInfoNN* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19189 | VkAllocationCallbacks* local_pAllocator; |
| 19190 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19191 | local_pCreateInfo = nullptr; |
| 19192 | if (pCreateInfo) |
| 19193 | { |
| 19194 | local_pCreateInfo = (VkViSurfaceCreateInfoNN*)pool->alloc(sizeof(const VkViSurfaceCreateInfoNN)); |
| 19195 | deepcopy_VkViSurfaceCreateInfoNN(pool, pCreateInfo, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| 19196 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19197 | local_pAllocator = nullptr; |
| 19198 | if (pAllocator) |
| 19199 | { |
| 19200 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19201 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19202 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19203 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19204 | if (local_pCreateInfo) |
| 19205 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19206 | transform_tohost_VkViSurfaceCreateInfoNN(mImpl->resources(), (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19207 | } |
| 19208 | if (local_pAllocator) |
| 19209 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19210 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19211 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19212 | countingStream->rewind(); |
| 19213 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19214 | uint64_t cgen_var_1258; |
| 19215 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1258, 1); |
| 19216 | countingStream->write((uint64_t*)&cgen_var_1258, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19217 | marshal_VkViSurfaceCreateInfoNN(countingStream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19218 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19219 | uint64_t cgen_var_1259 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19220 | countingStream->putBe64(cgen_var_1259); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19221 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19222 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19223 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19224 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19225 | uint64_t cgen_var_1260; |
| 19226 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1260, 1); |
| 19227 | countingStream->write((uint64_t*)&cgen_var_1260, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19228 | } |
| 19229 | uint32_t packetSize_vkCreateViSurfaceNN = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19230 | countingStream->rewind(); |
| 19231 | uint32_t opcode_vkCreateViSurfaceNN = OP_vkCreateViSurfaceNN; |
| 19232 | stream->write(&opcode_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| 19233 | stream->write(&packetSize_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19234 | uint64_t cgen_var_1261; |
| 19235 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1261, 1); |
| 19236 | stream->write((uint64_t*)&cgen_var_1261, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19237 | marshal_VkViSurfaceCreateInfoNN(stream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19238 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19239 | uint64_t cgen_var_1262 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19240 | stream->putBe64(cgen_var_1262); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19241 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19242 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19243 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19244 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19245 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19246 | uint64_t cgen_var_1263; |
| 19247 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1263, 1); |
| 19248 | stream->write((uint64_t*)&cgen_var_1263, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19249 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19250 | AEMU_SCOPED_TRACE("vkCreateViSurfaceNN readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19251 | uint64_t cgen_var_1264; |
| 19252 | stream->read((uint64_t*)&cgen_var_1264, 8); |
| 19253 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1264, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19254 | AEMU_SCOPED_TRACE("vkCreateViSurfaceNN returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19255 | VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0; |
| 19256 | stream->read(&vkCreateViSurfaceNN_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19257 | countingStream->clearPool(); |
| 19258 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19259 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19260 | mImpl->log("finish vkCreateViSurfaceNN");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19261 | return vkCreateViSurfaceNN_VkResult_return; |
| 19262 | } |
| 19263 | |
| 19264 | #endif |
| 19265 | #ifdef VK_EXT_shader_subgroup_ballot |
| 19266 | #endif |
| 19267 | #ifdef VK_EXT_shader_subgroup_vote |
| 19268 | #endif |
| 19269 | #ifdef VK_EXT_conditional_rendering |
| 19270 | void VkEncoder::vkCmdBeginConditionalRenderingEXT( |
| 19271 | VkCommandBuffer commandBuffer, |
| 19272 | const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) |
| 19273 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19274 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19275 | AEMU_SCOPED_TRACE("vkCmdBeginConditionalRenderingEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19276 | mImpl->log("start vkCmdBeginConditionalRenderingEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19277 | auto stream = mImpl->stream(); |
| 19278 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19279 | auto resources = mImpl->resources(); |
| 19280 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19281 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19282 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19283 | VkConditionalRenderingBeginInfoEXT* local_pConditionalRenderingBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19284 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19285 | local_pConditionalRenderingBegin = nullptr; |
| 19286 | if (pConditionalRenderingBegin) |
| 19287 | { |
| 19288 | local_pConditionalRenderingBegin = (VkConditionalRenderingBeginInfoEXT*)pool->alloc(sizeof(const VkConditionalRenderingBeginInfoEXT)); |
| 19289 | deepcopy_VkConditionalRenderingBeginInfoEXT(pool, pConditionalRenderingBegin, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| 19290 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19291 | if (local_pConditionalRenderingBegin) |
| 19292 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19293 | transform_tohost_VkConditionalRenderingBeginInfoEXT(mImpl->resources(), (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19294 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19295 | countingStream->rewind(); |
| 19296 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19297 | uint64_t cgen_var_1265; |
| 19298 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1265, 1); |
| 19299 | countingStream->write((uint64_t*)&cgen_var_1265, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19300 | marshal_VkConditionalRenderingBeginInfoEXT(countingStream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19301 | } |
| 19302 | uint32_t packetSize_vkCmdBeginConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19303 | countingStream->rewind(); |
| 19304 | uint32_t opcode_vkCmdBeginConditionalRenderingEXT = OP_vkCmdBeginConditionalRenderingEXT; |
| 19305 | stream->write(&opcode_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| 19306 | stream->write(&packetSize_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19307 | uint64_t cgen_var_1266; |
| 19308 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1266, 1); |
| 19309 | stream->write((uint64_t*)&cgen_var_1266, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19310 | marshal_VkConditionalRenderingBeginInfoEXT(stream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19311 | AEMU_SCOPED_TRACE("vkCmdBeginConditionalRenderingEXT readParams"); |
| 19312 | AEMU_SCOPED_TRACE("vkCmdBeginConditionalRenderingEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19313 | mImpl->log("finish vkCmdBeginConditionalRenderingEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19314 | } |
| 19315 | |
| 19316 | void VkEncoder::vkCmdEndConditionalRenderingEXT( |
| 19317 | VkCommandBuffer commandBuffer) |
| 19318 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19319 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19320 | AEMU_SCOPED_TRACE("vkCmdEndConditionalRenderingEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19321 | mImpl->log("start vkCmdEndConditionalRenderingEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19322 | auto stream = mImpl->stream(); |
| 19323 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19324 | auto resources = mImpl->resources(); |
| 19325 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19326 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19327 | VkCommandBuffer local_commandBuffer; |
| 19328 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19329 | countingStream->rewind(); |
| 19330 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19331 | uint64_t cgen_var_1267; |
| 19332 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1267, 1); |
| 19333 | countingStream->write((uint64_t*)&cgen_var_1267, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19334 | } |
| 19335 | uint32_t packetSize_vkCmdEndConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19336 | countingStream->rewind(); |
| 19337 | uint32_t opcode_vkCmdEndConditionalRenderingEXT = OP_vkCmdEndConditionalRenderingEXT; |
| 19338 | stream->write(&opcode_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| 19339 | stream->write(&packetSize_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19340 | uint64_t cgen_var_1268; |
| 19341 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1268, 1); |
| 19342 | stream->write((uint64_t*)&cgen_var_1268, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19343 | AEMU_SCOPED_TRACE("vkCmdEndConditionalRenderingEXT readParams"); |
| 19344 | AEMU_SCOPED_TRACE("vkCmdEndConditionalRenderingEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19345 | mImpl->log("finish vkCmdEndConditionalRenderingEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19346 | } |
| 19347 | |
| 19348 | #endif |
| 19349 | #ifdef VK_NVX_device_generated_commands |
| 19350 | void VkEncoder::vkCmdProcessCommandsNVX( |
| 19351 | VkCommandBuffer commandBuffer, |
| 19352 | const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) |
| 19353 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19354 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19355 | AEMU_SCOPED_TRACE("vkCmdProcessCommandsNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19356 | mImpl->log("start vkCmdProcessCommandsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19357 | auto stream = mImpl->stream(); |
| 19358 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19359 | auto resources = mImpl->resources(); |
| 19360 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19361 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19362 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19363 | VkCmdProcessCommandsInfoNVX* local_pProcessCommandsInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19364 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19365 | local_pProcessCommandsInfo = nullptr; |
| 19366 | if (pProcessCommandsInfo) |
| 19367 | { |
| 19368 | local_pProcessCommandsInfo = (VkCmdProcessCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdProcessCommandsInfoNVX)); |
| 19369 | deepcopy_VkCmdProcessCommandsInfoNVX(pool, pProcessCommandsInfo, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| 19370 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19371 | if (local_pProcessCommandsInfo) |
| 19372 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19373 | transform_tohost_VkCmdProcessCommandsInfoNVX(mImpl->resources(), (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19374 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19375 | countingStream->rewind(); |
| 19376 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19377 | uint64_t cgen_var_1269; |
| 19378 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1269, 1); |
| 19379 | countingStream->write((uint64_t*)&cgen_var_1269, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19380 | marshal_VkCmdProcessCommandsInfoNVX(countingStream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19381 | } |
| 19382 | uint32_t packetSize_vkCmdProcessCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19383 | countingStream->rewind(); |
| 19384 | uint32_t opcode_vkCmdProcessCommandsNVX = OP_vkCmdProcessCommandsNVX; |
| 19385 | stream->write(&opcode_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| 19386 | stream->write(&packetSize_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19387 | uint64_t cgen_var_1270; |
| 19388 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1270, 1); |
| 19389 | stream->write((uint64_t*)&cgen_var_1270, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19390 | marshal_VkCmdProcessCommandsInfoNVX(stream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19391 | AEMU_SCOPED_TRACE("vkCmdProcessCommandsNVX readParams"); |
| 19392 | AEMU_SCOPED_TRACE("vkCmdProcessCommandsNVX returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19393 | mImpl->log("finish vkCmdProcessCommandsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19394 | } |
| 19395 | |
| 19396 | void VkEncoder::vkCmdReserveSpaceForCommandsNVX( |
| 19397 | VkCommandBuffer commandBuffer, |
| 19398 | const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) |
| 19399 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19400 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19401 | AEMU_SCOPED_TRACE("vkCmdReserveSpaceForCommandsNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19402 | mImpl->log("start vkCmdReserveSpaceForCommandsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19403 | auto stream = mImpl->stream(); |
| 19404 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19405 | auto resources = mImpl->resources(); |
| 19406 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19407 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19408 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19409 | VkCmdReserveSpaceForCommandsInfoNVX* local_pReserveSpaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19410 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19411 | local_pReserveSpaceInfo = nullptr; |
| 19412 | if (pReserveSpaceInfo) |
| 19413 | { |
| 19414 | local_pReserveSpaceInfo = (VkCmdReserveSpaceForCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdReserveSpaceForCommandsInfoNVX)); |
| 19415 | deepcopy_VkCmdReserveSpaceForCommandsInfoNVX(pool, pReserveSpaceInfo, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| 19416 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19417 | if (local_pReserveSpaceInfo) |
| 19418 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19419 | transform_tohost_VkCmdReserveSpaceForCommandsInfoNVX(mImpl->resources(), (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19420 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19421 | countingStream->rewind(); |
| 19422 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19423 | uint64_t cgen_var_1271; |
| 19424 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1271, 1); |
| 19425 | countingStream->write((uint64_t*)&cgen_var_1271, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19426 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(countingStream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19427 | } |
| 19428 | uint32_t packetSize_vkCmdReserveSpaceForCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19429 | countingStream->rewind(); |
| 19430 | uint32_t opcode_vkCmdReserveSpaceForCommandsNVX = OP_vkCmdReserveSpaceForCommandsNVX; |
| 19431 | stream->write(&opcode_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| 19432 | stream->write(&packetSize_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19433 | uint64_t cgen_var_1272; |
| 19434 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1272, 1); |
| 19435 | stream->write((uint64_t*)&cgen_var_1272, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19436 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(stream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19437 | AEMU_SCOPED_TRACE("vkCmdReserveSpaceForCommandsNVX readParams"); |
| 19438 | AEMU_SCOPED_TRACE("vkCmdReserveSpaceForCommandsNVX returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19439 | mImpl->log("finish vkCmdReserveSpaceForCommandsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19440 | } |
| 19441 | |
| 19442 | VkResult VkEncoder::vkCreateIndirectCommandsLayoutNVX( |
| 19443 | VkDevice device, |
| 19444 | const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, |
| 19445 | const VkAllocationCallbacks* pAllocator, |
| 19446 | VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) |
| 19447 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19448 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19449 | AEMU_SCOPED_TRACE("vkCreateIndirectCommandsLayoutNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19450 | mImpl->log("start vkCreateIndirectCommandsLayoutNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19451 | auto stream = mImpl->stream(); |
| 19452 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19453 | auto resources = mImpl->resources(); |
| 19454 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19455 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19456 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19457 | VkIndirectCommandsLayoutCreateInfoNVX* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19458 | VkAllocationCallbacks* local_pAllocator; |
| 19459 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19460 | local_pCreateInfo = nullptr; |
| 19461 | if (pCreateInfo) |
| 19462 | { |
| 19463 | local_pCreateInfo = (VkIndirectCommandsLayoutCreateInfoNVX*)pool->alloc(sizeof(const VkIndirectCommandsLayoutCreateInfoNVX)); |
| 19464 | deepcopy_VkIndirectCommandsLayoutCreateInfoNVX(pool, pCreateInfo, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| 19465 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19466 | local_pAllocator = nullptr; |
| 19467 | if (pAllocator) |
| 19468 | { |
| 19469 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19470 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19471 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19472 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19473 | if (local_pCreateInfo) |
| 19474 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19475 | transform_tohost_VkIndirectCommandsLayoutCreateInfoNVX(mImpl->resources(), (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19476 | } |
| 19477 | if (local_pAllocator) |
| 19478 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19479 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19480 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19481 | countingStream->rewind(); |
| 19482 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19483 | uint64_t cgen_var_1273; |
| 19484 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1273, 1); |
| 19485 | countingStream->write((uint64_t*)&cgen_var_1273, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19486 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(countingStream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19487 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19488 | uint64_t cgen_var_1274 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19489 | countingStream->putBe64(cgen_var_1274); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19490 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19491 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19492 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19493 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19494 | uint64_t cgen_var_1275; |
| 19495 | countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1275, 1); |
| 19496 | countingStream->write((uint64_t*)&cgen_var_1275, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19497 | } |
| 19498 | uint32_t packetSize_vkCreateIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19499 | countingStream->rewind(); |
| 19500 | uint32_t opcode_vkCreateIndirectCommandsLayoutNVX = OP_vkCreateIndirectCommandsLayoutNVX; |
| 19501 | stream->write(&opcode_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 19502 | stream->write(&packetSize_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19503 | uint64_t cgen_var_1276; |
| 19504 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1276, 1); |
| 19505 | stream->write((uint64_t*)&cgen_var_1276, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19506 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(stream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19507 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19508 | uint64_t cgen_var_1277 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19509 | stream->putBe64(cgen_var_1277); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19510 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19511 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19512 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19513 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19514 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19515 | uint64_t cgen_var_1278; |
| 19516 | stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1278, 1); |
| 19517 | stream->write((uint64_t*)&cgen_var_1278, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19518 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19519 | AEMU_SCOPED_TRACE("vkCreateIndirectCommandsLayoutNVX readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19520 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19521 | uint64_t cgen_var_1279; |
| 19522 | stream->read((uint64_t*)&cgen_var_1279, 8); |
| 19523 | stream->handleMapping()->mapHandles_u64_VkIndirectCommandsLayoutNVX(&cgen_var_1279, (VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19524 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19525 | AEMU_SCOPED_TRACE("vkCreateIndirectCommandsLayoutNVX returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19526 | VkResult vkCreateIndirectCommandsLayoutNVX_VkResult_return = (VkResult)0; |
| 19527 | stream->read(&vkCreateIndirectCommandsLayoutNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19528 | countingStream->clearPool(); |
| 19529 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19530 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19531 | mImpl->log("finish vkCreateIndirectCommandsLayoutNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19532 | return vkCreateIndirectCommandsLayoutNVX_VkResult_return; |
| 19533 | } |
| 19534 | |
| 19535 | void VkEncoder::vkDestroyIndirectCommandsLayoutNVX( |
| 19536 | VkDevice device, |
| 19537 | VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 19538 | const VkAllocationCallbacks* pAllocator) |
| 19539 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19540 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19541 | AEMU_SCOPED_TRACE("vkDestroyIndirectCommandsLayoutNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19542 | mImpl->log("start vkDestroyIndirectCommandsLayoutNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19543 | auto stream = mImpl->stream(); |
| 19544 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19545 | auto resources = mImpl->resources(); |
| 19546 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19547 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19548 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19549 | VkIndirectCommandsLayoutNVX local_indirectCommandsLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19550 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19551 | local_device = device; |
| 19552 | local_indirectCommandsLayout = indirectCommandsLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19553 | local_pAllocator = nullptr; |
| 19554 | if (pAllocator) |
| 19555 | { |
| 19556 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19557 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19558 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19559 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19560 | if (local_pAllocator) |
| 19561 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19562 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19563 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19564 | countingStream->rewind(); |
| 19565 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19566 | uint64_t cgen_var_1280; |
| 19567 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1280, 1); |
| 19568 | countingStream->write((uint64_t*)&cgen_var_1280, 1 * 8); |
| 19569 | uint64_t cgen_var_1281; |
| 19570 | countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1281, 1); |
| 19571 | countingStream->write((uint64_t*)&cgen_var_1281, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19572 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19573 | uint64_t cgen_var_1282 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19574 | countingStream->putBe64(cgen_var_1282); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19575 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19576 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19577 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19578 | } |
| 19579 | } |
| 19580 | uint32_t packetSize_vkDestroyIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19581 | countingStream->rewind(); |
| 19582 | uint32_t opcode_vkDestroyIndirectCommandsLayoutNVX = OP_vkDestroyIndirectCommandsLayoutNVX; |
| 19583 | stream->write(&opcode_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 19584 | stream->write(&packetSize_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19585 | uint64_t cgen_var_1283; |
| 19586 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1283, 1); |
| 19587 | stream->write((uint64_t*)&cgen_var_1283, 1 * 8); |
| 19588 | uint64_t cgen_var_1284; |
| 19589 | stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1284, 1); |
| 19590 | stream->write((uint64_t*)&cgen_var_1284, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19591 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19592 | uint64_t cgen_var_1285 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19593 | stream->putBe64(cgen_var_1285); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19594 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19595 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19596 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19597 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19598 | AEMU_SCOPED_TRACE("vkDestroyIndirectCommandsLayoutNVX readParams"); |
| 19599 | AEMU_SCOPED_TRACE("vkDestroyIndirectCommandsLayoutNVX returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19600 | resources->destroyMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)&indirectCommandsLayout); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19601 | mImpl->log("finish vkDestroyIndirectCommandsLayoutNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19602 | } |
| 19603 | |
| 19604 | VkResult VkEncoder::vkCreateObjectTableNVX( |
| 19605 | VkDevice device, |
| 19606 | const VkObjectTableCreateInfoNVX* pCreateInfo, |
| 19607 | const VkAllocationCallbacks* pAllocator, |
| 19608 | VkObjectTableNVX* pObjectTable) |
| 19609 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19610 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19611 | AEMU_SCOPED_TRACE("vkCreateObjectTableNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19612 | mImpl->log("start vkCreateObjectTableNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19613 | auto stream = mImpl->stream(); |
| 19614 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19615 | auto resources = mImpl->resources(); |
| 19616 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19617 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19618 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19619 | VkObjectTableCreateInfoNVX* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19620 | VkAllocationCallbacks* local_pAllocator; |
| 19621 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19622 | local_pCreateInfo = nullptr; |
| 19623 | if (pCreateInfo) |
| 19624 | { |
| 19625 | local_pCreateInfo = (VkObjectTableCreateInfoNVX*)pool->alloc(sizeof(const VkObjectTableCreateInfoNVX)); |
| 19626 | deepcopy_VkObjectTableCreateInfoNVX(pool, pCreateInfo, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| 19627 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19628 | local_pAllocator = nullptr; |
| 19629 | if (pAllocator) |
| 19630 | { |
| 19631 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19632 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19633 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19634 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19635 | if (local_pCreateInfo) |
| 19636 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19637 | transform_tohost_VkObjectTableCreateInfoNVX(mImpl->resources(), (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19638 | } |
| 19639 | if (local_pAllocator) |
| 19640 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19641 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19642 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19643 | countingStream->rewind(); |
| 19644 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19645 | uint64_t cgen_var_1286; |
| 19646 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1286, 1); |
| 19647 | countingStream->write((uint64_t*)&cgen_var_1286, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19648 | marshal_VkObjectTableCreateInfoNVX(countingStream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19649 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19650 | uint64_t cgen_var_1287 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19651 | countingStream->putBe64(cgen_var_1287); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19652 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19653 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19654 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19655 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19656 | uint64_t cgen_var_1288; |
| 19657 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1288, 1); |
| 19658 | countingStream->write((uint64_t*)&cgen_var_1288, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19659 | } |
| 19660 | uint32_t packetSize_vkCreateObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19661 | countingStream->rewind(); |
| 19662 | uint32_t opcode_vkCreateObjectTableNVX = OP_vkCreateObjectTableNVX; |
| 19663 | stream->write(&opcode_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| 19664 | stream->write(&packetSize_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19665 | uint64_t cgen_var_1289; |
| 19666 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1289, 1); |
| 19667 | stream->write((uint64_t*)&cgen_var_1289, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19668 | marshal_VkObjectTableCreateInfoNVX(stream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19669 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19670 | uint64_t cgen_var_1290 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19671 | stream->putBe64(cgen_var_1290); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19672 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19673 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19674 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19675 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19676 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19677 | uint64_t cgen_var_1291; |
| 19678 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1291, 1); |
| 19679 | stream->write((uint64_t*)&cgen_var_1291, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19680 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19681 | AEMU_SCOPED_TRACE("vkCreateObjectTableNVX readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19682 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19683 | uint64_t cgen_var_1292; |
| 19684 | stream->read((uint64_t*)&cgen_var_1292, 8); |
| 19685 | stream->handleMapping()->mapHandles_u64_VkObjectTableNVX(&cgen_var_1292, (VkObjectTableNVX*)pObjectTable, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19686 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19687 | AEMU_SCOPED_TRACE("vkCreateObjectTableNVX returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19688 | VkResult vkCreateObjectTableNVX_VkResult_return = (VkResult)0; |
| 19689 | stream->read(&vkCreateObjectTableNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19690 | countingStream->clearPool(); |
| 19691 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19692 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19693 | mImpl->log("finish vkCreateObjectTableNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19694 | return vkCreateObjectTableNVX_VkResult_return; |
| 19695 | } |
| 19696 | |
| 19697 | void VkEncoder::vkDestroyObjectTableNVX( |
| 19698 | VkDevice device, |
| 19699 | VkObjectTableNVX objectTable, |
| 19700 | const VkAllocationCallbacks* pAllocator) |
| 19701 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19702 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19703 | AEMU_SCOPED_TRACE("vkDestroyObjectTableNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19704 | mImpl->log("start vkDestroyObjectTableNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19705 | auto stream = mImpl->stream(); |
| 19706 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19707 | auto resources = mImpl->resources(); |
| 19708 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19709 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19710 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19711 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19712 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19713 | local_device = device; |
| 19714 | local_objectTable = objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19715 | local_pAllocator = nullptr; |
| 19716 | if (pAllocator) |
| 19717 | { |
| 19718 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19719 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19720 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19721 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19722 | if (local_pAllocator) |
| 19723 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19724 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19725 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19726 | countingStream->rewind(); |
| 19727 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19728 | uint64_t cgen_var_1293; |
| 19729 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1293, 1); |
| 19730 | countingStream->write((uint64_t*)&cgen_var_1293, 1 * 8); |
| 19731 | uint64_t cgen_var_1294; |
| 19732 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1294, 1); |
| 19733 | countingStream->write((uint64_t*)&cgen_var_1294, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19734 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19735 | uint64_t cgen_var_1295 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19736 | countingStream->putBe64(cgen_var_1295); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19737 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19738 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19739 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19740 | } |
| 19741 | } |
| 19742 | uint32_t packetSize_vkDestroyObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19743 | countingStream->rewind(); |
| 19744 | uint32_t opcode_vkDestroyObjectTableNVX = OP_vkDestroyObjectTableNVX; |
| 19745 | stream->write(&opcode_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| 19746 | stream->write(&packetSize_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19747 | uint64_t cgen_var_1296; |
| 19748 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1296, 1); |
| 19749 | stream->write((uint64_t*)&cgen_var_1296, 1 * 8); |
| 19750 | uint64_t cgen_var_1297; |
| 19751 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1297, 1); |
| 19752 | stream->write((uint64_t*)&cgen_var_1297, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19753 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19754 | uint64_t cgen_var_1298 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19755 | stream->putBe64(cgen_var_1298); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19756 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19757 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19758 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19759 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19760 | AEMU_SCOPED_TRACE("vkDestroyObjectTableNVX readParams"); |
| 19761 | AEMU_SCOPED_TRACE("vkDestroyObjectTableNVX returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19762 | resources->destroyMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&objectTable); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19763 | mImpl->log("finish vkDestroyObjectTableNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19764 | } |
| 19765 | |
| 19766 | VkResult VkEncoder::vkRegisterObjectsNVX( |
| 19767 | VkDevice device, |
| 19768 | VkObjectTableNVX objectTable, |
| 19769 | uint32_t objectCount, |
| 19770 | const VkObjectTableEntryNVX* const* ppObjectTableEntries, |
| 19771 | const uint32_t* pObjectIndices) |
| 19772 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19773 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19774 | AEMU_SCOPED_TRACE("vkRegisterObjectsNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19775 | mImpl->log("start vkRegisterObjectsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19776 | auto stream = mImpl->stream(); |
| 19777 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19778 | auto resources = mImpl->resources(); |
| 19779 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19780 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19781 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19782 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19783 | uint32_t local_objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19784 | VkObjectTableEntryNVX** local_ppObjectTableEntries; |
| 19785 | uint32_t* local_pObjectIndices; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19786 | local_device = device; |
| 19787 | local_objectTable = objectTable; |
| 19788 | local_objectCount = objectCount; |
| 19789 | (void)ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19790 | local_pObjectIndices = nullptr; |
| 19791 | if (pObjectIndices) |
| 19792 | { |
| 19793 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 19794 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19795 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19796 | countingStream->rewind(); |
| 19797 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19798 | uint64_t cgen_var_1299; |
| 19799 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1299, 1); |
| 19800 | countingStream->write((uint64_t*)&cgen_var_1299, 1 * 8); |
| 19801 | uint64_t cgen_var_1300; |
| 19802 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1300, 1); |
| 19803 | countingStream->write((uint64_t*)&cgen_var_1300, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19804 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 19805 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19806 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19807 | } |
| 19808 | uint32_t packetSize_vkRegisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19809 | countingStream->rewind(); |
| 19810 | uint32_t opcode_vkRegisterObjectsNVX = OP_vkRegisterObjectsNVX; |
| 19811 | stream->write(&opcode_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| 19812 | stream->write(&packetSize_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19813 | uint64_t cgen_var_1301; |
| 19814 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1301, 1); |
| 19815 | stream->write((uint64_t*)&cgen_var_1301, 1 * 8); |
| 19816 | uint64_t cgen_var_1302; |
| 19817 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1302, 1); |
| 19818 | stream->write((uint64_t*)&cgen_var_1302, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19819 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 19820 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19821 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19822 | AEMU_SCOPED_TRACE("vkRegisterObjectsNVX readParams"); |
| 19823 | AEMU_SCOPED_TRACE("vkRegisterObjectsNVX returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19824 | VkResult vkRegisterObjectsNVX_VkResult_return = (VkResult)0; |
| 19825 | stream->read(&vkRegisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19826 | countingStream->clearPool(); |
| 19827 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19828 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19829 | mImpl->log("finish vkRegisterObjectsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19830 | return vkRegisterObjectsNVX_VkResult_return; |
| 19831 | } |
| 19832 | |
| 19833 | VkResult VkEncoder::vkUnregisterObjectsNVX( |
| 19834 | VkDevice device, |
| 19835 | VkObjectTableNVX objectTable, |
| 19836 | uint32_t objectCount, |
| 19837 | const VkObjectEntryTypeNVX* pObjectEntryTypes, |
| 19838 | const uint32_t* pObjectIndices) |
| 19839 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19840 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19841 | AEMU_SCOPED_TRACE("vkUnregisterObjectsNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19842 | mImpl->log("start vkUnregisterObjectsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19843 | auto stream = mImpl->stream(); |
| 19844 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19845 | auto resources = mImpl->resources(); |
| 19846 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19847 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19848 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19849 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19850 | uint32_t local_objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19851 | VkObjectEntryTypeNVX* local_pObjectEntryTypes; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19852 | uint32_t* local_pObjectIndices; |
| 19853 | local_device = device; |
| 19854 | local_objectTable = objectTable; |
| 19855 | local_objectCount = objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19856 | local_pObjectEntryTypes = nullptr; |
| 19857 | if (pObjectEntryTypes) |
| 19858 | { |
| 19859 | local_pObjectEntryTypes = (VkObjectEntryTypeNVX*)pool->dupArray(pObjectEntryTypes, ((objectCount)) * sizeof(const VkObjectEntryTypeNVX)); |
| 19860 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19861 | local_pObjectIndices = nullptr; |
| 19862 | if (pObjectIndices) |
| 19863 | { |
| 19864 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 19865 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19866 | countingStream->rewind(); |
| 19867 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19868 | uint64_t cgen_var_1303; |
| 19869 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1303, 1); |
| 19870 | countingStream->write((uint64_t*)&cgen_var_1303, 1 * 8); |
| 19871 | uint64_t cgen_var_1304; |
| 19872 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1304, 1); |
| 19873 | countingStream->write((uint64_t*)&cgen_var_1304, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19874 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 19875 | countingStream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 19876 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19877 | } |
| 19878 | uint32_t packetSize_vkUnregisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19879 | countingStream->rewind(); |
| 19880 | uint32_t opcode_vkUnregisterObjectsNVX = OP_vkUnregisterObjectsNVX; |
| 19881 | stream->write(&opcode_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| 19882 | stream->write(&packetSize_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19883 | uint64_t cgen_var_1305; |
| 19884 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1305, 1); |
| 19885 | stream->write((uint64_t*)&cgen_var_1305, 1 * 8); |
| 19886 | uint64_t cgen_var_1306; |
| 19887 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1306, 1); |
| 19888 | stream->write((uint64_t*)&cgen_var_1306, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19889 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 19890 | stream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 19891 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19892 | AEMU_SCOPED_TRACE("vkUnregisterObjectsNVX readParams"); |
| 19893 | AEMU_SCOPED_TRACE("vkUnregisterObjectsNVX returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19894 | VkResult vkUnregisterObjectsNVX_VkResult_return = (VkResult)0; |
| 19895 | stream->read(&vkUnregisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19896 | countingStream->clearPool(); |
| 19897 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19898 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19899 | mImpl->log("finish vkUnregisterObjectsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19900 | return vkUnregisterObjectsNVX_VkResult_return; |
| 19901 | } |
| 19902 | |
| 19903 | void VkEncoder::vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( |
| 19904 | VkPhysicalDevice physicalDevice, |
| 19905 | VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, |
| 19906 | VkDeviceGeneratedCommandsLimitsNVX* pLimits) |
| 19907 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19908 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19909 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19910 | mImpl->log("start vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19911 | auto stream = mImpl->stream(); |
| 19912 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19913 | auto resources = mImpl->resources(); |
| 19914 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19915 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19916 | VkPhysicalDevice local_physicalDevice; |
| 19917 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19918 | countingStream->rewind(); |
| 19919 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19920 | uint64_t cgen_var_1307; |
| 19921 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1307, 1); |
| 19922 | countingStream->write((uint64_t*)&cgen_var_1307, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19923 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(countingStream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 19924 | marshal_VkDeviceGeneratedCommandsLimitsNVX(countingStream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 19925 | } |
| 19926 | uint32_t packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19927 | countingStream->rewind(); |
| 19928 | uint32_t opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = OP_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX; |
| 19929 | stream->write(&opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| 19930 | stream->write(&packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19931 | uint64_t cgen_var_1308; |
| 19932 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1308, 1); |
| 19933 | stream->write((uint64_t*)&cgen_var_1308, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19934 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 19935 | marshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19936 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19937 | unmarshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19938 | if (pFeatures) |
| 19939 | { |
| 19940 | transform_fromhost_VkDeviceGeneratedCommandsFeaturesNVX(mImpl->resources(), (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 19941 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19942 | unmarshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19943 | if (pLimits) |
| 19944 | { |
| 19945 | transform_fromhost_VkDeviceGeneratedCommandsLimitsNVX(mImpl->resources(), (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 19946 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19947 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19948 | mImpl->log("finish vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19949 | } |
| 19950 | |
| 19951 | #endif |
| 19952 | #ifdef VK_NV_clip_space_w_scaling |
| 19953 | void VkEncoder::vkCmdSetViewportWScalingNV( |
| 19954 | VkCommandBuffer commandBuffer, |
| 19955 | uint32_t firstViewport, |
| 19956 | uint32_t viewportCount, |
| 19957 | const VkViewportWScalingNV* pViewportWScalings) |
| 19958 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19959 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19960 | AEMU_SCOPED_TRACE("vkCmdSetViewportWScalingNV encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19961 | mImpl->log("start vkCmdSetViewportWScalingNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19962 | auto stream = mImpl->stream(); |
| 19963 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19964 | auto resources = mImpl->resources(); |
| 19965 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19966 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19967 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19968 | uint32_t local_firstViewport; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19969 | uint32_t local_viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19970 | VkViewportWScalingNV* local_pViewportWScalings; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19971 | local_commandBuffer = commandBuffer; |
| 19972 | local_firstViewport = firstViewport; |
| 19973 | local_viewportCount = viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19974 | local_pViewportWScalings = nullptr; |
| 19975 | if (pViewportWScalings) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19976 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19977 | local_pViewportWScalings = (VkViewportWScalingNV*)pool->alloc(((viewportCount)) * sizeof(const VkViewportWScalingNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19978 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 19979 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19980 | deepcopy_VkViewportWScalingNV(pool, pViewportWScalings + i, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| 19981 | } |
| 19982 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19983 | if (local_pViewportWScalings) |
| 19984 | { |
| 19985 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 19986 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19987 | transform_tohost_VkViewportWScalingNV(mImpl->resources(), (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19988 | } |
| 19989 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19990 | countingStream->rewind(); |
| 19991 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19992 | uint64_t cgen_var_1309; |
| 19993 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1309, 1); |
| 19994 | countingStream->write((uint64_t*)&cgen_var_1309, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19995 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 19996 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 19997 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 19998 | { |
| 19999 | marshal_VkViewportWScalingNV(countingStream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20000 | } |
| 20001 | } |
| 20002 | uint32_t packetSize_vkCmdSetViewportWScalingNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20003 | countingStream->rewind(); |
| 20004 | uint32_t opcode_vkCmdSetViewportWScalingNV = OP_vkCmdSetViewportWScalingNV; |
| 20005 | stream->write(&opcode_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| 20006 | stream->write(&packetSize_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20007 | uint64_t cgen_var_1310; |
| 20008 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1310, 1); |
| 20009 | stream->write((uint64_t*)&cgen_var_1310, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20010 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 20011 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20012 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 20013 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20014 | marshal_VkViewportWScalingNV(stream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20015 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20016 | AEMU_SCOPED_TRACE("vkCmdSetViewportWScalingNV readParams"); |
| 20017 | AEMU_SCOPED_TRACE("vkCmdSetViewportWScalingNV returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20018 | mImpl->log("finish vkCmdSetViewportWScalingNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20019 | } |
| 20020 | |
| 20021 | #endif |
| 20022 | #ifdef VK_EXT_direct_mode_display |
| 20023 | VkResult VkEncoder::vkReleaseDisplayEXT( |
| 20024 | VkPhysicalDevice physicalDevice, |
| 20025 | VkDisplayKHR display) |
| 20026 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20027 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20028 | AEMU_SCOPED_TRACE("vkReleaseDisplayEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20029 | mImpl->log("start vkReleaseDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20030 | auto stream = mImpl->stream(); |
| 20031 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20032 | auto resources = mImpl->resources(); |
| 20033 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20034 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20035 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20036 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20037 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20038 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20039 | countingStream->rewind(); |
| 20040 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20041 | uint64_t cgen_var_1311; |
| 20042 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1311, 1); |
| 20043 | countingStream->write((uint64_t*)&cgen_var_1311, 1 * 8); |
| 20044 | uint64_t cgen_var_1312; |
| 20045 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1312, 1); |
| 20046 | countingStream->write((uint64_t*)&cgen_var_1312, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20047 | } |
| 20048 | uint32_t packetSize_vkReleaseDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20049 | countingStream->rewind(); |
| 20050 | uint32_t opcode_vkReleaseDisplayEXT = OP_vkReleaseDisplayEXT; |
| 20051 | stream->write(&opcode_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| 20052 | stream->write(&packetSize_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20053 | uint64_t cgen_var_1313; |
| 20054 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1313, 1); |
| 20055 | stream->write((uint64_t*)&cgen_var_1313, 1 * 8); |
| 20056 | uint64_t cgen_var_1314; |
| 20057 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1314, 1); |
| 20058 | stream->write((uint64_t*)&cgen_var_1314, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20059 | AEMU_SCOPED_TRACE("vkReleaseDisplayEXT readParams"); |
| 20060 | AEMU_SCOPED_TRACE("vkReleaseDisplayEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20061 | VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0; |
| 20062 | stream->read(&vkReleaseDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20063 | countingStream->clearPool(); |
| 20064 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20065 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20066 | mImpl->log("finish vkReleaseDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20067 | return vkReleaseDisplayEXT_VkResult_return; |
| 20068 | } |
| 20069 | |
| 20070 | #endif |
| 20071 | #ifdef VK_EXT_acquire_xlib_display |
| 20072 | VkResult VkEncoder::vkAcquireXlibDisplayEXT( |
| 20073 | VkPhysicalDevice physicalDevice, |
| 20074 | Display* dpy, |
| 20075 | VkDisplayKHR display) |
| 20076 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20077 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20078 | AEMU_SCOPED_TRACE("vkAcquireXlibDisplayEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20079 | mImpl->log("start vkAcquireXlibDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20080 | auto stream = mImpl->stream(); |
| 20081 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20082 | auto resources = mImpl->resources(); |
| 20083 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20084 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20085 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20086 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20087 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20088 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20089 | countingStream->rewind(); |
| 20090 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20091 | uint64_t cgen_var_1315; |
| 20092 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1315, 1); |
| 20093 | countingStream->write((uint64_t*)&cgen_var_1315, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20094 | countingStream->write((Display*)dpy, sizeof(Display)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20095 | uint64_t cgen_var_1316; |
| 20096 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1316, 1); |
| 20097 | countingStream->write((uint64_t*)&cgen_var_1316, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20098 | } |
| 20099 | uint32_t packetSize_vkAcquireXlibDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20100 | countingStream->rewind(); |
| 20101 | uint32_t opcode_vkAcquireXlibDisplayEXT = OP_vkAcquireXlibDisplayEXT; |
| 20102 | stream->write(&opcode_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| 20103 | stream->write(&packetSize_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20104 | uint64_t cgen_var_1317; |
| 20105 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1317, 1); |
| 20106 | stream->write((uint64_t*)&cgen_var_1317, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20107 | stream->write((Display*)dpy, sizeof(Display)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20108 | uint64_t cgen_var_1318; |
| 20109 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1318, 1); |
| 20110 | stream->write((uint64_t*)&cgen_var_1318, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20111 | AEMU_SCOPED_TRACE("vkAcquireXlibDisplayEXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20112 | stream->read((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20113 | AEMU_SCOPED_TRACE("vkAcquireXlibDisplayEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20114 | VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0; |
| 20115 | stream->read(&vkAcquireXlibDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20116 | countingStream->clearPool(); |
| 20117 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20118 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20119 | mImpl->log("finish vkAcquireXlibDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20120 | return vkAcquireXlibDisplayEXT_VkResult_return; |
| 20121 | } |
| 20122 | |
| 20123 | VkResult VkEncoder::vkGetRandROutputDisplayEXT( |
| 20124 | VkPhysicalDevice physicalDevice, |
| 20125 | Display* dpy, |
| 20126 | RROutput rrOutput, |
| 20127 | VkDisplayKHR* pDisplay) |
| 20128 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20129 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20130 | AEMU_SCOPED_TRACE("vkGetRandROutputDisplayEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20131 | mImpl->log("start vkGetRandROutputDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20132 | auto stream = mImpl->stream(); |
| 20133 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20134 | auto resources = mImpl->resources(); |
| 20135 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20136 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20137 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20138 | RROutput local_rrOutput; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20139 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20140 | local_rrOutput = rrOutput; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20141 | countingStream->rewind(); |
| 20142 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20143 | uint64_t cgen_var_1319; |
| 20144 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1319, 1); |
| 20145 | countingStream->write((uint64_t*)&cgen_var_1319, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20146 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20147 | countingStream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20148 | uint64_t cgen_var_1320; |
| 20149 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1320, 1); |
| 20150 | countingStream->write((uint64_t*)&cgen_var_1320, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20151 | } |
| 20152 | uint32_t packetSize_vkGetRandROutputDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20153 | countingStream->rewind(); |
| 20154 | uint32_t opcode_vkGetRandROutputDisplayEXT = OP_vkGetRandROutputDisplayEXT; |
| 20155 | stream->write(&opcode_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| 20156 | stream->write(&packetSize_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20157 | uint64_t cgen_var_1321; |
| 20158 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1321, 1); |
| 20159 | stream->write((uint64_t*)&cgen_var_1321, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20160 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20161 | stream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20162 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20163 | uint64_t cgen_var_1322; |
| 20164 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1322, 1); |
| 20165 | stream->write((uint64_t*)&cgen_var_1322, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20166 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20167 | AEMU_SCOPED_TRACE("vkGetRandROutputDisplayEXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20168 | stream->read((Display*)dpy, sizeof(Display)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20169 | uint64_t cgen_var_1323; |
| 20170 | stream->read((uint64_t*)&cgen_var_1323, 8); |
| 20171 | stream->handleMapping()->mapHandles_u64_VkDisplayKHR(&cgen_var_1323, (VkDisplayKHR*)pDisplay, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20172 | AEMU_SCOPED_TRACE("vkGetRandROutputDisplayEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20173 | VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0; |
| 20174 | stream->read(&vkGetRandROutputDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20175 | countingStream->clearPool(); |
| 20176 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20177 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20178 | mImpl->log("finish vkGetRandROutputDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20179 | return vkGetRandROutputDisplayEXT_VkResult_return; |
| 20180 | } |
| 20181 | |
| 20182 | #endif |
| 20183 | #ifdef VK_EXT_display_surface_counter |
| 20184 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2EXT( |
| 20185 | VkPhysicalDevice physicalDevice, |
| 20186 | VkSurfaceKHR surface, |
| 20187 | VkSurfaceCapabilities2EXT* pSurfaceCapabilities) |
| 20188 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20189 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20190 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2EXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20191 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilities2EXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20192 | auto stream = mImpl->stream(); |
| 20193 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20194 | auto resources = mImpl->resources(); |
| 20195 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20196 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20197 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20198 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20199 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20200 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20201 | countingStream->rewind(); |
| 20202 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20203 | uint64_t cgen_var_1324; |
| 20204 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1324, 1); |
| 20205 | countingStream->write((uint64_t*)&cgen_var_1324, 1 * 8); |
| 20206 | uint64_t cgen_var_1325; |
| 20207 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1325, 1); |
| 20208 | countingStream->write((uint64_t*)&cgen_var_1325, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20209 | marshal_VkSurfaceCapabilities2EXT(countingStream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 20210 | } |
| 20211 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20212 | countingStream->rewind(); |
| 20213 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT = OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT; |
| 20214 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| 20215 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20216 | uint64_t cgen_var_1326; |
| 20217 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1326, 1); |
| 20218 | stream->write((uint64_t*)&cgen_var_1326, 1 * 8); |
| 20219 | uint64_t cgen_var_1327; |
| 20220 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1327, 1); |
| 20221 | stream->write((uint64_t*)&cgen_var_1327, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20222 | marshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20223 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2EXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20224 | unmarshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20225 | if (pSurfaceCapabilities) |
| 20226 | { |
| 20227 | transform_fromhost_VkSurfaceCapabilities2EXT(mImpl->resources(), (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 20228 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20229 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2EXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20230 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0; |
| 20231 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20232 | countingStream->clearPool(); |
| 20233 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20234 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20235 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilities2EXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20236 | return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return; |
| 20237 | } |
| 20238 | |
| 20239 | #endif |
| 20240 | #ifdef VK_EXT_display_control |
| 20241 | VkResult VkEncoder::vkDisplayPowerControlEXT( |
| 20242 | VkDevice device, |
| 20243 | VkDisplayKHR display, |
| 20244 | const VkDisplayPowerInfoEXT* pDisplayPowerInfo) |
| 20245 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20246 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20247 | AEMU_SCOPED_TRACE("vkDisplayPowerControlEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20248 | mImpl->log("start vkDisplayPowerControlEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20249 | auto stream = mImpl->stream(); |
| 20250 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20251 | auto resources = mImpl->resources(); |
| 20252 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20253 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20254 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20255 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20256 | VkDisplayPowerInfoEXT* local_pDisplayPowerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20257 | local_device = device; |
| 20258 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20259 | local_pDisplayPowerInfo = nullptr; |
| 20260 | if (pDisplayPowerInfo) |
| 20261 | { |
| 20262 | local_pDisplayPowerInfo = (VkDisplayPowerInfoEXT*)pool->alloc(sizeof(const VkDisplayPowerInfoEXT)); |
| 20263 | deepcopy_VkDisplayPowerInfoEXT(pool, pDisplayPowerInfo, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| 20264 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20265 | if (local_pDisplayPowerInfo) |
| 20266 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20267 | transform_tohost_VkDisplayPowerInfoEXT(mImpl->resources(), (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20268 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20269 | countingStream->rewind(); |
| 20270 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20271 | uint64_t cgen_var_1328; |
| 20272 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1328, 1); |
| 20273 | countingStream->write((uint64_t*)&cgen_var_1328, 1 * 8); |
| 20274 | uint64_t cgen_var_1329; |
| 20275 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1329, 1); |
| 20276 | countingStream->write((uint64_t*)&cgen_var_1329, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20277 | marshal_VkDisplayPowerInfoEXT(countingStream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20278 | } |
| 20279 | uint32_t packetSize_vkDisplayPowerControlEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20280 | countingStream->rewind(); |
| 20281 | uint32_t opcode_vkDisplayPowerControlEXT = OP_vkDisplayPowerControlEXT; |
| 20282 | stream->write(&opcode_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| 20283 | stream->write(&packetSize_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20284 | uint64_t cgen_var_1330; |
| 20285 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1330, 1); |
| 20286 | stream->write((uint64_t*)&cgen_var_1330, 1 * 8); |
| 20287 | uint64_t cgen_var_1331; |
| 20288 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1331, 1); |
| 20289 | stream->write((uint64_t*)&cgen_var_1331, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20290 | marshal_VkDisplayPowerInfoEXT(stream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20291 | AEMU_SCOPED_TRACE("vkDisplayPowerControlEXT readParams"); |
| 20292 | AEMU_SCOPED_TRACE("vkDisplayPowerControlEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20293 | VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0; |
| 20294 | stream->read(&vkDisplayPowerControlEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20295 | countingStream->clearPool(); |
| 20296 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20297 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20298 | mImpl->log("finish vkDisplayPowerControlEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20299 | return vkDisplayPowerControlEXT_VkResult_return; |
| 20300 | } |
| 20301 | |
| 20302 | VkResult VkEncoder::vkRegisterDeviceEventEXT( |
| 20303 | VkDevice device, |
| 20304 | const VkDeviceEventInfoEXT* pDeviceEventInfo, |
| 20305 | const VkAllocationCallbacks* pAllocator, |
| 20306 | VkFence* pFence) |
| 20307 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20308 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20309 | AEMU_SCOPED_TRACE("vkRegisterDeviceEventEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20310 | mImpl->log("start vkRegisterDeviceEventEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20311 | auto stream = mImpl->stream(); |
| 20312 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20313 | auto resources = mImpl->resources(); |
| 20314 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20315 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20316 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20317 | VkDeviceEventInfoEXT* local_pDeviceEventInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20318 | VkAllocationCallbacks* local_pAllocator; |
| 20319 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20320 | local_pDeviceEventInfo = nullptr; |
| 20321 | if (pDeviceEventInfo) |
| 20322 | { |
| 20323 | local_pDeviceEventInfo = (VkDeviceEventInfoEXT*)pool->alloc(sizeof(const VkDeviceEventInfoEXT)); |
| 20324 | deepcopy_VkDeviceEventInfoEXT(pool, pDeviceEventInfo, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| 20325 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20326 | local_pAllocator = nullptr; |
| 20327 | if (pAllocator) |
| 20328 | { |
| 20329 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20330 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20331 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20332 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20333 | if (local_pDeviceEventInfo) |
| 20334 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20335 | transform_tohost_VkDeviceEventInfoEXT(mImpl->resources(), (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20336 | } |
| 20337 | if (local_pAllocator) |
| 20338 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20339 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20340 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20341 | countingStream->rewind(); |
| 20342 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20343 | uint64_t cgen_var_1332; |
| 20344 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1332, 1); |
| 20345 | countingStream->write((uint64_t*)&cgen_var_1332, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20346 | marshal_VkDeviceEventInfoEXT(countingStream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20347 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20348 | uint64_t cgen_var_1333 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20349 | countingStream->putBe64(cgen_var_1333); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20350 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20351 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20352 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20353 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20354 | uint64_t cgen_var_1334; |
| 20355 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1334, 1); |
| 20356 | countingStream->write((uint64_t*)&cgen_var_1334, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20357 | } |
| 20358 | uint32_t packetSize_vkRegisterDeviceEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20359 | countingStream->rewind(); |
| 20360 | uint32_t opcode_vkRegisterDeviceEventEXT = OP_vkRegisterDeviceEventEXT; |
| 20361 | stream->write(&opcode_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| 20362 | stream->write(&packetSize_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20363 | uint64_t cgen_var_1335; |
| 20364 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1335, 1); |
| 20365 | stream->write((uint64_t*)&cgen_var_1335, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20366 | marshal_VkDeviceEventInfoEXT(stream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20367 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20368 | uint64_t cgen_var_1336 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20369 | stream->putBe64(cgen_var_1336); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20370 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20371 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20372 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20373 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20374 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20375 | uint64_t cgen_var_1337; |
| 20376 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1337, 1); |
| 20377 | stream->write((uint64_t*)&cgen_var_1337, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20378 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20379 | AEMU_SCOPED_TRACE("vkRegisterDeviceEventEXT readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20380 | uint64_t cgen_var_1338; |
| 20381 | stream->read((uint64_t*)&cgen_var_1338, 8); |
| 20382 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1338, (VkFence*)pFence, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20383 | AEMU_SCOPED_TRACE("vkRegisterDeviceEventEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20384 | VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0; |
| 20385 | stream->read(&vkRegisterDeviceEventEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20386 | countingStream->clearPool(); |
| 20387 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20388 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20389 | mImpl->log("finish vkRegisterDeviceEventEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20390 | return vkRegisterDeviceEventEXT_VkResult_return; |
| 20391 | } |
| 20392 | |
| 20393 | VkResult VkEncoder::vkRegisterDisplayEventEXT( |
| 20394 | VkDevice device, |
| 20395 | VkDisplayKHR display, |
| 20396 | const VkDisplayEventInfoEXT* pDisplayEventInfo, |
| 20397 | const VkAllocationCallbacks* pAllocator, |
| 20398 | VkFence* pFence) |
| 20399 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20400 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20401 | AEMU_SCOPED_TRACE("vkRegisterDisplayEventEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20402 | mImpl->log("start vkRegisterDisplayEventEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20403 | auto stream = mImpl->stream(); |
| 20404 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20405 | auto resources = mImpl->resources(); |
| 20406 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20407 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20408 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20409 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20410 | VkDisplayEventInfoEXT* local_pDisplayEventInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20411 | VkAllocationCallbacks* local_pAllocator; |
| 20412 | local_device = device; |
| 20413 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20414 | local_pDisplayEventInfo = nullptr; |
| 20415 | if (pDisplayEventInfo) |
| 20416 | { |
| 20417 | local_pDisplayEventInfo = (VkDisplayEventInfoEXT*)pool->alloc(sizeof(const VkDisplayEventInfoEXT)); |
| 20418 | deepcopy_VkDisplayEventInfoEXT(pool, pDisplayEventInfo, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| 20419 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20420 | local_pAllocator = nullptr; |
| 20421 | if (pAllocator) |
| 20422 | { |
| 20423 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20424 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20425 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20426 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20427 | if (local_pDisplayEventInfo) |
| 20428 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20429 | transform_tohost_VkDisplayEventInfoEXT(mImpl->resources(), (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20430 | } |
| 20431 | if (local_pAllocator) |
| 20432 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20433 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20434 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20435 | countingStream->rewind(); |
| 20436 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20437 | uint64_t cgen_var_1339; |
| 20438 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1339, 1); |
| 20439 | countingStream->write((uint64_t*)&cgen_var_1339, 1 * 8); |
| 20440 | uint64_t cgen_var_1340; |
| 20441 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1340, 1); |
| 20442 | countingStream->write((uint64_t*)&cgen_var_1340, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20443 | marshal_VkDisplayEventInfoEXT(countingStream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20444 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20445 | uint64_t cgen_var_1341 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20446 | countingStream->putBe64(cgen_var_1341); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20447 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20448 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20449 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20450 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20451 | uint64_t cgen_var_1342; |
| 20452 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1342, 1); |
| 20453 | countingStream->write((uint64_t*)&cgen_var_1342, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20454 | } |
| 20455 | uint32_t packetSize_vkRegisterDisplayEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20456 | countingStream->rewind(); |
| 20457 | uint32_t opcode_vkRegisterDisplayEventEXT = OP_vkRegisterDisplayEventEXT; |
| 20458 | stream->write(&opcode_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| 20459 | stream->write(&packetSize_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20460 | uint64_t cgen_var_1343; |
| 20461 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1343, 1); |
| 20462 | stream->write((uint64_t*)&cgen_var_1343, 1 * 8); |
| 20463 | uint64_t cgen_var_1344; |
| 20464 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1344, 1); |
| 20465 | stream->write((uint64_t*)&cgen_var_1344, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20466 | marshal_VkDisplayEventInfoEXT(stream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20467 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20468 | uint64_t cgen_var_1345 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20469 | stream->putBe64(cgen_var_1345); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20470 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20471 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20472 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20473 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20474 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20475 | uint64_t cgen_var_1346; |
| 20476 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1346, 1); |
| 20477 | stream->write((uint64_t*)&cgen_var_1346, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20478 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20479 | AEMU_SCOPED_TRACE("vkRegisterDisplayEventEXT readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20480 | uint64_t cgen_var_1347; |
| 20481 | stream->read((uint64_t*)&cgen_var_1347, 8); |
| 20482 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1347, (VkFence*)pFence, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20483 | AEMU_SCOPED_TRACE("vkRegisterDisplayEventEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20484 | VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0; |
| 20485 | stream->read(&vkRegisterDisplayEventEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20486 | countingStream->clearPool(); |
| 20487 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20488 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20489 | mImpl->log("finish vkRegisterDisplayEventEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20490 | return vkRegisterDisplayEventEXT_VkResult_return; |
| 20491 | } |
| 20492 | |
| 20493 | VkResult VkEncoder::vkGetSwapchainCounterEXT( |
| 20494 | VkDevice device, |
| 20495 | VkSwapchainKHR swapchain, |
| 20496 | VkSurfaceCounterFlagBitsEXT counter, |
| 20497 | uint64_t* pCounterValue) |
| 20498 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20499 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20500 | AEMU_SCOPED_TRACE("vkGetSwapchainCounterEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20501 | mImpl->log("start vkGetSwapchainCounterEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20502 | auto stream = mImpl->stream(); |
| 20503 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20504 | auto resources = mImpl->resources(); |
| 20505 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20506 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20507 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20508 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20509 | VkSurfaceCounterFlagBitsEXT local_counter; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20510 | local_device = device; |
| 20511 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20512 | local_counter = counter; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20513 | countingStream->rewind(); |
| 20514 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20515 | uint64_t cgen_var_1348; |
| 20516 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1348, 1); |
| 20517 | countingStream->write((uint64_t*)&cgen_var_1348, 1 * 8); |
| 20518 | uint64_t cgen_var_1349; |
| 20519 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1349, 1); |
| 20520 | countingStream->write((uint64_t*)&cgen_var_1349, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20521 | countingStream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20522 | countingStream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 20523 | } |
| 20524 | uint32_t packetSize_vkGetSwapchainCounterEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20525 | countingStream->rewind(); |
| 20526 | uint32_t opcode_vkGetSwapchainCounterEXT = OP_vkGetSwapchainCounterEXT; |
| 20527 | stream->write(&opcode_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| 20528 | stream->write(&packetSize_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20529 | uint64_t cgen_var_1350; |
| 20530 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1350, 1); |
| 20531 | stream->write((uint64_t*)&cgen_var_1350, 1 * 8); |
| 20532 | uint64_t cgen_var_1351; |
| 20533 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1351, 1); |
| 20534 | stream->write((uint64_t*)&cgen_var_1351, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20535 | stream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20536 | stream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20537 | AEMU_SCOPED_TRACE("vkGetSwapchainCounterEXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20538 | stream->read((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20539 | AEMU_SCOPED_TRACE("vkGetSwapchainCounterEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20540 | VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0; |
| 20541 | stream->read(&vkGetSwapchainCounterEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20542 | countingStream->clearPool(); |
| 20543 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20544 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20545 | mImpl->log("finish vkGetSwapchainCounterEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20546 | return vkGetSwapchainCounterEXT_VkResult_return; |
| 20547 | } |
| 20548 | |
| 20549 | #endif |
| 20550 | #ifdef VK_GOOGLE_display_timing |
| 20551 | VkResult VkEncoder::vkGetRefreshCycleDurationGOOGLE( |
| 20552 | VkDevice device, |
| 20553 | VkSwapchainKHR swapchain, |
| 20554 | VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) |
| 20555 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20556 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20557 | AEMU_SCOPED_TRACE("vkGetRefreshCycleDurationGOOGLE encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20558 | mImpl->log("start vkGetRefreshCycleDurationGOOGLE"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20559 | auto stream = mImpl->stream(); |
| 20560 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20561 | auto resources = mImpl->resources(); |
| 20562 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20563 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20564 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20565 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20566 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20567 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20568 | countingStream->rewind(); |
| 20569 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20570 | uint64_t cgen_var_1352; |
| 20571 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1352, 1); |
| 20572 | countingStream->write((uint64_t*)&cgen_var_1352, 1 * 8); |
| 20573 | uint64_t cgen_var_1353; |
| 20574 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1353, 1); |
| 20575 | countingStream->write((uint64_t*)&cgen_var_1353, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20576 | marshal_VkRefreshCycleDurationGOOGLE(countingStream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 20577 | } |
| 20578 | uint32_t packetSize_vkGetRefreshCycleDurationGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20579 | countingStream->rewind(); |
| 20580 | uint32_t opcode_vkGetRefreshCycleDurationGOOGLE = OP_vkGetRefreshCycleDurationGOOGLE; |
| 20581 | stream->write(&opcode_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| 20582 | stream->write(&packetSize_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20583 | uint64_t cgen_var_1354; |
| 20584 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1354, 1); |
| 20585 | stream->write((uint64_t*)&cgen_var_1354, 1 * 8); |
| 20586 | uint64_t cgen_var_1355; |
| 20587 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1355, 1); |
| 20588 | stream->write((uint64_t*)&cgen_var_1355, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20589 | marshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20590 | AEMU_SCOPED_TRACE("vkGetRefreshCycleDurationGOOGLE readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20591 | unmarshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20592 | if (pDisplayTimingProperties) |
| 20593 | { |
| 20594 | transform_fromhost_VkRefreshCycleDurationGOOGLE(mImpl->resources(), (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 20595 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20596 | AEMU_SCOPED_TRACE("vkGetRefreshCycleDurationGOOGLE returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20597 | VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0; |
| 20598 | stream->read(&vkGetRefreshCycleDurationGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20599 | countingStream->clearPool(); |
| 20600 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20601 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20602 | mImpl->log("finish vkGetRefreshCycleDurationGOOGLE");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20603 | return vkGetRefreshCycleDurationGOOGLE_VkResult_return; |
| 20604 | } |
| 20605 | |
| 20606 | VkResult VkEncoder::vkGetPastPresentationTimingGOOGLE( |
| 20607 | VkDevice device, |
| 20608 | VkSwapchainKHR swapchain, |
| 20609 | uint32_t* pPresentationTimingCount, |
| 20610 | VkPastPresentationTimingGOOGLE* pPresentationTimings) |
| 20611 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20612 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20613 | AEMU_SCOPED_TRACE("vkGetPastPresentationTimingGOOGLE encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20614 | mImpl->log("start vkGetPastPresentationTimingGOOGLE"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20615 | auto stream = mImpl->stream(); |
| 20616 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20617 | auto resources = mImpl->resources(); |
| 20618 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20619 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20620 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20621 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20622 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20623 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20624 | countingStream->rewind(); |
| 20625 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20626 | uint64_t cgen_var_1356; |
| 20627 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1356, 1); |
| 20628 | countingStream->write((uint64_t*)&cgen_var_1356, 1 * 8); |
| 20629 | uint64_t cgen_var_1357; |
| 20630 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1357, 1); |
| 20631 | countingStream->write((uint64_t*)&cgen_var_1357, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20632 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20633 | uint64_t cgen_var_1358 = (uint64_t)(uintptr_t)pPresentationTimingCount; |
| 20634 | countingStream->putBe64(cgen_var_1358); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20635 | if (pPresentationTimingCount) |
| 20636 | { |
| 20637 | countingStream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 20638 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20639 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20640 | uint64_t cgen_var_1359 = (uint64_t)(uintptr_t)pPresentationTimings; |
| 20641 | countingStream->putBe64(cgen_var_1359); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20642 | if (pPresentationTimings) |
| 20643 | { |
| 20644 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20645 | { |
| 20646 | marshal_VkPastPresentationTimingGOOGLE(countingStream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20647 | } |
| 20648 | } |
| 20649 | } |
| 20650 | uint32_t packetSize_vkGetPastPresentationTimingGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20651 | countingStream->rewind(); |
| 20652 | uint32_t opcode_vkGetPastPresentationTimingGOOGLE = OP_vkGetPastPresentationTimingGOOGLE; |
| 20653 | stream->write(&opcode_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| 20654 | stream->write(&packetSize_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20655 | uint64_t cgen_var_1360; |
| 20656 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1360, 1); |
| 20657 | stream->write((uint64_t*)&cgen_var_1360, 1 * 8); |
| 20658 | uint64_t cgen_var_1361; |
| 20659 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1361, 1); |
| 20660 | stream->write((uint64_t*)&cgen_var_1361, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20661 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20662 | uint64_t cgen_var_1362 = (uint64_t)(uintptr_t)pPresentationTimingCount; |
| 20663 | stream->putBe64(cgen_var_1362); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20664 | if (pPresentationTimingCount) |
| 20665 | { |
| 20666 | stream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 20667 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20668 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20669 | uint64_t cgen_var_1363 = (uint64_t)(uintptr_t)pPresentationTimings; |
| 20670 | stream->putBe64(cgen_var_1363); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20671 | if (pPresentationTimings) |
| 20672 | { |
| 20673 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20674 | { |
| 20675 | marshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20676 | } |
| 20677 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20678 | AEMU_SCOPED_TRACE("vkGetPastPresentationTimingGOOGLE readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20679 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20680 | uint32_t* check_pPresentationTimingCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20681 | check_pPresentationTimingCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20682 | if (pPresentationTimingCount) |
| 20683 | { |
| 20684 | if (!(check_pPresentationTimingCount)) |
| 20685 | { |
| 20686 | fprintf(stderr, "fatal: pPresentationTimingCount inconsistent between guest and host\n"); |
| 20687 | } |
| 20688 | stream->read((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 20689 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20690 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20691 | VkPastPresentationTimingGOOGLE* check_pPresentationTimings; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20692 | check_pPresentationTimings = (VkPastPresentationTimingGOOGLE*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20693 | if (pPresentationTimings) |
| 20694 | { |
| 20695 | if (!(check_pPresentationTimings)) |
| 20696 | { |
| 20697 | fprintf(stderr, "fatal: pPresentationTimings inconsistent between guest and host\n"); |
| 20698 | } |
| 20699 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20700 | { |
| 20701 | unmarshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20702 | } |
| 20703 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20704 | if (pPresentationTimings) |
| 20705 | { |
| 20706 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20707 | { |
| 20708 | transform_fromhost_VkPastPresentationTimingGOOGLE(mImpl->resources(), (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20709 | } |
| 20710 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20711 | AEMU_SCOPED_TRACE("vkGetPastPresentationTimingGOOGLE returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20712 | VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0; |
| 20713 | stream->read(&vkGetPastPresentationTimingGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20714 | countingStream->clearPool(); |
| 20715 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20716 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20717 | mImpl->log("finish vkGetPastPresentationTimingGOOGLE");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20718 | return vkGetPastPresentationTimingGOOGLE_VkResult_return; |
| 20719 | } |
| 20720 | |
| 20721 | #endif |
| 20722 | #ifdef VK_NV_sample_mask_override_coverage |
| 20723 | #endif |
| 20724 | #ifdef VK_NV_geometry_shader_passthrough |
| 20725 | #endif |
| 20726 | #ifdef VK_NV_viewport_array2 |
| 20727 | #endif |
| 20728 | #ifdef VK_NVX_multiview_per_view_attributes |
| 20729 | #endif |
| 20730 | #ifdef VK_NV_viewport_swizzle |
| 20731 | #endif |
| 20732 | #ifdef VK_EXT_discard_rectangles |
| 20733 | void VkEncoder::vkCmdSetDiscardRectangleEXT( |
| 20734 | VkCommandBuffer commandBuffer, |
| 20735 | uint32_t firstDiscardRectangle, |
| 20736 | uint32_t discardRectangleCount, |
| 20737 | const VkRect2D* pDiscardRectangles) |
| 20738 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20739 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20740 | AEMU_SCOPED_TRACE("vkCmdSetDiscardRectangleEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20741 | mImpl->log("start vkCmdSetDiscardRectangleEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20742 | auto stream = mImpl->stream(); |
| 20743 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20744 | auto resources = mImpl->resources(); |
| 20745 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20746 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20747 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20748 | uint32_t local_firstDiscardRectangle; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20749 | uint32_t local_discardRectangleCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20750 | VkRect2D* local_pDiscardRectangles; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20751 | local_commandBuffer = commandBuffer; |
| 20752 | local_firstDiscardRectangle = firstDiscardRectangle; |
| 20753 | local_discardRectangleCount = discardRectangleCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20754 | local_pDiscardRectangles = nullptr; |
| 20755 | if (pDiscardRectangles) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20756 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20757 | local_pDiscardRectangles = (VkRect2D*)pool->alloc(((discardRectangleCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20758 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20759 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20760 | deepcopy_VkRect2D(pool, pDiscardRectangles + i, (VkRect2D*)(local_pDiscardRectangles + i)); |
| 20761 | } |
| 20762 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20763 | if (local_pDiscardRectangles) |
| 20764 | { |
| 20765 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20766 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20767 | transform_tohost_VkRect2D(mImpl->resources(), (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20768 | } |
| 20769 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20770 | countingStream->rewind(); |
| 20771 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20772 | uint64_t cgen_var_1366; |
| 20773 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1366, 1); |
| 20774 | countingStream->write((uint64_t*)&cgen_var_1366, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20775 | countingStream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 20776 | countingStream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| 20777 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20778 | { |
| 20779 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20780 | } |
| 20781 | } |
| 20782 | uint32_t packetSize_vkCmdSetDiscardRectangleEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20783 | countingStream->rewind(); |
| 20784 | uint32_t opcode_vkCmdSetDiscardRectangleEXT = OP_vkCmdSetDiscardRectangleEXT; |
| 20785 | stream->write(&opcode_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| 20786 | stream->write(&packetSize_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20787 | uint64_t cgen_var_1367; |
| 20788 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1367, 1); |
| 20789 | stream->write((uint64_t*)&cgen_var_1367, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20790 | stream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 20791 | stream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20792 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20793 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20794 | marshal_VkRect2D(stream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20795 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20796 | AEMU_SCOPED_TRACE("vkCmdSetDiscardRectangleEXT readParams"); |
| 20797 | AEMU_SCOPED_TRACE("vkCmdSetDiscardRectangleEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20798 | mImpl->log("finish vkCmdSetDiscardRectangleEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20799 | } |
| 20800 | |
| 20801 | #endif |
| 20802 | #ifdef VK_EXT_conservative_rasterization |
| 20803 | #endif |
| 20804 | #ifdef VK_EXT_swapchain_colorspace |
| 20805 | #endif |
| 20806 | #ifdef VK_EXT_hdr_metadata |
| 20807 | void VkEncoder::vkSetHdrMetadataEXT( |
| 20808 | VkDevice device, |
| 20809 | uint32_t swapchainCount, |
| 20810 | const VkSwapchainKHR* pSwapchains, |
| 20811 | const VkHdrMetadataEXT* pMetadata) |
| 20812 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20813 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20814 | AEMU_SCOPED_TRACE("vkSetHdrMetadataEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20815 | mImpl->log("start vkSetHdrMetadataEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20816 | auto stream = mImpl->stream(); |
| 20817 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20818 | auto resources = mImpl->resources(); |
| 20819 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20820 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20821 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20822 | uint32_t local_swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20823 | VkSwapchainKHR* local_pSwapchains; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20824 | VkHdrMetadataEXT* local_pMetadata; |
| 20825 | local_device = device; |
| 20826 | local_swapchainCount = swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20827 | local_pSwapchains = nullptr; |
| 20828 | if (pSwapchains) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20829 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20830 | local_pSwapchains = (VkSwapchainKHR*)pool->dupArray(pSwapchains, ((swapchainCount)) * sizeof(const VkSwapchainKHR)); |
| 20831 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20832 | local_pMetadata = nullptr; |
| 20833 | if (pMetadata) |
| 20834 | { |
| 20835 | local_pMetadata = (VkHdrMetadataEXT*)pool->alloc(((swapchainCount)) * sizeof(const VkHdrMetadataEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20836 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20837 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20838 | deepcopy_VkHdrMetadataEXT(pool, pMetadata + i, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| 20839 | } |
| 20840 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20841 | if (local_pMetadata) |
| 20842 | { |
| 20843 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20844 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20845 | transform_tohost_VkHdrMetadataEXT(mImpl->resources(), (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20846 | } |
| 20847 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20848 | countingStream->rewind(); |
| 20849 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20850 | uint64_t cgen_var_1368; |
| 20851 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1368, 1); |
| 20852 | countingStream->write((uint64_t*)&cgen_var_1368, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20853 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20854 | if (((swapchainCount))) |
| 20855 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20856 | uint64_t* cgen_var_1369; |
| 20857 | countingStream->alloc((void**)&cgen_var_1369, ((swapchainCount)) * 8); |
| 20858 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1369, ((swapchainCount))); |
| 20859 | countingStream->write((uint64_t*)cgen_var_1369, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20860 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20861 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20862 | { |
| 20863 | marshal_VkHdrMetadataEXT(countingStream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20864 | } |
| 20865 | } |
| 20866 | uint32_t packetSize_vkSetHdrMetadataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20867 | countingStream->rewind(); |
| 20868 | uint32_t opcode_vkSetHdrMetadataEXT = OP_vkSetHdrMetadataEXT; |
| 20869 | stream->write(&opcode_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| 20870 | stream->write(&packetSize_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20871 | uint64_t cgen_var_1370; |
| 20872 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1370, 1); |
| 20873 | stream->write((uint64_t*)&cgen_var_1370, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20874 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20875 | if (((swapchainCount))) |
| 20876 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20877 | uint64_t* cgen_var_1371; |
| 20878 | stream->alloc((void**)&cgen_var_1371, ((swapchainCount)) * 8); |
| 20879 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1371, ((swapchainCount))); |
| 20880 | stream->write((uint64_t*)cgen_var_1371, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20881 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20882 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20883 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20884 | marshal_VkHdrMetadataEXT(stream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20885 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20886 | AEMU_SCOPED_TRACE("vkSetHdrMetadataEXT readParams"); |
| 20887 | AEMU_SCOPED_TRACE("vkSetHdrMetadataEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20888 | mImpl->log("finish vkSetHdrMetadataEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20889 | } |
| 20890 | |
| 20891 | #endif |
| 20892 | #ifdef VK_MVK_ios_surface |
| 20893 | VkResult VkEncoder::vkCreateIOSSurfaceMVK( |
| 20894 | VkInstance instance, |
| 20895 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo, |
| 20896 | const VkAllocationCallbacks* pAllocator, |
| 20897 | VkSurfaceKHR* pSurface) |
| 20898 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20899 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20900 | AEMU_SCOPED_TRACE("vkCreateIOSSurfaceMVK encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20901 | mImpl->log("start vkCreateIOSSurfaceMVK"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20902 | auto stream = mImpl->stream(); |
| 20903 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20904 | auto resources = mImpl->resources(); |
| 20905 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20906 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20907 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20908 | VkIOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20909 | VkAllocationCallbacks* local_pAllocator; |
| 20910 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20911 | local_pCreateInfo = nullptr; |
| 20912 | if (pCreateInfo) |
| 20913 | { |
| 20914 | local_pCreateInfo = (VkIOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkIOSSurfaceCreateInfoMVK)); |
| 20915 | deepcopy_VkIOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 20916 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20917 | local_pAllocator = nullptr; |
| 20918 | if (pAllocator) |
| 20919 | { |
| 20920 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20921 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20922 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20923 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20924 | if (local_pCreateInfo) |
| 20925 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20926 | transform_tohost_VkIOSSurfaceCreateInfoMVK(mImpl->resources(), (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20927 | } |
| 20928 | if (local_pAllocator) |
| 20929 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20930 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20931 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20932 | countingStream->rewind(); |
| 20933 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20934 | uint64_t cgen_var_1372; |
| 20935 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1372, 1); |
| 20936 | countingStream->write((uint64_t*)&cgen_var_1372, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20937 | marshal_VkIOSSurfaceCreateInfoMVK(countingStream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20938 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20939 | uint64_t cgen_var_1373 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20940 | countingStream->putBe64(cgen_var_1373); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20941 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20942 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20943 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20944 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20945 | uint64_t cgen_var_1374; |
| 20946 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1374, 1); |
| 20947 | countingStream->write((uint64_t*)&cgen_var_1374, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20948 | } |
| 20949 | uint32_t packetSize_vkCreateIOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20950 | countingStream->rewind(); |
| 20951 | uint32_t opcode_vkCreateIOSSurfaceMVK = OP_vkCreateIOSSurfaceMVK; |
| 20952 | stream->write(&opcode_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| 20953 | stream->write(&packetSize_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20954 | uint64_t cgen_var_1375; |
| 20955 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1375, 1); |
| 20956 | stream->write((uint64_t*)&cgen_var_1375, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20957 | marshal_VkIOSSurfaceCreateInfoMVK(stream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20958 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20959 | uint64_t cgen_var_1376 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20960 | stream->putBe64(cgen_var_1376); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20961 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20962 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20963 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20964 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20965 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20966 | uint64_t cgen_var_1377; |
| 20967 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1377, 1); |
| 20968 | stream->write((uint64_t*)&cgen_var_1377, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20969 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20970 | AEMU_SCOPED_TRACE("vkCreateIOSSurfaceMVK readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20971 | uint64_t cgen_var_1378; |
| 20972 | stream->read((uint64_t*)&cgen_var_1378, 8); |
| 20973 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1378, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20974 | AEMU_SCOPED_TRACE("vkCreateIOSSurfaceMVK returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20975 | VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 20976 | stream->read(&vkCreateIOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20977 | countingStream->clearPool(); |
| 20978 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20979 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20980 | mImpl->log("finish vkCreateIOSSurfaceMVK");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20981 | return vkCreateIOSSurfaceMVK_VkResult_return; |
| 20982 | } |
| 20983 | |
| 20984 | #endif |
| 20985 | #ifdef VK_MVK_macos_surface |
| 20986 | VkResult VkEncoder::vkCreateMacOSSurfaceMVK( |
| 20987 | VkInstance instance, |
| 20988 | const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, |
| 20989 | const VkAllocationCallbacks* pAllocator, |
| 20990 | VkSurfaceKHR* pSurface) |
| 20991 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20992 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20993 | AEMU_SCOPED_TRACE("vkCreateMacOSSurfaceMVK encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20994 | mImpl->log("start vkCreateMacOSSurfaceMVK"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20995 | auto stream = mImpl->stream(); |
| 20996 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20997 | auto resources = mImpl->resources(); |
| 20998 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20999 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21000 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21001 | VkMacOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21002 | VkAllocationCallbacks* local_pAllocator; |
| 21003 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21004 | local_pCreateInfo = nullptr; |
| 21005 | if (pCreateInfo) |
| 21006 | { |
| 21007 | local_pCreateInfo = (VkMacOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkMacOSSurfaceCreateInfoMVK)); |
| 21008 | deepcopy_VkMacOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 21009 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21010 | local_pAllocator = nullptr; |
| 21011 | if (pAllocator) |
| 21012 | { |
| 21013 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21014 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21015 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21016 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21017 | if (local_pCreateInfo) |
| 21018 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21019 | transform_tohost_VkMacOSSurfaceCreateInfoMVK(mImpl->resources(), (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21020 | } |
| 21021 | if (local_pAllocator) |
| 21022 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21023 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21024 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21025 | countingStream->rewind(); |
| 21026 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21027 | uint64_t cgen_var_1379; |
| 21028 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1379, 1); |
| 21029 | countingStream->write((uint64_t*)&cgen_var_1379, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21030 | marshal_VkMacOSSurfaceCreateInfoMVK(countingStream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21031 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21032 | uint64_t cgen_var_1380 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21033 | countingStream->putBe64(cgen_var_1380); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21034 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21035 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21036 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21037 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21038 | uint64_t cgen_var_1381; |
| 21039 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1381, 1); |
| 21040 | countingStream->write((uint64_t*)&cgen_var_1381, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21041 | } |
| 21042 | uint32_t packetSize_vkCreateMacOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21043 | countingStream->rewind(); |
| 21044 | uint32_t opcode_vkCreateMacOSSurfaceMVK = OP_vkCreateMacOSSurfaceMVK; |
| 21045 | stream->write(&opcode_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| 21046 | stream->write(&packetSize_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21047 | uint64_t cgen_var_1382; |
| 21048 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1382, 1); |
| 21049 | stream->write((uint64_t*)&cgen_var_1382, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21050 | marshal_VkMacOSSurfaceCreateInfoMVK(stream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21051 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21052 | uint64_t cgen_var_1383 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21053 | stream->putBe64(cgen_var_1383); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21054 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21055 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21056 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21057 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21058 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21059 | uint64_t cgen_var_1384; |
| 21060 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1384, 1); |
| 21061 | stream->write((uint64_t*)&cgen_var_1384, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21062 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21063 | AEMU_SCOPED_TRACE("vkCreateMacOSSurfaceMVK readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21064 | uint64_t cgen_var_1385; |
| 21065 | stream->read((uint64_t*)&cgen_var_1385, 8); |
| 21066 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1385, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21067 | AEMU_SCOPED_TRACE("vkCreateMacOSSurfaceMVK returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21068 | VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 21069 | stream->read(&vkCreateMacOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21070 | countingStream->clearPool(); |
| 21071 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21072 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21073 | mImpl->log("finish vkCreateMacOSSurfaceMVK");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21074 | return vkCreateMacOSSurfaceMVK_VkResult_return; |
| 21075 | } |
| 21076 | |
| 21077 | #endif |
| 21078 | #ifdef VK_EXT_external_memory_dma_buf |
| 21079 | #endif |
| 21080 | #ifdef VK_EXT_queue_family_foreign |
| 21081 | #endif |
| 21082 | #ifdef VK_EXT_debug_utils |
| 21083 | VkResult VkEncoder::vkSetDebugUtilsObjectNameEXT( |
| 21084 | VkDevice device, |
| 21085 | const VkDebugUtilsObjectNameInfoEXT* pNameInfo) |
| 21086 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21087 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21088 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectNameEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21089 | mImpl->log("start vkSetDebugUtilsObjectNameEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21090 | auto stream = mImpl->stream(); |
| 21091 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21092 | auto resources = mImpl->resources(); |
| 21093 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21094 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21095 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21096 | VkDebugUtilsObjectNameInfoEXT* local_pNameInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21097 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21098 | local_pNameInfo = nullptr; |
| 21099 | if (pNameInfo) |
| 21100 | { |
| 21101 | local_pNameInfo = (VkDebugUtilsObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectNameInfoEXT)); |
| 21102 | deepcopy_VkDebugUtilsObjectNameInfoEXT(pool, pNameInfo, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| 21103 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21104 | if (local_pNameInfo) |
| 21105 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21106 | transform_tohost_VkDebugUtilsObjectNameInfoEXT(mImpl->resources(), (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21107 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21108 | countingStream->rewind(); |
| 21109 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21110 | uint64_t cgen_var_1386; |
| 21111 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1386, 1); |
| 21112 | countingStream->write((uint64_t*)&cgen_var_1386, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21113 | marshal_VkDebugUtilsObjectNameInfoEXT(countingStream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21114 | } |
| 21115 | uint32_t packetSize_vkSetDebugUtilsObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21116 | countingStream->rewind(); |
| 21117 | uint32_t opcode_vkSetDebugUtilsObjectNameEXT = OP_vkSetDebugUtilsObjectNameEXT; |
| 21118 | stream->write(&opcode_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| 21119 | stream->write(&packetSize_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21120 | uint64_t cgen_var_1387; |
| 21121 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1387, 1); |
| 21122 | stream->write((uint64_t*)&cgen_var_1387, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21123 | marshal_VkDebugUtilsObjectNameInfoEXT(stream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21124 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectNameEXT readParams"); |
| 21125 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectNameEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21126 | VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0; |
| 21127 | stream->read(&vkSetDebugUtilsObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21128 | countingStream->clearPool(); |
| 21129 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21130 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21131 | mImpl->log("finish vkSetDebugUtilsObjectNameEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21132 | return vkSetDebugUtilsObjectNameEXT_VkResult_return; |
| 21133 | } |
| 21134 | |
| 21135 | VkResult VkEncoder::vkSetDebugUtilsObjectTagEXT( |
| 21136 | VkDevice device, |
| 21137 | const VkDebugUtilsObjectTagInfoEXT* pTagInfo) |
| 21138 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21139 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21140 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectTagEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21141 | mImpl->log("start vkSetDebugUtilsObjectTagEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21142 | auto stream = mImpl->stream(); |
| 21143 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21144 | auto resources = mImpl->resources(); |
| 21145 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21146 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21147 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21148 | VkDebugUtilsObjectTagInfoEXT* local_pTagInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21149 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21150 | local_pTagInfo = nullptr; |
| 21151 | if (pTagInfo) |
| 21152 | { |
| 21153 | local_pTagInfo = (VkDebugUtilsObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectTagInfoEXT)); |
| 21154 | deepcopy_VkDebugUtilsObjectTagInfoEXT(pool, pTagInfo, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| 21155 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21156 | if (local_pTagInfo) |
| 21157 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21158 | transform_tohost_VkDebugUtilsObjectTagInfoEXT(mImpl->resources(), (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21159 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21160 | countingStream->rewind(); |
| 21161 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21162 | uint64_t cgen_var_1388; |
| 21163 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1388, 1); |
| 21164 | countingStream->write((uint64_t*)&cgen_var_1388, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21165 | marshal_VkDebugUtilsObjectTagInfoEXT(countingStream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21166 | } |
| 21167 | uint32_t packetSize_vkSetDebugUtilsObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21168 | countingStream->rewind(); |
| 21169 | uint32_t opcode_vkSetDebugUtilsObjectTagEXT = OP_vkSetDebugUtilsObjectTagEXT; |
| 21170 | stream->write(&opcode_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| 21171 | stream->write(&packetSize_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21172 | uint64_t cgen_var_1389; |
| 21173 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1389, 1); |
| 21174 | stream->write((uint64_t*)&cgen_var_1389, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21175 | marshal_VkDebugUtilsObjectTagInfoEXT(stream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21176 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectTagEXT readParams"); |
| 21177 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectTagEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21178 | VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0; |
| 21179 | stream->read(&vkSetDebugUtilsObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21180 | countingStream->clearPool(); |
| 21181 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21182 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21183 | mImpl->log("finish vkSetDebugUtilsObjectTagEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21184 | return vkSetDebugUtilsObjectTagEXT_VkResult_return; |
| 21185 | } |
| 21186 | |
| 21187 | void VkEncoder::vkQueueBeginDebugUtilsLabelEXT( |
| 21188 | VkQueue queue, |
| 21189 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 21190 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21191 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21192 | AEMU_SCOPED_TRACE("vkQueueBeginDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21193 | mImpl->log("start vkQueueBeginDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21194 | auto stream = mImpl->stream(); |
| 21195 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21196 | auto resources = mImpl->resources(); |
| 21197 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21198 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21199 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21200 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21201 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21202 | local_pLabelInfo = nullptr; |
| 21203 | if (pLabelInfo) |
| 21204 | { |
| 21205 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 21206 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 21207 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21208 | if (local_pLabelInfo) |
| 21209 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21210 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21211 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21212 | countingStream->rewind(); |
| 21213 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21214 | uint64_t cgen_var_1390; |
| 21215 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1390, 1); |
| 21216 | countingStream->write((uint64_t*)&cgen_var_1390, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21217 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21218 | } |
| 21219 | uint32_t packetSize_vkQueueBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21220 | countingStream->rewind(); |
| 21221 | uint32_t opcode_vkQueueBeginDebugUtilsLabelEXT = OP_vkQueueBeginDebugUtilsLabelEXT; |
| 21222 | stream->write(&opcode_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21223 | stream->write(&packetSize_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21224 | uint64_t cgen_var_1391; |
| 21225 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1391, 1); |
| 21226 | stream->write((uint64_t*)&cgen_var_1391, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21227 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21228 | AEMU_SCOPED_TRACE("vkQueueBeginDebugUtilsLabelEXT readParams"); |
| 21229 | AEMU_SCOPED_TRACE("vkQueueBeginDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21230 | mImpl->log("finish vkQueueBeginDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21231 | } |
| 21232 | |
| 21233 | void VkEncoder::vkQueueEndDebugUtilsLabelEXT( |
| 21234 | VkQueue queue) |
| 21235 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21236 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21237 | AEMU_SCOPED_TRACE("vkQueueEndDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21238 | mImpl->log("start vkQueueEndDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21239 | auto stream = mImpl->stream(); |
| 21240 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21241 | auto resources = mImpl->resources(); |
| 21242 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21243 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21244 | VkQueue local_queue; |
| 21245 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21246 | countingStream->rewind(); |
| 21247 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21248 | uint64_t cgen_var_1392; |
| 21249 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1392, 1); |
| 21250 | countingStream->write((uint64_t*)&cgen_var_1392, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21251 | } |
| 21252 | uint32_t packetSize_vkQueueEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21253 | countingStream->rewind(); |
| 21254 | uint32_t opcode_vkQueueEndDebugUtilsLabelEXT = OP_vkQueueEndDebugUtilsLabelEXT; |
| 21255 | stream->write(&opcode_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21256 | stream->write(&packetSize_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21257 | uint64_t cgen_var_1393; |
| 21258 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1393, 1); |
| 21259 | stream->write((uint64_t*)&cgen_var_1393, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21260 | AEMU_SCOPED_TRACE("vkQueueEndDebugUtilsLabelEXT readParams"); |
| 21261 | AEMU_SCOPED_TRACE("vkQueueEndDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21262 | mImpl->log("finish vkQueueEndDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21263 | } |
| 21264 | |
| 21265 | void VkEncoder::vkQueueInsertDebugUtilsLabelEXT( |
| 21266 | VkQueue queue, |
| 21267 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 21268 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21269 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21270 | AEMU_SCOPED_TRACE("vkQueueInsertDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21271 | mImpl->log("start vkQueueInsertDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21272 | auto stream = mImpl->stream(); |
| 21273 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21274 | auto resources = mImpl->resources(); |
| 21275 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21276 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21277 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21278 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21279 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21280 | local_pLabelInfo = nullptr; |
| 21281 | if (pLabelInfo) |
| 21282 | { |
| 21283 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 21284 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 21285 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21286 | if (local_pLabelInfo) |
| 21287 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21288 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21289 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21290 | countingStream->rewind(); |
| 21291 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21292 | uint64_t cgen_var_1394; |
| 21293 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1394, 1); |
| 21294 | countingStream->write((uint64_t*)&cgen_var_1394, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21295 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21296 | } |
| 21297 | uint32_t packetSize_vkQueueInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21298 | countingStream->rewind(); |
| 21299 | uint32_t opcode_vkQueueInsertDebugUtilsLabelEXT = OP_vkQueueInsertDebugUtilsLabelEXT; |
| 21300 | stream->write(&opcode_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21301 | stream->write(&packetSize_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21302 | uint64_t cgen_var_1395; |
| 21303 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1395, 1); |
| 21304 | stream->write((uint64_t*)&cgen_var_1395, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21305 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21306 | AEMU_SCOPED_TRACE("vkQueueInsertDebugUtilsLabelEXT readParams"); |
| 21307 | AEMU_SCOPED_TRACE("vkQueueInsertDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21308 | mImpl->log("finish vkQueueInsertDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21309 | } |
| 21310 | |
| 21311 | void VkEncoder::vkCmdBeginDebugUtilsLabelEXT( |
| 21312 | VkCommandBuffer commandBuffer, |
| 21313 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 21314 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21315 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21316 | AEMU_SCOPED_TRACE("vkCmdBeginDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21317 | mImpl->log("start vkCmdBeginDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21318 | auto stream = mImpl->stream(); |
| 21319 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21320 | auto resources = mImpl->resources(); |
| 21321 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21322 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21323 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21324 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21325 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21326 | local_pLabelInfo = nullptr; |
| 21327 | if (pLabelInfo) |
| 21328 | { |
| 21329 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 21330 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 21331 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21332 | if (local_pLabelInfo) |
| 21333 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21334 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21335 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21336 | countingStream->rewind(); |
| 21337 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21338 | uint64_t cgen_var_1396; |
| 21339 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1396, 1); |
| 21340 | countingStream->write((uint64_t*)&cgen_var_1396, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21341 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21342 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21343 | uint32_t packetSize_vkCmdBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21344 | countingStream->rewind(); |
| 21345 | uint32_t opcode_vkCmdBeginDebugUtilsLabelEXT = OP_vkCmdBeginDebugUtilsLabelEXT; |
| 21346 | stream->write(&opcode_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21347 | stream->write(&packetSize_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21348 | uint64_t cgen_var_1397; |
| 21349 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1397, 1); |
| 21350 | stream->write((uint64_t*)&cgen_var_1397, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21351 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21352 | AEMU_SCOPED_TRACE("vkCmdBeginDebugUtilsLabelEXT readParams"); |
| 21353 | AEMU_SCOPED_TRACE("vkCmdBeginDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21354 | mImpl->log("finish vkCmdBeginDebugUtilsLabelEXT");; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21355 | } |
| 21356 | |
| 21357 | void VkEncoder::vkCmdEndDebugUtilsLabelEXT( |
| 21358 | VkCommandBuffer commandBuffer) |
| 21359 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21360 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21361 | AEMU_SCOPED_TRACE("vkCmdEndDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21362 | mImpl->log("start vkCmdEndDebugUtilsLabelEXT"); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21363 | auto stream = mImpl->stream(); |
| 21364 | auto countingStream = mImpl->countingStream(); |
| 21365 | auto resources = mImpl->resources(); |
| 21366 | auto pool = mImpl->pool(); |
| 21367 | stream->setHandleMapping(resources->unwrapMapping()); |
| 21368 | VkCommandBuffer local_commandBuffer; |
| 21369 | local_commandBuffer = commandBuffer; |
| 21370 | countingStream->rewind(); |
| 21371 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21372 | uint64_t cgen_var_1398; |
| 21373 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1398, 1); |
| 21374 | countingStream->write((uint64_t*)&cgen_var_1398, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21375 | } |
| 21376 | uint32_t packetSize_vkCmdEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21377 | countingStream->rewind(); |
| 21378 | uint32_t opcode_vkCmdEndDebugUtilsLabelEXT = OP_vkCmdEndDebugUtilsLabelEXT; |
| 21379 | stream->write(&opcode_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21380 | stream->write(&packetSize_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21381 | uint64_t cgen_var_1399; |
| 21382 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1399, 1); |
| 21383 | stream->write((uint64_t*)&cgen_var_1399, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21384 | AEMU_SCOPED_TRACE("vkCmdEndDebugUtilsLabelEXT readParams"); |
| 21385 | AEMU_SCOPED_TRACE("vkCmdEndDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21386 | mImpl->log("finish vkCmdEndDebugUtilsLabelEXT");; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21387 | } |
| 21388 | |
| 21389 | void VkEncoder::vkCmdInsertDebugUtilsLabelEXT( |
| 21390 | VkCommandBuffer commandBuffer, |
| 21391 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 21392 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21393 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21394 | AEMU_SCOPED_TRACE("vkCmdInsertDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21395 | mImpl->log("start vkCmdInsertDebugUtilsLabelEXT"); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21396 | auto stream = mImpl->stream(); |
| 21397 | auto countingStream = mImpl->countingStream(); |
| 21398 | auto resources = mImpl->resources(); |
| 21399 | auto pool = mImpl->pool(); |
| 21400 | stream->setHandleMapping(resources->unwrapMapping()); |
| 21401 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21402 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21403 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21404 | local_pLabelInfo = nullptr; |
| 21405 | if (pLabelInfo) |
| 21406 | { |
| 21407 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 21408 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 21409 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21410 | if (local_pLabelInfo) |
| 21411 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21412 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21413 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21414 | countingStream->rewind(); |
| 21415 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21416 | uint64_t cgen_var_1400; |
| 21417 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1400, 1); |
| 21418 | countingStream->write((uint64_t*)&cgen_var_1400, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21419 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 21420 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21421 | uint32_t packetSize_vkCmdInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21422 | countingStream->rewind(); |
| 21423 | uint32_t opcode_vkCmdInsertDebugUtilsLabelEXT = OP_vkCmdInsertDebugUtilsLabelEXT; |
| 21424 | stream->write(&opcode_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21425 | stream->write(&packetSize_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21426 | uint64_t cgen_var_1401; |
| 21427 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1401, 1); |
| 21428 | stream->write((uint64_t*)&cgen_var_1401, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21429 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21430 | AEMU_SCOPED_TRACE("vkCmdInsertDebugUtilsLabelEXT readParams"); |
| 21431 | AEMU_SCOPED_TRACE("vkCmdInsertDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21432 | mImpl->log("finish vkCmdInsertDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21433 | } |
| 21434 | |
| 21435 | VkResult VkEncoder::vkCreateDebugUtilsMessengerEXT( |
| 21436 | VkInstance instance, |
| 21437 | const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, |
| 21438 | const VkAllocationCallbacks* pAllocator, |
| 21439 | VkDebugUtilsMessengerEXT* pMessenger) |
| 21440 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21441 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21442 | AEMU_SCOPED_TRACE("vkCreateDebugUtilsMessengerEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21443 | mImpl->log("start vkCreateDebugUtilsMessengerEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21444 | auto stream = mImpl->stream(); |
| 21445 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21446 | auto resources = mImpl->resources(); |
| 21447 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21448 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21449 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21450 | VkDebugUtilsMessengerCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21451 | VkAllocationCallbacks* local_pAllocator; |
| 21452 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21453 | local_pCreateInfo = nullptr; |
| 21454 | if (pCreateInfo) |
| 21455 | { |
| 21456 | local_pCreateInfo = (VkDebugUtilsMessengerCreateInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCreateInfoEXT)); |
| 21457 | deepcopy_VkDebugUtilsMessengerCreateInfoEXT(pool, pCreateInfo, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| 21458 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21459 | local_pAllocator = nullptr; |
| 21460 | if (pAllocator) |
| 21461 | { |
| 21462 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21463 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21464 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21465 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21466 | if (local_pCreateInfo) |
| 21467 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21468 | transform_tohost_VkDebugUtilsMessengerCreateInfoEXT(mImpl->resources(), (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21469 | } |
| 21470 | if (local_pAllocator) |
| 21471 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21472 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21473 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21474 | countingStream->rewind(); |
| 21475 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21476 | uint64_t cgen_var_1402; |
| 21477 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1402, 1); |
| 21478 | countingStream->write((uint64_t*)&cgen_var_1402, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21479 | marshal_VkDebugUtilsMessengerCreateInfoEXT(countingStream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21480 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21481 | uint64_t cgen_var_1403 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21482 | countingStream->putBe64(cgen_var_1403); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21483 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21484 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21485 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21486 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21487 | uint64_t cgen_var_1404; |
| 21488 | countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1404, 1); |
| 21489 | countingStream->write((uint64_t*)&cgen_var_1404, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21490 | } |
| 21491 | uint32_t packetSize_vkCreateDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21492 | countingStream->rewind(); |
| 21493 | uint32_t opcode_vkCreateDebugUtilsMessengerEXT = OP_vkCreateDebugUtilsMessengerEXT; |
| 21494 | stream->write(&opcode_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 21495 | stream->write(&packetSize_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21496 | uint64_t cgen_var_1405; |
| 21497 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1405, 1); |
| 21498 | stream->write((uint64_t*)&cgen_var_1405, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21499 | marshal_VkDebugUtilsMessengerCreateInfoEXT(stream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21500 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21501 | uint64_t cgen_var_1406 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21502 | stream->putBe64(cgen_var_1406); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21503 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21504 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21505 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21506 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21507 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21508 | uint64_t cgen_var_1407; |
| 21509 | stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1407, 1); |
| 21510 | stream->write((uint64_t*)&cgen_var_1407, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21511 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21512 | AEMU_SCOPED_TRACE("vkCreateDebugUtilsMessengerEXT readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21513 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21514 | uint64_t cgen_var_1408; |
| 21515 | stream->read((uint64_t*)&cgen_var_1408, 8); |
| 21516 | stream->handleMapping()->mapHandles_u64_VkDebugUtilsMessengerEXT(&cgen_var_1408, (VkDebugUtilsMessengerEXT*)pMessenger, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21517 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21518 | AEMU_SCOPED_TRACE("vkCreateDebugUtilsMessengerEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21519 | VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0; |
| 21520 | stream->read(&vkCreateDebugUtilsMessengerEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21521 | countingStream->clearPool(); |
| 21522 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21523 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21524 | mImpl->log("finish vkCreateDebugUtilsMessengerEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21525 | return vkCreateDebugUtilsMessengerEXT_VkResult_return; |
| 21526 | } |
| 21527 | |
| 21528 | void VkEncoder::vkDestroyDebugUtilsMessengerEXT( |
| 21529 | VkInstance instance, |
| 21530 | VkDebugUtilsMessengerEXT messenger, |
| 21531 | const VkAllocationCallbacks* pAllocator) |
| 21532 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21533 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21534 | AEMU_SCOPED_TRACE("vkDestroyDebugUtilsMessengerEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21535 | mImpl->log("start vkDestroyDebugUtilsMessengerEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21536 | auto stream = mImpl->stream(); |
| 21537 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21538 | auto resources = mImpl->resources(); |
| 21539 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21540 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21541 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21542 | VkDebugUtilsMessengerEXT local_messenger; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21543 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21544 | local_instance = instance; |
| 21545 | local_messenger = messenger; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21546 | local_pAllocator = nullptr; |
| 21547 | if (pAllocator) |
| 21548 | { |
| 21549 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21550 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21551 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21552 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21553 | if (local_pAllocator) |
| 21554 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21555 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21556 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21557 | countingStream->rewind(); |
| 21558 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21559 | uint64_t cgen_var_1409; |
| 21560 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1409, 1); |
| 21561 | countingStream->write((uint64_t*)&cgen_var_1409, 1 * 8); |
| 21562 | uint64_t cgen_var_1410; |
| 21563 | countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1410, 1); |
| 21564 | countingStream->write((uint64_t*)&cgen_var_1410, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21565 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21566 | uint64_t cgen_var_1411 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21567 | countingStream->putBe64(cgen_var_1411); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21568 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21569 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21570 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21571 | } |
| 21572 | } |
| 21573 | uint32_t packetSize_vkDestroyDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21574 | countingStream->rewind(); |
| 21575 | uint32_t opcode_vkDestroyDebugUtilsMessengerEXT = OP_vkDestroyDebugUtilsMessengerEXT; |
| 21576 | stream->write(&opcode_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 21577 | stream->write(&packetSize_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21578 | uint64_t cgen_var_1412; |
| 21579 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1412, 1); |
| 21580 | stream->write((uint64_t*)&cgen_var_1412, 1 * 8); |
| 21581 | uint64_t cgen_var_1413; |
| 21582 | stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1413, 1); |
| 21583 | stream->write((uint64_t*)&cgen_var_1413, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21584 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21585 | uint64_t cgen_var_1414 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21586 | stream->putBe64(cgen_var_1414); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21587 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21588 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21589 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21590 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21591 | AEMU_SCOPED_TRACE("vkDestroyDebugUtilsMessengerEXT readParams"); |
| 21592 | AEMU_SCOPED_TRACE("vkDestroyDebugUtilsMessengerEXT returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21593 | resources->destroyMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)&messenger); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21594 | mImpl->log("finish vkDestroyDebugUtilsMessengerEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21595 | } |
| 21596 | |
| 21597 | void VkEncoder::vkSubmitDebugUtilsMessageEXT( |
| 21598 | VkInstance instance, |
| 21599 | VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, |
| 21600 | VkDebugUtilsMessageTypeFlagsEXT messageTypes, |
| 21601 | const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) |
| 21602 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21603 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21604 | AEMU_SCOPED_TRACE("vkSubmitDebugUtilsMessageEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21605 | mImpl->log("start vkSubmitDebugUtilsMessageEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21606 | auto stream = mImpl->stream(); |
| 21607 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21608 | auto resources = mImpl->resources(); |
| 21609 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21610 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21611 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21612 | VkDebugUtilsMessageSeverityFlagBitsEXT local_messageSeverity; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21613 | VkDebugUtilsMessageTypeFlagsEXT local_messageTypes; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21614 | VkDebugUtilsMessengerCallbackDataEXT* local_pCallbackData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21615 | local_instance = instance; |
| 21616 | local_messageSeverity = messageSeverity; |
| 21617 | local_messageTypes = messageTypes; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21618 | local_pCallbackData = nullptr; |
| 21619 | if (pCallbackData) |
| 21620 | { |
| 21621 | local_pCallbackData = (VkDebugUtilsMessengerCallbackDataEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCallbackDataEXT)); |
| 21622 | deepcopy_VkDebugUtilsMessengerCallbackDataEXT(pool, pCallbackData, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| 21623 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21624 | if (local_pCallbackData) |
| 21625 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21626 | transform_tohost_VkDebugUtilsMessengerCallbackDataEXT(mImpl->resources(), (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21627 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21628 | countingStream->rewind(); |
| 21629 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21630 | uint64_t cgen_var_1415; |
| 21631 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1415, 1); |
| 21632 | countingStream->write((uint64_t*)&cgen_var_1415, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21633 | countingStream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 21634 | countingStream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 21635 | marshal_VkDebugUtilsMessengerCallbackDataEXT(countingStream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21636 | } |
| 21637 | uint32_t packetSize_vkSubmitDebugUtilsMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21638 | countingStream->rewind(); |
| 21639 | uint32_t opcode_vkSubmitDebugUtilsMessageEXT = OP_vkSubmitDebugUtilsMessageEXT; |
| 21640 | stream->write(&opcode_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| 21641 | stream->write(&packetSize_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21642 | uint64_t cgen_var_1416; |
| 21643 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1416, 1); |
| 21644 | stream->write((uint64_t*)&cgen_var_1416, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21645 | stream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 21646 | stream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 21647 | marshal_VkDebugUtilsMessengerCallbackDataEXT(stream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21648 | AEMU_SCOPED_TRACE("vkSubmitDebugUtilsMessageEXT readParams"); |
| 21649 | AEMU_SCOPED_TRACE("vkSubmitDebugUtilsMessageEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21650 | mImpl->log("finish vkSubmitDebugUtilsMessageEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21651 | } |
| 21652 | |
| 21653 | #endif |
| 21654 | #ifdef VK_ANDROID_external_memory_android_hardware_buffer |
| 21655 | VkResult VkEncoder::vkGetAndroidHardwareBufferPropertiesANDROID( |
| 21656 | VkDevice device, |
| 21657 | const AHardwareBuffer* buffer, |
| 21658 | VkAndroidHardwareBufferPropertiesANDROID* pProperties) |
| 21659 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21660 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21661 | AEMU_SCOPED_TRACE("vkGetAndroidHardwareBufferPropertiesANDROID encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21662 | mImpl->log("start vkGetAndroidHardwareBufferPropertiesANDROID"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21663 | auto stream = mImpl->stream(); |
| 21664 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21665 | auto resources = mImpl->resources(); |
| 21666 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21667 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21668 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21669 | AHardwareBuffer* local_buffer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21670 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21671 | local_buffer = nullptr; |
| 21672 | if (buffer) |
| 21673 | { |
| 21674 | local_buffer = (AHardwareBuffer*)pool->dupArray(buffer, sizeof(const AHardwareBuffer)); |
| 21675 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21676 | countingStream->rewind(); |
| 21677 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21678 | uint64_t cgen_var_1417; |
| 21679 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1417, 1); |
| 21680 | countingStream->write((uint64_t*)&cgen_var_1417, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21681 | countingStream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21682 | marshal_VkAndroidHardwareBufferPropertiesANDROID(countingStream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 21683 | } |
| 21684 | uint32_t packetSize_vkGetAndroidHardwareBufferPropertiesANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21685 | countingStream->rewind(); |
| 21686 | uint32_t opcode_vkGetAndroidHardwareBufferPropertiesANDROID = OP_vkGetAndroidHardwareBufferPropertiesANDROID; |
| 21687 | stream->write(&opcode_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| 21688 | stream->write(&packetSize_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21689 | uint64_t cgen_var_1418; |
| 21690 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1418, 1); |
| 21691 | stream->write((uint64_t*)&cgen_var_1418, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21692 | stream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21693 | marshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21694 | AEMU_SCOPED_TRACE("vkGetAndroidHardwareBufferPropertiesANDROID readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21695 | unmarshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21696 | if (pProperties) |
| 21697 | { |
| 21698 | transform_fromhost_VkAndroidHardwareBufferPropertiesANDROID(mImpl->resources(), (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 21699 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21700 | AEMU_SCOPED_TRACE("vkGetAndroidHardwareBufferPropertiesANDROID returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21701 | VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0; |
| 21702 | stream->read(&vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21703 | countingStream->clearPool(); |
| 21704 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21705 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21706 | mImpl->log("finish vkGetAndroidHardwareBufferPropertiesANDROID");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21707 | return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return; |
| 21708 | } |
| 21709 | |
| 21710 | VkResult VkEncoder::vkGetMemoryAndroidHardwareBufferANDROID( |
| 21711 | VkDevice device, |
| 21712 | const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, |
| 21713 | AHardwareBuffer** pBuffer) |
| 21714 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21715 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21716 | AEMU_SCOPED_TRACE("vkGetMemoryAndroidHardwareBufferANDROID encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21717 | mImpl->log("start vkGetMemoryAndroidHardwareBufferANDROID"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21718 | auto stream = mImpl->stream(); |
| 21719 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21720 | auto resources = mImpl->resources(); |
| 21721 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21722 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21723 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21724 | VkMemoryGetAndroidHardwareBufferInfoANDROID* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21725 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21726 | local_pInfo = nullptr; |
| 21727 | if (pInfo) |
| 21728 | { |
| 21729 | local_pInfo = (VkMemoryGetAndroidHardwareBufferInfoANDROID*)pool->alloc(sizeof(const VkMemoryGetAndroidHardwareBufferInfoANDROID)); |
| 21730 | deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(pool, pInfo, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| 21731 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21732 | if (local_pInfo) |
| 21733 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21734 | transform_tohost_VkMemoryGetAndroidHardwareBufferInfoANDROID(mImpl->resources(), (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21735 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21736 | countingStream->rewind(); |
| 21737 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21738 | uint64_t cgen_var_1419; |
| 21739 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1419, 1); |
| 21740 | countingStream->write((uint64_t*)&cgen_var_1419, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21741 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(countingStream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21742 | countingStream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 21743 | } |
| 21744 | uint32_t packetSize_vkGetMemoryAndroidHardwareBufferANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21745 | countingStream->rewind(); |
| 21746 | uint32_t opcode_vkGetMemoryAndroidHardwareBufferANDROID = OP_vkGetMemoryAndroidHardwareBufferANDROID; |
| 21747 | stream->write(&opcode_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| 21748 | stream->write(&packetSize_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21749 | uint64_t cgen_var_1420; |
| 21750 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1420, 1); |
| 21751 | stream->write((uint64_t*)&cgen_var_1420, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21752 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(stream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21753 | stream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21754 | AEMU_SCOPED_TRACE("vkGetMemoryAndroidHardwareBufferANDROID readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21755 | stream->read((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21756 | AEMU_SCOPED_TRACE("vkGetMemoryAndroidHardwareBufferANDROID returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21757 | VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0; |
| 21758 | stream->read(&vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21759 | countingStream->clearPool(); |
| 21760 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21761 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21762 | mImpl->log("finish vkGetMemoryAndroidHardwareBufferANDROID");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21763 | return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return; |
| 21764 | } |
| 21765 | |
| 21766 | #endif |
| 21767 | #ifdef VK_EXT_sampler_filter_minmax |
| 21768 | #endif |
| 21769 | #ifdef VK_AMD_gpu_shader_int16 |
| 21770 | #endif |
| 21771 | #ifdef VK_AMD_mixed_attachment_samples |
| 21772 | #endif |
| 21773 | #ifdef VK_AMD_shader_fragment_mask |
| 21774 | #endif |
| 21775 | #ifdef VK_EXT_shader_stencil_export |
| 21776 | #endif |
| 21777 | #ifdef VK_EXT_sample_locations |
| 21778 | void VkEncoder::vkCmdSetSampleLocationsEXT( |
| 21779 | VkCommandBuffer commandBuffer, |
| 21780 | const VkSampleLocationsInfoEXT* pSampleLocationsInfo) |
| 21781 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21782 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21783 | AEMU_SCOPED_TRACE("vkCmdSetSampleLocationsEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21784 | mImpl->log("start vkCmdSetSampleLocationsEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21785 | auto stream = mImpl->stream(); |
| 21786 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21787 | auto resources = mImpl->resources(); |
| 21788 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21789 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21790 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21791 | VkSampleLocationsInfoEXT* local_pSampleLocationsInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21792 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21793 | local_pSampleLocationsInfo = nullptr; |
| 21794 | if (pSampleLocationsInfo) |
| 21795 | { |
| 21796 | local_pSampleLocationsInfo = (VkSampleLocationsInfoEXT*)pool->alloc(sizeof(const VkSampleLocationsInfoEXT)); |
| 21797 | deepcopy_VkSampleLocationsInfoEXT(pool, pSampleLocationsInfo, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| 21798 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21799 | if (local_pSampleLocationsInfo) |
| 21800 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21801 | transform_tohost_VkSampleLocationsInfoEXT(mImpl->resources(), (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21802 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21803 | countingStream->rewind(); |
| 21804 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21805 | uint64_t cgen_var_1421; |
| 21806 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1421, 1); |
| 21807 | countingStream->write((uint64_t*)&cgen_var_1421, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21808 | marshal_VkSampleLocationsInfoEXT(countingStream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21809 | } |
| 21810 | uint32_t packetSize_vkCmdSetSampleLocationsEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21811 | countingStream->rewind(); |
| 21812 | uint32_t opcode_vkCmdSetSampleLocationsEXT = OP_vkCmdSetSampleLocationsEXT; |
| 21813 | stream->write(&opcode_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| 21814 | stream->write(&packetSize_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21815 | uint64_t cgen_var_1422; |
| 21816 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1422, 1); |
| 21817 | stream->write((uint64_t*)&cgen_var_1422, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21818 | marshal_VkSampleLocationsInfoEXT(stream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21819 | AEMU_SCOPED_TRACE("vkCmdSetSampleLocationsEXT readParams"); |
| 21820 | AEMU_SCOPED_TRACE("vkCmdSetSampleLocationsEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21821 | mImpl->log("finish vkCmdSetSampleLocationsEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21822 | } |
| 21823 | |
| 21824 | void VkEncoder::vkGetPhysicalDeviceMultisamplePropertiesEXT( |
| 21825 | VkPhysicalDevice physicalDevice, |
| 21826 | VkSampleCountFlagBits samples, |
| 21827 | VkMultisamplePropertiesEXT* pMultisampleProperties) |
| 21828 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21829 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21830 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMultisamplePropertiesEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21831 | mImpl->log("start vkGetPhysicalDeviceMultisamplePropertiesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21832 | auto stream = mImpl->stream(); |
| 21833 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21834 | auto resources = mImpl->resources(); |
| 21835 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21836 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21837 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21838 | VkSampleCountFlagBits local_samples; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21839 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21840 | local_samples = samples; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21841 | countingStream->rewind(); |
| 21842 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21843 | uint64_t cgen_var_1423; |
| 21844 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1423, 1); |
| 21845 | countingStream->write((uint64_t*)&cgen_var_1423, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21846 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21847 | marshal_VkMultisamplePropertiesEXT(countingStream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 21848 | } |
| 21849 | uint32_t packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21850 | countingStream->rewind(); |
| 21851 | uint32_t opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT = OP_vkGetPhysicalDeviceMultisamplePropertiesEXT; |
| 21852 | stream->write(&opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| 21853 | stream->write(&packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21854 | uint64_t cgen_var_1424; |
| 21855 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1424, 1); |
| 21856 | stream->write((uint64_t*)&cgen_var_1424, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21857 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21858 | marshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21859 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMultisamplePropertiesEXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21860 | unmarshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21861 | if (pMultisampleProperties) |
| 21862 | { |
| 21863 | transform_fromhost_VkMultisamplePropertiesEXT(mImpl->resources(), (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 21864 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21865 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMultisamplePropertiesEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21866 | mImpl->log("finish vkGetPhysicalDeviceMultisamplePropertiesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21867 | } |
| 21868 | |
| 21869 | #endif |
| 21870 | #ifdef VK_EXT_blend_operation_advanced |
| 21871 | #endif |
| 21872 | #ifdef VK_NV_fragment_coverage_to_color |
| 21873 | #endif |
| 21874 | #ifdef VK_NV_framebuffer_mixed_samples |
| 21875 | #endif |
| 21876 | #ifdef VK_NV_fill_rectangle |
| 21877 | #endif |
| 21878 | #ifdef VK_EXT_post_depth_coverage |
| 21879 | #endif |
| 21880 | #ifdef VK_EXT_validation_cache |
| 21881 | VkResult VkEncoder::vkCreateValidationCacheEXT( |
| 21882 | VkDevice device, |
| 21883 | const VkValidationCacheCreateInfoEXT* pCreateInfo, |
| 21884 | const VkAllocationCallbacks* pAllocator, |
| 21885 | VkValidationCacheEXT* pValidationCache) |
| 21886 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21887 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21888 | AEMU_SCOPED_TRACE("vkCreateValidationCacheEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21889 | mImpl->log("start vkCreateValidationCacheEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21890 | auto stream = mImpl->stream(); |
| 21891 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21892 | auto resources = mImpl->resources(); |
| 21893 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21894 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21895 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21896 | VkValidationCacheCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21897 | VkAllocationCallbacks* local_pAllocator; |
| 21898 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21899 | local_pCreateInfo = nullptr; |
| 21900 | if (pCreateInfo) |
| 21901 | { |
| 21902 | local_pCreateInfo = (VkValidationCacheCreateInfoEXT*)pool->alloc(sizeof(const VkValidationCacheCreateInfoEXT)); |
| 21903 | deepcopy_VkValidationCacheCreateInfoEXT(pool, pCreateInfo, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| 21904 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21905 | local_pAllocator = nullptr; |
| 21906 | if (pAllocator) |
| 21907 | { |
| 21908 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21909 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21910 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21911 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21912 | if (local_pCreateInfo) |
| 21913 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21914 | transform_tohost_VkValidationCacheCreateInfoEXT(mImpl->resources(), (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21915 | } |
| 21916 | if (local_pAllocator) |
| 21917 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21918 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21919 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21920 | countingStream->rewind(); |
| 21921 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21922 | uint64_t cgen_var_1425; |
| 21923 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1425, 1); |
| 21924 | countingStream->write((uint64_t*)&cgen_var_1425, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21925 | marshal_VkValidationCacheCreateInfoEXT(countingStream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21926 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21927 | uint64_t cgen_var_1426 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21928 | countingStream->putBe64(cgen_var_1426); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21929 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21930 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21931 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21932 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21933 | uint64_t cgen_var_1427; |
| 21934 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1427, 1); |
| 21935 | countingStream->write((uint64_t*)&cgen_var_1427, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21936 | } |
| 21937 | uint32_t packetSize_vkCreateValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21938 | countingStream->rewind(); |
| 21939 | uint32_t opcode_vkCreateValidationCacheEXT = OP_vkCreateValidationCacheEXT; |
| 21940 | stream->write(&opcode_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| 21941 | stream->write(&packetSize_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21942 | uint64_t cgen_var_1428; |
| 21943 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1428, 1); |
| 21944 | stream->write((uint64_t*)&cgen_var_1428, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21945 | marshal_VkValidationCacheCreateInfoEXT(stream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21946 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21947 | uint64_t cgen_var_1429 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21948 | stream->putBe64(cgen_var_1429); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21949 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21950 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21951 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21952 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21953 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21954 | uint64_t cgen_var_1430; |
| 21955 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1430, 1); |
| 21956 | stream->write((uint64_t*)&cgen_var_1430, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21957 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21958 | AEMU_SCOPED_TRACE("vkCreateValidationCacheEXT readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21959 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21960 | uint64_t cgen_var_1431; |
| 21961 | stream->read((uint64_t*)&cgen_var_1431, 8); |
| 21962 | stream->handleMapping()->mapHandles_u64_VkValidationCacheEXT(&cgen_var_1431, (VkValidationCacheEXT*)pValidationCache, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21963 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21964 | AEMU_SCOPED_TRACE("vkCreateValidationCacheEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21965 | VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0; |
| 21966 | stream->read(&vkCreateValidationCacheEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21967 | countingStream->clearPool(); |
| 21968 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21969 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21970 | mImpl->log("finish vkCreateValidationCacheEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21971 | return vkCreateValidationCacheEXT_VkResult_return; |
| 21972 | } |
| 21973 | |
| 21974 | void VkEncoder::vkDestroyValidationCacheEXT( |
| 21975 | VkDevice device, |
| 21976 | VkValidationCacheEXT validationCache, |
| 21977 | const VkAllocationCallbacks* pAllocator) |
| 21978 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21979 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21980 | AEMU_SCOPED_TRACE("vkDestroyValidationCacheEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21981 | mImpl->log("start vkDestroyValidationCacheEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21982 | auto stream = mImpl->stream(); |
| 21983 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21984 | auto resources = mImpl->resources(); |
| 21985 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21986 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21987 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21988 | VkValidationCacheEXT local_validationCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21989 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21990 | local_device = device; |
| 21991 | local_validationCache = validationCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21992 | local_pAllocator = nullptr; |
| 21993 | if (pAllocator) |
| 21994 | { |
| 21995 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21996 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21997 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21998 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21999 | if (local_pAllocator) |
| 22000 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 22001 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 22002 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22003 | countingStream->rewind(); |
| 22004 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22005 | uint64_t cgen_var_1432; |
| 22006 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1432, 1); |
| 22007 | countingStream->write((uint64_t*)&cgen_var_1432, 1 * 8); |
| 22008 | uint64_t cgen_var_1433; |
| 22009 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1433, 1); |
| 22010 | countingStream->write((uint64_t*)&cgen_var_1433, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22011 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22012 | uint64_t cgen_var_1434 = (uint64_t)(uintptr_t)local_pAllocator; |
| 22013 | countingStream->putBe64(cgen_var_1434); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22014 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22015 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22016 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22017 | } |
| 22018 | } |
| 22019 | uint32_t packetSize_vkDestroyValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22020 | countingStream->rewind(); |
| 22021 | uint32_t opcode_vkDestroyValidationCacheEXT = OP_vkDestroyValidationCacheEXT; |
| 22022 | stream->write(&opcode_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| 22023 | stream->write(&packetSize_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22024 | uint64_t cgen_var_1435; |
| 22025 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1435, 1); |
| 22026 | stream->write((uint64_t*)&cgen_var_1435, 1 * 8); |
| 22027 | uint64_t cgen_var_1436; |
| 22028 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1436, 1); |
| 22029 | stream->write((uint64_t*)&cgen_var_1436, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22030 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22031 | uint64_t cgen_var_1437 = (uint64_t)(uintptr_t)local_pAllocator; |
| 22032 | stream->putBe64(cgen_var_1437); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22033 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22034 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22035 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22036 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22037 | AEMU_SCOPED_TRACE("vkDestroyValidationCacheEXT readParams"); |
| 22038 | AEMU_SCOPED_TRACE("vkDestroyValidationCacheEXT returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22039 | resources->destroyMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&validationCache); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22040 | mImpl->log("finish vkDestroyValidationCacheEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22041 | } |
| 22042 | |
| 22043 | VkResult VkEncoder::vkMergeValidationCachesEXT( |
| 22044 | VkDevice device, |
| 22045 | VkValidationCacheEXT dstCache, |
| 22046 | uint32_t srcCacheCount, |
| 22047 | const VkValidationCacheEXT* pSrcCaches) |
| 22048 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22049 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22050 | AEMU_SCOPED_TRACE("vkMergeValidationCachesEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22051 | mImpl->log("start vkMergeValidationCachesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22052 | auto stream = mImpl->stream(); |
| 22053 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22054 | auto resources = mImpl->resources(); |
| 22055 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22056 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22057 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22058 | VkValidationCacheEXT local_dstCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22059 | uint32_t local_srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22060 | VkValidationCacheEXT* local_pSrcCaches; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 22061 | local_device = device; |
| 22062 | local_dstCache = dstCache; |
| 22063 | local_srcCacheCount = srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22064 | local_pSrcCaches = nullptr; |
| 22065 | if (pSrcCaches) |
| 22066 | { |
| 22067 | local_pSrcCaches = (VkValidationCacheEXT*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkValidationCacheEXT)); |
| 22068 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22069 | countingStream->rewind(); |
| 22070 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22071 | uint64_t cgen_var_1438; |
| 22072 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1438, 1); |
| 22073 | countingStream->write((uint64_t*)&cgen_var_1438, 1 * 8); |
| 22074 | uint64_t cgen_var_1439; |
| 22075 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1439, 1); |
| 22076 | countingStream->write((uint64_t*)&cgen_var_1439, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22077 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22078 | if (((srcCacheCount))) |
| 22079 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22080 | uint64_t* cgen_var_1440; |
| 22081 | countingStream->alloc((void**)&cgen_var_1440, ((srcCacheCount)) * 8); |
| 22082 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1440, ((srcCacheCount))); |
| 22083 | countingStream->write((uint64_t*)cgen_var_1440, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22084 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22085 | } |
| 22086 | uint32_t packetSize_vkMergeValidationCachesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22087 | countingStream->rewind(); |
| 22088 | uint32_t opcode_vkMergeValidationCachesEXT = OP_vkMergeValidationCachesEXT; |
| 22089 | stream->write(&opcode_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| 22090 | stream->write(&packetSize_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22091 | uint64_t cgen_var_1441; |
| 22092 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1441, 1); |
| 22093 | stream->write((uint64_t*)&cgen_var_1441, 1 * 8); |
| 22094 | uint64_t cgen_var_1442; |
| 22095 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1442, 1); |
| 22096 | stream->write((uint64_t*)&cgen_var_1442, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22097 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22098 | if (((srcCacheCount))) |
| 22099 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22100 | uint64_t* cgen_var_1443; |
| 22101 | stream->alloc((void**)&cgen_var_1443, ((srcCacheCount)) * 8); |
| 22102 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1443, ((srcCacheCount))); |
| 22103 | stream->write((uint64_t*)cgen_var_1443, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22104 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22105 | AEMU_SCOPED_TRACE("vkMergeValidationCachesEXT readParams"); |
| 22106 | AEMU_SCOPED_TRACE("vkMergeValidationCachesEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22107 | VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0; |
| 22108 | stream->read(&vkMergeValidationCachesEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22109 | countingStream->clearPool(); |
| 22110 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22111 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22112 | mImpl->log("finish vkMergeValidationCachesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22113 | return vkMergeValidationCachesEXT_VkResult_return; |
| 22114 | } |
| 22115 | |
| 22116 | VkResult VkEncoder::vkGetValidationCacheDataEXT( |
| 22117 | VkDevice device, |
| 22118 | VkValidationCacheEXT validationCache, |
| 22119 | size_t* pDataSize, |
| 22120 | void* pData) |
| 22121 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22122 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22123 | AEMU_SCOPED_TRACE("vkGetValidationCacheDataEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22124 | mImpl->log("start vkGetValidationCacheDataEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22125 | auto stream = mImpl->stream(); |
| 22126 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22127 | auto resources = mImpl->resources(); |
| 22128 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22129 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22130 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22131 | VkValidationCacheEXT local_validationCache; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 22132 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22133 | local_validationCache = validationCache; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22134 | countingStream->rewind(); |
| 22135 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22136 | uint64_t cgen_var_1444; |
| 22137 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1444, 1); |
| 22138 | countingStream->write((uint64_t*)&cgen_var_1444, 1 * 8); |
| 22139 | uint64_t cgen_var_1445; |
| 22140 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1445, 1); |
| 22141 | countingStream->write((uint64_t*)&cgen_var_1445, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22142 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22143 | uint64_t cgen_var_1446 = (uint64_t)(uintptr_t)pDataSize; |
| 22144 | countingStream->putBe64(cgen_var_1446); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22145 | if (pDataSize) |
| 22146 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22147 | uint64_t cgen_var_1447 = (uint64_t)(*pDataSize); |
| 22148 | countingStream->putBe64(cgen_var_1447); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22149 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22150 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22151 | uint64_t cgen_var_1448 = (uint64_t)(uintptr_t)pData; |
| 22152 | countingStream->putBe64(cgen_var_1448); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22153 | if (pData) |
| 22154 | { |
| 22155 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 22156 | } |
| 22157 | } |
| 22158 | uint32_t packetSize_vkGetValidationCacheDataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22159 | countingStream->rewind(); |
| 22160 | uint32_t opcode_vkGetValidationCacheDataEXT = OP_vkGetValidationCacheDataEXT; |
| 22161 | stream->write(&opcode_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| 22162 | stream->write(&packetSize_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22163 | uint64_t cgen_var_1449; |
| 22164 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1449, 1); |
| 22165 | stream->write((uint64_t*)&cgen_var_1449, 1 * 8); |
| 22166 | uint64_t cgen_var_1450; |
| 22167 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1450, 1); |
| 22168 | stream->write((uint64_t*)&cgen_var_1450, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22169 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22170 | uint64_t cgen_var_1451 = (uint64_t)(uintptr_t)pDataSize; |
| 22171 | stream->putBe64(cgen_var_1451); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22172 | if (pDataSize) |
| 22173 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22174 | uint64_t cgen_var_1452 = (uint64_t)(*pDataSize); |
| 22175 | stream->putBe64(cgen_var_1452); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22176 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22177 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22178 | uint64_t cgen_var_1453 = (uint64_t)(uintptr_t)pData; |
| 22179 | stream->putBe64(cgen_var_1453); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22180 | if (pData) |
| 22181 | { |
| 22182 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 22183 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22184 | AEMU_SCOPED_TRACE("vkGetValidationCacheDataEXT readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22185 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22186 | size_t* check_pDataSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22187 | check_pDataSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22188 | if (pDataSize) |
| 22189 | { |
| 22190 | if (!(check_pDataSize)) |
| 22191 | { |
| 22192 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 22193 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 22194 | (*pDataSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22195 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22196 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22197 | void* check_pData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22198 | check_pData = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22199 | if (pData) |
| 22200 | { |
| 22201 | if (!(check_pData)) |
| 22202 | { |
| 22203 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 22204 | } |
| 22205 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 22206 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22207 | AEMU_SCOPED_TRACE("vkGetValidationCacheDataEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22208 | VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0; |
| 22209 | stream->read(&vkGetValidationCacheDataEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22210 | countingStream->clearPool(); |
| 22211 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22212 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22213 | mImpl->log("finish vkGetValidationCacheDataEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22214 | return vkGetValidationCacheDataEXT_VkResult_return; |
| 22215 | } |
| 22216 | |
| 22217 | #endif |
| 22218 | #ifdef VK_EXT_descriptor_indexing |
| 22219 | #endif |
| 22220 | #ifdef VK_EXT_shader_viewport_index_layer |
| 22221 | #endif |
| 22222 | #ifdef VK_EXT_global_priority |
| 22223 | #endif |
| 22224 | #ifdef VK_EXT_external_memory_host |
| 22225 | VkResult VkEncoder::vkGetMemoryHostPointerPropertiesEXT( |
| 22226 | VkDevice device, |
| 22227 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 22228 | const void* pHostPointer, |
| 22229 | VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) |
| 22230 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22231 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22232 | AEMU_SCOPED_TRACE("vkGetMemoryHostPointerPropertiesEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22233 | mImpl->log("start vkGetMemoryHostPointerPropertiesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22234 | auto stream = mImpl->stream(); |
| 22235 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22236 | auto resources = mImpl->resources(); |
| 22237 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22238 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22239 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22240 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22241 | void* local_pHostPointer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 22242 | local_device = device; |
| 22243 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22244 | local_pHostPointer = nullptr; |
| 22245 | if (pHostPointer) |
| 22246 | { |
| 22247 | local_pHostPointer = (void*)pool->dupArray(pHostPointer, sizeof(const uint8_t)); |
| 22248 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22249 | countingStream->rewind(); |
| 22250 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22251 | uint64_t cgen_var_1457; |
| 22252 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1457, 1); |
| 22253 | countingStream->write((uint64_t*)&cgen_var_1457, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22254 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22255 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22256 | uint64_t cgen_var_1458 = (uint64_t)(uintptr_t)local_pHostPointer; |
| 22257 | countingStream->putBe64(cgen_var_1458); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22258 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22259 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22260 | countingStream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22261 | } |
| 22262 | marshal_VkMemoryHostPointerPropertiesEXT(countingStream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 22263 | } |
| 22264 | uint32_t packetSize_vkGetMemoryHostPointerPropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22265 | countingStream->rewind(); |
| 22266 | uint32_t opcode_vkGetMemoryHostPointerPropertiesEXT = OP_vkGetMemoryHostPointerPropertiesEXT; |
| 22267 | stream->write(&opcode_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| 22268 | stream->write(&packetSize_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22269 | uint64_t cgen_var_1459; |
| 22270 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1459, 1); |
| 22271 | stream->write((uint64_t*)&cgen_var_1459, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22272 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22273 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22274 | uint64_t cgen_var_1460 = (uint64_t)(uintptr_t)local_pHostPointer; |
| 22275 | stream->putBe64(cgen_var_1460); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22276 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22277 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22278 | stream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22279 | } |
| 22280 | marshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22281 | AEMU_SCOPED_TRACE("vkGetMemoryHostPointerPropertiesEXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22282 | unmarshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 22283 | if (pMemoryHostPointerProperties) |
| 22284 | { |
| 22285 | transform_fromhost_VkMemoryHostPointerPropertiesEXT(mImpl->resources(), (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 22286 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22287 | AEMU_SCOPED_TRACE("vkGetMemoryHostPointerPropertiesEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22288 | VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0; |
| 22289 | stream->read(&vkGetMemoryHostPointerPropertiesEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22290 | countingStream->clearPool(); |
| 22291 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22292 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22293 | mImpl->log("finish vkGetMemoryHostPointerPropertiesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22294 | return vkGetMemoryHostPointerPropertiesEXT_VkResult_return; |
| 22295 | } |
| 22296 | |
| 22297 | #endif |
| 22298 | #ifdef VK_AMD_buffer_marker |
| 22299 | void VkEncoder::vkCmdWriteBufferMarkerAMD( |
| 22300 | VkCommandBuffer commandBuffer, |
| 22301 | VkPipelineStageFlagBits pipelineStage, |
| 22302 | VkBuffer dstBuffer, |
| 22303 | VkDeviceSize dstOffset, |
| 22304 | uint32_t marker) |
| 22305 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22306 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22307 | AEMU_SCOPED_TRACE("vkCmdWriteBufferMarkerAMD encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22308 | mImpl->log("start vkCmdWriteBufferMarkerAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22309 | auto stream = mImpl->stream(); |
| 22310 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22311 | auto resources = mImpl->resources(); |
| 22312 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22313 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22314 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22315 | VkPipelineStageFlagBits local_pipelineStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22316 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22317 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22318 | uint32_t local_marker; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 22319 | local_commandBuffer = commandBuffer; |
| 22320 | local_pipelineStage = pipelineStage; |
| 22321 | local_dstBuffer = dstBuffer; |
| 22322 | local_dstOffset = dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22323 | local_marker = marker; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22324 | countingStream->rewind(); |
| 22325 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22326 | uint64_t cgen_var_1461; |
| 22327 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1461, 1); |
| 22328 | countingStream->write((uint64_t*)&cgen_var_1461, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22329 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22330 | uint64_t cgen_var_1462; |
| 22331 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1462, 1); |
| 22332 | countingStream->write((uint64_t*)&cgen_var_1462, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22333 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 22334 | countingStream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22335 | } |
| 22336 | uint32_t packetSize_vkCmdWriteBufferMarkerAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22337 | countingStream->rewind(); |
| 22338 | uint32_t opcode_vkCmdWriteBufferMarkerAMD = OP_vkCmdWriteBufferMarkerAMD; |
| 22339 | stream->write(&opcode_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| 22340 | stream->write(&packetSize_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22341 | uint64_t cgen_var_1463; |
| 22342 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1463, 1); |
| 22343 | stream->write((uint64_t*)&cgen_var_1463, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22344 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22345 | uint64_t cgen_var_1464; |
| 22346 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1464, 1); |
| 22347 | stream->write((uint64_t*)&cgen_var_1464, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22348 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 22349 | stream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22350 | AEMU_SCOPED_TRACE("vkCmdWriteBufferMarkerAMD readParams"); |
| 22351 | AEMU_SCOPED_TRACE("vkCmdWriteBufferMarkerAMD returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22352 | mImpl->log("finish vkCmdWriteBufferMarkerAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22353 | } |
| 22354 | |
| 22355 | #endif |
| 22356 | #ifdef VK_AMD_shader_core_properties |
| 22357 | #endif |
| 22358 | #ifdef VK_EXT_vertex_attribute_divisor |
| 22359 | #endif |
| 22360 | #ifdef VK_NV_shader_subgroup_partitioned |
| 22361 | #endif |
| 22362 | #ifdef VK_NV_device_diagnostic_checkpoints |
| 22363 | void VkEncoder::vkCmdSetCheckpointNV( |
| 22364 | VkCommandBuffer commandBuffer, |
| 22365 | const void* pCheckpointMarker) |
| 22366 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22367 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22368 | AEMU_SCOPED_TRACE("vkCmdSetCheckpointNV encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22369 | mImpl->log("start vkCmdSetCheckpointNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22370 | auto stream = mImpl->stream(); |
| 22371 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22372 | auto resources = mImpl->resources(); |
| 22373 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22374 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22375 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22376 | void* local_pCheckpointMarker; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 22377 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22378 | local_pCheckpointMarker = nullptr; |
| 22379 | if (pCheckpointMarker) |
| 22380 | { |
| 22381 | local_pCheckpointMarker = (void*)pool->dupArray(pCheckpointMarker, sizeof(const uint8_t)); |
| 22382 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22383 | countingStream->rewind(); |
| 22384 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22385 | uint64_t cgen_var_1465; |
| 22386 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1465, 1); |
| 22387 | countingStream->write((uint64_t*)&cgen_var_1465, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22388 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22389 | uint64_t cgen_var_1466 = (uint64_t)(uintptr_t)local_pCheckpointMarker; |
| 22390 | countingStream->putBe64(cgen_var_1466); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22391 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22392 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22393 | countingStream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22394 | } |
| 22395 | } |
| 22396 | uint32_t packetSize_vkCmdSetCheckpointNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22397 | countingStream->rewind(); |
| 22398 | uint32_t opcode_vkCmdSetCheckpointNV = OP_vkCmdSetCheckpointNV; |
| 22399 | stream->write(&opcode_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| 22400 | stream->write(&packetSize_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22401 | uint64_t cgen_var_1467; |
| 22402 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1467, 1); |
| 22403 | stream->write((uint64_t*)&cgen_var_1467, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22404 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22405 | uint64_t cgen_var_1468 = (uint64_t)(uintptr_t)local_pCheckpointMarker; |
| 22406 | stream->putBe64(cgen_var_1468); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22407 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22408 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22409 | stream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22410 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22411 | AEMU_SCOPED_TRACE("vkCmdSetCheckpointNV readParams"); |
| 22412 | AEMU_SCOPED_TRACE("vkCmdSetCheckpointNV returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22413 | mImpl->log("finish vkCmdSetCheckpointNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22414 | } |
| 22415 | |
| 22416 | void VkEncoder::vkGetQueueCheckpointDataNV( |
| 22417 | VkQueue queue, |
| 22418 | uint32_t* pCheckpointDataCount, |
| 22419 | VkCheckpointDataNV* pCheckpointData) |
| 22420 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22421 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22422 | AEMU_SCOPED_TRACE("vkGetQueueCheckpointDataNV encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22423 | mImpl->log("start vkGetQueueCheckpointDataNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22424 | auto stream = mImpl->stream(); |
| 22425 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22426 | auto resources = mImpl->resources(); |
| 22427 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22428 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22429 | VkQueue local_queue; |
| 22430 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22431 | countingStream->rewind(); |
| 22432 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22433 | uint64_t cgen_var_1469; |
| 22434 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1469, 1); |
| 22435 | countingStream->write((uint64_t*)&cgen_var_1469, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22436 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22437 | uint64_t cgen_var_1470 = (uint64_t)(uintptr_t)pCheckpointDataCount; |
| 22438 | countingStream->putBe64(cgen_var_1470); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22439 | if (pCheckpointDataCount) |
| 22440 | { |
| 22441 | countingStream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 22442 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22443 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22444 | uint64_t cgen_var_1471 = (uint64_t)(uintptr_t)pCheckpointData; |
| 22445 | countingStream->putBe64(cgen_var_1471); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22446 | if (pCheckpointData) |
| 22447 | { |
| 22448 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 22449 | { |
| 22450 | marshal_VkCheckpointDataNV(countingStream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 22451 | } |
| 22452 | } |
| 22453 | } |
| 22454 | uint32_t packetSize_vkGetQueueCheckpointDataNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22455 | countingStream->rewind(); |
| 22456 | uint32_t opcode_vkGetQueueCheckpointDataNV = OP_vkGetQueueCheckpointDataNV; |
| 22457 | stream->write(&opcode_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| 22458 | stream->write(&packetSize_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22459 | uint64_t cgen_var_1472; |
| 22460 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1472, 1); |
| 22461 | stream->write((uint64_t*)&cgen_var_1472, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22462 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22463 | uint64_t cgen_var_1473 = (uint64_t)(uintptr_t)pCheckpointDataCount; |
| 22464 | stream->putBe64(cgen_var_1473); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22465 | if (pCheckpointDataCount) |
| 22466 | { |
| 22467 | stream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 22468 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22469 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22470 | uint64_t cgen_var_1474 = (uint64_t)(uintptr_t)pCheckpointData; |
| 22471 | stream->putBe64(cgen_var_1474); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22472 | if (pCheckpointData) |
| 22473 | { |
| 22474 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 22475 | { |
| 22476 | marshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 22477 | } |
| 22478 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22479 | AEMU_SCOPED_TRACE("vkGetQueueCheckpointDataNV readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22480 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22481 | uint32_t* check_pCheckpointDataCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22482 | check_pCheckpointDataCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22483 | if (pCheckpointDataCount) |
| 22484 | { |
| 22485 | if (!(check_pCheckpointDataCount)) |
| 22486 | { |
| 22487 | fprintf(stderr, "fatal: pCheckpointDataCount inconsistent between guest and host\n"); |
| 22488 | } |
| 22489 | stream->read((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 22490 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22491 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22492 | VkCheckpointDataNV* check_pCheckpointData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22493 | check_pCheckpointData = (VkCheckpointDataNV*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22494 | if (pCheckpointData) |
| 22495 | { |
| 22496 | if (!(check_pCheckpointData)) |
| 22497 | { |
| 22498 | fprintf(stderr, "fatal: pCheckpointData inconsistent between guest and host\n"); |
| 22499 | } |
| 22500 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 22501 | { |
| 22502 | unmarshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 22503 | } |
| 22504 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 22505 | if (pCheckpointData) |
| 22506 | { |
| 22507 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 22508 | { |
| 22509 | transform_fromhost_VkCheckpointDataNV(mImpl->resources(), (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 22510 | } |
| 22511 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22512 | AEMU_SCOPED_TRACE("vkGetQueueCheckpointDataNV returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22513 | mImpl->log("finish vkGetQueueCheckpointDataNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22514 | } |
| 22515 | |
| 22516 | #endif |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22517 | #ifdef VK_GOOGLE_address_space |
| 22518 | VkResult VkEncoder::vkMapMemoryIntoAddressSpaceGOOGLE( |
| 22519 | VkDevice device, |
| 22520 | VkDeviceMemory memory, |
| 22521 | uint64_t* pAddress) |
| 22522 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22523 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22524 | AEMU_SCOPED_TRACE("vkMapMemoryIntoAddressSpaceGOOGLE encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22525 | mImpl->log("start vkMapMemoryIntoAddressSpaceGOOGLE"); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22526 | encoderLock.unlock(); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22527 | mImpl->resources()->on_vkMapMemoryIntoAddressSpaceGOOGLE_pre(this, VK_SUCCESS, device, memory, pAddress); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22528 | encoderLock.lock(); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22529 | auto stream = mImpl->stream(); |
| 22530 | auto countingStream = mImpl->countingStream(); |
| 22531 | auto resources = mImpl->resources(); |
| 22532 | auto pool = mImpl->pool(); |
| 22533 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22534 | VkDevice local_device; |
| 22535 | VkDeviceMemory local_memory; |
| 22536 | local_device = device; |
| 22537 | local_memory = memory; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 22538 | mImpl->resources()->deviceMemoryTransform_tohost((VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22539 | countingStream->rewind(); |
| 22540 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22541 | uint64_t cgen_var_1477; |
| 22542 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1477, 1); |
| 22543 | countingStream->write((uint64_t*)&cgen_var_1477, 1 * 8); |
| 22544 | uint64_t cgen_var_1478; |
| 22545 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1478, 1); |
| 22546 | countingStream->write((uint64_t*)&cgen_var_1478, 1 * 8); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22547 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22548 | uint64_t cgen_var_1479 = (uint64_t)(uintptr_t)pAddress; |
| 22549 | countingStream->putBe64(cgen_var_1479); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22550 | if (pAddress) |
| 22551 | { |
| 22552 | countingStream->write((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22553 | } |
| 22554 | } |
| 22555 | uint32_t packetSize_vkMapMemoryIntoAddressSpaceGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22556 | countingStream->rewind(); |
| 22557 | uint32_t opcode_vkMapMemoryIntoAddressSpaceGOOGLE = OP_vkMapMemoryIntoAddressSpaceGOOGLE; |
| 22558 | stream->write(&opcode_vkMapMemoryIntoAddressSpaceGOOGLE, sizeof(uint32_t)); |
| 22559 | stream->write(&packetSize_vkMapMemoryIntoAddressSpaceGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22560 | uint64_t cgen_var_1480; |
| 22561 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1480, 1); |
| 22562 | stream->write((uint64_t*)&cgen_var_1480, 1 * 8); |
| 22563 | uint64_t cgen_var_1481; |
| 22564 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1481, 1); |
| 22565 | stream->write((uint64_t*)&cgen_var_1481, 1 * 8); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22566 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22567 | uint64_t cgen_var_1482 = (uint64_t)(uintptr_t)pAddress; |
| 22568 | stream->putBe64(cgen_var_1482); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22569 | if (pAddress) |
| 22570 | { |
| 22571 | stream->write((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22572 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22573 | AEMU_SCOPED_TRACE("vkMapMemoryIntoAddressSpaceGOOGLE readParams"); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22574 | // WARNING PTR CHECK |
| 22575 | uint64_t* check_pAddress; |
| 22576 | check_pAddress = (uint64_t*)(uintptr_t)stream->getBe64(); |
| 22577 | if (pAddress) |
| 22578 | { |
| 22579 | if (!(check_pAddress)) |
| 22580 | { |
| 22581 | fprintf(stderr, "fatal: pAddress inconsistent between guest and host\n"); |
| 22582 | } |
| 22583 | stream->read((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22584 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22585 | AEMU_SCOPED_TRACE("vkMapMemoryIntoAddressSpaceGOOGLE returnUnmarshal"); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22586 | VkResult vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return = (VkResult)0; |
| 22587 | stream->read(&vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return, sizeof(VkResult)); |
| 22588 | countingStream->clearPool(); |
| 22589 | stream->clearPool(); |
| 22590 | pool->freeAll(); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22591 | encoderLock.unlock(); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22592 | mImpl->resources()->on_vkMapMemoryIntoAddressSpaceGOOGLE(this, vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return, device, memory, pAddress); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22593 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22594 | mImpl->log("finish vkMapMemoryIntoAddressSpaceGOOGLE");; |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22595 | return vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return; |
| 22596 | } |
| 22597 | |
| 22598 | #endif |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22599 | #ifdef VK_GOOGLE_color_buffer |
| 22600 | VkResult VkEncoder::vkRegisterImageColorBufferGOOGLE( |
| 22601 | VkDevice device, |
| 22602 | VkImage image, |
| 22603 | uint32_t colorBuffer) |
| 22604 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22605 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22606 | AEMU_SCOPED_TRACE("vkRegisterImageColorBufferGOOGLE encode"); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22607 | mImpl->log("start vkRegisterImageColorBufferGOOGLE"); |
| 22608 | auto stream = mImpl->stream(); |
| 22609 | auto countingStream = mImpl->countingStream(); |
| 22610 | auto resources = mImpl->resources(); |
| 22611 | auto pool = mImpl->pool(); |
| 22612 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22613 | VkDevice local_device; |
| 22614 | VkImage local_image; |
| 22615 | uint32_t local_colorBuffer; |
| 22616 | local_device = device; |
| 22617 | local_image = image; |
| 22618 | local_colorBuffer = colorBuffer; |
| 22619 | countingStream->rewind(); |
| 22620 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22621 | uint64_t cgen_var_1484; |
| 22622 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1484, 1); |
| 22623 | countingStream->write((uint64_t*)&cgen_var_1484, 1 * 8); |
| 22624 | uint64_t cgen_var_1485; |
| 22625 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1485, 1); |
| 22626 | countingStream->write((uint64_t*)&cgen_var_1485, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22627 | countingStream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| 22628 | } |
| 22629 | uint32_t packetSize_vkRegisterImageColorBufferGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22630 | countingStream->rewind(); |
| 22631 | uint32_t opcode_vkRegisterImageColorBufferGOOGLE = OP_vkRegisterImageColorBufferGOOGLE; |
| 22632 | stream->write(&opcode_vkRegisterImageColorBufferGOOGLE, sizeof(uint32_t)); |
| 22633 | stream->write(&packetSize_vkRegisterImageColorBufferGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22634 | uint64_t cgen_var_1486; |
| 22635 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1486, 1); |
| 22636 | stream->write((uint64_t*)&cgen_var_1486, 1 * 8); |
| 22637 | uint64_t cgen_var_1487; |
| 22638 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1487, 1); |
| 22639 | stream->write((uint64_t*)&cgen_var_1487, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22640 | stream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22641 | AEMU_SCOPED_TRACE("vkRegisterImageColorBufferGOOGLE readParams"); |
| 22642 | AEMU_SCOPED_TRACE("vkRegisterImageColorBufferGOOGLE returnUnmarshal"); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22643 | VkResult vkRegisterImageColorBufferGOOGLE_VkResult_return = (VkResult)0; |
| 22644 | stream->read(&vkRegisterImageColorBufferGOOGLE_VkResult_return, sizeof(VkResult)); |
| 22645 | countingStream->clearPool(); |
| 22646 | stream->clearPool(); |
| 22647 | pool->freeAll(); |
| 22648 | mImpl->log("finish vkRegisterImageColorBufferGOOGLE");; |
| 22649 | return vkRegisterImageColorBufferGOOGLE_VkResult_return; |
| 22650 | } |
| 22651 | |
| 22652 | VkResult VkEncoder::vkRegisterBufferColorBufferGOOGLE( |
| 22653 | VkDevice device, |
| 22654 | VkBuffer buffer, |
| 22655 | uint32_t colorBuffer) |
| 22656 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22657 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22658 | AEMU_SCOPED_TRACE("vkRegisterBufferColorBufferGOOGLE encode"); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22659 | mImpl->log("start vkRegisterBufferColorBufferGOOGLE"); |
| 22660 | auto stream = mImpl->stream(); |
| 22661 | auto countingStream = mImpl->countingStream(); |
| 22662 | auto resources = mImpl->resources(); |
| 22663 | auto pool = mImpl->pool(); |
| 22664 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22665 | VkDevice local_device; |
| 22666 | VkBuffer local_buffer; |
| 22667 | uint32_t local_colorBuffer; |
| 22668 | local_device = device; |
| 22669 | local_buffer = buffer; |
| 22670 | local_colorBuffer = colorBuffer; |
| 22671 | countingStream->rewind(); |
| 22672 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22673 | uint64_t cgen_var_1488; |
| 22674 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1488, 1); |
| 22675 | countingStream->write((uint64_t*)&cgen_var_1488, 1 * 8); |
| 22676 | uint64_t cgen_var_1489; |
| 22677 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1489, 1); |
| 22678 | countingStream->write((uint64_t*)&cgen_var_1489, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22679 | countingStream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| 22680 | } |
| 22681 | uint32_t packetSize_vkRegisterBufferColorBufferGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22682 | countingStream->rewind(); |
| 22683 | uint32_t opcode_vkRegisterBufferColorBufferGOOGLE = OP_vkRegisterBufferColorBufferGOOGLE; |
| 22684 | stream->write(&opcode_vkRegisterBufferColorBufferGOOGLE, sizeof(uint32_t)); |
| 22685 | stream->write(&packetSize_vkRegisterBufferColorBufferGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22686 | uint64_t cgen_var_1490; |
| 22687 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1490, 1); |
| 22688 | stream->write((uint64_t*)&cgen_var_1490, 1 * 8); |
| 22689 | uint64_t cgen_var_1491; |
| 22690 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1491, 1); |
| 22691 | stream->write((uint64_t*)&cgen_var_1491, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22692 | stream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22693 | AEMU_SCOPED_TRACE("vkRegisterBufferColorBufferGOOGLE readParams"); |
| 22694 | AEMU_SCOPED_TRACE("vkRegisterBufferColorBufferGOOGLE returnUnmarshal"); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22695 | VkResult vkRegisterBufferColorBufferGOOGLE_VkResult_return = (VkResult)0; |
| 22696 | stream->read(&vkRegisterBufferColorBufferGOOGLE_VkResult_return, sizeof(VkResult)); |
| 22697 | countingStream->clearPool(); |
| 22698 | stream->clearPool(); |
| 22699 | pool->freeAll(); |
| 22700 | mImpl->log("finish vkRegisterBufferColorBufferGOOGLE");; |
| 22701 | return vkRegisterBufferColorBufferGOOGLE_VkResult_return; |
| 22702 | } |
| 22703 | |
| 22704 | #endif |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22705 | #ifdef VK_GOOGLE_sized_descriptor_update_template |
| 22706 | void VkEncoder::vkUpdateDescriptorSetWithTemplateSizedGOOGLE( |
| 22707 | VkDevice device, |
| 22708 | VkDescriptorSet descriptorSet, |
| 22709 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 22710 | uint32_t imageInfoCount, |
| 22711 | uint32_t bufferInfoCount, |
| 22712 | uint32_t bufferViewCount, |
| 22713 | const uint32_t* pImageInfoEntryIndices, |
| 22714 | const uint32_t* pBufferInfoEntryIndices, |
| 22715 | const uint32_t* pBufferViewEntryIndices, |
| 22716 | const VkDescriptorImageInfo* pImageInfos, |
| 22717 | const VkDescriptorBufferInfo* pBufferInfos, |
| 22718 | const VkBufferView* pBufferViews) |
| 22719 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22720 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22721 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateSizedGOOGLE encode"); |
| 22722 | mImpl->log("start vkUpdateDescriptorSetWithTemplateSizedGOOGLE"); |
| 22723 | auto stream = mImpl->stream(); |
| 22724 | auto countingStream = mImpl->countingStream(); |
| 22725 | auto resources = mImpl->resources(); |
| 22726 | auto pool = mImpl->pool(); |
| 22727 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22728 | VkDevice local_device; |
| 22729 | VkDescriptorSet local_descriptorSet; |
| 22730 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 22731 | uint32_t local_imageInfoCount; |
| 22732 | uint32_t local_bufferInfoCount; |
| 22733 | uint32_t local_bufferViewCount; |
| 22734 | uint32_t* local_pImageInfoEntryIndices; |
| 22735 | uint32_t* local_pBufferInfoEntryIndices; |
| 22736 | uint32_t* local_pBufferViewEntryIndices; |
| 22737 | VkDescriptorImageInfo* local_pImageInfos; |
| 22738 | VkDescriptorBufferInfo* local_pBufferInfos; |
| 22739 | VkBufferView* local_pBufferViews; |
| 22740 | local_device = device; |
| 22741 | local_descriptorSet = descriptorSet; |
| 22742 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 22743 | local_imageInfoCount = imageInfoCount; |
| 22744 | local_bufferInfoCount = bufferInfoCount; |
| 22745 | local_bufferViewCount = bufferViewCount; |
| 22746 | local_pImageInfoEntryIndices = nullptr; |
| 22747 | if (pImageInfoEntryIndices) |
| 22748 | { |
| 22749 | local_pImageInfoEntryIndices = (uint32_t*)pool->dupArray(pImageInfoEntryIndices, ((imageInfoCount)) * sizeof(const uint32_t)); |
| 22750 | } |
| 22751 | local_pBufferInfoEntryIndices = nullptr; |
| 22752 | if (pBufferInfoEntryIndices) |
| 22753 | { |
| 22754 | local_pBufferInfoEntryIndices = (uint32_t*)pool->dupArray(pBufferInfoEntryIndices, ((bufferInfoCount)) * sizeof(const uint32_t)); |
| 22755 | } |
| 22756 | local_pBufferViewEntryIndices = nullptr; |
| 22757 | if (pBufferViewEntryIndices) |
| 22758 | { |
| 22759 | local_pBufferViewEntryIndices = (uint32_t*)pool->dupArray(pBufferViewEntryIndices, ((bufferViewCount)) * sizeof(const uint32_t)); |
| 22760 | } |
| 22761 | local_pImageInfos = nullptr; |
| 22762 | if (pImageInfos) |
| 22763 | { |
| 22764 | local_pImageInfos = (VkDescriptorImageInfo*)pool->alloc(((imageInfoCount)) * sizeof(const VkDescriptorImageInfo)); |
| 22765 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22766 | { |
| 22767 | deepcopy_VkDescriptorImageInfo(pool, pImageInfos + i, (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22768 | } |
| 22769 | } |
| 22770 | local_pBufferInfos = nullptr; |
| 22771 | if (pBufferInfos) |
| 22772 | { |
| 22773 | local_pBufferInfos = (VkDescriptorBufferInfo*)pool->alloc(((bufferInfoCount)) * sizeof(const VkDescriptorBufferInfo)); |
| 22774 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22775 | { |
| 22776 | deepcopy_VkDescriptorBufferInfo(pool, pBufferInfos + i, (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22777 | } |
| 22778 | } |
| 22779 | local_pBufferViews = nullptr; |
| 22780 | if (pBufferViews) |
| 22781 | { |
| 22782 | local_pBufferViews = (VkBufferView*)pool->dupArray(pBufferViews, ((bufferViewCount)) * sizeof(const VkBufferView)); |
| 22783 | } |
| 22784 | if (local_pImageInfos) |
| 22785 | { |
| 22786 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22787 | { |
| 22788 | transform_tohost_VkDescriptorImageInfo(mImpl->resources(), (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22789 | } |
| 22790 | } |
| 22791 | if (local_pBufferInfos) |
| 22792 | { |
| 22793 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22794 | { |
| 22795 | transform_tohost_VkDescriptorBufferInfo(mImpl->resources(), (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22796 | } |
| 22797 | } |
| 22798 | countingStream->rewind(); |
| 22799 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22800 | uint64_t cgen_var_1492; |
| 22801 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1492, 1); |
| 22802 | countingStream->write((uint64_t*)&cgen_var_1492, 1 * 8); |
| 22803 | uint64_t cgen_var_1493; |
| 22804 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1493, 1); |
| 22805 | countingStream->write((uint64_t*)&cgen_var_1493, 1 * 8); |
| 22806 | uint64_t cgen_var_1494; |
| 22807 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1494, 1); |
| 22808 | countingStream->write((uint64_t*)&cgen_var_1494, 1 * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22809 | countingStream->write((uint32_t*)&local_imageInfoCount, sizeof(uint32_t)); |
| 22810 | countingStream->write((uint32_t*)&local_bufferInfoCount, sizeof(uint32_t)); |
| 22811 | countingStream->write((uint32_t*)&local_bufferViewCount, sizeof(uint32_t)); |
| 22812 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22813 | uint64_t cgen_var_1495 = (uint64_t)(uintptr_t)local_pImageInfoEntryIndices; |
| 22814 | countingStream->putBe64(cgen_var_1495); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22815 | if (local_pImageInfoEntryIndices) |
| 22816 | { |
| 22817 | countingStream->write((uint32_t*)local_pImageInfoEntryIndices, ((imageInfoCount)) * sizeof(uint32_t)); |
| 22818 | } |
| 22819 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22820 | uint64_t cgen_var_1496 = (uint64_t)(uintptr_t)local_pBufferInfoEntryIndices; |
| 22821 | countingStream->putBe64(cgen_var_1496); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22822 | if (local_pBufferInfoEntryIndices) |
| 22823 | { |
| 22824 | countingStream->write((uint32_t*)local_pBufferInfoEntryIndices, ((bufferInfoCount)) * sizeof(uint32_t)); |
| 22825 | } |
| 22826 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22827 | uint64_t cgen_var_1497 = (uint64_t)(uintptr_t)local_pBufferViewEntryIndices; |
| 22828 | countingStream->putBe64(cgen_var_1497); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22829 | if (local_pBufferViewEntryIndices) |
| 22830 | { |
| 22831 | countingStream->write((uint32_t*)local_pBufferViewEntryIndices, ((bufferViewCount)) * sizeof(uint32_t)); |
| 22832 | } |
| 22833 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22834 | uint64_t cgen_var_1498 = (uint64_t)(uintptr_t)local_pImageInfos; |
| 22835 | countingStream->putBe64(cgen_var_1498); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22836 | if (local_pImageInfos) |
| 22837 | { |
| 22838 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22839 | { |
| 22840 | marshal_VkDescriptorImageInfo(countingStream, (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22841 | } |
| 22842 | } |
| 22843 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22844 | uint64_t cgen_var_1499 = (uint64_t)(uintptr_t)local_pBufferInfos; |
| 22845 | countingStream->putBe64(cgen_var_1499); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22846 | if (local_pBufferInfos) |
| 22847 | { |
| 22848 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22849 | { |
| 22850 | marshal_VkDescriptorBufferInfo(countingStream, (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22851 | } |
| 22852 | } |
| 22853 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22854 | uint64_t cgen_var_1500 = (uint64_t)(uintptr_t)local_pBufferViews; |
| 22855 | countingStream->putBe64(cgen_var_1500); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22856 | if (local_pBufferViews) |
| 22857 | { |
| 22858 | if (((bufferViewCount))) |
| 22859 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22860 | uint64_t* cgen_var_1501; |
| 22861 | countingStream->alloc((void**)&cgen_var_1501, ((bufferViewCount)) * 8); |
| 22862 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(local_pBufferViews, cgen_var_1501, ((bufferViewCount))); |
| 22863 | countingStream->write((uint64_t*)cgen_var_1501, ((bufferViewCount)) * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22864 | } |
| 22865 | } |
| 22866 | } |
| 22867 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22868 | countingStream->rewind(); |
| 22869 | uint32_t opcode_vkUpdateDescriptorSetWithTemplateSizedGOOGLE = OP_vkUpdateDescriptorSetWithTemplateSizedGOOGLE; |
| 22870 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplateSizedGOOGLE, sizeof(uint32_t)); |
| 22871 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22872 | uint64_t cgen_var_1502; |
| 22873 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1502, 1); |
| 22874 | stream->write((uint64_t*)&cgen_var_1502, 1 * 8); |
| 22875 | uint64_t cgen_var_1503; |
| 22876 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1503, 1); |
| 22877 | stream->write((uint64_t*)&cgen_var_1503, 1 * 8); |
| 22878 | uint64_t cgen_var_1504; |
| 22879 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1504, 1); |
| 22880 | stream->write((uint64_t*)&cgen_var_1504, 1 * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22881 | stream->write((uint32_t*)&local_imageInfoCount, sizeof(uint32_t)); |
| 22882 | stream->write((uint32_t*)&local_bufferInfoCount, sizeof(uint32_t)); |
| 22883 | stream->write((uint32_t*)&local_bufferViewCount, sizeof(uint32_t)); |
| 22884 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22885 | uint64_t cgen_var_1505 = (uint64_t)(uintptr_t)local_pImageInfoEntryIndices; |
| 22886 | stream->putBe64(cgen_var_1505); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22887 | if (local_pImageInfoEntryIndices) |
| 22888 | { |
| 22889 | stream->write((uint32_t*)local_pImageInfoEntryIndices, ((imageInfoCount)) * sizeof(uint32_t)); |
| 22890 | } |
| 22891 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22892 | uint64_t cgen_var_1506 = (uint64_t)(uintptr_t)local_pBufferInfoEntryIndices; |
| 22893 | stream->putBe64(cgen_var_1506); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22894 | if (local_pBufferInfoEntryIndices) |
| 22895 | { |
| 22896 | stream->write((uint32_t*)local_pBufferInfoEntryIndices, ((bufferInfoCount)) * sizeof(uint32_t)); |
| 22897 | } |
| 22898 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22899 | uint64_t cgen_var_1507 = (uint64_t)(uintptr_t)local_pBufferViewEntryIndices; |
| 22900 | stream->putBe64(cgen_var_1507); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22901 | if (local_pBufferViewEntryIndices) |
| 22902 | { |
| 22903 | stream->write((uint32_t*)local_pBufferViewEntryIndices, ((bufferViewCount)) * sizeof(uint32_t)); |
| 22904 | } |
| 22905 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22906 | uint64_t cgen_var_1508 = (uint64_t)(uintptr_t)local_pImageInfos; |
| 22907 | stream->putBe64(cgen_var_1508); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22908 | if (local_pImageInfos) |
| 22909 | { |
| 22910 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22911 | { |
| 22912 | marshal_VkDescriptorImageInfo(stream, (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22913 | } |
| 22914 | } |
| 22915 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22916 | uint64_t cgen_var_1509 = (uint64_t)(uintptr_t)local_pBufferInfos; |
| 22917 | stream->putBe64(cgen_var_1509); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22918 | if (local_pBufferInfos) |
| 22919 | { |
| 22920 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22921 | { |
| 22922 | marshal_VkDescriptorBufferInfo(stream, (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22923 | } |
| 22924 | } |
| 22925 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22926 | uint64_t cgen_var_1510 = (uint64_t)(uintptr_t)local_pBufferViews; |
| 22927 | stream->putBe64(cgen_var_1510); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22928 | if (local_pBufferViews) |
| 22929 | { |
| 22930 | if (((bufferViewCount))) |
| 22931 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22932 | uint64_t* cgen_var_1511; |
| 22933 | stream->alloc((void**)&cgen_var_1511, ((bufferViewCount)) * 8); |
| 22934 | stream->handleMapping()->mapHandles_VkBufferView_u64(local_pBufferViews, cgen_var_1511, ((bufferViewCount))); |
| 22935 | stream->write((uint64_t*)cgen_var_1511, ((bufferViewCount)) * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22936 | } |
| 22937 | } |
| 22938 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateSizedGOOGLE readParams"); |
| 22939 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateSizedGOOGLE returnUnmarshal"); |
| 22940 | mImpl->log("finish vkUpdateDescriptorSetWithTemplateSizedGOOGLE");; |
| 22941 | } |
| 22942 | |
| 22943 | #endif |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22944 | #ifdef VK_GOOGLE_async_command_buffers |
| 22945 | void VkEncoder::vkBeginCommandBufferAsyncGOOGLE( |
| 22946 | VkCommandBuffer commandBuffer, |
| 22947 | const VkCommandBufferBeginInfo* pBeginInfo) |
| 22948 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22949 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22950 | AEMU_SCOPED_TRACE("vkBeginCommandBufferAsyncGOOGLE encode"); |
| 22951 | mImpl->log("start vkBeginCommandBufferAsyncGOOGLE"); |
| 22952 | auto stream = mImpl->stream(); |
| 22953 | auto countingStream = mImpl->countingStream(); |
| 22954 | auto resources = mImpl->resources(); |
| 22955 | auto pool = mImpl->pool(); |
| 22956 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22957 | VkCommandBuffer local_commandBuffer; |
| 22958 | VkCommandBufferBeginInfo* local_pBeginInfo; |
| 22959 | local_commandBuffer = commandBuffer; |
| 22960 | local_pBeginInfo = nullptr; |
| 22961 | if (pBeginInfo) |
| 22962 | { |
| 22963 | local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo)); |
| 22964 | deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22965 | } |
| 22966 | if (local_pBeginInfo) |
| 22967 | { |
| 22968 | transform_tohost_VkCommandBufferBeginInfo(mImpl->resources(), (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22969 | } |
| 22970 | countingStream->rewind(); |
| 22971 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22972 | uint64_t cgen_var_1512; |
| 22973 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1512, 1); |
| 22974 | countingStream->write((uint64_t*)&cgen_var_1512, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22975 | marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22976 | } |
| 22977 | uint32_t packetSize_vkBeginCommandBufferAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22978 | countingStream->rewind(); |
| 22979 | uint32_t opcode_vkBeginCommandBufferAsyncGOOGLE = OP_vkBeginCommandBufferAsyncGOOGLE; |
| 22980 | stream->write(&opcode_vkBeginCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| 22981 | stream->write(&packetSize_vkBeginCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22982 | uint64_t cgen_var_1513; |
| 22983 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1513, 1); |
| 22984 | stream->write((uint64_t*)&cgen_var_1513, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22985 | marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22986 | AEMU_SCOPED_TRACE("vkBeginCommandBufferAsyncGOOGLE readParams"); |
| 22987 | AEMU_SCOPED_TRACE("vkBeginCommandBufferAsyncGOOGLE returnUnmarshal"); |
| 22988 | mImpl->log("finish vkBeginCommandBufferAsyncGOOGLE");; |
| 22989 | } |
| 22990 | |
| 22991 | void VkEncoder::vkEndCommandBufferAsyncGOOGLE( |
| 22992 | VkCommandBuffer commandBuffer) |
| 22993 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22994 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22995 | AEMU_SCOPED_TRACE("vkEndCommandBufferAsyncGOOGLE encode"); |
| 22996 | mImpl->log("start vkEndCommandBufferAsyncGOOGLE"); |
| 22997 | auto stream = mImpl->stream(); |
| 22998 | auto countingStream = mImpl->countingStream(); |
| 22999 | auto resources = mImpl->resources(); |
| 23000 | auto pool = mImpl->pool(); |
| 23001 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23002 | VkCommandBuffer local_commandBuffer; |
| 23003 | local_commandBuffer = commandBuffer; |
| 23004 | countingStream->rewind(); |
| 23005 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 23006 | uint64_t cgen_var_1514; |
| 23007 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1514, 1); |
| 23008 | countingStream->write((uint64_t*)&cgen_var_1514, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23009 | } |
| 23010 | uint32_t packetSize_vkEndCommandBufferAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23011 | countingStream->rewind(); |
| 23012 | uint32_t opcode_vkEndCommandBufferAsyncGOOGLE = OP_vkEndCommandBufferAsyncGOOGLE; |
| 23013 | stream->write(&opcode_vkEndCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| 23014 | stream->write(&packetSize_vkEndCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 23015 | uint64_t cgen_var_1515; |
| 23016 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1515, 1); |
| 23017 | stream->write((uint64_t*)&cgen_var_1515, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23018 | AEMU_SCOPED_TRACE("vkEndCommandBufferAsyncGOOGLE readParams"); |
| 23019 | AEMU_SCOPED_TRACE("vkEndCommandBufferAsyncGOOGLE returnUnmarshal"); |
| 23020 | mImpl->log("finish vkEndCommandBufferAsyncGOOGLE");; |
| 23021 | } |
| 23022 | |
| 23023 | void VkEncoder::vkResetCommandBufferAsyncGOOGLE( |
| 23024 | VkCommandBuffer commandBuffer, |
| 23025 | VkCommandBufferResetFlags flags) |
| 23026 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 23027 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23028 | AEMU_SCOPED_TRACE("vkResetCommandBufferAsyncGOOGLE encode"); |
| 23029 | mImpl->log("start vkResetCommandBufferAsyncGOOGLE"); |
| 23030 | auto stream = mImpl->stream(); |
| 23031 | auto countingStream = mImpl->countingStream(); |
| 23032 | auto resources = mImpl->resources(); |
| 23033 | auto pool = mImpl->pool(); |
| 23034 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23035 | VkCommandBuffer local_commandBuffer; |
| 23036 | VkCommandBufferResetFlags local_flags; |
| 23037 | local_commandBuffer = commandBuffer; |
| 23038 | local_flags = flags; |
| 23039 | countingStream->rewind(); |
| 23040 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 23041 | uint64_t cgen_var_1516; |
| 23042 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1516, 1); |
| 23043 | countingStream->write((uint64_t*)&cgen_var_1516, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23044 | countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| 23045 | } |
| 23046 | uint32_t packetSize_vkResetCommandBufferAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23047 | countingStream->rewind(); |
| 23048 | uint32_t opcode_vkResetCommandBufferAsyncGOOGLE = OP_vkResetCommandBufferAsyncGOOGLE; |
| 23049 | stream->write(&opcode_vkResetCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| 23050 | stream->write(&packetSize_vkResetCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 23051 | uint64_t cgen_var_1517; |
| 23052 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1517, 1); |
| 23053 | stream->write((uint64_t*)&cgen_var_1517, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23054 | stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| 23055 | AEMU_SCOPED_TRACE("vkResetCommandBufferAsyncGOOGLE readParams"); |
| 23056 | AEMU_SCOPED_TRACE("vkResetCommandBufferAsyncGOOGLE returnUnmarshal"); |
| 23057 | mImpl->log("finish vkResetCommandBufferAsyncGOOGLE");; |
| 23058 | } |
| 23059 | |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 23060 | void VkEncoder::vkCommandBufferHostSyncGOOGLE( |
| 23061 | VkCommandBuffer commandBuffer, |
| 23062 | uint32_t needHostSync, |
| 23063 | uint32_t sequenceNumber) |
| 23064 | { |
| 23065 | AutoLock encoderLock(mImpl->lock); |
| 23066 | AEMU_SCOPED_TRACE("vkCommandBufferHostSyncGOOGLE encode"); |
| 23067 | mImpl->log("start vkCommandBufferHostSyncGOOGLE"); |
| 23068 | auto stream = mImpl->stream(); |
| 23069 | auto countingStream = mImpl->countingStream(); |
| 23070 | auto resources = mImpl->resources(); |
| 23071 | auto pool = mImpl->pool(); |
| 23072 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23073 | VkCommandBuffer local_commandBuffer; |
| 23074 | uint32_t local_needHostSync; |
| 23075 | uint32_t local_sequenceNumber; |
| 23076 | local_commandBuffer = commandBuffer; |
| 23077 | local_needHostSync = needHostSync; |
| 23078 | local_sequenceNumber = sequenceNumber; |
| 23079 | countingStream->rewind(); |
| 23080 | { |
| 23081 | uint64_t cgen_var_1518; |
| 23082 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1518, 1); |
| 23083 | countingStream->write((uint64_t*)&cgen_var_1518, 1 * 8); |
| 23084 | countingStream->write((uint32_t*)&local_needHostSync, sizeof(uint32_t)); |
| 23085 | countingStream->write((uint32_t*)&local_sequenceNumber, sizeof(uint32_t)); |
| 23086 | } |
| 23087 | uint32_t packetSize_vkCommandBufferHostSyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23088 | countingStream->rewind(); |
| 23089 | uint32_t opcode_vkCommandBufferHostSyncGOOGLE = OP_vkCommandBufferHostSyncGOOGLE; |
| 23090 | stream->write(&opcode_vkCommandBufferHostSyncGOOGLE, sizeof(uint32_t)); |
| 23091 | stream->write(&packetSize_vkCommandBufferHostSyncGOOGLE, sizeof(uint32_t)); |
| 23092 | uint64_t cgen_var_1519; |
| 23093 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1519, 1); |
| 23094 | stream->write((uint64_t*)&cgen_var_1519, 1 * 8); |
| 23095 | stream->write((uint32_t*)&local_needHostSync, sizeof(uint32_t)); |
| 23096 | stream->write((uint32_t*)&local_sequenceNumber, sizeof(uint32_t)); |
| 23097 | AEMU_SCOPED_TRACE("vkCommandBufferHostSyncGOOGLE readParams"); |
| 23098 | AEMU_SCOPED_TRACE("vkCommandBufferHostSyncGOOGLE returnUnmarshal"); |
| 23099 | mImpl->log("finish vkCommandBufferHostSyncGOOGLE");; |
| 23100 | } |
| 23101 | |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23102 | #endif |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 23103 | #ifdef VK_GOOGLE_create_resources_with_requirements |
| 23104 | VkResult VkEncoder::vkCreateImageWithRequirementsGOOGLE( |
| 23105 | VkDevice device, |
| 23106 | const VkImageCreateInfo* pCreateInfo, |
| 23107 | const VkAllocationCallbacks* pAllocator, |
| 23108 | VkImage* pImage, |
| 23109 | VkMemoryRequirements* pMemoryRequirements) |
| 23110 | { |
| 23111 | AutoLock encoderLock(mImpl->lock); |
| 23112 | AEMU_SCOPED_TRACE("vkCreateImageWithRequirementsGOOGLE encode"); |
| 23113 | mImpl->log("start vkCreateImageWithRequirementsGOOGLE"); |
| 23114 | auto stream = mImpl->stream(); |
| 23115 | auto countingStream = mImpl->countingStream(); |
| 23116 | auto resources = mImpl->resources(); |
| 23117 | auto pool = mImpl->pool(); |
| 23118 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23119 | VkDevice local_device; |
| 23120 | VkImageCreateInfo* local_pCreateInfo; |
| 23121 | VkAllocationCallbacks* local_pAllocator; |
| 23122 | local_device = device; |
| 23123 | local_pCreateInfo = nullptr; |
| 23124 | if (pCreateInfo) |
| 23125 | { |
| 23126 | local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo)); |
| 23127 | deepcopy_VkImageCreateInfo(pool, pCreateInfo, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 23128 | } |
| 23129 | local_pAllocator = nullptr; |
| 23130 | if (pAllocator) |
| 23131 | { |
| 23132 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 23133 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 23134 | } |
| 23135 | mImpl->resources()->unwrap_VkNativeBufferANDROID(pCreateInfo, local_pCreateInfo); |
| 23136 | local_pAllocator = nullptr; |
| 23137 | if (local_pCreateInfo) |
| 23138 | { |
| 23139 | transform_tohost_VkImageCreateInfo(mImpl->resources(), (VkImageCreateInfo*)(local_pCreateInfo)); |
| 23140 | } |
| 23141 | if (local_pAllocator) |
| 23142 | { |
| 23143 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 23144 | } |
| 23145 | countingStream->rewind(); |
| 23146 | { |
| 23147 | uint64_t cgen_var_1520; |
| 23148 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1520, 1); |
| 23149 | countingStream->write((uint64_t*)&cgen_var_1520, 1 * 8); |
| 23150 | marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 23151 | // WARNING PTR CHECK |
| 23152 | uint64_t cgen_var_1521 = (uint64_t)(uintptr_t)local_pAllocator; |
| 23153 | countingStream->putBe64(cgen_var_1521); |
| 23154 | if (local_pAllocator) |
| 23155 | { |
| 23156 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 23157 | } |
| 23158 | uint64_t cgen_var_1522; |
| 23159 | countingStream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_1522, 1); |
| 23160 | countingStream->write((uint64_t*)&cgen_var_1522, 8); |
| 23161 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 23162 | } |
| 23163 | uint32_t packetSize_vkCreateImageWithRequirementsGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23164 | countingStream->rewind(); |
| 23165 | uint32_t opcode_vkCreateImageWithRequirementsGOOGLE = OP_vkCreateImageWithRequirementsGOOGLE; |
| 23166 | stream->write(&opcode_vkCreateImageWithRequirementsGOOGLE, sizeof(uint32_t)); |
| 23167 | stream->write(&packetSize_vkCreateImageWithRequirementsGOOGLE, sizeof(uint32_t)); |
| 23168 | uint64_t cgen_var_1523; |
| 23169 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1523, 1); |
| 23170 | stream->write((uint64_t*)&cgen_var_1523, 1 * 8); |
| 23171 | marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 23172 | // WARNING PTR CHECK |
| 23173 | uint64_t cgen_var_1524 = (uint64_t)(uintptr_t)local_pAllocator; |
| 23174 | stream->putBe64(cgen_var_1524); |
| 23175 | if (local_pAllocator) |
| 23176 | { |
| 23177 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 23178 | } |
| 23179 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| 23180 | uint64_t cgen_var_1525; |
| 23181 | stream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_1525, 1); |
| 23182 | stream->write((uint64_t*)&cgen_var_1525, 8); |
| 23183 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23184 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 23185 | AEMU_SCOPED_TRACE("vkCreateImageWithRequirementsGOOGLE readParams"); |
| 23186 | stream->setHandleMapping(resources->createMapping()); |
| 23187 | uint64_t cgen_var_1526; |
| 23188 | stream->read((uint64_t*)&cgen_var_1526, 8); |
| 23189 | stream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_1526, (VkImage*)pImage, 1); |
| 23190 | stream->unsetHandleMapping(); |
| 23191 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 23192 | if (pMemoryRequirements) |
| 23193 | { |
| 23194 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 23195 | } |
| 23196 | AEMU_SCOPED_TRACE("vkCreateImageWithRequirementsGOOGLE returnUnmarshal"); |
| 23197 | VkResult vkCreateImageWithRequirementsGOOGLE_VkResult_return = (VkResult)0; |
| 23198 | stream->read(&vkCreateImageWithRequirementsGOOGLE_VkResult_return, sizeof(VkResult)); |
| 23199 | countingStream->clearPool(); |
| 23200 | stream->clearPool(); |
| 23201 | pool->freeAll(); |
| 23202 | mImpl->log("finish vkCreateImageWithRequirementsGOOGLE");; |
| 23203 | return vkCreateImageWithRequirementsGOOGLE_VkResult_return; |
| 23204 | } |
| 23205 | |
| 23206 | VkResult VkEncoder::vkCreateBufferWithRequirementsGOOGLE( |
| 23207 | VkDevice device, |
| 23208 | const VkBufferCreateInfo* pCreateInfo, |
| 23209 | const VkAllocationCallbacks* pAllocator, |
| 23210 | VkBuffer* pBuffer, |
| 23211 | VkMemoryRequirements* pMemoryRequirements) |
| 23212 | { |
| 23213 | AutoLock encoderLock(mImpl->lock); |
| 23214 | AEMU_SCOPED_TRACE("vkCreateBufferWithRequirementsGOOGLE encode"); |
| 23215 | mImpl->log("start vkCreateBufferWithRequirementsGOOGLE"); |
| 23216 | auto stream = mImpl->stream(); |
| 23217 | auto countingStream = mImpl->countingStream(); |
| 23218 | auto resources = mImpl->resources(); |
| 23219 | auto pool = mImpl->pool(); |
| 23220 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23221 | VkDevice local_device; |
| 23222 | VkBufferCreateInfo* local_pCreateInfo; |
| 23223 | VkAllocationCallbacks* local_pAllocator; |
| 23224 | local_device = device; |
| 23225 | local_pCreateInfo = nullptr; |
| 23226 | if (pCreateInfo) |
| 23227 | { |
| 23228 | local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo)); |
| 23229 | deepcopy_VkBufferCreateInfo(pool, pCreateInfo, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 23230 | } |
| 23231 | local_pAllocator = nullptr; |
| 23232 | if (pAllocator) |
| 23233 | { |
| 23234 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 23235 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 23236 | } |
| 23237 | local_pAllocator = nullptr; |
| 23238 | if (local_pCreateInfo) |
| 23239 | { |
| 23240 | transform_tohost_VkBufferCreateInfo(mImpl->resources(), (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 23241 | } |
| 23242 | if (local_pAllocator) |
| 23243 | { |
| 23244 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 23245 | } |
| 23246 | countingStream->rewind(); |
| 23247 | { |
| 23248 | uint64_t cgen_var_1527; |
| 23249 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1527, 1); |
| 23250 | countingStream->write((uint64_t*)&cgen_var_1527, 1 * 8); |
| 23251 | marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 23252 | // WARNING PTR CHECK |
| 23253 | uint64_t cgen_var_1528 = (uint64_t)(uintptr_t)local_pAllocator; |
| 23254 | countingStream->putBe64(cgen_var_1528); |
| 23255 | if (local_pAllocator) |
| 23256 | { |
| 23257 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 23258 | } |
| 23259 | uint64_t cgen_var_1529; |
| 23260 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_1529, 1); |
| 23261 | countingStream->write((uint64_t*)&cgen_var_1529, 8); |
| 23262 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 23263 | } |
| 23264 | uint32_t packetSize_vkCreateBufferWithRequirementsGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23265 | countingStream->rewind(); |
| 23266 | uint32_t opcode_vkCreateBufferWithRequirementsGOOGLE = OP_vkCreateBufferWithRequirementsGOOGLE; |
| 23267 | stream->write(&opcode_vkCreateBufferWithRequirementsGOOGLE, sizeof(uint32_t)); |
| 23268 | stream->write(&packetSize_vkCreateBufferWithRequirementsGOOGLE, sizeof(uint32_t)); |
| 23269 | uint64_t cgen_var_1530; |
| 23270 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1530, 1); |
| 23271 | stream->write((uint64_t*)&cgen_var_1530, 1 * 8); |
| 23272 | marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 23273 | // WARNING PTR CHECK |
| 23274 | uint64_t cgen_var_1531 = (uint64_t)(uintptr_t)local_pAllocator; |
| 23275 | stream->putBe64(cgen_var_1531); |
| 23276 | if (local_pAllocator) |
| 23277 | { |
| 23278 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 23279 | } |
| 23280 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| 23281 | uint64_t cgen_var_1532; |
| 23282 | stream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_1532, 1); |
| 23283 | stream->write((uint64_t*)&cgen_var_1532, 8); |
| 23284 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23285 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 23286 | AEMU_SCOPED_TRACE("vkCreateBufferWithRequirementsGOOGLE readParams"); |
| 23287 | stream->setHandleMapping(resources->createMapping()); |
| 23288 | uint64_t cgen_var_1533; |
| 23289 | stream->read((uint64_t*)&cgen_var_1533, 8); |
| 23290 | stream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_1533, (VkBuffer*)pBuffer, 1); |
| 23291 | stream->unsetHandleMapping(); |
| 23292 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 23293 | if (pMemoryRequirements) |
| 23294 | { |
| 23295 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 23296 | } |
| 23297 | AEMU_SCOPED_TRACE("vkCreateBufferWithRequirementsGOOGLE returnUnmarshal"); |
| 23298 | VkResult vkCreateBufferWithRequirementsGOOGLE_VkResult_return = (VkResult)0; |
| 23299 | stream->read(&vkCreateBufferWithRequirementsGOOGLE_VkResult_return, sizeof(VkResult)); |
| 23300 | countingStream->clearPool(); |
| 23301 | stream->clearPool(); |
| 23302 | pool->freeAll(); |
| 23303 | mImpl->log("finish vkCreateBufferWithRequirementsGOOGLE");; |
| 23304 | return vkCreateBufferWithRequirementsGOOGLE_VkResult_return; |
| 23305 | } |
| 23306 | |
| 23307 | #endif |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 23308 | |
| Lingfeng Yang | b1d9010 | 2018-11-29 16:10:36 -0800 | [diff] [blame] | 23309 | } // namespace goldfish_vk |